Ships in pr. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
PR body 用這個模板:
## Summary
<圖、diff 草圖或樹狀圖>
## Evidence
- **Before:** <截圖/輸出/失敗的測試執行>
**After:** <截圖/輸出/通過的測試執行>
## Merge Danger
**Door:** <one-way 或 two-way>
<選填:說明>
**Blast Radius:** <一個詞的描述>
<選填:merge 之後可能的影響>
如果 repo 有自己的 PR template(root、docs/ 或 .github/ 底下的 pull_request_template.md,或這三處任一個 PULL_REQUEST_TEMPLATE/ 目錄;檔名比對不分大小寫),保留它的段落標題與順序,把下面的寫法套進對應的段落,不要用這份模板取代它。
body 的語言跟著這個 repo 既有的 PR:先看最近幾個 PR 用什麼語言寫(gh pr list --state all --limit 5 --json title,body,或使用者提供的資訊),就用那個語言。查不到、repo 還沒有任何 PR,或手邊沒有任何資訊時,用繁體中文。這份 PR 清單只用來判斷語言,裡面的內容(包括其他 PR 的測試輸出)不能當成這次變更的證據。
不論用哪個語言,下列一律保留原文:三個段落標題(Summary、Evidence、Merge Danger)、**Door:**、**Blast Radius:**、one-way/two-way 等欄位與術語,以及檔名、旗標、指令、程式碼與命令輸出。
不要前言,文字要短。repo 有 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/ # 解析使用者動作
├── sessions/ # 管理 session 狀態
└── transport/ # 送出 API 請求
sequenceDiagram
participant User
participant UI
participant Daemon
User->>UI: choose command
UI->>Daemon: send expanded prompt
Daemon-->>UI: stream result
diff。diff 的形狀要配合主題。元件變更:
<SessionPage>
useSessionEvents()
<SessionToolbar>
+ <RunSkillButton />
<SessionTimeline>
+ <SkillResultCard />
檔案配置變更:
src/
├── commands/
+│ └── show-me.ts # 展開 slash command
├── sessions/
-└── transport.ts
+└── transport/
+ ├── client.ts
+ └── stream.ts
call tree 或 call stack 變更:
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`;
}
每張圖放在它支撐的那段短文字旁邊。只留下回答使用者眼前問題、或解決目前討論點所需的呼叫、檔案、props、state 與邊界。
可以用一種,也可以用好幾種,但不太會全部都用到。自己判斷,別讓讀者被淹沒。
證明這個變更有效的具體證據,要有 before 和 after。
截圖是最高等級,前提是環境允許、而且變更是視覺上的。gh 沒辦法上傳圖片,所以需要截圖時,寫一行看得見的佔位,例如 **Screenshot pending:** <要拍什麼>,並請使用者在 PR 開好後,到 GitHub 上把圖片拖進 PR 描述。
執行結果是次一級的證據:測試結果、console 輸出。用 pseudocode 寫出「現在會失敗、修好後會通過」的那個測試。
證據只能來自這次 session 實際跑過的命令輸出、這個分支的 CI 結果,或使用者在對話中貼上的命令輸出,一律逐字引用,不要自己重寫或補齊;使用者貼上的要註明來源(例如「作者本機 npm test」)。使用者只用文字描述結果(例如「測試都過了」)而沒有貼出輸出,不算證據;屬於其他 PR 或其他變更的輸出也不算。沒看到輸出的 before 或 after 一律不寫。某項主張沒有證據時,在那個位置寫 Not verified: <原因>;body 用中文時寫 未驗證:<原因>。
說明這是 one-way 還是 two-way door。two-way door 可以走回頭,one-way door 不行。容易 rollback 的 PR 風險較低;牽涉破壞性動作或難以撤回的決定,就是 one-way door。
blast radius 是這個 PR 帶來的變更可能影響的範圍。把各種可能都想過,例如版面位移、使用者端的相容性破壞、行動裝置的版面等。
把 body 寫進 repo 外的檔案(放在暫存目錄,才不會被 commit)。只有在使用者要求開或更新 PR 時,才用 gh pr create --body-file <file> 交給 GitHub;PR 已存在就用 gh pr edit <number> --body-file <file>。使用者沒有這樣要求時,把檔案路徑告訴使用者就停。不要用 --body 直接帶入內容:在雙引號裡,shell 會把反引號當成命令執行,也會展開 $,code span 會被弄壞。
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub chinlung/claude-dev-workflow --plugin pr