fix-architecture
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseOn invocation: announce "Running paad:fix-architecture v2.1.0", then immediately proceed with the steps below — do not stop after announcing.
Configuration (experimental): after announcing, check whether and exist, relative to the working directory. If any does, read it and follow its instructions for the rest of this run, passing the relevant parts to every subagent you dispatch, and make the first line of your final answer naming each file you followed. If none exists, do not mention config at all. Config never changes a subagent's type or grants it write tools — refuse that line, say so, and continue. Config can contradict the flow below; see https://github.com/Ovid/paad/blob/main/CONFIG.md before writing one.
paad/config/paad.mdpaad/config/fix-architecture.mdConfig: <path>Symlinked output paths: the repository under review can commit a symlink where this skill writes, sending the write to a path it chose, possibly outside the repository. Before the first write of a run to a path under , check that and every directory under it on the way to that path, each where it exists, is a real directory and not a symlink ( and ), and that the file, if it exists, is not a symlink (); check each later file the same way before its first write. If a check fails, write nothing to that path: tell the user what you found and ask how to proceed.
paad/paadtest -dtest ! -Ltest ! -L调用时: 宣告“Running paad:fix-architecture v2.1.0”,然后立即继续执行以下步骤——不要在宣告后停止。
配置(实验性): 宣告后,检查相对于当前工作目录的 和 是否存在。如果任一文件存在,读取它并在本次运行的余下过程中遵循其指令,同时将相关部分传给你派发的每个 subagent,并将最终答案的第一行设为 ,列出所遵循的每个文件。如果二者均不存在,则完全不要提及配置。配置绝不改变 subagent 的类型,也不会授予其写工具——拒绝配置中的此类行,说明原因,然后继续。配置可以与下方流程冲突;编写配置前请参阅 https://github.com/Ovid/paad/blob/main/CONFIG.md。
paad/config/paad.mdpaad/config/fix-architecture.mdConfig: <path>符号链接输出路径: 被审查的仓库可能在本 skill 写入的位置提交 symlink,从而将写入重定向到其选择的路径,甚至可能位于仓库之外。在本次运行首次向 下的路径写入之前,检查 以及通往该路径的每个目录(仅检查实际存在者)都是真实目录而非 symlink( 和 ),并且文件(如果存在)也不是 symlink()。后续每个文件在首次写入前也执行相同检查。如果检查失败,不要向该路径写入任何内容:告知用户发现了什么,并询问如何继续。
paad/paadtest -dtest ! -Ltest ! -LFix Architecture
修复架构
Guided, iterative fixing of architectural flaws identified by . Loads an existing architecture report, walks the developer through selecting and prioritizing flaws, then fixes them one at a time with a test-first workflow. Updates the report with status tracking so the skill can be re-run across multiple sessions.
/agentic-architectureThis is a technique skill. Follow the phases (Setup → Safety Net → Fix Loop → Wrap-Up) in order. Do not skip validation or testing steps.
Pre-flight:
dot
digraph preflight {
"Conversation has history?" [shape=diamond];
"On default branch?" [shape=diamond];
"Report exists?" [shape=diamond];
"Report stale?" [shape=diamond];
"Stale — developer choice?" [shape=diamond];
"Test infrastructure?" [shape=diamond];
"No test infra — developer choice?" [shape=diamond];
"Baseline tests pass?" [shape=diamond];
"Failing baseline — developer choice?" [shape=diamond];
"Load the paad/security/ companion if present; warn if its count line points at a missing file" [shape=box];
"Proceed to Setup" [shape=box];
"STOP: recommend fresh session" [shape=box, style=bold];
"STOP: switch to feature branch" [shape=box, style=bold];
"STOP: run agentic-architecture first" [shape=box, style=bold];
"STOP: re-run agentic-architecture for a fresh report" [shape=box, style=bold];
"STOP: developer declined" [shape=box, style=bold];
"STOP: set up a test framework first" [shape=box, style=bold];
"STOP: fix the failing tests first" [shape=box, style=bold];
"Conversation has history?" -> "STOP: recommend fresh session" [label="yes"];
"Conversation has history?" -> "On default branch?" [label="no"];
"On default branch?" -> "STOP: switch to feature branch" [label="yes"];
"On default branch?" -> "Report exists?" [label="no"];
"Report exists?" -> "STOP: run agentic-architecture first" [label="no"];
"Report exists?" -> "Load the paad/security/ companion if present; warn if its count line points at a missing file" [label="yes"];
"Load the paad/security/ companion if present; warn if its count line points at a missing file" -> "Report stale?";
"Report stale?" -> "Stale — developer choice?" [label="yes (>14 days old)"];
"Report stale?" -> "Test infrastructure?" [label="no"];
"Stale — developer choice?" -> "Test infrastructure?" [label="yes, proceed anyway"];
"Stale — developer choice?" -> "STOP: developer declined" [label="no"];
"Stale — developer choice?" -> "STOP: re-run agentic-architecture for a fresh report" [label="re-run first"];
"Test infrastructure?" -> "Baseline tests pass?" [label="yes"];
"Test infrastructure?" -> "No test infra — developer choice?" [label="no"];
"No test infra — developer choice?" -> "STOP: set up a test framework first" [label="set up framework"];
"No test infra — developer choice?" -> "Proceed to Setup" [label="proceed without tests (high risk)"];
"No test infra — developer choice?" -> "STOP: developer declined" [label="stop"];
"Baseline tests pass?" -> "Proceed to Setup" [label="all pass"];
"Baseline tests pass?" -> "Failing baseline — developer choice?" [label="some failing"];
"Failing baseline — developer choice?" -> "Proceed to Setup" [label="proceed anyway (record failing tests)"];
"Failing baseline — developer choice?" -> "STOP: fix the failing tests first" [label="fix first"];
}Session flow — Setup → Safety Net → Fix Loop → Wrap-Up. The Safety Net gate is non-negotiable: no fix may begin until every safety-net test for the whole batch is written and committed.
dot
digraph fix_session {
"Invocation pre-answers or refuses the questions?" [shape=diamond];
"Present plan in ONE message, assumptions stated" [shape=box];
"Solo or team?" [shape=diamond];
"Any unfixed flaws remain?" [shape=diamond];
"Developer approves plan?" [shape=diamond];
"Flaw still exists?" [shape=diamond];
"Test coverage?" [shape=diamond];
"More batch flaws to validate?" [shape=diamond];
"ALL safety-net tests written and committed?" [shape=diamond];
"Tests pass after fix?" [shape=diamond];
"Which tests broke?" [shape=diamond];
"Auto-commit mode?" [shape=diamond];
"Fix resolved other flaws?" [shape=diamond];
"Context running low?" [shape=diamond];
"Flaws left in batch?" [shape=diamond];
"Recommend 3-5 fixes, conflicts unlikely" [shape=box];
"Recommend 1-2 fixes, warn about conflict risk" [shape=box];
"Ask commit preference (auto / manual)" [shape=box];
"Dependency scan + complexity assessment" [shape=box];
"STOP: congratulate, suggest re-running agentic-architecture" [shape=box, style=bold];
"Present triage table, developer selects flaws" [shape=box];
"Revise plan with developer" [shape=box];
"Ask developer: does it still need work?" [shape=box];
"Show developer the evidence; developer agrees?" [shape=diamond];
"Mark Fixed (pre-existing) / Won't fix, skip flaw" [shape=box];
"Write safety-net tests for the gap" [shape=box];
"Developer picks approach: refactor first / e2e tests / no tests / skip flaw" [shape=box];
"Write and commit the outstanding safety-net tests" [shape=box, style=bold];
"Print Safety Net Report; every field filled; push warning first if a security flaw" [shape=box, style=bold];
"Revert the fix; record status Attempted, reverted" [shape=box];
"Propose fix options, developer chooses" [shape=box];
"Execute red/green/refactor" [shape=box];
"Pre-existing failure — not caused by this fix" [shape=box];
"Propose updating structure-dependent unit tests" [shape=box];
"RED FLAG: discuss fix-forward vs revert" [shape=box];
"Sanity check: did the fix introduce new architectural issues?" [shape=box];
"Output paths under paad/ free of symlinks?" [shape=diamond];
"Write nothing to that path; tell the user, ask how to proceed" [shape=box];
"Update report status fields" [shape=box];
"Commit fix + tests + report update" [shape=box];
"Leave changes staged, tell developer what changed" [shape=box];
"Validate and update the affected flaws" [shape=box];
"STOP: finish current fix, resume in a fresh session" [shape=box, style=bold];
"Wrap-Up: push warning first if a security flaw is still unfixed; summary + suggest re-running fix-architecture" [shape=box];
"Invocation pre-answers or refuses the questions?" -> "Solo or team?" [label="no — full setup conversation"];
"Invocation pre-answers or refuses the questions?" -> "Dependency scan + complexity assessment" [label="yes — skip only the answered questions, never the scan or Step 4"];
"Solo or team?" -> "Recommend 3-5 fixes, conflicts unlikely" [label="solo"];
"Solo or team?" -> "Recommend 1-2 fixes, warn about conflict risk" [label="team"];
"Recommend 3-5 fixes, conflicts unlikely" -> "Ask commit preference (auto / manual)";
"Recommend 1-2 fixes, warn about conflict risk" -> "Ask commit preference (auto / manual)";
"Ask commit preference (auto / manual)" -> "Dependency scan + complexity assessment";
"Dependency scan + complexity assessment" -> "Any unfixed flaws remain?";
"Any unfixed flaws remain?" -> "STOP: congratulate, suggest re-running agentic-architecture" [label="no"];
"Any unfixed flaws remain?" -> "Present triage table, developer selects flaws" [label="yes — full setup conversation"];
"Any unfixed flaws remain?" -> "Present plan in ONE message, assumptions stated" [label="yes — questions were pre-answered"];
"Present plan in ONE message, assumptions stated" -> "Developer approves plan?";
"Present triage table, developer selects flaws" -> "Developer approves plan?";
"Developer approves plan?" -> "Revise plan with developer" [label="no"];
"Revise plan with developer" -> "Developer approves plan?";
"Developer approves plan?" -> "Flaw still exists?" [label="yes — Safety Net begins"];
"Flaw still exists?" -> "Test coverage?" [label="yes, as described"];
"Flaw still exists?" -> "Ask developer: does it still need work?" [label="partially addressed"];
"Flaw still exists?" -> "Show developer the evidence; developer agrees?" [label="no longer exists / false positive"];
"Show developer the evidence; developer agrees?" -> "Mark Fixed (pre-existing) / Won't fix, skip flaw" [label="yes"];
"Show developer the evidence; developer agrees?" -> "Test coverage?" [label="no — flaw stands, treat as still exists"];
"Ask developer: does it still need work?" -> "Test coverage?" [label="yes"];
"Ask developer: does it still need work?" -> "Mark Fixed (pre-existing) / Won't fix, skip flaw" [label="no"];
"Mark Fixed (pre-existing) / Won't fix, skip flaw" -> "More batch flaws to validate?";
"Test coverage?" -> "More batch flaws to validate?" [label="good — no gaps in affected paths"];
"Test coverage?" -> "Write safety-net tests for the gap" [label="gaps found / testable but untested"];
"Test coverage?" -> "Developer picks approach: refactor first / e2e tests / no tests / skip flaw" [label="not unit-testable without refactoring"];
"Write safety-net tests for the gap" -> "More batch flaws to validate?";
"Developer picks approach: refactor first / e2e tests / no tests / skip flaw" -> "More batch flaws to validate?";
"More batch flaws to validate?" -> "Flaw still exists?" [label="yes"];
"More batch flaws to validate?" -> "ALL safety-net tests written and committed?" [label="no"];
"ALL safety-net tests written and committed?" -> "Write and commit the outstanding safety-net tests" [label="no — no fix may start yet"];
"Write and commit the outstanding safety-net tests" -> "ALL safety-net tests written and committed?";
"ALL safety-net tests written and committed?" -> "Print Safety Net Report; every field filled; push warning first if a security flaw" [label="yes, or the developer chose to proceed without tests"];
"Print Safety Net Report; every field filled; push warning first if a security flaw" -> "Propose fix options, developer chooses" [label="Fix Loop begins"];
"Propose fix options, developer chooses" -> "Execute red/green/refactor";
"Execute red/green/refactor" -> "Tests pass after fix?";
"Tests pass after fix?" -> "Sanity check: did the fix introduce new architectural issues?" [label="yes"];
"Tests pass after fix?" -> "Which tests broke?" [label="no"];
"Which tests broke?" -> "Pre-existing failure — not caused by this fix" [label="already failing at pre-flight baseline"];
"Which tests broke?" -> "Propose updating structure-dependent unit tests" [label="internal unit tests (expected in refactoring)"];
"Which tests broke?" -> "RED FLAG: discuss fix-forward vs revert" [label="external / integration tests"];
"Pre-existing failure — not caused by this fix" -> "Sanity check: did the fix introduce new architectural issues?";
"Propose updating structure-dependent unit tests" -> "Execute red/green/refactor" [label="developer approves"];
"Propose updating structure-dependent unit tests" -> "RED FLAG: discuss fix-forward vs revert" [label="safety-net test still fails after call sites updated — assertions may not be changed"];
"RED FLAG: discuss fix-forward vs revert" -> "Execute red/green/refactor" [label="fix forward"];
"RED FLAG: discuss fix-forward vs revert" -> "Revert the fix; record status Attempted, reverted" [label="revert — nothing to commit as a fix"];
"Revert the fix; record status Attempted, reverted" -> "Fix resolved other flaws?";
"Sanity check: did the fix introduce new architectural issues?" -> "Output paths under paad/ free of symlinks?" [label="flag any to developer"];
"Update report status fields" -> "Auto-commit mode?";
"Auto-commit mode?" -> "Commit fix + tests + report update" [label="yes"];
"Auto-commit mode?" -> "Leave changes staged, tell developer what changed" [label="no"];
"Commit fix + tests + report update" -> "Fix resolved other flaws?";
"Leave changes staged, tell developer what changed" -> "Fix resolved other flaws?";
"Fix resolved other flaws?" -> "Validate and update the affected flaws" [label="yes (check whole report, not just batch)"];
"Fix resolved other flaws?" -> "Context running low?" [label="no"];
"Validate and update the affected flaws" -> "Context running low?";
"Context running low?" -> "STOP: finish current fix, resume in a fresh session" [label="yes"];
"Context running low?" -> "Flaws left in batch?" [label="no"];
"Flaws left in batch?" -> "Propose fix options, developer chooses" [label="yes, developer continues"];
"Flaws left in batch?" -> "Wrap-Up: push warning first if a security flaw is still unfixed; summary + suggest re-running fix-architecture" [label="no / developer stops here"];
"STOP: finish current fix, resume in a fresh session" -> "Wrap-Up: push warning first if a security flaw is still unfixed; summary + suggest re-running fix-architecture";
"Output paths under paad/ free of symlinks?" -> "Update report status fields" [label="yes"];
"Output paths under paad/ free of symlinks?" -> "Write nothing to that path; tell the user, ask how to proceed" [label="no"];
"Write nothing to that path; tell the user, ask how to proceed" -> "Update report status fields" [label="user names a safe path"];
}对 识别出的架构缺陷进行引导式、迭代式修复。加载现有架构报告,引导开发者选择缺陷并确定优先级,然后采用测试先行的工作流逐个修复。通过更新报告中的状态进行跟踪,使该 skill 可以跨多个会话重新运行。
/agentic-architecture这是一个 technique skill。 严格按顺序遵循各阶段(Setup → Safety Net → Fix Loop → Wrap-Up)。不得跳过验证或测试步骤。
Pre-flight:
dot
digraph preflight {
"Conversation has history?" [shape=diamond];
"On default branch?" [shape=diamond];
"Report exists?" [shape=diamond];
"Report stale?" [shape=diamond];
"Stale — developer choice?" [shape=diamond];
"Test infrastructure?" [shape=diamond];
"No test infra — developer choice?" [shape=diamond];
"Baseline tests pass?" [shape=diamond];
"Failing baseline — developer choice?" [shape=diamond];
"Load the paad/security/ companion if present; warn if its count line points at a missing file" [shape=box];
"Proceed to Setup" [shape=box];
"STOP: recommend fresh session" [shape=box, style=bold];
"STOP: switch to feature branch" [shape=box, style=bold];
"STOP: run agentic-architecture first" [shape=box, style=bold];
"STOP: re-run agentic-architecture for a fresh report" [shape=box, style=bold];
"STOP: developer declined" [shape=box, style=bold];
"STOP: set up a test framework first" [shape=box, style=bold];
"STOP: fix the failing tests first" [shape=box, style=bold];
"Conversation has history?" -> "STOP: recommend fresh session" [label="yes"];
"Conversation has history?" -> "On default branch?" [label="no"];
"On default branch?" -> "STOP: switch to feature branch" [label="yes"];
"On default branch?" -> "Report exists?" [label="no"];
"Report exists?" -> "STOP: run agentic-architecture first" [label="no"];
"Report exists?" -> "Load the paad/security/ companion if present; warn if its count line points at a missing file" [label="yes"];
"Load the paad/security/ companion if present; warn if its count line points at a missing file" -> "Report stale?";
"Report stale?" -> "Stale — developer choice?" [label="yes (>14 days old)"];
"Report stale?" -> "Test infrastructure?" [label="no"];
"Stale — developer choice?" -> "Test infrastructure?" [label="yes, proceed anyway"];
"Stale — developer choice?" -> "STOP: developer declined" [label="no"];
"Stale — developer choice?" -> "STOP: re-run agentic-architecture for a fresh report" [label="re-run first"];
"Test infrastructure?" -> "Baseline tests pass?" [label="yes"];
"Test infrastructure?" -> "No test infra — developer choice?" [label="no"];
"No test infra — developer choice?" -> "STOP: set up a test framework first" [label="set up framework"];
"No test infra — developer choice?" -> "Proceed to Setup" [label="proceed without tests (high risk)"];
"No test infra — developer choice?" -> "STOP: developer declined" [label="stop"];
"Baseline tests pass?" -> "Proceed to Setup" [label="all pass"];
"Baseline tests pass?" -> "Failing baseline — developer choice?" [label="some failing"];
"Failing baseline — developer choice?" -> "Proceed to Setup" [label="proceed anyway (record failing tests)"];
"Failing baseline — developer choice?" -> "STOP: fix the failing tests first" [label="fix first"];
}会话流程 — Setup → Safety Net → Fix Loop → Wrap-Up。Safety Net 门禁不可协商:在整个批次的每一项 safety-net 测试都编写并提交完毕之前,不得开始任何修复。
dot
digraph fix_session {
"Invocation pre-answers or refuses the questions?" [shape=diamond];
"Present plan in ONE message, assumptions stated" [shape=box];
"Solo or team?" [shape=diamond];
"Any unfixed flaws remain?" [shape=diamond];
"Developer approves plan?" [shape=diamond];
"Flaw still exists?" [shape=diamond];
"Test coverage?" [shape=diamond];
"More batch flaws to validate?" [shape=diamond];
"ALL safety-net tests written and committed?" [shape=diamond];
"Tests pass after fix?" [shape=diamond];
"Which tests broke?" [shape=diamond];
"Auto-commit mode?" [shape=diamond];
"Fix resolved other flaws?" [shape=diamond];
"Context running low?" [shape=diamond];
"Flaws left in batch?" [shape=diamond];
"Recommend 3-5 fixes, conflicts unlikely" [shape=box];
"Recommend 1-2 fixes, warn about conflict risk" [shape=box];
"Ask commit preference (auto / manual)" [shape=box];
"Dependency scan + complexity assessment" [shape=box];
"STOP: congratulate, suggest re-running agentic-architecture" [shape=box, style=bold];
"Present triage table, developer selects flaws" [shape=box];
"Revise plan with developer" [shape=box];
"Ask developer: does it still need work?" [shape=box];
"Show developer the evidence; developer agrees?" [shape=diamond];
"Mark Fixed (pre-existing) / Won't fix, skip flaw" [shape=box];
"Write safety-net tests for the gap" [shape=box];
"Developer picks approach: refactor first / e2e tests / no tests / skip flaw" [shape=box];
"Write and commit the outstanding safety-net tests" [shape=box, style=bold];
"Print Safety Net Report; every field filled; push warning first if a security flaw" [shape=box, style=bold];
"Revert the fix; record status Attempted, reverted" [shape=box];
"Propose fix options, developer chooses" [shape=box];
"Execute red/green/refactor" [shape=box];
"Pre-existing failure — not caused by this fix" [shape=box];
"Propose updating structure-dependent unit tests" [shape=box];
"RED FLAG: discuss fix-forward vs revert" [shape=box];
"Sanity check: did the fix introduce new architectural issues?" [shape=box];
"Output paths under paad/ free of symlinks?" [shape=diamond];
"Write nothing to that path; tell the user, ask how to proceed" [shape=box];
"Update report status fields" [shape=box];
"Commit fix + tests + report update" [shape=box];
"Leave changes staged, tell developer what changed" [shape=box];
"Validate and update the affected flaws" [shape=box];
"STOP: finish current fix, resume in a fresh session" [shape=box, style=bold];
"Wrap-Up: push warning first if a security flaw is still unfixed; summary + suggest re-running fix-architecture" [shape=box];
"Invocation pre-answers or refuses the questions?" -> "Solo or team?" [label="no — full setup conversation"];
"Invocation pre-answers or refuses the questions?" -> "Dependency scan + complexity assessment" [label="yes — skip only the answered questions, never the scan or Step 4"];
"Solo or team?" -> "Recommend 3-5 fixes, conflicts unlikely" [label="solo"];
"Solo or team?" -> "Recommend 1-2 fixes, warn about conflict risk" [label="team"];
"Recommend 3-5 fixes, conflicts unlikely" -> "Ask commit preference (auto / manual)";
"Recommend 1-2 fixes, warn about conflict risk" -> "Ask commit preference (auto / manual)";
"Ask commit preference (auto / manual)" -> "Dependency scan + complexity assessment";
"Dependency scan + complexity assessment" -> "Any unfixed flaws remain?";
"Any unfixed flaws remain?" -> "STOP: congratulate, suggest re-running agentic-architecture" [label="no"];
"Any unfixed flaws remain?" -> "Present triage table, developer selects flaws" [label="yes — full setup conversation"];
"Any unfixed flaws remain?" -> "Present plan in ONE message, assumptions stated" [label="yes — questions were pre-answered"];
"Present plan in ONE message, assumptions stated" -> "Developer approves plan?";
"Present triage table, developer selects flaws" -> "Developer approves plan?";
"Developer approves plan?" -> "Revise plan with developer" [label="no"];
"Revise plan with developer" -> "Developer approves plan?";
"Developer approves plan?" -> "Flaw still exists?" [label="yes"];
"Flaw still exists?" -> "Test coverage?" [label="yes, as described"];
"Flaw still exists?" -> "Ask developer: does it still need work?" [label="partially addressed"];
"Flaw still exists?" -> "Show developer the evidence; developer agrees?" [label="no longer exists / false positive"];
"Show developer the evidence; developer agrees?" -> "Mark Fixed (pre-existing) / Won't fix, skip flaw" [label="yes"];
"Show developer the evidence; developer agrees?" -> "Test coverage?" [label="no — flaw stands, treat as still exists"];
"Ask developer: does it still need work?" -> "Test coverage?" [label="yes"];
"Ask developer: does it still need work?" -> "Mark Fixed (pre-existing) / Won't fix, skip flaw" [label="no"];
"Mark Fixed (pre-existing) / Won't fix, skip flaw" -> "More batch flaws to validate?";
"Test coverage?" -> "More batch flaws to validate?" [label="good — no gaps in affected paths"];
"Test coverage?" -> "Write safety-net tests for the gap" [label="gaps found / testable but untested"];
"Test coverage?" -> "Developer picks approach: refactor first / e2e tests / no tests / skip flaw" [label="not unit-testable without refactoring"];
"Write safety-net tests for the gap" -> "More batch flaws to validate?";
"Developer picks approach: refactor first / e2e tests / no tests / skip flaw" -> "More batch flaws to validate?";
"More batch flaws to validate?" -> "Flaw still exists?" [label="yes"];
"More batch flaws to validate?" -> "ALL safety-net tests written and committed?" [label="no"];
"ALL safety-net tests written and committed?" -> "Write and commit the outstanding safety-net tests" [label="no — no fix may start yet"];
"Write and commit the outstanding safety-net tests" -> "ALL safety-net tests written and committed?";
"ALL safety-net tests written and committed?" -> "Print Safety Net Report; every field filled; push warning first if a security flaw" [label="yes, or the developer chose to proceed without tests"];
"Print Safety Net Report; every field filled; push warning first if a security flaw" -> "Propose fix options, developer chooses";
"Propose fix options, developer chooses" -> "Execute red/green/refactor";
"Execute red/green/refactor" -> "Tests pass after fix?";
"Tests pass after fix?" -> "Sanity check: did the fix introduce new architectural issues?" [label="yes"];
"Tests pass after fix?" -> "Which tests broke?" [label="no"];
"Which tests broke?" -> "Pre-existing failure — not caused by this fix" [label="already failing at pre-flight baseline"];
"Which tests broke?" -> "Propose updating structure-dependent unit tests" [label="internal unit tests (expected in refactoring)"];
"Which tests broke?" -> "RED FLAG: discuss fix-forward vs revert" [label="external / integration tests"];
"Pre-existing failure — not caused by this fix" -> "Sanity check: did the fix introduce new architectural issues?";
"Propose updating structure-dependent unit tests" -> "Execute red/green/refactor" [label="developer approves"];
"Propose updating structure-dependent unit tests" -> "RED FLAG: discuss fix-forward vs revert" [label="safety-net test still fails after call sites updated — assertions may not be changed"];
"RED FLAG: discuss fix-forward vs revert" -> "Execute red/green/refactor" [label="fix forward"];
"RED FLAG: discuss fix-forward vs revert" -> "Revert the fix; record status Attempted, reverted" [label="revert — nothing to commit as a fix"];
"Revert the fix; record status Attempted, reverted" -> "Fix resolved other flaws?";
"Sanity check: did the fix introduce new architectural issues?" -> "Output paths under paad/ free of symlinks?" [label="flag any to developer"];
"Update report status fields" -> "Auto-commit mode?";
"Auto-commit mode?" -> "Commit fix + tests + report update" [label="yes"];
"Auto-commit mode?" -> "Leave changes staged, tell developer what changed" [label="no"];
"Commit fix + tests + report update" -> "Fix resolved other flaws?";
"Leave changes staged, tell developer what changed" -> "Fix resolved other flaws?";
"Fix resolved other flaws?" -> "Validate and update the affected flaws" [label="yes (check whole report, not just batch)"];
"Fix resolved other flaws?" -> "Context running low?" [label="no"];
"Validate and update the affected flaws" -> "Context running low?";
"Context running low?" -> "STOP: finish current fix, resume in a fresh session" [label="yes"];
"Context running low?" -> "Flaws left in batch?" [label="no"];
"Flaws left in batch?" -> "Propose fix options, developer chooses" [label="yes, developer continues"];
"Flaws left in batch?" -> "Wrap-Up: push warning first if a security flaw is still unfixed; summary + suggest re-running fix-architecture" [label="no / developer stops here"];
"STOP: finish current fix, resume in a fresh session" -> "Wrap-Up: push warning first if a security flaw is still unfixed; summary + suggest re-running fix-architecture";
"Output paths under paad/ free of symlinks?" -> "Update report status fields" [label="yes"];
"Output paths under paad/ free of symlinks?" -> "Write nothing to that path; tell the user, ask how to proceed" [label="no"];
"Write nothing to that path; tell the user, ask how to proceed" -> "Update report status fields" [label="user names a safe path"];
}Arguments
参数
/fix-architecture$ARGUMENTS- — finds the most recent report in
/fix-architectureby date prefixpaad/architecture-reviews/ - — uses a specific report
/fix-architecture path/to/report.md
/fix-architecture$ARGUMENTS- — 按日期前缀查找
/fix-architecture中最近的报告paad/architecture-reviews/ - — 使用指定报告
/fix-architecture path/to/report.md
Pre-flight Checks
Pre-flight 检查
-
Context window: If conversation has substantive history beyond invoking this skill, tell the user: "This skill consumes significant context. Start a fresh session withto avoid context rot." Stop and wait.
/fix-architecture -
Branch protection: Refuse to operate on the default branch (main/master/trunk). Detect via(local, instant), falling back to branch name matching (
git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null/main/master), and only falling back totrunkas a last resort if neither works. If on the default branch: "Architecture fixes must be done on a feature branch. Create one and re-run this skill." Stop and wait.git remote show origin -
Report exists: Locate the report fromor find the most recent file in
$ARGUMENTSby date prefix. Ifpaad/architecture-reviews/names a file under$ARGUMENTS, locate the main report with the same date and repo name instead. If none found: "No architecture report found. Runpaad/security/first to generate one." Stop and wait./agentic-architectureSecurity flaws:writes flaws that would help an attacker to/agentic-architecture, with the main report's date and repo name, and leaves only a count line in the main report. If that file exists, load its flaws too; they are part of this session like any other, marked as security flaws. Both files number frompaad/security/agentic-architecture-<YYYY-MM-DD>-<git-repo-name>.md, so refer to a security flaw asF-01everywhere in this session — triage table, plan, status updates — and never by its bare F-ID. If the main report has aS:F-<n>count line and the file is gone, tell the developer: "N security flaw(s) from this report are no longer on this machine —security finding(s) written to paad/security/is local scratch. Re-runpaad/security/to recover them." Then continue with the rest. Never/agentic-architectureanything undergit add -f.paad/security/ -
Report staleness: Parse the date from the report. If the report is >14 days old, warn: "This report was generated N days ago. Some findings may be outdated. I'll validate each flaw before fixing, but consider re-runningfor a fresh baseline." Ask explicitly: "Proceed anyway? (yes / no / re-run
/agentic-architecturefirst)". Do not use commit count as a staleness signal — architectural flaws persist across many commits, and high commit velocity (especially from fix sessions on the same report) does not indicate staleness./agentic-architecture -
Test infrastructure: Check whether the project has a test framework, runner, and conventions (e.g., aor
test/directory, a test script in__tests__/, pytest config, etc.). If no test infrastructure exists: "This project has no test infrastructure. Fixes without tests are high-risk. Want to set up a test framework first, proceed without tests, or stop?" Wait for the developer's decision.package.json -
Baseline test run: Run the complete test suite to establish a green baseline — not a subset, not only the modules named in the report, and not a CI result from an earlier commit. Record the exact command, the pass/fail/skip counts, and the verbatim names of every failing test. If tests are already failing: "N tests are currently failing before any changes. This means I can't reliably attribute test failures to my fixes. Proceed anyway, or fix the failing tests first?" If the suite cannot run to completion (missing services, unavailable fixtures), say so and treat the unrunnable portion as unknown, never as passing.A test that fails after a fix and does not appear by name in the recorded baseline failure list must be treated as caused by the fix. Absence of evidence is not a pre-existing failure.
-
上下文窗口: 如果除调用此 skill 外,对话中还有实质性历史,则告知用户:“此 skill 会消耗大量上下文。请使用启动一个新会话,以避免 context rot。”然后停止并等待。
/fix-architecture -
分支保护: 拒绝在默认分支(main/master/trunk)上操作。优先通过检测(本地即可立即完成),其次匹配分支名(
git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null/main/master),仅在前两种方式均无效时才最后使用trunk。如果当前位于默认分支,则提示:“架构修复必须在 feature branch 上完成。请创建一个分支,然后重新运行此 skill。”然后停止并等待。git remote show origin -
报告存在: 根据定位报告,或按日期前缀查找
$ARGUMENTS中最新的文件。如果paad/architecture-reviews/指向$ARGUMENTS下的文件,则改为定位日期和 repo name 相同的主报告。如果未找到,则提示:“未找到架构报告。请先运行paad/security/生成一份。”然后停止并等待。/agentic-architecture安全缺陷:会将可能帮助攻击者发起攻击的缺陷写入/agentic-architecture,文件名采用主报告相同的日期和 repo name,并且只在主报告中保留一行计数。如果该文件存在,也加载其中的缺陷;它们与本次会话中的其他缺陷一样参与处理,并标记为安全缺陷。两份文件均从paad/security/agentic-architecture-<YYYY-MM-DD>-<git-repo-name>.md开始编号,因此在整个会话中——包括 triage 表、计划和状态更新——始终使用F-01引用安全缺陷,绝不能只使用其原始 F-ID。如果主报告包含S:F-<n>计数行,但对应文件已不存在,则告知开发者:“此报告中的 N 个安全缺陷已不在当前机器上——security finding(s) written to paad/security/是本地临时目录。请重新运行paad/security/以恢复它们。”然后继续处理其余缺陷。绝不要对/agentic-architecture下的任何内容执行paad/security/。git add -f -
报告陈旧程度: 从报告中解析日期。如果报告已有超过 14 天,则警告:“此报告生成于 N 天前,部分发现可能已经过时。我会在修复前逐项验证,但仍建议重新运行以获得新的基线。”并明确询问:“是否继续?(yes / no / 先重新运行
/agentic-architecture)”。不要将 commit 数量用作陈旧程度的信号——架构缺陷会跨越许多 commit 持续存在,而较高的提交频率(尤其是针对同一报告的修复会话)并不表示报告已经陈旧。/agentic-architecture -
测试基础设施: 检查项目是否具有 test framework、test runner 和相关约定(例如或
test/目录、__tests__/中的 test script、pytest 配置等)。如果不存在测试基础设施,则提示:“此项目没有测试基础设施。没有测试的修复风险很高。是否先建立 test framework、在没有测试的情况下继续,还是停止?”等待开发者的决定。package.json -
基线测试运行: 运行完整测试套件以建立绿色基线——不能只运行子集,不能只运行报告中提到的模块,也不能使用较早 commit 的 CI 结果。记录准确命令、通过/失败/跳过数量,以及每个失败测试的逐字名称。如果测试已经失败,则提示:“当前有 N 个测试在任何更改之前就失败了。这意味着我无法可靠地将测试失败归因于我的修复。是否继续,还是先修复失败的测试?”如果套件无法完整运行(缺少服务、fixtures 不可用),应明确说明,并将无法运行的部分视为未知,绝不能视为通过。修复后失败、且未按名称出现在已记录基线失败列表中的测试,必须视为由本次修复导致。 不能以“没有证据表明它预先失败”为由将其归类为既有失败。
Setup: Developer Conversation
Setup:开发者对话
A setup conversation before any code is touched. One question per message. Ask, wait for the answer, then ask the next. Do not combine multiple questions into one message — it is frustrating and overwhelming.
在触碰任何代码之前进行 setup 对话。每条消息只问一个问题。提问后等待回答,再问下一个。 不要在一条消息中合并多个问题——这会让人感到烦躁和不堪重负。
When the developer pre-answers or refuses the questions
当开发者预先回答或拒绝回答问题时
An invocation like answers some of the steps below and declines the rest. Honour that, within limits.
/fix-architecture report.md — fix F-02 and F-11, don't ask me a bunch of questions, just goYou may skip any question the developer has already answered. Re-asking it is the same friction the one-question-per-message rule exists to prevent.
You may not skip Step 3's dependency scan and complexity assessment, or Step 4. Those are not questions — they are work that produces information the developer does not have: naming two flaws is not the same as knowing that fixing one resolves the other.
So: run the scan, then present the plan in one message with every assumption stated explicitly — "assuming solo and auto-commit; F-02 before F-11, because fixing F-02 likely resolves F-11" — and wait for a single confirmation. One message, one answer. That is the floor, not zero.
Silence is not a go-ahead, and being told to skip the questions is not approval of a plan the developer has not seen. If they reply "yes, go" to that one message, you have your approval and Setup is complete.
类似 的调用已经回答了以下部分步骤,并拒绝了其余步骤。应在限制范围内照此执行。
/fix-architecture report.md — fix F-02 and F-11, don't ask me a bunch of questions, just go可以跳过开发者已经回答的任何问题。重新询问只会制造摩擦,而这正是“每条消息只问一个问题”规则要防止的情况。
不能跳过 Step 3 的依赖扫描和复杂度评估,也不能跳过 Step 4。它们不是问题,而是需要执行并产出开发者尚不知悉的信息的工作:指出两个缺陷,并不等于知道修复其中一个是否会解决另一个。
因此:先执行扫描,然后在一则消息中呈现计划,明确列出每项假设——例如“假设独立开发并自动提交;先处理 F-02,再处理 F-11,因为修复 F-02 很可能解决 F-11”——并等待一次确认。一条消息,一个回答。这是一条消息、一个回答的最低要求,而不是可以完全省略。
沉默不表示同意,而“跳过问题”也不表示批准开发者尚未看到的计划。 如果开发者回复“yes, go”,即表示已批准计划,Setup 完成。
Step 1: Team Context
Step 1:团队上下文
"Are you working solo or on a team? This affects how many fixes I'll recommend per session."
- Solo → recommend larger batches (3-5 fixes), note that conflicts are unlikely
- Team → recommend 1-2 fixes per session, warn about conflict risk with other developers' work
“你是独立开发,还是与团队一起开发?这会影响我建议每次会话修复多少缺陷。”
- 独立开发 → 建议较大的批次(3-5 个修复),并说明发生冲突的可能性较低
- 团队协作 → 建议每次会话处理 1-2 个修复,并警告与其他开发者的工作发生冲突的风险
Step 2: Commit Preference
Step 2:提交偏好
"When I complete a fix, should I commit automatically, or would you prefer to review and commit yourself?"
Two modes:
- Auto-commit — skill commits after each successful fix (one commit per fix, including tests and report update)
- Manual commit — skill leaves changes staged, tells the developer what was changed
Both modes govern fix commits only. The Safety Net phase always commits its tests, in either mode — that commit is what lets a fix be reverted without taking the tests with it. Say so when the developer picks manual: "I'll leave fixes staged for you. The safety-net tests still get their own commit up front, so reverting a fix can't destroy them."
“完成修复后,你希望我自动提交,还是由你审阅并自行提交?”
两种模式:
- Auto-commit — skill 在每次成功修复后提交(每次修复一个 commit,包括测试和报告更新)
- Manual commit — skill 将更改暂存,并告知开发者具体变更
两种模式仅约束修复 commit。无论选择哪种模式,Safety Net 阶段始终会提交其测试——正是这个 commit 确保回退修复时不会一并移除测试。开发者选择 manual 时说明:“我会将修复内容暂存,供你审阅和提交。Safety Net 测试仍会提前单独提交,因此回退修复时不会破坏这些测试。”
Step 3: Flaw Triage
Step 3:缺陷分诊
Present flaws from the report, excluding any already marked as Fixed or Won't Fix. Before presenting, do two things:
Dependency scan — cross-reference flaws to find relationships:
- File paths — flaws in the same file(s) are likely related
- Categories — e.g., god object (F-02) + low cohesion (F-11) on the same class
- Present related flaws as groups: "F-02 and F-11 both affect — fixing F-02 first will likely resolve F-11"
UserService.ts
Complexity assessment — for each flaw, do a lightweight scan of the affected code to estimate fix complexity (Low / Medium / High):
- Low complexity: localized change (1-2 files), few references, no cross-cutting concerns
- Medium complexity: multiple files, moderate references, or requires coordination across a few modules
- High complexity: cross-cutting change, many references, touches core abstractions, or requires significant refactoring
Present flaws in a table showing both Impact (from the report) and Complexity (from your scan). Only include complexity categories that have flaws in them — skip empty categories.
Then ask (adapting the options to reflect the actual impact and complexity of the remaining flaws — do NOT label flaws as "high impact" if they are Medium or Low in the report):
"What would you like to focus on?
- Highest-impact flaws first (<list F-IDs with their actual impact levels>)
- Lowest-complexity flaws first (<list F-IDs you assessed as low complexity>)
- Specific flaws (pick by F-ID)
- Something else"
Do not describe fix approaches or verification steps in the triage — that's the Fix Loop. The triage assesses scope (how many files, how localized) and complexity to help the developer choose, not how the fix will work.
Based on the developer's answer and team context, recommend a batch size and let them select specific flaws.
If no unfixed flaws remain (all are marked Fixed or Won't Fix), congratulate the developer and suggest re-running for a fresh analysis to find any new issues. Stop.
/agentic-architecture呈现报告中的缺陷,排除已标记为 Fixed 或 Won't fix 的缺陷。呈现之前需要完成两项工作:
依赖扫描 — 交叉引用缺陷以找出关联:
- 文件路径 — 位于相同文件中的缺陷很可能相互关联
- 类别 — 例如,同一个类中的 god object(F-02)和 low cohesion(F-11)
- 将相关缺陷分组呈现:“F-02 和 F-11 都影响 ——先修复 F-02 很可能也会解决 F-11”
UserService.ts
复杂度评估 — 对每个缺陷进行轻量级扫描,估算修复复杂度(Low / Medium / High):
- Low complexity: 局部更改(1-2 个文件)、引用较少、无跨领域影响
- Medium complexity: 涉及多个文件、较多引用,或需要协调少数几个模块
- High complexity: 跨领域更改、引用众多、触及核心抽象,或需要进行大规模重构
以表格呈现缺陷,同时显示报告中的 Impact 和扫描得出的 Complexity。只列出实际包含缺陷的复杂度类别——跳过空类别。
然后询问,并根据剩余缺陷的实际影响和复杂度调整选项——如果报告中的影响等级是 Medium 或 Low,绝不能将其描述为“high impact”:
“你希望重点处理什么?
- 优先处理影响最大的缺陷(<列出具有实际影响等级的 F-ID>)
- 优先处理复杂度最低的缺陷(<列出评估为 low complexity 的 F-ID>)
- 指定缺陷(按 F-ID 选择)
- 其他”
不要在分诊阶段描述修复方案或验证步骤——这些属于 Fix Loop。 分诊用于评估范围(涉及多少文件、局部程度)和复杂度,以帮助开发者选择,而不是解释具体如何修复。
根据开发者的回答和团队上下文,建议批次大小,并让开发者选择具体缺陷。
如果不存在未修复的缺陷(全部标记为 Fixed 或 Won't fix),则恭喜开发者,并建议重新运行 进行全新分析,以查找新问题。然后停止。
/agentic-architectureStep 4: Plan Confirmation
Step 4:计划确认
Summarize the full plan:
- Selected flaws in fix order (ordered by: dependencies first — flaws that unblock others; then by impact — High before Medium before Low; then by complexity — simpler first within the same impact level. The developer can override this order.)
- Known dependencies between them
- Testing note: "I'll validate all flaws and write ALL safety-net tests in the Safety Net phase before any code is changed. No exceptions — one refactor can break code another flaw's tests would have caught."
- Batch size
- Commit mode
Get explicit go-ahead before touching any code.
总结完整计划:
- 按修复顺序列出选定缺陷(排序规则:先处理依赖关系——能够解除其他缺陷阻塞的缺陷;然后按影响排序——High 在 Medium 和 Low 之前;在同一影响等级内,再按复杂度排序——优先处理较简单的缺陷。开发者可以覆盖此顺序。)
- 已知依赖关系
- 测试说明:“我会在 Safety Net 阶段验证所有缺陷,并在修改任何代码之前编写全部 safety-net 测试。没有任何例外——一次重构可能破坏另一个缺陷的测试本应捕获的问题。”
- 批次大小
- 提交模式
在触碰任何代码之前获得明确同意。
Safety Net: Validate and Write Upfront Tests
Safety Net:验证并预先编写测试
Non-negotiable rule: ALL safety-net tests must be written and committed before ANY fixes are applied. No exceptions. Changes can have unexpected action at a distance — tests must exist before any refactoring begins, even for a single fix. This phase must complete fully before the Fix Loop begins.
The tests this phase credits as the safety net — written here or existing — are frozen for the rest of the session: once the Fix Loop starts, their assertions and expected values may not be changed, relaxed, skipped, or deleted. See "Editing tests during the Fix Loop". A safety net you are free to rewrite until the suite goes green is not a safety net.
-
For each flaw in the batch, run Validate the Flaw and Assess Test Coverage
-
Write all needed safety-net tests
-
Commit all safety-net tests together (before any fix commits) — in both commit modes. For a security flaw, the commit message, test names, docstrings, comments and assertion messages describe the inputs and observed behavior in neutral terms, never the weakness or its label — the same rule as the fix commit below. Manual-commit mode applies to fix commits, not to this one: staged tests are destroyed by a later revert along with the fix.
-
Print the Safety Net Report (below) and show it to the developer. When the batch includes a security flaw, the message that carries the report opens with this warning, before the report and before any fix options:Before you push: commitholds a test that still reproduces a security flaw (details only in
<sha>). If this branch goes to a public remote, don't push it until that flaw's fix commit is on top of it.paad/security/<file>Never tell the developer that push is safe: the neutral name hides the test from a search, but the test itself is the reproduction. Don't describe the weakness in the message either. -
Only then proceed to the Fix Loop (starting at Propose Fix Options for each flaw)
不可协商的规则:所有 safety-net 测试都必须在应用任何修复之前编写并提交。没有任何例外。 更改可能产生意外的距离效应——测试必须在任何重构开始前就存在,即使只修复一个缺陷也是如此。这个阶段必须完整完成后,才能进入 Fix Loop。
本阶段计入 safety net 的测试——无论是在此编写还是已经存在——在本次会话余下部分都处于冻结状态:一旦 Fix Loop 开始,不得修改、放宽、跳过或删除其断言和预期值。参见“Editing tests during the Fix Loop”。一个在测试套件变绿之前可以随意重写的 safety net 不是真正的 safety net。
-
对批次中的每个缺陷,执行 Validate the Flaw 和 Assess Test Coverage
-
编写所有必要的 safety-net 测试
-
将所有 safety-net 测试一起提交(必须早于任何修复 commit)——两种提交模式均如此。 对于安全缺陷,commit message、测试名称、docstring、注释和断言消息必须以中性措辞描述输入和观察到的行为,绝不能描述弱点本身或其标签——修复 commit 也遵循相同规则。Manual-commit 模式只适用于修复 commit,不适用于这个 commit:暂存的测试会在后续回退时与修复一起被破坏。
-
打印下方的 Safety Net Report 并展示给开发者。如果批次中包含安全缺陷,携带该报告的消息必须先以以下警告开头,且警告必须位于报告和任何修复选项之前:推送前: commit包含一项仍在复现安全缺陷的测试(详情仅位于
<sha>)。如果此分支将推送到公共 remote,在该缺陷的修复 commit 位于其上方之前,不要推送。paad/security/<file>绝不能告诉开发者推送是安全的:中性的名称会掩盖测试在搜索结果中的可见性,但测试本身就是复现用例。消息中也绝不能描述该弱点。 -
之后才能进入 Fix Loop(从每个缺陷的 Propose Fix Options 开始)
Safety Net Report
Safety Net Report
Every other check in this phase is self-attested, so a hollow Safety Net looks identical to a real one. This report makes the difference visible as blanks.
Print it before the first fix, filling in every field:
Safety Net Report
Baseline: <exact command run>
<pass/fail/skip counts>
Pre-existing failures: <verbatim test names, or "none">
Not runnable: <what could not be run, or "nothing">
Per flaw:
<F-ID> Coverage: <written | existing | none — developer approved>
Cases: <named test cases — the ones you wrote, or the existing
ones you are crediting as coverage>
Proof: <command that ran those cases, and its result>
Commit: <SHA of the safety-net commit, or "n/a — existing tests">Rules for filling it in:
- Never leave a field blank or write "see above". A field you cannot fill is a gap in the safety net, and the developer needs to see it before the first fix, not after a revert.
- must name cases, not files. "
Cases:" is not an answer; "test/services/user.test.ts,describes user split across services" is.rejects empty role - requires you to have actually run them this session. A green CI badge, a suite you ran before writing the tests, and "these obviously pass" are all not proof.
Proof: - If the whole batch comes back and you wrote no tests at all, say so explicitly and get the developer's confirmation before entering the Fix Loop. A Safety Net phase that produces zero tests is a claim that needs a witness.
Coverage: existing
此阶段的其他所有检查均为自我声明,因此空洞的 Safety Net 与真实的 Safety Net 看起来完全相同。下面的报告会通过空白字段直观展示差异。
在第一次修复之前打印该报告,并填写每一个字段:
Safety Net Report
Baseline: <exact command run>
<pass/fail/skip counts>
Pre-existing failures: <verbatim test names, or "none">
Not runnable: <what could not be run, or "nothing">
Per flaw:
<F-ID> Coverage: <written | existing | none — developer approved>
Cases: <named test cases — the ones you wrote, or the existing
ones you are crediting as coverage>
Proof: <command that ran those cases, and its result>
Commit: <SHA of the safety-net commit, or "n/a — existing tests">填写规则:
- 任何字段都不得留空,也不得写“see above”。 无法填写的字段就是 safety net 中的缺口,开发者必须在第一次修复之前看到它,而不是回退之后才看到。
- 必须列出用例名称,而不是文件。 “
Cases:”不是答案;“test/services/user.test.ts、describes user split across services”才是。rejects empty role - 要求你确实在本次会话中运行过这些用例。 绿色的 CI 徽章、编写测试前运行过的套件,以及“这些显然会通过”都不是证明。
Proof: - 如果整个批次的 都是
Coverage,且你完全没有编写测试,必须明确说明这一点,并在进入 Fix Loop 前获得开发者确认。 一个没有产出任何测试的 Safety Net 阶段是一项需要见证的主张。existing
Fix Loop
Fix Loop
For each flaw in the confirmed batch, execute this sequence:
The Setup rule applies here too: ask, wait for the answer, then act. Every approval point below is a stop, not an announcement — presenting an approach and beginning work on it in the same turn is not "getting confirmation".
Two things that are not approval for a fix approach:
- The batch approval from Setup Step 4. That approved which flaws are in scope. It never approved how any of them gets fixed, how it gets tested, or whether it proceeds without tests.
- Only one option existing. A single viable approach still needs a yes — it is the developer's last look before code moves, and the point where they can say the only sensible thing is still not worth doing.
对已确认批次中的每个缺陷,执行以下序列:
Setup 规则在这里同样适用:提问、等待回答,然后执行。 下面的每个审批点都是停止点,而不是公告——在同一轮中提出方案并开始工作并不等于“获得确认”。
以下两项不构成对修复方案的批准:
- Setup Step 4 中的批次批准。 它批准的是哪些缺陷属于范围,从未批准如何修复、如何测试,或是否在无测试的情况下继续。
- 只有一个可用方案。 即使只有一种可行方案,仍然需要开发者回答 yes——这是代码变更前开发者最后一次审阅的机会,也是开发者仍可判断唯一合理方案是否不值得实施的关键点。
Validate the Flaw
Validate the Flaw
Read targeted sections around the referenced file:line (not entire files — conserve context window). Check on affected files since the report date. Determine outcome:
git log| Outcome | Action |
|---|---|
| Still exists as described | Proceed to Assess Test Coverage |
| Partially addressed | Explain what changed, ask developer if it still needs work |
| No longer exists | Show the developer the evidence that it's gone — the commit that removed it, and the current state of the cited code — and get their agreement before marking "Fixed (pre-existing)" with date and commit SHA |
| False positive / wrong | Explain why, ask developer. If agreed, mark "Won't fix — false positive" |
If uncertain about any flaw, ask the developer specifically rather than guessing.
Targeted reading does not mean grep-only. If the cited line numbers have drifted, or the symbol isn't found where the report says it is, the file has changed enough that you must read the surrounding structure before concluding the flaw is gone. A rename is not a fix, and neither is a move.
Why "No longer exists" needs a witness. It writes a terminal status, and terminal statuses are permanently excluded from later sessions ("Present flaws from the report, excluding any already marked as Fixed or Won't Fix") — so a flaw wrongly marked here goes invisible to every future run, with a commit SHA next to it making the record look audited. If you cannot identify the commit that actually resolved the flaw, say so rather than picking a plausible one from .
git log有针对性地读取所引用 附近的代码段(不要读取整个文件——以节省上下文窗口)。检查报告日期之后受影响文件的 。确定结果:
file:linegit log| 结果 | 操作 |
|---|---|
| 仍与描述一致 | 继续 Assess Test Coverage |
| 已部分处理 | 说明发生了哪些变化,并询问开发者是否仍需处理 |
| 已不存在 | 向开发者展示其已消失的证据——移除它的 commit,以及当前所引用代码的状态——并在标记“Fixed (pre-existing)”及填写日期和 commit SHA 之前获得开发者认可 |
| 误报 / 判断错误 | 说明原因并询问开发者。如果开发者认可,则标记为“Won't fix — false positive” |
如果对任何缺陷都不确定,应具体询问开发者,而不是猜测。
有针对性的阅读不意味着只使用 grep。 如果引用的行号已经偏移,或者在报告所述位置找不到对应符号,说明文件已经发生了足够大的变化,必须在断定缺陷消失之前阅读周围的整体结构。重命名不是修复,移动代码也不是。
为什么“No longer exists”需要见证。 这会写入一个终态,而终态会被后续会话永久排除(“呈现报告中的缺陷,排除已标记为 Fixed 或 Won't fix 的缺陷”)——因此,错误标记的缺陷会从所有未来运行中消失,并且旁边的 commit SHA 还会让记录看起来像是经过审计。如果无法确定真正解决缺陷的 commit,就应如实说明,而不是从 中随意选择一个看似合理的 commit。
git logAssess Test Coverage
Assess Test Coverage
Check whether the affected code has existing tests. Three outcomes:
Good coverage exists → "good" means you have named the specific test cases that exercise each path the fix will change, run them, and seen them pass. A test file sitting next to the affected code is not coverage, and skipped or ed cases count for nothing. If you cannot name a case for an affected path, that path has a gap. If gaps are identified during assessment — even if overall coverage looks strong — fill them with safety-net tests before proceeding. Do not dismiss gaps as "edge cases" and proceed anyway.
xfailTestable but untested → write tests for existing behavior first, then red/green/refactor the fix. Flag this as higher risk: "This code has no tests. I'll write tests for the current behavior first so we have a safety net." In auto-commit mode, commit the safety-net tests separately before applying the fix, so they can be preserved independently if the fix is reverted.
Not unit-testable without refactoring → analyze the code and present feasible, specific testing approaches with tradeoffs. The skill must assess how to write tests concretely, not offer abstract categories:
- Refactor for testability first, then fix (safest, more work)
- Write end-to-end/integration tests covering the affected paths — explain specifically how (e.g., "test via the endpoint which exercises this validation path")
/api/orders - Fix without tests (risky)
- Skip this flaw for now
If only one testing approach is feasible, present it with explanation of why alternatives aren't viable. Developer chooses — stop and wait for their answer. This fork matters more than the others: option 3 is fix without tests, so proceeding on your own decides to refactor a structural flaw with no safety net on the developer's behalf.
检查受影响代码是否已有测试。三种结果:
已有良好覆盖(Good coverage exists) → “良好”意味着你已经列出覆盖修复将改变的每条路径的具体测试用例名称,运行了它们,并看到它们通过。紧邻受影响代码的测试文件不算覆盖,被 skipped 或 的用例也完全不计入。如果无法为某条受影响路径指出具体用例,该路径就存在缺口。如果评估期间发现缺口——即使总体覆盖率看起来很高——也必须先用 safety-net 测试补齐,然后才能继续。不要把缺口视为“边缘情况”而直接继续。
xfail可测试但未测试(Testable but untested) → 先为现有行为编写测试,再按 red/green/refactor 流程修复。将其标记为更高风险:“这段代码没有测试。我会先为当前行为编写测试,为我们建立 safety net。”在 auto-commit 模式下,应在应用修复前单独提交 safety-net 测试,使其在修复被回退时仍能独立保留。
不重构就无法进行单元测试(Not unit-testable without refactoring) → 分析代码,并提出具体可行的测试方案及其权衡。该 skill 必须评估如何具体编写测试,不能只提供抽象类别:
- 先重构以提高可测试性,然后修复(最安全,但工作量更大)
- 编写覆盖受影响路径的 end-to-end/integration 测试——具体解释如何编写,例如“通过 endpoint 进行测试,该路径会执行这项验证逻辑”
/api/orders - 不编写测试直接修复(风险较高)
- 暂时跳过该缺陷
如果只有一种可行的测试方案,应呈现该方案,并解释其他方案为何不可行。由开发者选择——停止并等待回答。 这个分支比其他分支更重要:方案 3 是“无测试修复”,因此自行继续等于替开发者决定,在没有 safety net 的情况下重构结构性缺陷。
Propose Fix Options
Propose Fix Options
If multiple fix approaches exist, present as a numbered list:
- Recommended option first, with reasoning
- Each option includes: what changes, files affected, tradeoffs (complexity, risk, scope)
If only one reasonable approach, present it and get confirmation. Stop and wait — in both cases. Do not begin editing in the same turn you present the options, and do not treat a single viable approach as needing no answer.
如果存在多种修复方案,以编号列表呈现:
- 推荐方案排在第一位,并说明理由
- 每个方案包括:具体变更、涉及文件、权衡(复杂度、风险、范围)
如果只有一种合理方案,呈现该方案并请求确认。停止并等待——两种情况均如此。不要在呈现方案的同一轮中开始编辑,也不要认为只有一个可行方案就无需回答。
Execute the Fix
Execute the Fix
Follow red/green/refactor:
- Red — write/update tests that fail against the current code (for the desired behavior)
- Green — make the minimal code change to pass tests
- Refactor — clean up if warranted
- Verify — re-run the full test suite, using the same command recorded in the pre-flight baseline, and state that command and its result. A scoped run cannot detect damage at a distance, which is the damage structural changes cause. Do not proceed to Update the Report on a partial run, and do not defer the full run to Wrap-Up — the "context running low" stop fires first, and the deferred run never happens.
遵循 red/green/refactor:
- Red — 针对预期行为,编写或更新在当前代码上失败的测试
- Green — 实施使测试通过的最小代码更改
- Refactor — 在确有必要时清理代码
- Verify — 使用 Pre-flight 基线中记录的相同命令重新运行完整测试套件,并说明该命令及其结果。局部运行无法发现距离效应,而结构性更改正是这种影响的来源。不要基于局部运行进入 Update Report,也不要将完整运行推迟到 Wrap-Up——“上下文即将耗尽”的停止点会先触发,而被推迟的运行永远不会发生。
Handle Test Failures
Handle Test Failures
If tests fail after the fix:
- Analyze which tests failed and why
- Cross-reference against the pre-flight baseline — if a test was already failing before the session, it's not caused by this fix
- Internal unit tests breaking because structure changed → expected during refactoring, propose updating them. Note the limits in "Editing tests during the Fix Loop" below — they are strictest for safety-net tests.
- External/integration tests breaking → red flag, discuss with developer whether to fix forward or revert
- Developer decides how to proceed — stop and wait for their decision. Do not fix forward, revert, or update a test on your own reading of which failure this is.
如果修复后测试失败:
- 分析哪些测试失败以及为什么失败
- 与 Pre-flight 基线交叉核对——如果某个测试在会话开始前就已失败,则不是本次修复导致的
- 内部单元测试因结构变化而失败 → 重构期间属于预期情况,提出更新这些测试的建议。注意“Editing tests during the Fix Loop”中的限制——这些限制对作为 safety net 的测试最为严格。
- 外部/integration 测试失败 → 发出红旗,与开发者讨论是继续修复还是回退
- 由开发者决定如何继续——停止并等待其决定。 不要自行判断失败类型后直接继续修复、回退或更新测试。
Editing tests during the Fix Loop
Editing tests during the Fix Loop
Step 3 licenses updating tests that broke because the structure moved. That license has a hard boundary, and it is at its hardest for the tests the Safety Net phase credited as the safety net — written or existing.
A safety-net test may be edited only to follow the code it already tested: import paths, call sites, object construction, fixture wiring, type or module names. Mechanical adaptation to the new shape, nothing more.
A safety-net test may not have its assertions, expected values, or cases changed, relaxed, skipped, or deleted. Not to "match the new design", not because the assertion "no longer maps onto the decomposition", not because the old expectation "was testing an implementation detail". Only the developer may authorize otherwise, at the red-flag stop, and only when the flaw itself is the behaviour being asserted — a swallowed error, a non-idempotent call, a hard-coded secret. Never on your own reading.
The Safety Net phase is only worth anything if it is not reversible: every guarantee dissolves if the same agent may edit those tests until the suite is green. A genuine behaviour break and a mechanical call-shape break look identical from inside the loop — both present as "this test doesn't fit the new structure."
So apply this rule: if a safety-net test still fails after its call sites are updated, that is a behaviour change, not a structural one. Stop treating it as step 3 and route it to step 4 — red flag, discuss fix-forward versus revert with the developer. The test is reporting exactly the regression it was written to catch.
Show the developer a before/after diff of any safety-net test you touch, however mechanical the edit looks. If you find yourself explaining why an assertion change is really just a structural adjustment, that explanation is the finding — surface it instead of applying it.
After the fix passes, do a brief sanity check: does the change introduce any obvious new architectural issues (e.g., splitting a god object but creating tight coupling between the new modules)? If so, flag it to the developer. This is not a full re-analysis — just a common-sense review of the code just written.
Step 3 允许更新因结构迁移而失败的测试。这项许可有严格边界,而对于 Safety Net 阶段计入 safety net 的测试——无论新编写还是已经存在——边界最为严格。
safety-net 测试只能为了跟随其原本测试的代码而编辑: import path、call site、对象构造、fixture wiring、类型或模块名称。只能对新结构做机械性适配,不得做其他修改。
不得修改、放宽、跳过或删除 safety-net 测试的断言、预期值或用例。 不能为了“匹配新设计”而修改,不能因为“断言不再映射到拆分后的实现”而修改,也不能因为“旧预期测试的是实现细节”而修改。只有开发者可以在红旗停止点授权例外,而且仅限于缺陷本身正是被断言的行为——例如被吞掉的错误、非幂等调用或硬编码 secret。绝不能自行判断后修改。
Safety Net 阶段只有在不可被反向修改时才有价值:如果同一个 agent 可以反复编辑这些测试直到套件变绿,那么所有保证都会消融。真实的行为断裂和机械性的调用形态断裂,从循环内部看完全相同——两者都表现为“这个测试不再适合新的结构”。
因此遵循此规则:如果 safety-net 测试在 call site 更新后仍然失败,这就是行为变化,而不是结构变化。 不要继续将其视为 Step 3,应转交 Step 4——发出红旗,并与开发者讨论继续修复还是回退。该测试正在准确报告它被编写来捕获的回归问题。
对任何修改过的 safety-net 测试,向开发者展示修改前后的 diff,无论改动看起来多么机械。如果你发现自己在解释为什么断言变化实际上只是结构调整,那么该解释本身就是结论——应将其呈现出来,而不是直接应用修改。
修复通过后,进行一次简要 sanity check:此次更改是否引入了明显的新架构问题(例如拆分了 god object,却在新模块之间形成紧密耦合)?如果有,则向开发者发出提示。这不是一次完整重新分析,只是对刚编写的代码进行常识性检查。
Update the Report
Update the Report
Add status fields inline to the flaw entry in the architecture report:
markdown
undefined在架构报告的缺陷条目中内联添加状态字段:
markdown
undefined[F-ID] <Flaw label>
[F-ID] <Flaw label>
- Category: ...
- Impact: ...
- Explanation: ...
- Evidence: ...
- Found by: ...
- Status: Fixed
- Status reason: Extracted PaymentLogic and NotificationLogic into separate services
- Status date: <YYYY-MM-DD HH:MM UTC>
- Status commit: <commit-sha>
If status fields don't exist on the entry (report was generated before this skill existed), add them.
A security flaw's status fields go in the `paad/security/` file it came from, never in the main report.
Do this before committing, so auto-commit mode can include the report update in the same commit. **Status commit** is the one field that can only be filled once the commit exists — record it immediately after committing (`git commit --amend` in auto-commit mode, or leave it for the developer in manual mode).- Category: ...
- Impact: ...
- Explanation: ...
- Evidence: ...
- Found by: ...
- Status: Fixed
- Status reason: Extracted PaymentLogic and NotificationLogic into separate services
- Status date: <YYYY-MM-DD HH:MM UTC>
- Status commit: <commit-sha>
如果缺陷条目中尚不存在状态字段(报告是在此 skill 出现之前生成的),则添加这些字段。
安全缺陷的状态字段必须写入其来源文件 `paad/security/`,绝不能写入主报告。
在提交之前完成此操作,以便 auto-commit 模式可以在同一个 commit 中包含报告更新。**Status commit** 是唯一只能在 commit 已存在后填写的字段——提交后立即记录(auto-commit 模式下使用 `git commit --amend`;manual 模式下则留给开发者处理)。Commit
Commit
If auto-commit mode: one commit per fix (including tests and report update), using this commit message format:
fix(architecture): [F-ID] <short description>
Resolves architectural flaw F-ID (<flaw label>) identified in
<report-filename>.
<brief description of what changed>For a security flaw, the message names neither the flaw label nor either report's filename, and the description says what the code now does, not the weakness it had — commit history is permanent and public wherever the repo is. Use and a body of what changed. The file is ignored, so its status update is never part of the commit.
fix(architecture): <neutral description>paad/security/Note: safety-net tests are committed in the Safety Net phase (before any fixes) so they survive if a fix is reverted. That commit already happened regardless of commit mode — nothing here re-commits it.
If manual mode: leave the fix changes staged, tell the developer what changed.
如果使用 auto-commit 模式:每次修复一个 commit(包括测试和报告更新),并使用以下 commit message 格式:
fix(architecture): [F-ID] <short description>
Resolves architectural flaw F-ID (<flaw label>) identified in
<report-filename>.
<brief description of what changed>对于安全缺陷,message 既不包含缺陷标签,也不包含任一报告的 filename;描述应说明代码现在的行为,而不是它过去存在的弱点——commit history 是永久的,并且只要仓库公开就会公开可见。使用 ,正文说明发生了哪些更改。 文件已被忽略,因此其中的状态更新永远不会包含在 commit 中。
fix(architecture): <neutral description>paad/security/注意:safety-net 测试在 Safety Net 阶段已经提交(早于任何修复),因此即使修复被回退,这些测试依然存在。无论采用哪种提交模式,这个 commit 都已经完成——这里不会再次提交它。
如果使用 manual 模式:将修复更改暂存,并告知开发者具体变更。
Check Flaw Dependencies
Check Flaw Dependencies
Before moving to the next flaw, check if the fix just applied addresses or affects other flaws in the report (not just the current batch — a fix might resolve flaws the developer didn't select):
"Fixing F-03 appears to have also resolved F-07 (low cohesion). Let me verify..."
Validate and update accordingly.
进入下一个缺陷之前,检查刚应用的修复是否解决了报告中的其他缺陷,或对它们产生了影响(不只是检查当前批次——某个修复可能解决开发者未选择的缺陷):
“修复 F-03 似乎还解决了 F-07(low cohesion)。让我验证一下……”
相应地进行验证和更新。
Continue or Stop
Continue or Stop
"F-03 is done. N flaws remaining in this batch. Continue with F-05, or stop here?"
If context usage is approaching limits, recommend stopping after the current fix and continuing in a fresh session. Do not attempt a fix that may not fit in remaining context.
“F-03 已完成。本批次还剩 N 个缺陷。要继续处理 F-05,还是在这里停止?”
如果上下文用量即将达到上限,建议完成当前修复后停止,并在新会话中继续。不要尝试执行可能无法容纳在剩余上下文中的修复。
Wrap-Up: Post-Session
Wrap-Up:会话结束后处理
After the developer stops or the batch is complete:
-
If a security flaw's safety-net test was committed but the flaw is not fixed (skipped, won't-fixed, reverted, or the session stopped first), open the wrap-up with:Before you push: commitholds a test that still reproduces an unfixed security flaw (details only in
<sha>). If this branch goes to a public remote, don't push it until the hole is fixed. The fix is yours to schedule — in a fresh session, runpaad/security/<file>and pick/fix-architectureat triage, or fix it by hand; the safety net is already in place.S:F-<n>Don't describe the weakness anywhere in the wrap-up — not in the summary, not in the remaining-flaws list. Name the flaw only as; the details stay inS:F-<n>.paad/security/ -
Print summary:
-
Number of flaws fixed, skipped, won't-fixed this session
-
Remaining unfixed flaws in the report, including thefile's
paad/security/ -
Every artifact this session wrote or updated, one line per path, each marked new or updated — the report always, since its status fields are the record of what happened here and developers routinely miss that it changed. Source files are the fixes the developer just watched you apply and a structural fix can touch dozens, so give them as a count with a pointer to the diff rather than a list that buries the report:
Files written or updated: updated paad/architecture-reviews/2026-07-14-myrepo-architecture-report.md updated paad/security/agentic-architecture-2026-07-14-myrepo.md 12 source files changed across 3 modules (see git diff)The security line appears only when this session changed that file.
-
-
Suggest: "Runagain in a fresh session to continue fixing remaining flaws."
/fix-architecture
开发者停止或批次完成后:
-
如果安全缺陷的 safety-net 测试已经提交,但该缺陷尚未修复(被跳过、标记为 won't-fixed、被回退,或会话提前停止),则使用以下警告开始 wrap-up:推送前: commit包含一项仍在复现未修复安全缺陷的测试(详情仅位于
<sha>)。如果此分支将推送到公共 remote,在该问题修复之前不要推送。修复安排由你决定——可以在新会话中运行paad/security/<file>,并在 triage 时选择/fix-architecture,也可以手动修复;safety net 已经就位。S:F-<n>在 wrap-up 的任何位置都不得描述该弱点——摘要中不得描述,剩余缺陷列表中也不得描述。仅以命名该缺陷;详情保留在S:F-<n>中。paad/security/ -
打印摘要:
-
本次会话修复、跳过和标记为 won't-fixed 的缺陷数量
-
报告中剩余的未修复缺陷,包括文件中的缺陷
paad/security/ -
本次会话写入或更新的每项产物,每个 path 单独一行,并分别标记为 new 或 updated——报告始终都要列出,因为其状态字段记录了本次会话发生的情况,而开发者经常会忽略报告发生了变化。源代码文件就是开发者刚刚看着你应用的修复;结构性修复可能涉及数十个文件,因此应以数量和 diff 指引代替完整清单,以免报告被淹没:
Files written or updated: updated paad/architecture-reviews/2026-07-14-myrepo-architecture-report.md updated paad/security/agentic-architecture-2026-07-14-myrepo.md 12 source files changed across 3 modules (see git diff)只有当本次会话实际更改了安全文件时,才显示 security 行。
-
-
建议:“在新的会话中再次运行,以继续修复剩余缺陷。”
/fix-architecture
Status Values
状态值
| Status | Requires reason? | When used |
|---|---|---|
| Not yet fixed | No | Default for untouched flaws (no status fields added) |
| Fixed | Yes | Fix applied and tests pass |
| Won't fix | Yes | Developer decided not to fix (with rationale) |
| Partially fixed | Yes | Some aspect addressed, more work needed |
| Skipped | Yes | Deferred to a future session |
| Fixed (pre-existing) | Yes | Was already fixed before this session |
| Attempted, reverted | Yes | Fix was tried but reverted after discussion |
| 状态 | 是否需要原因? | 使用时机 |
|---|---|---|
| Not yet fixed | 否 | 尚未处理的缺陷的默认值(不添加状态字段) |
| Fixed | 是 | 已应用修复且测试通过 |
| Won't fix | 是 | 开发者决定不修复(附理由) |
| Partially fixed | 是 | 已处理部分方面,仍需继续工作 |
| Skipped | 是 | 推迟到未来会话处理 |
| Fixed (pre-existing) | 是 | 本次会话开始前已经修复 |
| Attempted, reverted | 是 | 尝试修复后经讨论决定回退 |
Common Mistakes
常见错误
These patterns produce bad architecture fix sessions. Avoid them:
| Mistake | What to do instead |
|---|---|
| Fixing without validating first | Always check if the flaw still exists (Validate the Flaw) — code may have changed since the report |
| Skipping tests | Always assess test coverage (Assess Test Coverage) and write safety-net tests before changing untested code |
| Fixing on the default branch | Architecture fixes go on feature branches — never main/master/trunk |
| Ignoring flaw dependencies | Check whether fixing one flaw resolves others (Check Flaw Dependencies) — avoid duplicate work |
| Large batches on team repos | Team members' concurrent work creates conflict risk — recommend 1-2 fixes per session |
| Continuing when context is low | Stop after the current fix and suggest a fresh session rather than starting a fix that won't fit |
| Auto-deciding without developer input | Every consequential decision (what to fix, how to test, which approach) requires developer approval |
| Writing tests alongside fixes | ALL safety-net tests must be written in the Safety Net phase before ANY fixes in the Fix Loop — changes can have action at a distance, even a single fix |
| Calling coverage "good" despite identified gaps | If gaps are found during assessment, fill them — don't dismiss gaps as "edge cases" and proceed |
| Asking multiple questions at once | One question per message in Setup — ask, wait for the answer, then ask the next |
| Reading entire files | Read targeted sections around the referenced lines to conserve context |
| Proposing abstract test strategies | Assess how to write tests concretely — name the specific endpoints, functions, or paths |
以下模式会产生糟糕的架构修复会话,应予避免:
| 错误 | 正确做法 |
|---|---|
| 未先验证就进行修复 | 始终检查缺陷是否仍然存在(Validate the Flaw)——代码可能已在报告生成后发生变化 |
| 跳过测试 | 始终评估测试覆盖(Assess Test Coverage),并在修改未测试代码前编写 safety-net 测试 |
| 在默认分支上修复 | 架构修复必须在 feature branch 上完成——绝不能使用 main/master/trunk |
| 忽略缺陷依赖关系 | 检查修复一个缺陷是否解决了其他缺陷(Check Flaw Dependencies)——避免重复工作 |
| 在团队仓库中处理大批次 | 团队成员的并发工作会产生冲突风险——建议每次会话处理 1-2 个修复 |
| 上下文不足时仍继续 | 完成当前修复后停止,并建议在新会话中继续,而不是启动可能无法容纳的修复 |
| 未经开发者输入就自行决定 | 每个重要决策(修复什么、如何测试、采用哪种方案)都需要开发者批准 |
| 将测试与修复一起编写 | 所有 safety-net 测试都必须在 Fix Loop 中应用任何修复之前于 Safety Net 阶段编写完成——更改可能产生距离效应,即使只修复一个缺陷也是如此 |
| 发现缺口后仍称覆盖率“良好” | 如果评估中发现缺口,必须补齐——不要把缺口视为“边缘情况”后继续 |
| 一条消息中询问多个问题 | Setup 阶段每条消息只问一个问题——提问后等待回答,再问下一个 |
| 读取整个文件 | 有针对性地读取所引用行附近的代码段,以节省上下文 |
| 提出抽象的测试策略 | 具体评估如何编写测试——指出具体 endpoint、函数或路径 |