/maigo:github-title-descriptionfrom maigo
Drafts or rewrites GitHub PR titles and descriptions with a user-impact title and Why/What/Test Plan body. Use for fresh drafts from branch commits/diff or ad-hoc rewrites.
Ships in maigo. 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.
Owner Agent: Tomori(/maigo:describe-pr step 2——orchestrator 前置抓料後交給燈套用)
Consumers: /maigo:describe-pr
PR title / description 是 reviewer 對這次變更的第一印象。常見的失敗:
這個 skill 把這四件事變成有結構的 process。
main;caller 可覆寫)git log <base>..HEAD --pretty=format:'%h %s%n%b' --no-mergesgit diff <base>...HEAD --statgit diff <base>...HEAD(必要時 truncate)——描述淨交付,不是過程:
若 branch 曾經試過一個設計、後來整段 revert(例如先加了某組 flag + UI,後來為了 auto-detect
拆掉),diff 已經反映拆掉後的淨狀態,草稿只描述這個最終形狀,不提被拆掉的中途嘗試——squash
merge 會把整段歷史壓平,reviewer 只在乎最終長什麼樣。用 git diff <base>...HEAD(或明確要求
working tree 版本 git diff <base>,含未 commit 的收尾)取料,不要餵 commit log 的話題給草稿——
commit log 會帶出被拆掉的中途嘗試痕跡。skills/commit-message
Inputs 第 3 條([tool.commitizen] / .cz.* / commitlint 設定檔 → Conventional Commits;repo
有明文禁用 CC 的慣例 → 跟 repo 走自由格式;皆無訊號 → 預設 Conventional Commits)。
這只影響 commit message 風格參考;PR title 本身永不套 type: prefix。.github/PULL_REQUEST_TEMPLATE.md(含大小寫變體與 .github/PULL_REQUEST_TEMPLATE/ 目錄)找到的 template 內容。
feat: 、fix: )auth.py」← bad;「Reject empty emails before hashing」← good字級措辭(em-dash 取代 , so、句首 Also 不加逗號、避免抽象名詞改用可量化說法)跟
skills/github-reply-draft
的 Convention 1 共用,見該處的「Word-level conventions」,這裡不重複寫。
| Bad | Good |
|---|---|
feat: add email validator | Reject empty emails at signup |
update auth.py and tests | Block login when MFA token expired |
WIP fix | Stop retry storm on 5xx from upstream |
必填三段(順序固定:Why → What → Test Plan):
## Why
<為什麼要做:bug repro / 痛點 / 觸發場景。可以引用 issue / 對話 / log。1–3 句。>
## What
<2–4 句或 bullets:這個 PR 改了什麼行為。reviewer 讀完就知道要看什麼。>
## Test Plan
- <怎麼驗證:跑了哪些 test / 手動測了什麼 / 看了哪個 metric>
- <command + 預期結果>
每段的長度紀律:
## Why ≤ 2 句。## What ≤ 1 段 + 1 個 code example(僅限 core API 改動這種需要秀 signature/呼叫方式的情況)——不要寫成逐檔案條列。## Test Plan 維持條列、一行一個 bullet,描述測到什麼,不要貼 test 檔內容進去。至多 3 條:跑了什麼指令、結論是什麼;有實跑證據時寫出命令與結論,做過 mutation 驗證就加一句摘要(拿掉哪裡、哪支測試轉紅);逐項的筆數、計數與驗證過程留在 review thread,不進 description。## What 改用條列,至多 4–5 條、每條一句;同一類的小修併成一條(「修了 pre-commit 安裝與 livereload 兩個 dev task」),不要一個修正一條、每條三句。## What 不開粗體子標題分區;實作細節(逐項安全措施、metric/log 欄位、截斷上限)與已知限制只用一句指向 PR 帶的 guide / docs,不在 description 重講。(實例:一份新 adapter 的初稿因逐項展開被使用者評「有點太長」,砍到約 1/3 才合格。)## Test Plan 最後一條 bullet(Not checked: A, and B.),只留 reviewer 需要自己確認的;不另開小節、不逐項解釋為什麼沒驗。🟣 Taki 回報的未驗項目只進這一條,不重複寫進 ## Known limitations。## Design rationale 或 ## Known limitations 時,放寬到約 40 行,且兩段各有上限(Design rationale ≤3 句、Known limitations ≤5 條且每條一句)。放寬只為這兩段,不是讓 Why / What / Test Plan 變長;沒有這兩段就維持約 25 行。| Anti-pattern | 問題 |
|---|---|
| 版本演進敘事(「v1 是這樣做,後來因為 Z 改成 Y」) | 這種討論屬於 PR review thread,不屬於 description。與 ## Design rationale 的界線:rationale 講最終設計為何如此(選了什麼、放棄哪個替代方案、一句理由),不講改了幾版、哪一版先試過 |
## What 逐檔案條列(「改了 a.py / 改了 b.py / 改了 c.py」) | reviewer 自己看 diff 就有檔案清單;description 該講行為改變,不是檔案清單 |
## Test Plan 貼整段 test 檔內容 | reviewer 要的是「測了什麼」的摘要,不是原始碼;貼檔案內容讓 test plan 難掃 |
帶確切 commit sha((a8910e8)、見 306feea) | rebase / squash 後 sha 失效,對 reviewer 也沒有資訊量;改用描述性文字(「移除 exclude-newer 豁免」)。永遠不帶,不因為「方便對照」而例外 |
可選段(有才加,不要為了塞而塞):
## Design rationale
<選了什麼、放棄了哪個替代方案、一句理由。≤3 句。>
## Known limitations
- <作者已知、刻意不處理的邊界或後續。≤5 條,每條一句。只收 plan 明確不處理的邊界與 🟡 Soyo 的 nit;「沒驗證到」的事項屬於 Test Plan 的 `Not checked`,不放這裡。>
## Breaking changes
<API / config / behaviour 改了什麼會打破既有 caller。沒有就不加這段。>
## Related issues
- Closes #<n>
- Refs #<n>
Closes: vs Refs: 判斷——colocated TODO 不代表這是誰的改動:一個緊貼著
某段程式碼異味(code smell)的 TODO: AIP-XX ... See #N 註解,不代表修那個
異味屬於 AIP-XX 這個 feature 的 scope。要分清楚「誰引入」跟「誰只是標註」——
一個 feature commit 若剛好落在異味旁邊,可能只是標註了早就存在的問題,不是
它引入的。判斷方式:git log -S"<name-or-string>" 找出真正引入異味的 commit,
git show <introducing-commit>^:<file> 確認異味在該 commit 之前就存在;再用
gh issue view N 看連結 issue 的 title/labels 是 feature item 還是單純的
kind:bug/kind:meta。異味早於 feature、issue 也不是 feature item 時,
用 Refs:(issue 範圍比這次改動大),不要用 Closes:——把長期存在的清理工作
歸給恰好標註它的 feature 會誇大這個 PR 的 scope,也會誤導 reviewer 理解這個 PR
在做什麼。
跟同屬「斷言資料歷史前先查 git」家族的
skills/harness-discipline/references/evidence-discipline.md
第 1 節同精神——那條講「別把推測寫成事實」,這條是它在 closes:/related:
判斷上的具體應用。
若 repo 有 PR template(Inputs 第 6 條):
## Why / ## What 標題:即使 template 沒有這兩個 section,也要把它們加在 template 開頭的自由描述區(通常在第一條 --- 分隔線之前),不能寫成無標題散文。Why/What 是 reviewer 理解改動的最低資訊,不能因 template 不含它們就省略。這是上一條「不要增加 template 沒有的 section」的明確例外;## Test Plan 同樣加在那一區(template 已有等價的測試說明 section 時,用 template 的)。## Description),Why / What / Test Plan 是它的內容,要降一級寫成 ### Why / ### What / ### Test Plan 掛在該 section 底下,不可與它同級並列成 ## Why。只有 template 沒有這種容器 section 時,才用 ##。寫完對照一次:每個標題的層級是否反映它在 template 結構裡的從屬關係。| 段落 | 訊號來源 |
|---|---|
| Why | commit body 裡的「why」段、PR 描述對話、issue link |
| What | branch commits 的主旨合併 + diff 摘要的 net effect |
| Test Plan | diff 裡新增 / 改動的 test 檔 + 推測的手動驗證 |
| Breaking changes | public API signature 改變、config key 改名、預設值翻轉 |
| Related issues | commit message 裡的 #<n> / Closes #<n> / Refs #<n> |
找不到 signal 不要編造——標記 <待補:...> 留給使用者填,不要 hallucinate。
caller 另附 plan 路徑與審查/驗證摘要時,可選段與 Test Plan 依下表取料;沒有對應素材就省略該段,不要自己補寫:
| 段落 | 素材來源 |
|---|---|
| Design rationale | plan 的 ## Decisions needed 與使用者的選擇(選了什麼、另一選項為何放棄) |
| Known limitations | plan 的 ## Risks / Open questions 中明確不處理的邊界、🟡 Soyo 的 Nit 與 Evidence pending(🟣 Taki 的未驗項目不在這裡,見下一列) |
| Test Plan | 🟣 Taki 的 command 與 exit code;🎀 Anon 附的 mutation 逐測試表(只寫一句摘要);🟣 Taki 的未驗項目併成最後一條 Not checked |
兩段的價值在於先講限制與被否決的方案,不在篇幅;長度以上方的上限為準。
target repo 有自己的 PR 撰寫規範時(例:skills/airflow-aware/SKILL.md 指向的 repo skill、PR template),repo 規範優先;這兩段放進 template 的自由描述區(標題層級依上方「若 repo 有 PR template」處理)。
skill 跑完直接給 caller 兩塊 markdown:
## Suggested PR title
<one line, user-impact>
## Suggested PR description
## Why
...
## What
...
## Test Plan
- ...
## Breaking changes <!-- 若無,整段刪 -->
...
## Related issues <!-- 若無,整段刪 -->
- Closes #...
上面兩塊是 skill 回給 caller 的結構化輸出。caller(/maigo:describe-pr orchestrator)
在印給使用者時,額外再附一份「可整段複製」的 description:
## Suggested PR description 底下的 body 原封放進單一 fenced code block。**Title:** <one line> 給 title,方便一起複製。<待補:...> 佔位符保留讓使用者替換。不是每個 <待補> 都屬於 fence 裡面。分兩種:
<待補: closes #NNNNN>)→ 留在可複製的 fenced block 裡。判斷方式:「使用者填完之後,這句話會不會以某種形式留在 body 裡?」 會 → 留在 body。不會(純粹是提醒 / 決策點)→ 移到 fence 外。
案例:某次 airflow FixedKeyMapper crash fix 的 describe-pr 草稿,把
<待補: newsfragment?> 加上兩行說明直接寫進 PR body——因為 copy-paste block
會被原封複製貼到 GitHub,那兩行說明會變成 PR 描述裡的 literal 雜訊。
(skill 本身只負責產 body / title;組裝 copy-paste block 是 caller 的收尾步驟。)
caller 呈現最終 deliverable 給使用者時,遵守 skills/copyable-deliverable——把可複製的內容放進單一 fenced code block。
Verify every PR-state / API-signature / CLI-flag claim against live source before writing —
reference docs go stale silently; use gh pr view, git show HEAD:<path>, or
gh pr diff <n> to confirm. Details and a per-claim-type recipe in
references/verification-discipline.md.
A PR that adds user-visible output (metrics, log lines, CLI output) states its use case and attaches a screenshot or real-run output in the description — same reference, "A PR that adds user-visible output needs a use case and a real run".
When drafting a tracking / follow-up issue body (e.g. for deferred work
surfaced by the current PR), default to a short prose block — problem +
proposal + a related PR/comment link — not a 5-section markdown template
(### Context / ### Proposal / ### Out of scope / ### Acceptance /
### Related). Target ≤3 sentences of prose plus the related link. Add
explicit ### Acceptance or similar headers only when the user asks for them
or the issue genuinely needs pinned acceptance criteria (e.g. a feature
request being scoped for a milestone).
要進公開 repo 的 PR 標題、描述、範例與測試,不得出現內部票號(任務描述帶來的私有追蹤系統編號),也不得帶客戶工單的內容:工單裡的時區與日期組合、crash 敘述(例如特定的資料庫錯誤)、相關 issue 連結。需求用語意描述(「註解與欄位共用同一個 result-size 預算」);範例改用自己構造、實際跑過的新例子,期望值用獨立方法算,不靠被測程式。動筆前先問「這個例子是不是來自工單」,是就換掉並重新實測;寫完 grep 一次票號格式。完整規則見 skills/commit-message 的「No internal ticket IDs」段。
PR body 不加任何 AI / Claude 署名——不寫「🤖 Generated with Claude Code」之類字句,即使 host 工具 / 平台預設會塞。與 skills/commit-message 的 Trailers 段同精神(commit 不加 Co-Authored-By):產出對外保持中性、不留 AI 痕跡。
gh pr create 或 GitHub UI)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub lee-w/maigo --plugin maigo26 skills in this plugin
/airflow-awareThis skill should be used when working in the apache/airflow repository as a contributor (not as a Dag author). It surfaces Airflow's own AGENTS.md conventions — naming, Breeze/uv, Ruff/Mypy, coding rules, pytest patterns, PR hygiene — for any review, quick-fix or refactor there./change-site-enumerationThis skill should be used when about to declare "N sites need changing", "the scope is closed", or "this is already fully shared" — before writing a plan that lists change sites, implementing one, reviewing a diff for lingering per-section branches, or reporting a scope/size number to the user./command-routerCodex pseudo-command router for Maigo. Use when the user sends or discusses any `/maigo:*` or `maigo:*` command (go, team, quick, review, board, remember, retro, doctor, etc.), or asks why Maigo commands do not behave like native Codex slash commands.Other plugins' skills for the same job