Pr

From FeatherHunter/dsh-mattpocock-skills-deck · View interactive version

Pr is an AI agent skill from the GitHub repository FeatherHunter/dsh-mattpocock-skills-deck. 写 PR 正文时使用。

How to use this skill

Skill file

写 PR 正文时用下面这个模板:

## Summary

<diagram, diff-sketch, or tree>

## Evidence

- **Before:** <screenshot/output/failing test run>
  **After:** <screenshot/output/passing test run>

## Merge Danger

**Door:** <one-way or two-way>

<optional: description>

**Blast Radius:** <one-word description>

<optional: potential ramifications of merge>

各部分

跳过所有开场白,行文保持简短。使用 GLOSSARY.md 里用户的领域语言。

总结

挑最小的那个视图,让要点清楚。

on(save)
  if content is unchanged
    return cached result
  write new content
  return fresh result
submitForm
  createSession
    persistPrompt
    launchAgent
  navigateToSession
<SessionPage> (apps/example/src/routes/session.tsx)
  useSessionEvents()
  <SessionToolbar>
    <RunSkillButton> (packages/ui)
src/
├── commands/       # parses user actions
├── sessions/       # owns session state
└── transport/      # sends API requests
sequenceDiagram
    participant User
    participant UI
    participant Daemon
    User->>UI: choose command
    UI->>Daemon: send expanded prompt
    Daemon-->>UI: stream result

组件改动:

 <SessionPage>
   useSessionEvents()
   <SessionToolbar>
+    <RunSkillButton />
   <SessionTimeline>
+    <SkillResultCard />

文件布局改动:

 src/
 ├── commands/
+│   └── show-me.ts       # expands the slash command
 ├── sessions/
-└── transport.ts
+└── transport/
+    ├── client.ts
+    └── stream.ts

调用树或调用栈改动:

 submitForm
   createSession
     persistPrompt
+    expandSkillMention
     launchAgent
-  navigateToSession
+  navigateToSession
+    subscribeToEvents

状态或控制流改动:

 on(save)
-  write content
+  if content is unchanged
+    return cached result
+  write new content
+  invalidate cache
function expandSkill(command: string): string {
  const skillName = command.slice(1);
  return `use the ${skillName} skill`;
}
指引

把每一处视觉元素放在它所支撑的那段短文字旁边。只保留回答用户当前问题、或解决当前讨论点所必需的那些调用、文件、属性、状态和边界。

你可以只用其中一种,也可以用上好几种,但不太可能全部用上。自己拿捏,别让用户应接不暇。

证据

证明改动有效的具体证据。要展示前与后。

截图是 S 级——当环境已经为此搭好、而且改动是视觉上的时候。

基于执行的证据是 A 级。测试结果、控制台输出。用伪代码展示那条从失败变为通过的具体测试。

合并风险

说明这是一扇单向门还是双向门。双向门你可以走回去,单向门不行。回滚代价低的 PR 风险更低。涉及破坏性操作或难以逆转的决定的改动,都是单向门。

爆炸半径是这次 PR 引入的改动可能造成的影响或波及范围。把所有可能都考虑进来。例子有布局偏移、对使用方的破坏、移动端响应式等。

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.