循環(huán)實戰(zhàn):Scoped Re-Review 提示詞模板如何驗證“修復(fù)真的生效了“)
Superpowers SDD 修復(fù)循環(huán)實戰(zhàn)Scoped Re-Review 提示詞模板如何驗證修復(fù)真的生效了【免費下載鏈接】superpowersAn agentic skills framework software development methodology that works.項目地址: https://gitcode.com/GitHub_Trending/su/superpowers在 superpowers 的 subagent-driven-developmentSDD技能中每個任務(wù)實現(xiàn)完成后都要經(jīng)過實現(xiàn) → 評審 → 修復(fù) → 復(fù)審的循環(huán)。re-review-prompt.md 定義的就是這個循環(huán)中最關(guān)鍵的一環(huán)——范圍化復(fù)審scoped re-review的提示詞模板復(fù)審者不再做一輪全新評審而是只驗證上一輪評審的每條 finding 是否已被處理并檢查修復(fù) diff 本身是否引入了新問題。讀完本文你將理解這個模板每一節(jié)的契約語義、七個占位符的填充方式以及它與 SKILL.md 中五輪熔斷、評審包腳本scripts/review-package如何協(xié)同工作使修復(fù)循環(huán)在結(jié)構(gòu)上必然收斂。一、為什么復(fù)審必須是范圍化的模板開篇就定調(diào)re-review-prompt.mdUse this template when dispatching a re-review after a fix round. The re-reviewer verifies the findings were addressed and checks the fix diff for new breakage.It is not a fresh review — the full review already happened.Purpose:驗證上一輪評審的每條 finding 是否被處理且修復(fù)本身沒有破壞任何東西。這條定位不是風(fēng)格偏好而是對真實故障的修正。設(shè)計文檔 2026-07-15-sdd-fix-loop-redesign-design.md 記錄了四個在真實會話中觀察到的問題其中第一個就是病態(tài)評審循環(huán)舊版循環(huán)的字面語義是Repeat until approved且沒有輪次上限每一輪復(fù)審又是對整個 diff 的全新完整評審——于是非確定性的前沿評審模型每輪都會翻出新 finding形成 implement → review → fix → review → review → fix → review 的打轉(zhuǎn)沒有斷路器。設(shè)計文檔把這種每輪全量復(fù)審稱為churn engine空轉(zhuǎn)引擎并指出 strict-cost 實驗獨立測量過評審循環(huán)次數(shù)是單次運行成本中最大的方差來源。因此新循環(huán)有兩條硬性設(shè)計決策見設(shè)計文檔 Design Decisions 表格復(fù)審范圍鎖定到 findings 列表——復(fù)審者只能對給定 finding 逐條判詞并只檢查修復(fù) diff 內(nèi)的新破壞五輪熔斷——每任務(wù)最多 5 輪修復(fù)第 5 輪仍失敗則由控制器裁決。范圍化復(fù)審是結(jié)構(gòu)性收斂的第一塊基石復(fù)審者被禁止漫無目的地游走wander新發(fā)現(xiàn)如果落在修復(fù) diff 之外的代碼上只能作為非阻塞觀察項記錄不能延長循環(huán)。二、模板全文結(jié)構(gòu)與逐節(jié)契約模板主體是一個可直接復(fù)制填充的 Subagent 派發(fā)塊。下面按模板內(nèi)部的章節(jié)順序拆解每一節(jié)都是對復(fù)審者行為的強約束2.1 派發(fā)頭模型必填Subagent (general-purpose): description: Re-review Task N fix round R model: [MODEL — REQUIRED: choose per SKILL.md Model Selection; an omitted model silently inherits the sessions most expensive one][MODEL]是必填項。SKILL.md 的 Model Selection 一節(jié)明確警告省略 model 字段會靜默繼承會話模型——通常是最強也最貴的模型——從而靜默地使整節(jié)模型選擇策略失效。針對復(fù)審的特殊建議是小修復(fù) diff 的范圍化復(fù)審用低到中檔模型原文Scoped re-reviews of small fix diffs take a cheap-to-mid tier因為復(fù)審只看一個窄范圍不需要最強推理。2.2 The Task / The Findings Under Verification / The Fix三路輸入模板給復(fù)審者三路文件輸入章節(jié)占位符內(nèi)容The Task[BRIEF_FILE]任務(wù)簡報文件——與實現(xiàn)者工作時使用的是同一個文件The Findings Under Verification[FINDINGS]上一輪評審的 Critical/Important findings 與 spec gaps逐字復(fù)制copied verbatim每條一個 bulletThe Fix[REPORT_FILE]實現(xiàn)者的報告文件修復(fù)報告追加在文件末尾[FINDINGS]必須逐字復(fù)制而不能改寫這一點很重要finding 是上一輪評審的輸出原文改寫會引入語義漂移使這條是否被處理的判斷失去錨點。[FINDINGS]與[BRIEF_FILE]共同構(gòu)成復(fù)審的完整任務(wù)面——brief 告訴復(fù)審者任務(wù)本來要做什么findings 告訴它上一輪發(fā)現(xiàn)了什么。2.3 Diff 窗口FIX_BASE 與 HEAD**Fix base:** [FIX_BASE_SHA] (the head the previous review saw) **Head:** [HEAD_SHA] **Diff file:** [DIFF_FILE] Read the diff file once — it contains the fix commits, a stat summary, and the fix diff with surrounding context. Do not re-run git commands. If the diff file is missing, fetch the diff yourself: git diff --stat [FIX_BASE_SHA]..[HEAD_SHA] and git diff [FIX_BASE_SHA]..[HEAD_SHA].這里有三個要點[FIX_BASE_SHA]的語義是上一輪評審看到的 head而不是任務(wù)開始時的 BASE。這是范圍化的核心diff 窗口只覆蓋上次評審之后到現(xiàn)在的提交即本輪修復(fù)本身。[DIFF_FILE]由腳本生成scripts/review-package PLAN_FILE FIX_BASE HEAD打印出的路徑。從 review-package 的源碼可以看到輸出文件包含三段——git log --oneline提交列表、git diff --stat統(tǒng)計、git diff -U10帶 10 行上下文的完整 diff。文件名按范圍命名out$dir/review-$(git rev-parse --short $base)..$(git rev-parse --short $head).diff腳本頭注釋專門說明了這個設(shè)計意圖named per range, so a re-review after fixes gets a distinct fresh file按范圍命名因此修復(fù)后的復(fù)審得到的是另一個全新文件。這保證了修復(fù)輪復(fù)審的 diff 包不會與首輪評審的包互相覆蓋。只讀約束模板明確要求 Your review is read-only on this checkout. Do not mutate the working tree, the index, HEAD, or branch state in any way.你的評審對此 checkout 是只讀的不得改動工作樹、索引、HEAD 或分支狀態(tài)。并規(guī)定讀一次 diff 文件、不要重跑 git 命令僅在 diff 文件缺失時才自行用 git 命令兜底。2.4 Scope 節(jié)禁止漫游這是范圍化復(fù)審與全量復(fù)審的分水嶺原文措辭非常強硬Your scope is the findings list and the fix diff. Verdict every finding. Inspect the fix diff for new problems the fix itself introduced.Do NOT re-review code the fix did not touch: if you notice an issue entirely outside the fix diff, report it under Out-of-Scope Observations — it does not block this task and does not extend the loop. A broad whole-branch review happens after all tasks are complete.三條規(guī)則每條 finding 都必須給判詞Verdict every finding不能漏只檢查修復(fù) diff 引入的新問題修復(fù) diff 之外發(fā)現(xiàn)的任何問題一律進 Out-of-Scope Observations不阻塞本任務(wù)、不延長循環(huán)由控制器記錄在案留給最終整分支評審處理。這條規(guī)則直接回應(yīng)了 SKILL.md Common Rationalizations 表格中的一行借口The reviewer will just find something new anyway反正評審者總會發(fā)現(xiàn)新東西——現(xiàn)實是范圍化復(fù)審只驗證修復(fù)、不會漫游未觸及代碼上的新發(fā)現(xiàn)進賬本ledger不進循環(huán)。2.5 Tests 節(jié)報告是未驗證的聲明The implementer re-ran the tests covering the amended code and appended the results to the report file.Treat the report as unverified claims: confirm the fix report names the covering tests and shows their output, and verify the claims against the diff. Do not re-run the suite to confirm their report. Run a test only when reading the code raises a specific doubt that no existing run answers — and then a focused test, never a package-wide suite.復(fù)審者對實現(xiàn)者報告的測試結(jié)論持懷疑態(tài)度與 task-reviewer-prompt.md 的 Do Not Trust the Report 一脈相承要確認修復(fù)報告指名了覆蓋測試、展示了輸出并把聲明與 diff 對照核驗但不得為確認報告而重跑測試套件——只有當(dāng)讀代碼時產(chǎn)生現(xiàn)有運行都無法回答的具體疑問時才跑測試且只能跑聚焦測試絕不跑包級全量套件。這與 SKILL.md 修復(fù)循環(huán)中的完整性門呼應(yīng)派發(fā)復(fù)審前控制器要先確認修復(fù)報告同時包含三樣?xùn)|西——覆蓋測試、運行命令、輸出三者齊全才派發(fā)復(fù)審。2.6 Output Format四段式輸出契約模板規(guī)定復(fù)審者的最終消息就是報告本身begin directly with the first findings verdict. Every line is a verdict, a finding with file:line, or a check you ran — no preamble, no process narration.直接從第一條 finding 的判詞開始每一行要么是判詞、要么帶 file:line 的發(fā)現(xiàn)、要么是你執(zhí)行的檢查——無前言、無過程敘述。四個輸出塊1) Finding Verdicts逐條判詞### Finding Verdicts For each finding in The Findings Under Verification, in order: - **[finding one-liner]** — ADDRESSED | NOT ADDRESSED, with file:line evidence. Attempted is not addressed: the specific defect must no longer exist.按順序?qū)γ織l finding 給出二值判詞ADDRESSED / NOT ADDRESSED且必須附file:line證據(jù)。模板特別收緊了判定標(biāo)準(zhǔn)Attempted is not addressed嘗試過不算處理——那個具體的缺陷必須已不復(fù)存在。這一條把我改了相關(guān)代碼和缺陷確實消失區(qū)分開。2) New Breakage in the Fix Diff修復(fù) diff 中的新破壞修復(fù)本身弄壞或引入的東西帶嚴(yán)重級別Critical/Important/Minor與 file:line干凈則寫 None。按 SKILL.md 的循環(huán)規(guī)則修復(fù) diff 中新出現(xiàn)的 Critical/Important 破壞會并入 open findings 列表——這是循環(huán)唯一會被擴大的合法途徑而且只限修復(fù) diff 內(nèi)部。3) Out-of-Scope Observations范圍外觀察完全位于修復(fù) diff 之外的問題。非阻塞控制器把它們記入賬本留給最終評審。沒有則寫 None。4) Verdict輪次裁決### Verdict **Fix round:** [All findings addressed, no new Critical/Important breakage | Findings remain open] — list the open ones.二選一要么所有 finding 已處理且無新 Critical/Important 破壞要么仍有未處理 finding——并列出仍開放的條目。這正是控制器判定循環(huán)是否收斂的唯一依據(jù)。三、占位符速查表模板末尾給出的七項占位符re-review-prompt.md Placeholders 一節(jié)占位符必填取值來源[MODEL]必填按 SKILL.md Model Selection 選定小修復(fù) diff 的范圍化復(fù)審用低到中檔檔[BRIEF_FILE]—任務(wù)簡報文件與實現(xiàn)者同一份由 scripts/task-brief 生成輸出workspace/task-N-brief.md[FINDINGS]—上一輪評審的 Critical/Important findings 與 spec gaps逐字復(fù)制每條一個 bullet[REPORT_FILE]—實現(xiàn)者報告文件修復(fù)報告追加于其后[FIX_BASE_SHA]—上一輪評審看到的 head不是任務(wù)初始 BASE[HEAD_SHA]—當(dāng)前提交[DIFF_FILE]—scripts/review-package PLAN_FILE FIX_BASE HEAD打印出的路徑注意[FINDINGS]和[FIX_BASE_SHA]是 2026-07-15 修復(fù)循環(huán)重構(gòu)時為復(fù)審模板新增的占位符——實施計劃 2026-07-15-sdd-fix-loop-redesign.md 的 Global Constraints 明確寫道Template placeholders keep the existing bracket convention:[MODEL],[BRIEF_FILE],[REPORT_FILE],[BASE_SHA],[HEAD_SHA],[DIFF_FILE],[GLOBAL_CONSTRAINTS]; the new re-review template adds[FINDINGS],[FIX_BASE_SHA].復(fù)審者返回內(nèi)容Re-reviewer returns 一節(jié)原文摘要逐條 finding 判詞ADDRESSED / NOT ADDRESSED、修復(fù) diff 中的新破壞、范圍外觀察、輪次裁決??刂破髂眠@四樣就能直接決定下一步收斂 → 完成任務(wù)不收斂且未達上限 → 下一輪不收斂且第 5 輪 → 熔斷裁決。四、模板在 SDD 修復(fù)循環(huán)中的位置單獨看模板是一份合同放進 SKILL.md 的 The fix loop 小節(jié)才能看到它的完整生命周期。4.1 觸發(fā)與輪次策略循環(huán)在評審報告 spec ?、任意 Critical/Important finding、或控制器確認過的 ?? 項時觸發(fā)。兩個出口在循環(huán)開始前就分流Minor findings 只記賬本Task N: minor (deferred): one-liner永不進循環(huán)與計劃文本沖突的 finding 直接交人類裁決。進入循環(huán)后每任務(wù)最多 5 輪每輪 一次修復(fù)派發(fā) 一次范圍化復(fù)審第 1–3 輪resume 原始實現(xiàn)者把開放 findings 逐字發(fā)給它。實現(xiàn)者上下文完整——它知道任務(wù)、代碼和自己的選擇。implementer-prompt.md 的 After Review Findings 一節(jié)規(guī)定了被 resume 后的動作合同F(xiàn)ix them, re-run the tests that cover the amended code, and append a fix report to your report file: what you changed, the covering tests you ran, the command, and the output.修復(fù)它們重跑覆蓋被改代碼的測試把修復(fù)報告追加到報告文件改了什么、跑了哪些覆蓋測試、命令、輸出。若你的 harness 無法向存活的子代理再發(fā)消息則派發(fā)一個攜帶 brief 路徑、報告文件路徑和 findings 的新實現(xiàn)者——報告文件無論如何都是持久記憶。第 4–5 輪換一個更強模型的實現(xiàn)者附帶框架話術(shù)A prior implementer attempted this task [N] times; you own it now. Read the report file for what was tried.此前一位實現(xiàn)者嘗試過此任務(wù) [N] 次現(xiàn)在由你接手。讀報告文件看嘗試過什么。設(shè)計文檔的解釋是能撐過三次 resume 的循環(huán)通常意味著實現(xiàn)者看不到自己的問題——fresh eyes and a capability bump in one move一次動作同時完成換視角與升能力。4.2 每一輪如何調(diào)用復(fù)審模板SKILL.md 第 4 步的關(guān)鍵段落The re-review is scoped.Runscripts/review-package PLAN_FILE FIX_BASE HEADwhere FIX_BASE is the head the previous review saw, and dispatch re-review-prompt.md with the findings list, the brief, the report file, and the printed diff path. The re-reviewer verdicts each finding ADDRESSED or NOT ADDRESSED and flags new breakage in the fix diff only. New Critical/Important breakage in the fix diff joins the open findings list. Out-of-scope observations go to the ledger as deferred minors — they never extend the loop.拆解成控制器動作序列修復(fù)者返回后確認其修復(fù)報告三要素齊全覆蓋測試、命令、輸出運行scripts/review-package PLAN_FILE FIX_BASE HEAD——FIX_BASE是上一輪評審看到的 head。從 review-package 源碼可見它會校驗兩個 SHAgit rev-parse --verify把提交列表、stat、-U10diff 寫入按范圍命名的文件并打印wrote path: N commit(s), bytes bytes——控制器拿到打印的路徑即可diff 內(nèi)容永不進入控制器上下文填充模板七占位符派發(fā)復(fù)審子代理按四段式輸出更新賬本格式為SKILL.md After each round 與實施計劃 Global Constraints 中的精確格式供 eval 場景 grepTask N: fix round R/5 (X addressed, Y open — finding one-liners; commits a7..b7)4.3 熔斷與裁決當(dāng)?shù)?5 輪的復(fù)審仍有 finding 未關(guān)閉斷路器跳閘停止派發(fā)由控制器逐條裁決控制器持有評審者所沒有的計劃和跨任務(wù)上下文評審者錯了或有爭議→ 擱置park賬本記Task N: parked — finding — ruling: why the code stands最終評審會看到雙方立場真實但下游無依賴→ 同樣擱置ruling 注明真實但延期真實且承重load-bearing——后續(xù)任務(wù)構(gòu)建于其上或暴露計劃缺陷 → 立即 STOP記Task N: BLOCKED — reason并向人類報告。模板里的 Verdict 一節(jié)正是這一裁決機制的數(shù)據(jù)來源。設(shè)計文檔特別強調(diào)沒有提前出口控制器絕不在達到上限前裁決因為提前裁決以結(jié)束循環(huán)等于換了一種名字做預(yù)判pre-judging——這與模板禁止評審者漫游是同一設(shè)計哲學(xué)的兩面把循環(huán)的自由度鎖死收斂才有保證。4.4 最終評審中的復(fù)用范圍化復(fù)審不只服務(wù)于單任務(wù)循環(huán)。SKILL.md 的 Final Review 一節(jié)規(guī)定最終整分支評審若發(fā)現(xiàn) findings派發(fā)一個ONE修復(fù)子代理處理完整 findings 列表然后恰好運行一次范圍化復(fù)審對修復(fù)范圍跑review-package仍用本模板殘余 findings 按熔斷規(guī)則裁決——沒有第二波修復(fù)。也就是說同一份模板、同一套契約同時約束任務(wù)級循環(huán)與分支級收尾規(guī)則完全一致。五、一次完整的修復(fù)輪從示例中看模板生效SKILL.md 的 Example Workflow 給出了帶行內(nèi)引用的完整樣例Task 2 場景[Run review-package PLAN_FILE BASE HEAD; dispatch task reviewer with the printed path] Task reviewer: Spec ?: - Missing: Progress reporting (spec says report every 100 items) Issues (Important): Magic number (100) [Fix round 1: resume the implementer with both findings] Implementer: Added progress reporting, extracted PROGRESS_INTERVAL constant. Re-ran test/recovery.test.js — 10/10 passing. Fix report appended. [Run review-package PLAN_FILE FIX_BASE HEAD; dispatch scoped re-review] Re-reviewer: Missing progress reporting — ADDRESSED (src/recovery.js:41). Magic number — ADDRESSED (src/recovery.js:7). New breakage: none. Verdict: all findings addressed. [Ledger: Task 2: fix round 1/5 (2 addressed, 0 open; commits d4e5f6a..b7c8d9e)] [Ledger: Task 2: complete (commits d4e5f6a..b7c8d9e, review clean)]對照模板的四段式輸出可以看到復(fù)審者的行為被完全約束住每條 finding 一個判詞加file:linesrc/recovery.js:41、src/recovery.js:7、New breakage 一行 none、沒有范圍外觀察就省略、最后給出輪次裁決 all findings addressed??刂破鲹?jù)此把 2 addressed, 0 open 記入賬本并直接標(biāo)記任務(wù) complete——整個過程沒有任何再從頭審一遍的開銷。六、與首輪評審模板的職責(zé)邊界為避免兩份模板職責(zé)混淆這里對照 task-reviewer-prompt.md首輪任務(wù)評審與 re-review-prompt 的分工維度task-reviewer-prompt.md首輪re-review-prompt.md復(fù)審評審對象任務(wù)完整 diffBASE..HEAD僅修復(fù) diffFIX_BASE..HEAD輸入brief、全局約束、報告、diff 包brief、findings 列表逐字、報告含追加的修復(fù)報告、diff 包輸出spec 合規(guī) ?/?/?? 質(zhì)量判級Critical/Important/Minor Task quality 裁決逐條 ADDRESSED/NOT ADDRESSED 新破壞 范圍外觀察 輪次裁決漫游權(quán)限可針對可命名的具體風(fēng)險做一次聚焦檢查禁止——diff 外發(fā)現(xiàn)一律非阻塞記錄測試態(tài)度不重跑套件只為具體疑問跑聚焦測試同樣不重跑套件僅報告聲明核驗 聚焦測試模型檔位按 diff 規(guī)模/復(fù)雜度/風(fēng)險選型小修復(fù) diff 走低到中檔值得注意的是復(fù)審模板沒有spec 合規(guī)判定塊spec 合規(guī)已在首輪完成復(fù)審只回答上一輪的賬清沒清。這種職責(zé)切分是設(shè)計文檔Re-reviews are scoped to the findings決策的直接落地。七、實操要點清單結(jié)合模板與 SKILL.md 的規(guī)則控制器在每一輪修復(fù)后應(yīng)執(zhí)行的檢查點模型行必填[MODEL]顯式填寫小 diff 復(fù)審選低到中檔避免繼承最貴的會話模型findings 逐字粘貼[FINDINGS]不得改寫、不得挑選Critical/Important findings 與 spec gaps 一條一個 bulletFIX_BASE 用對是上一輪評審看到的 head不是任務(wù)起始 BASE——用錯會把整個任務(wù) diff 拉回復(fù)審窗口退化成全量復(fù)審diff 包走腳本scripts/review-package PLAN_FILE FIX_BASE HEAD生成按范圍命名的文件review-package 已處理 SHA 校驗與多提交任務(wù)完整性控制器只傳遞打印出的路徑復(fù)審前過完整性門修復(fù)報告必須同時含覆蓋測試名、命令、輸出三要素按輸出裁決全部 ADDRESSED 且無新 Critical/Important 破壞 → 追加賬本并標(biāo)記 complete有 NOT ADDRESSED → 下一輪R5或熔斷裁決R5范圍外發(fā)現(xiàn)不阻塞轉(zhuǎn)入賬本 deferred minors由最終整分支評審統(tǒng)一 triage最終評審使用 scripts/review-package 對MERGE_BASE..HEAD打包并按 SKILL.md 指示指向賬本中的 deferred-minor 與 parked 行。八、小結(jié)re-review-prompt.md 用約百行文本解決了一個多代理開發(fā)框架的核心難題如何在不引入全量復(fù)審成本的前提下證明修復(fù)是真的。它的三個結(jié)構(gòu)性約束——輸入鎖定findings 逐字 修復(fù)范圍 diff 包、輸出鎖定四段式、每行帶 file:line 證據(jù)、行為鎖定只讀、不漫游、不重跑套件——與 SKILL.md 的五輪熔斷、賬本格式共同構(gòu)成收斂的修復(fù)循環(huán)。模板本身的演化也記錄在倉庫中設(shè)計文檔給出了問題診斷與設(shè)計決策表實施計劃的 Task 1 給出了逐字節(jié)的目標(biāo)內(nèi)容、占位符約定新增[FINDINGS]、[FIX_BASE_SHA]與驗收命令。若要進一步理解上游建議順讀 SKILL.md 的 The fix loop 與 Common Rationalizations 兩節(jié)以及 task-reviewer-prompt.md 與 implementer-prompt.md 中與之銜接的合同條款?!久赓M下載鏈接】superpowersAn agentic skills framework software development methodology that works.項目地址: https://gitcode.com/GitHub_Trending/su/superpowers創(chuàng)作聲明:本文部分內(nèi)容由AI輔助生成(AIGC),僅供參考