一份可貼進任何 coding agent 的 Definition of Done 模板,把『什麼叫做完』寫成 agent 必須逐項自檢的 checklist:行為符合驗收標準、tests / lint / typecheck / build 全綠(沒跑要說原因)、有風險的改動附 rollback、最後交一份『驗證故事』。杜絕「它說完成了結果一堆紅」。
Before you report this task as done, you MUST self-verify against the Definition of Done below. Treat "done" as a claim you have to prove, not a feeling. If you cannot satisfy a check, do NOT silently skip it — state exactly which check failed and why.
## The task
{{TASK_DESCRIPTION}}
## Acceptance criteria (the change is correct only if ALL hold)
{{ACCEPTANCE_CRITERIA}}
## Out of scope — do NOT touch
{{OUT_OF_SCOPE}}
## Definition of Done checklist — go through every item and mark ✅ / ❌ with evidence
1. **Behavior** — The change satisfies every acceptance criterion above. For each criterion, say in one line how the code now satisfies it.
2. **Scope discipline** — You touched only what was needed; nothing in the out-of-scope list changed. List the files you modified and confirm none are out of scope.
3. **Tests** — Run the project's test command (`{{TEST_COMMAND}}`). Paste the real, unedited result (pass/fail counts). If you could not run it, say so explicitly and why — never claim it passed without running it.
4. **Lint / typecheck / build** — Run `{{QUALITY_COMMANDS}}`. Paste the actual output. Any new error you introduced must be fixed, not suppressed.
5. **New coverage** — If you added or changed behavior, you added or updated at least one test that would FAIL on the old code and PASS on the new code. Name it. If you intentionally didn't, justify it.
6. **Edge cases** — List the edge / error cases relevant to this change (empty input, null, concurrency, failure path, etc.) and confirm each is handled or explicitly out of scope.
7. **Conventions** — The new code matches existing patterns, naming, and error-handling style in the surrounding files (don't invent a new style).
8. **Rollback / risk** — If this change is risky (touches data, auth, money, migrations, shared infra), describe how to revert it (single commit? feature flag?). If low-risk, say so.
9. **No placeholders** — Confirm there are no `TODO`, `pass`, `...`, stubbed functions, or commented-out "will do later" left in the diff.
## Final output — the verification story
End with a short paragraph a human reviewer can read in 30 seconds: what you changed, why it's correct, what you ran to prove it, and any check that is ❌ with the honest reason. Do not say "done" anywhere unless items 1–9 are all ✅ or have a stated, accepted reason.不用離開網站,直接看這組 prompt 跑出來長怎樣(AI 即時生成,扣 1 點)。
不只複製貼上 — 下載後放到 ~/.claude/skills/agent-definition-of-done-self-gate-spec/SKILL.md,之後每個 session 自動可用(觸發時自動載入)。
mkdir -p ~/.claude/skills/agent-definition-of-done-self-gate-spec && mv ~/Downloads/SKILL.md ~/.claude/skills/agent-definition-of-done-self-gate-spec/SKILL.mdNew-Item -ItemType Directory -Force "$env:USERPROFILE\.claude\skills\agent-definition-of-done-self-gate-spec" | Out-Null; Move-Item "$env:USERPROFILE\Downloads\SKILL.md" "$env:USERPROFILE\.claude\skills\agent-definition-of-done-self-gate-spec\SKILL.md"適用情境:交付任何稍微重要的 coding task(修 bug、加功能、改 API)時,貼在任務描述末端;或把整段精簡後放進 CLAUDE.md / AGENTS.md 變成每次都生效的常駐規則。為什麼有效:① 把『完成』從感覺變成『必須提出證據的主張』,直接打中 agent 最常見的假性完成;② 要求貼『真實未經修飾的測試/build output』,擋掉它編造綠燈;③ 明確的 out-of-scope 清單 + scope discipline 自檢,避免它順手亂改不相干檔案;④ 『驗證故事』讓人類 reviewer 30 秒就懂發生什麼。技巧:TEST_COMMAND / QUALITY_COMMANDS 填你專案真實指令(如 pnpm test、tsc --noEmit、next build),agent 才有得跑。這套 DoD 概念對 Claude Code、Codex、或任何能跑指令的 agent 都通用。
## Definition of Done 1. Behavior ✅ — 三條驗收標準逐條對應到 auth.ts L40-58。 2. Scope ✅ — 只改 auth.ts / auth.test.ts,未碰 out-of-scope 的 db/。 3. Tests ✅ — `pnpm test`:`Test Files 12 passed | Tests 84 passed`(原文貼上)。 4. Lint/typecheck/build ✅ — `tsc --noEmit` exit 0;`next build` 成功。 5. New coverage ✅ — 新增 `returns JSON on 401`,在舊 code 會 fail。 6. Edge cases ✅ — 空 body / 過期 token / 並發重送 已處理。 7. Conventions ✅ — 沿用既有 `errJson()` helper。 8. Rollback ✅ — 單一 commit,可直接 revert。 9. No placeholders ✅。 Verification story:把 401 從回 HTML 改成回結構化 JSON,新增對應測試證明新舊行為差異,型別/建置全綠,單一 commit 可回滾。
以上為此 Prompt 丟進 Claude Code / Codex 後可得到的描述性成果,實際畫面會因填入的變數而有差異。
[TASK_DESCRIPTION]這次要做的任務,一兩句講清楚目標
[ACCEPTANCE_CRITERIA]具體驗收標準,越可驗證越好(例如:『/login 401 時回 JSON 而非 HTML』『清單空時顯示空狀態而非崩潰』)
[OUT_OF_SCOPE]明確不准動的範圍(哪些檔案/模組/行為不能改),用來防止 agent 順手改壞別的地方
[TEST_COMMAND]專案的測試指令,如 pnpm test / npm run test / pytest
[QUALITY_COMMANDS]lint / typecheck / build 指令,如 tsc --noEmit、eslint .、next build
填下面的欄位,上方 prompt 會即時替換 [方括號] 內容。填好後按「複製組好的 prompt」直接丟進工具。
Before you report this task as done, you MUST self-verify against the Definition of Done below. Treat "done" as a claim you have to prove, not a feeling. If you cannot satisfy a check, do NOT silently skip it — state exactly which check failed and why.
## The task
{{TASK_DESCRIPTION}}
## Acceptance criteria (the change is correct only if ALL hold)
{{ACCEPTANCE_CRITERIA}}
## Out of scope — do NOT touch
{{OUT_OF_SCOPE}}
## Definition of Done checklist — go through every item and mark ✅ / ❌ with evidence
1. **Behavior** — The change satisfies every acceptance criterion above. For each criterion, say in one line how the code now satisfies it.
2. **Scope discipline** — You touched only what was needed; nothing in the out-of-scope list changed. List the files you modified and confirm none are out of scope.
3. **Tests** — Run the project's test command (`{{TEST_COMMAND}}`). Paste the real, unedited result (pass/fail counts). If you could not run it, say so explicitly and why — never claim it passed without running it.
4. **Lint / typecheck / build** — Run `{{QUALITY_COMMANDS}}`. Paste the actual output. Any new error you introduced must be fixed, not suppressed.
5. **New coverage** — If you added or changed behavior, you added or updated at least one test that would FAIL on the old code and PASS on the new code. Name it. If you intentionally didn't, justify it.
6. **Edge cases** — List the edge / error cases relevant to this change (empty input, null, concurrency, failure path, etc.) and confirm each is handled or explicitly out of scope.
7. **Conventions** — The new code matches existing patterns, naming, and error-handling style in the surrounding files (don't invent a new style).
8. **Rollback / risk** — If this change is risky (touches data, auth, money, migrations, shared infra), describe how to revert it (single commit? feature flag?). If low-risk, say so.
9. **No placeholders** — Confirm there are no `TODO`, `pass`, `...`, stubbed functions, or commented-out "will do later" left in the diff.
## Final output — the verification story
End with a short paragraph a human reviewer can read in 30 seconds: what you changed, why it's correct, what you ran to prove it, and any check that is ❌ with the honest reason. Do not say "done" anywhere unless items 1–9 are all ✅ or have a stated, accepted reason.這組 prompt 專為 Claude Code / Codex 設計。把 prompt 內 5 個方括號 [變數] 換成你自己的內容,貼進 Claude Code / Codex 執行即可。難度中等,照變數說明填好後即可上手。
完整 prompt 免費開放閱讀,不用註冊;登入後可一鍵複製、收藏與留言。
prompt 文字本身你可自由使用與修改。但 AI 生成物(圖/音樂/影片/文字)的商用授權,取決於你在 Claude Code / Codex 使用的方案與其官方服務條款,請以該工具的授權規範為準。
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/agent-definition-of-done-self-gate-spec" width="100%" height="380" frameborder="0" style="border:1px solid #e0dcd0;border-radius:4px;" loading="lazy" title="PromptCraft Embed"></iframe>
把方括號 [ ] 內的變數換成你的內容,丟進 Claude Code / Codex。
六個月在 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」。