把 steipete/agent-rules 的三條核心 project-rule 策展成一份可直接當 slash 指令用的規則包:語意化 commit(12 種型別 + emoji、自動分拆 atomic commit)、6 個專業視角的 PR 審查、以及 5 Whys 根因分析。
# Agent Rule Pack — pick ONE mode per invocation
# Works as a Claude Code / Cursor slash command. Set {{MODE}} to: commit | pr-review | five-whys
MODE: {{MODE}}
CONTEXT: {{CONTEXT}} # e.g. the diff, the PR link, or the problem statement
=== MODE: commit ===
Create well-formatted, ATOMIC commits.
1. Run `git status`. If nothing is staged, review changes and stage the relevant ones.
2. Run pre-commit checks if the project has them (lint, build, type-check). Fix failures before committing.
3. If the staged changes cover unrelated concerns, SPLIT them into multiple commits — one concern each.
4. Pick the type and emoji, then write `type(scope): description` (imperative, lowercase, no trailing period). Add a body explaining WHY for non-trivial changes.
✨ feat | 🐛 fix | 📝 docs | ♻️ refactor | 🎨 style | ⚡️ perf | ✅ test | 🧑💻 chore | 🚧 wip | 🔥 remove | 🚑 hotfix | 🔒 security
=== MODE: pr-review ===
Review the change through SIX personas, each with its own checklist. Report findings per persona.
1. Product Manager — does it deliver the intended business value and meet requirements?
2. Developer — maintainability, standards, performance, scalability.
3. Quality Engineer — test coverage, edge cases, regression risk.
4. Security Engineer — vulnerabilities, authn/authz, input validation, data protection.
5. DevOps — CI/CD, config, monitoring, rollback safety.
6. UI/UX Designer — visual consistency, usability, accessibility, responsiveness.
RULE: anything you'd "fix later" must be raised NOW. End with: APPROVE or REQUEST CHANGES + the blocking items.
=== MODE: five-whys ===
Find the ROOT cause, not the symptom. Focus on process, not people.
1. State the problem/symptom precisely.
2. Ask "why" five times in a chain; each answer feeds the next question (Why 1 → Why 5).
3. Validate the chain: would fixing the final cause actually prevent recurrence?
4. Propose solutions that target the ROOT cause, plus a preventive measure so it can't return.
Output: the numbered Why-chain, a one-line root-cause statement, then the fix + prevention.不用離開網站,直接看這組 prompt 跑出來長怎樣(AI 即時生成,扣 1 點)。
不只複製貼上 — 下載後放到 ~/.claude/skills/steipete-agent-rules-commit-pr-fivewhys-pack/SKILL.md,之後每個 session 自動可用(觸發時自動載入)。
mkdir -p ~/.claude/skills/steipete-agent-rules-commit-pr-fivewhys-pack && mv ~/Downloads/SKILL.md ~/.claude/skills/steipete-agent-rules-commit-pr-fivewhys-pack/SKILL.mdNew-Item -ItemType Directory -Force "$env:USERPROFILE\.claude\skills\steipete-agent-rules-commit-pr-fivewhys-pack" | Out-Null; Move-Item "$env:USERPROFILE\Downloads\SKILL.md" "$env:USERPROFILE\.claude\skills\steipete-agent-rules-commit-pr-fivewhys-pack\SKILL.md"## 這是什麼/解決什麼痛點 三個天天發生、又天天被將就的問題:commit 訊息隨便寫(之後 git log 看不懂)、PR 審查靠當下心情(漏掉安全或測試)、bug 修了表面又復發(沒找到真因)。steipete/agent-rules 把這些做成「規則檔」,讓 AI 助理每次都照同一套標準執行。本篇把其中最實用的三條打包成一個可切換模式的規則包。 ## 為什麼這個來源值得用 來源是 Peter Steinberger(steipete,知名 iOS 開源作者、PSPDFKit 創辦人)的 agent-rules(MIT 授權、可商用)。這些規則原本是他用 Cursor 時打磨出來的 `.mdc` 規則檔,而 `.mdc` 規則本質上就能當成 Claude Code 的 slash 指令來用(複製到 `.claude/commands/` 即可)——同一套規則跨 Cursor 與 Claude Code 通用。三條規則的內容很扎實: - **commit**:12 種 Conventional Commit 型別配 emoji(✨feat/🐛fix/📝docs/♻️refactor…),會先跑 pre-commit 檢查、強調 atomic commit,並主動「把不相關的變更分拆成多個 commit」。 - **pr-review**:用 6 個專業 persona(PM/開發/品保/資安/DevOps/UI-UX)各自一份 checklist 審查,並有一條硬規則:「打算之後再修的,現在就要修」。 - **five(5 Whys)**:定義問題 → 連問五次為什麼 → 驗證因果鏈 → 針對根因提解法+預防措施,並強調「對事不對人」。 ## 怎麼用(步驟) 1. 把上方 full_prompt 存成一個 Claude Code slash 指令(`.claude/commands/agent-rule.md`),或直接貼進對話。 2. 設定 `{{MODE}}` 為 `commit`、`pr-review` 或 `five-whys`,並在 `{{CONTEXT}}` 給對應材料(diff/PR 連結/問題描述)。 3. AI 就會照該模式的固定流程執行並輸出。想要原汁原味的全套規則,直接 clone repo 把 `project-rules/*.mdc` 丟進你的工具。 ## 何時用 - 想統一團隊的 commit 風格與 PR 審查品質。 - 線上事故 / 反覆出現的 bug,需要結構化地挖根因而非貼 OK 繃。 - 同時用 Cursor 和 Claude Code,想要一套規則兩邊共用。 📎 來源:steipete/agent-rules(project-rules,作者 Peter Steinberger,MIT 授權)— 本篇為繁中改寫整理,三條規則合併成可切換模式的版本;原始各別 `.mdc` 規則檔見上方連結。
[MODE]要執行的模式:commit(語意化提交)/ pr-review(6 視角審查)/ five-whys(根因分析)
[CONTEXT]對應模式的輸入材料:commit 給變更、pr-review 給 diff 或 PR 連結、five-whys 給問題描述
填下面的欄位,上方 prompt 會即時替換 [方括號] 內容。填好後按「複製組好的 prompt」直接丟進工具。
# Agent Rule Pack — pick ONE mode per invocation
# Works as a Claude Code / Cursor slash command. Set {{MODE}} to: commit | pr-review | five-whys
MODE: {{MODE}}
CONTEXT: {{CONTEXT}} # e.g. the diff, the PR link, or the problem statement
=== MODE: commit ===
Create well-formatted, ATOMIC commits.
1. Run `git status`. If nothing is staged, review changes and stage the relevant ones.
2. Run pre-commit checks if the project has them (lint, build, type-check). Fix failures before committing.
3. If the staged changes cover unrelated concerns, SPLIT them into multiple commits — one concern each.
4. Pick the type and emoji, then write `type(scope): description` (imperative, lowercase, no trailing period). Add a body explaining WHY for non-trivial changes.
✨ feat | 🐛 fix | 📝 docs | ♻️ refactor | 🎨 style | ⚡️ perf | ✅ test | 🧑💻 chore | 🚧 wip | 🔥 remove | 🚑 hotfix | 🔒 security
=== MODE: pr-review ===
Review the change through SIX personas, each with its own checklist. Report findings per persona.
1. Product Manager — does it deliver the intended business value and meet requirements?
2. Developer — maintainability, standards, performance, scalability.
3. Quality Engineer — test coverage, edge cases, regression risk.
4. Security Engineer — vulnerabilities, authn/authz, input validation, data protection.
5. DevOps — CI/CD, config, monitoring, rollback safety.
6. UI/UX Designer — visual consistency, usability, accessibility, responsiveness.
RULE: anything you'd "fix later" must be raised NOW. End with: APPROVE or REQUEST CHANGES + the blocking items.
=== MODE: five-whys ===
Find the ROOT cause, not the symptom. Focus on process, not people.
1. State the problem/symptom precisely.
2. Ask "why" five times in a chain; each answer feeds the next question (Why 1 → Why 5).
3. Validate the chain: would fixing the final cause actually prevent recurrence?
4. Propose solutions that target the ROOT cause, plus a preventive measure so it can't return.
Output: the numbered Why-chain, a one-line root-cause statement, then the fix + prevention.這組 prompt 專為 Claude Code 設計。把 prompt 內 2 個方括號 [變數] 換成你自己的內容,貼進 Claude Code 執行即可。難度中等,照變數說明填好後即可上手。
完整 prompt 免費開放閱讀,不用註冊;登入後可一鍵複製、收藏與留言。
prompt 文字本身你可自由使用與修改。但 AI 生成物(圖/音樂/影片/文字)的商用授權,取決於你在 Claude Code 使用的方案與其官方服務條款,請以該工具的授權規範為準。
Studio engineer 視角拆解 Suno 致命弱點(油炸 vocals、高頻 artifact)+ 4 步驟 DAW workflow + Suno Studio 修音 prompt
提案產生器 / 會議處理器 / 內容再利用 / 週五回顧 / 收工 reset — 試了 40 個只有這 5 個沒被丟掉、各省 30+ 分鐘 / 次。
適合:部落格、Medium、Notion 公開頁、Substack — 任何支援 iframe / HTML 嵌入的地方。對方點「看完整」會回到本站、是 prompt 庫的免費 backlink。
<iframe src="https://prompt.luvai.net/embed/steipete-agent-rules-commit-pr-fivewhys-pack" width="100%" height="380" frameborder="0" style="border:1px solid #e0dcd0;border-radius:4px;" loading="lazy" title="PromptCraft Embed"></iframe>
把方括號 [ ] 內的變數換成你的內容,丟進 Claude Code。
六個月在 Claude / GPT-4 / Gemini 上用人工 rater A/B 測 200+ prompt 後寫的。包含 persona+constraint stacking / anti-example / role reversal QA / cognitive scaffold / emotional priming / uncertainty CoT / steelman first。
一年的 role-play system prompt + 14-step framework 後總結:真正改變品質的是 5 個單行 prompt。沒有 role、沒有 markdown、沒有「you are an expert」。