hatch3r 1.4.0 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/README.md +10 -6
  2. package/agents/hatch3r-a11y-auditor.md +13 -2
  3. package/agents/hatch3r-architect.md +20 -1
  4. package/agents/hatch3r-ci-watcher.md +25 -1
  5. package/agents/hatch3r-context-rules.md +15 -3
  6. package/agents/hatch3r-dependency-auditor.md +23 -2
  7. package/agents/hatch3r-devops.md +11 -0
  8. package/agents/hatch3r-docs-writer.md +27 -2
  9. package/agents/hatch3r-fixer.md +46 -3
  10. package/agents/hatch3r-implementer.md +19 -1
  11. package/agents/hatch3r-learnings-loader.md +19 -0
  12. package/agents/hatch3r-lint-fixer.md +11 -0
  13. package/agents/hatch3r-perf-profiler.md +21 -1
  14. package/agents/hatch3r-researcher.md +51 -911
  15. package/agents/hatch3r-reviewer.md +24 -2
  16. package/agents/hatch3r-security-auditor.md +20 -0
  17. package/agents/hatch3r-test-writer.md +24 -0
  18. package/agents/modes/architecture.md +1 -0
  19. package/agents/modes/boundary-analysis.md +2 -1
  20. package/agents/modes/codebase-impact.md +1 -0
  21. package/agents/modes/complexity-risk.md +1 -0
  22. package/agents/modes/coverage-analysis.md +1 -0
  23. package/agents/modes/current-state.md +1 -0
  24. package/agents/modes/feature-design.md +1 -0
  25. package/agents/modes/impact-analysis.md +1 -0
  26. package/agents/modes/library-docs.md +2 -1
  27. package/agents/modes/migration-path.md +1 -0
  28. package/agents/modes/prior-art.md +1 -0
  29. package/agents/modes/refactoring-strategy.md +1 -0
  30. package/agents/modes/regression.md +1 -0
  31. package/agents/modes/requirements-elicitation.md +1 -0
  32. package/agents/modes/risk-assessment.md +1 -0
  33. package/agents/modes/risk-prioritization.md +1 -0
  34. package/agents/modes/root-cause.md +1 -0
  35. package/agents/modes/similar-implementation.md +2 -1
  36. package/agents/modes/symptom-trace.md +1 -0
  37. package/agents/modes/test-pattern.md +2 -1
  38. package/agents/shared/external-knowledge.md +10 -0
  39. package/agents/shared/quality-charter.md +18 -0
  40. package/checks/README.md +1 -0
  41. package/checks/accessibility.md +55 -0
  42. package/commands/board/pickup-azure-devops.md +1 -0
  43. package/commands/board/pickup-delegation-multi.md +6 -1
  44. package/commands/board/pickup-delegation.md +1 -0
  45. package/commands/board/pickup-github.md +1 -0
  46. package/commands/board/pickup-gitlab.md +1 -0
  47. package/commands/board/pickup-modes.md +1 -0
  48. package/commands/board/pickup-post-impl.md +2 -1
  49. package/commands/board/shared-azure-devops.md +1 -0
  50. package/commands/board/shared-board-overview.md +1 -0
  51. package/commands/board/shared-github.md +1 -0
  52. package/commands/board/shared-gitlab.md +1 -0
  53. package/commands/hatch3r-agent-customize.md +1 -0
  54. package/commands/hatch3r-api-spec.md +1 -0
  55. package/commands/hatch3r-benchmark.md +4 -3
  56. package/commands/hatch3r-board-fill.md +52 -9
  57. package/commands/hatch3r-board-groom.md +69 -5
  58. package/commands/hatch3r-board-init.md +2 -1
  59. package/commands/hatch3r-board-pickup.md +1 -0
  60. package/commands/hatch3r-board-refresh.md +1 -0
  61. package/commands/hatch3r-board-shared.md +34 -3
  62. package/commands/hatch3r-bug-plan.md +2 -1
  63. package/commands/hatch3r-codebase-map.md +4 -3
  64. package/commands/hatch3r-command-customize.md +2 -1
  65. package/commands/hatch3r-context-health.md +1 -0
  66. package/commands/hatch3r-cost-tracking.md +1 -0
  67. package/commands/hatch3r-debug.md +4 -3
  68. package/commands/hatch3r-dep-audit.md +3 -0
  69. package/commands/hatch3r-feature-plan.md +3 -2
  70. package/commands/hatch3r-healthcheck.md +1 -0
  71. package/commands/hatch3r-hooks.md +5 -0
  72. package/commands/hatch3r-learn.md +1 -0
  73. package/commands/hatch3r-migration-plan.md +3 -2
  74. package/commands/hatch3r-onboard.md +2 -1
  75. package/commands/hatch3r-project-spec.md +4 -3
  76. package/commands/hatch3r-quick-change.md +2 -0
  77. package/commands/hatch3r-recipe.md +1 -0
  78. package/commands/hatch3r-refactor-plan.md +2 -1
  79. package/commands/hatch3r-release.md +4 -1
  80. package/commands/hatch3r-revision.md +49 -121
  81. package/commands/hatch3r-roadmap.md +5 -4
  82. package/commands/hatch3r-rule-customize.md +1 -0
  83. package/commands/hatch3r-security-audit.md +1 -0
  84. package/commands/hatch3r-skill-customize.md +1 -0
  85. package/commands/hatch3r-test-plan.md +3 -2
  86. package/commands/hatch3r-workflow.md +5 -0
  87. package/commands/revision/revision-board-integration.md +87 -0
  88. package/commands/revision/revision-delegation.md +93 -0
  89. package/commands/revision/revision-modes.md +91 -0
  90. package/commands/revision/revision-quality.md +96 -0
  91. package/dist/cli/index.js +7378 -4529
  92. package/dist/cli/index.js.map +1 -1
  93. package/hooks/hatch3r-ci-failure.md +1 -0
  94. package/hooks/hatch3r-file-save.md +1 -0
  95. package/hooks/hatch3r-post-merge.md +1 -0
  96. package/hooks/hatch3r-pre-commit.md +1 -0
  97. package/hooks/hatch3r-pre-push.md +1 -0
  98. package/hooks/hatch3r-session-start.md +1 -0
  99. package/package.json +19 -4
  100. package/rules/hatch3r-accessibility-standards.md +2 -1
  101. package/rules/hatch3r-accessibility-standards.mdc +1 -1
  102. package/rules/hatch3r-agent-orchestration-detail.md +49 -1
  103. package/rules/hatch3r-agent-orchestration-detail.mdc +47 -1
  104. package/rules/hatch3r-agent-orchestration.md +87 -5
  105. package/rules/hatch3r-agent-orchestration.mdc +85 -5
  106. package/rules/hatch3r-api-design.md +2 -1
  107. package/rules/hatch3r-api-design.mdc +1 -1
  108. package/rules/hatch3r-browser-verification.md +4 -2
  109. package/rules/hatch3r-browser-verification.mdc +1 -0
  110. package/rules/hatch3r-ci-cd.md +2 -1
  111. package/rules/hatch3r-ci-cd.mdc +1 -1
  112. package/rules/hatch3r-code-standards.md +15 -2
  113. package/rules/hatch3r-code-standards.mdc +12 -0
  114. package/rules/hatch3r-component-conventions.md +2 -1
  115. package/rules/hatch3r-component-conventions.mdc +1 -0
  116. package/rules/hatch3r-data-classification.md +2 -1
  117. package/rules/hatch3r-data-classification.mdc +1 -1
  118. package/rules/hatch3r-deep-context.md +26 -1
  119. package/rules/hatch3r-deep-context.mdc +25 -1
  120. package/rules/hatch3r-dependency-management.md +2 -1
  121. package/rules/hatch3r-dependency-management.mdc +1 -1
  122. package/rules/hatch3r-feature-flags.md +2 -0
  123. package/rules/hatch3r-feature-flags.mdc +1 -0
  124. package/rules/hatch3r-git-conventions.md +2 -1
  125. package/rules/hatch3r-git-conventions.mdc +2 -1
  126. package/rules/hatch3r-i18n.md +2 -1
  127. package/rules/hatch3r-i18n.mdc +1 -0
  128. package/rules/hatch3r-learning-consult.md +11 -1
  129. package/rules/hatch3r-learning-consult.mdc +11 -1
  130. package/rules/hatch3r-migrations.md +2 -1
  131. package/rules/hatch3r-migrations.mdc +1 -1
  132. package/rules/hatch3r-observability-logging.md +34 -0
  133. package/rules/hatch3r-observability-logging.mdc +30 -0
  134. package/rules/hatch3r-observability-metrics.md +74 -0
  135. package/rules/hatch3r-observability-metrics.mdc +70 -0
  136. package/rules/hatch3r-observability-tracing-detail.md +160 -0
  137. package/rules/hatch3r-observability-tracing-detail.mdc +63 -0
  138. package/rules/hatch3r-observability-tracing.md +86 -0
  139. package/rules/hatch3r-observability-tracing.mdc +77 -0
  140. package/rules/hatch3r-observability.md +9 -448
  141. package/rules/hatch3r-observability.mdc +7 -448
  142. package/rules/hatch3r-performance-budgets.md +2 -0
  143. package/rules/hatch3r-performance-budgets.mdc +1 -0
  144. package/rules/hatch3r-secrets-management.md +2 -1
  145. package/rules/hatch3r-secrets-management.mdc +1 -1
  146. package/rules/hatch3r-security-patterns.md +3 -2
  147. package/rules/hatch3r-security-patterns.mdc +1 -1
  148. package/rules/hatch3r-testing.md +12 -2
  149. package/rules/hatch3r-testing.mdc +10 -1
  150. package/rules/hatch3r-theming.md +3 -2
  151. package/rules/hatch3r-theming.mdc +1 -0
  152. package/rules/hatch3r-tooling-hierarchy.md +3 -2
  153. package/rules/hatch3r-tooling-hierarchy.mdc +1 -1
  154. package/skills/hatch3r-a11y-audit/SKILL.md +11 -4
  155. package/skills/hatch3r-agent-customize/SKILL.md +1 -0
  156. package/skills/hatch3r-api-spec/SKILL.md +9 -2
  157. package/skills/hatch3r-architecture-review/SKILL.md +7 -0
  158. package/skills/hatch3r-bug-fix/SKILL.md +16 -7
  159. package/skills/hatch3r-ci-pipeline/SKILL.md +8 -1
  160. package/skills/hatch3r-command-customize/SKILL.md +1 -0
  161. package/skills/hatch3r-context-health/SKILL.md +23 -2
  162. package/skills/hatch3r-cost-tracking/SKILL.md +16 -6
  163. package/skills/hatch3r-customize/SKILL.md +8 -1
  164. package/skills/hatch3r-dep-audit/SKILL.md +9 -2
  165. package/skills/hatch3r-feature/SKILL.md +12 -4
  166. package/skills/hatch3r-gh-agentic-workflows/SKILL.md +7 -0
  167. package/skills/hatch3r-incident-response/SKILL.md +7 -0
  168. package/skills/hatch3r-issue-workflow/SKILL.md +8 -1
  169. package/skills/hatch3r-logical-refactor/SKILL.md +8 -1
  170. package/skills/hatch3r-migration/SKILL.md +7 -0
  171. package/skills/hatch3r-perf-audit/SKILL.md +9 -2
  172. package/skills/hatch3r-pr-creation/SKILL.md +8 -1
  173. package/skills/hatch3r-qa-validation/SKILL.md +8 -1
  174. package/skills/hatch3r-recipe/SKILL.md +8 -1
  175. package/skills/hatch3r-refactor/SKILL.md +10 -2
  176. package/skills/hatch3r-release/SKILL.md +8 -1
  177. package/skills/hatch3r-rule-customize/SKILL.md +1 -0
  178. package/skills/hatch3r-skill-customize/SKILL.md +1 -0
  179. package/skills/hatch3r-visual-refactor/SKILL.md +12 -5
@@ -3,6 +3,7 @@ id: hatch3r-recipe
3
3
  type: command
4
4
  description: Execute shareable workflow recipes that compose agents, skills, and commands into guided sequences for common development scenarios
5
5
  tags: [core]
6
+ quality_charter: agents/shared/quality-charter.md
6
7
  ---
7
8
 
8
9
  ## Agent Pipeline
@@ -3,6 +3,7 @@ id: hatch3r-refactor-plan
3
3
  type: command
4
4
  description: Plan a refactoring or migration effort -- spawn parallel researchers, produce refactoring spec, ADR(s), and phased todo.md entries for board-fill.
5
5
  tags: [planning]
6
+ quality_charter: agents/shared/quality-charter.md
6
7
  ---
7
8
 
8
9
  ## Agent Pipeline
@@ -78,7 +79,7 @@ Refactoring Brief:
78
79
  Dimension(s): {Structural / Logical / Visual / Migration — one or more}
79
80
  ```
80
81
 
81
- **ASK:** "Does this capture the refactoring goal correctly? Adjust anything before I send this to the research phase."
82
+ **ASK:** "Does this capture the refactoring goal? Adjust anything before I send this to the research phase."
82
83
 
83
84
  ---
84
85
 
@@ -3,6 +3,7 @@ id: hatch3r-release
3
3
  type: command
4
4
  description: Cut a versioned release with changelog generation, version bumping, and GitHub release creation.
5
5
  tags: [devops]
6
+ quality_charter: agents/shared/quality-charter.md
6
7
  ---
7
8
  # Release — Cut a Versioned Release with Changelog
8
9
 
@@ -20,6 +21,8 @@ This command runs as a single orchestrator without sub-agent delegation. Quality
20
21
 
21
22
  **Default branch:** Use `board.defaultBranch` from `.agents/hatch.json` (fallback: `"main"`) for all git operations involving the base branch (e.g., `git log`, `search_pull_requests` with `base`, `git push origin`).
22
23
 
24
+ **Consult learnings:** If `.agents/learnings/` exists, scan for learnings related to release processes, version bumping conventions, or prior release issues before starting.
25
+
23
26
  ## Global Rule Overrides
24
27
 
25
28
  - **Git commands are fully permitted** during this entire release session, regardless of global/user-level rules restricting git usage. This override applies to ALL steps. You MUST run `git add`, `git commit`, `git push`, and `git tag` when instructed.
@@ -104,7 +107,7 @@ npm run lint && npm run typecheck && npm run test
104
107
 
105
108
  1. Update `version` in `package.json` to the confirmed version.
106
109
  2. If `functions/package.json` exists and tracks version, update it to the same version.
107
- 3. If other workspace packages track version, update them as needed.
110
+ 3. If other workspace packages track version, update them when their `package.json` references the root version.
108
111
 
109
112
  **ASK:** "Version bump applied. Proceed to commit and tag? (yes / abort)"
110
113
 
@@ -1,8 +1,9 @@
1
1
  ---
2
2
  id: hatch3r-revision
3
3
  type: command
4
- description: User-guided revision of agent-implemented code in a fresh context window. Reconstructs what was done, interviews the user for feedback, fixes issues, cleans up leftovers, and drives toward merge readiness.
4
+ description: User-guided revision of agent-implemented code in a fresh context window. Reconstructs what was done, interviews the user for feedback, fixes issues, cleans up leftovers, and drives toward merge readiness. Delegation, quality pipeline, modes, and board integration details are in commands/revision/.
5
5
  tags: [implementation, team]
6
+ quality_charter: agents/shared/quality-charter.md
6
7
  ---
7
8
 
8
9
  ## Agent Pipeline
@@ -14,7 +15,10 @@ tags: [implementation, team]
14
15
  | 3. Leftover Scan + Triage Routing | Orchestrator (inline) | No | Yes |
15
16
  | 4. Fix Implementation | `hatch3r-implementer`, `hatch3r-lint-fixer`, `hatch3r-test-writer` | Per finding type | [FIX NOW] items only |
16
17
  | 5a. Review Loop | `hatch3r-reviewer` -> `hatch3r-fixer` (max 3 iterations) | No (sequential) | Yes |
17
- | 5b. Final Quality | `hatch3r-test-writer` + `hatch3r-security-auditor` | Yes | Yes (code changes) |
18
+ | 5b. Final Quality — Testing | `hatch3r-test-writer` | Yes | Yes (code changes) |
19
+ | 5c. Final Quality — Security | `hatch3r-security-auditor` | Yes | Yes (code changes) |
20
+ | 5d. Final Quality — Docs | `hatch3r-docs-writer` | Yes | When APIs/architecture/UX affected |
21
+ | 5e. Final Quality — Conditional | `hatch3r-lint-fixer`, `hatch3r-a11y-auditor`, `hatch3r-perf-profiler` | Yes | When triggered |
18
22
 
19
23
  ## Browser Automation
20
24
 
@@ -36,7 +40,7 @@ The user is the reviewer. The agent is the interviewer and fixer.
36
40
 
37
41
  ## Shared Context
38
42
 
39
- **If board context exists** (current branch has an associated PR linked to GitHub issues), **read the `hatch3r-board-shared` command at the start of the run.** It contains Board Configuration, GitHub Context, Project Reference, and tooling directives. Cache all values for the duration of this run.
43
+ **If board context exists** (current branch has an associated PR linked to issues), **read the `hatch3r-board-shared` command at the start of the run.** It contains Board Configuration, Platform Detection, Platform Context, Board Sync Procedure, and tooling directives. Cache all values for the duration of this run.
40
44
 
41
45
  If no board context exists (plain instruction, no PR, no linked issues), skip shared context loading and work from the git diff alone.
42
46
 
@@ -51,6 +55,10 @@ If no board context exists (plain instruction, no PR, no linked issues), skip sh
51
55
  3. **Do NOT re-read shared context files** -- their content is available via always-applied rules or inline in this command.
52
56
  4. **Limit documentation reads.** Read project documentation selectively -- TOC/headers first, full content only for relevant sections.
53
57
 
58
+ ## Run Cache
59
+
60
+ Initialize the run cache at the start of the workflow. See `commands/revision/revision-board-integration.md` for the full schema. The cache tracks: diff, findings with triage routing and fix status, quality agents spawned, errors encountered.
61
+
54
62
  ---
55
63
 
56
64
  ## Workflow
@@ -67,16 +75,22 @@ Rebuild full context in the fresh window. No prior implementation context is ass
67
75
  2. Determine the default branch from `.agents/hatch.json` (`board.defaultBranch`). Fall back to `main` if unavailable.
68
76
  3. Compute the diff: `git diff {defaultBranch}...HEAD --stat` for a summary, then `git diff {defaultBranch}...HEAD` for the full diff.
69
77
  4. Parse the diff summary: files changed, lines added/removed, file types affected.
70
- 5. Identify affected areas from the file paths (e.g., `src/routes/` API, `src/components/` UI, `tests/` testing).
78
+ 5. Identify affected areas from the file paths (e.g., `src/routes/` -> API, `src/components/` -> UI, `tests/` -> testing).
71
79
 
72
80
  #### 1b. Find Associated PR and Issues
73
81
 
74
- 1. Search for an open PR on this branch: `gh pr list --head {branch} --state open --json number,title,body,url --limit 1`.
75
- 2. If a PR exists:
82
+ > Platform-specific CLI commands: see `commands/board/shared-{platform}.md` for PR/issue lookup
83
+
84
+ 1. Detect the platform from `.agents/hatch.json` (`board.platform`). Fall back to GitHub if unavailable.
85
+ 2. Search for an open PR on this branch using the platform CLI:
86
+ - **GitHub:** `gh pr list --head {branch} --state open --json number,title,body,url --limit 1`
87
+ - **Azure DevOps:** `az repos pr list --source-branch {branch} --status active --top 1`
88
+ - **GitLab:** `glab mr list --source-branch {branch} --state opened --per-page 1`
89
+ 3. If a PR exists:
76
90
  - Read the PR body.
77
91
  - Extract linked issues from `Closes #N`, `Fixes #N`, `Relates to #N` references.
78
- - For each linked issue: `gh issue view {N} --json title,body,labels` to read acceptance criteria and labels.
79
- 3. If no PR exists: note this and work from the branch diff alone.
92
+ - For each linked issue: fetch title, body, labels, and acceptance criteria using the platform CLI.
93
+ 4. If no PR exists: note this and work from the branch diff alone.
80
94
 
81
95
  #### 1c. Load Project Rules
82
96
 
@@ -95,6 +109,7 @@ Present a reconstruction summary to the user:
95
109
  ```
96
110
  Revision Context:
97
111
  Branch: {branch}
112
+ Platform: {GitHub / Azure DevOps / GitLab}
98
113
  PR: #{N} — {title} ({url}) | No PR found
99
114
  Linked issues: #{N} — {title} (×{count}) | None
100
115
  Diff: {files_changed} files changed (+{additions} / -{deletions})
@@ -122,7 +137,7 @@ Based on the user's initial response and the diff scope, ask targeted follow-up
122
137
 
123
138
  **If UI changes detected** (components, styles, templates in diff):
124
139
  - "Any visual mismatches -- spacing, alignment, colors, typography?"
125
- - "Does it behave correctly at different viewport sizes?"
140
+ - "Does it render and respond as expected at different viewport sizes?"
126
141
  - "Any interaction issues -- hover states, focus, transitions, animations?"
127
142
 
128
143
  **If API/backend changes detected** (routes, services, middleware in diff):
@@ -264,7 +279,7 @@ If the user attempts to defer a Critical finding, execute the Critical Deferral
264
279
  Deferral rationale: {user's stated rationale}
265
280
  ```
266
281
 
267
- 4. **Flag for triage.** The `Critical-deferred` tag ensures board-fill surfaces this item with elevated visibility during the next triage cycle. Board-fill should treat `Critical-deferred` items as priority:p0 candidates regardless of other signals.
282
+ 4. **Flag for triage.** The `Critical-deferred` tag signals board-fill to surface this item with elevated visibility during the next triage cycle. Board-fill should treat `Critical-deferred` items as priority:p0 candidates regardless of other signals.
268
283
 
269
284
  The user is never blocked — this protocol adds accountability, not a veto.
270
285
 
@@ -298,7 +313,7 @@ If any findings are routed to [DEFER]:
298
313
  2. Present summary:
299
314
  `"Deferred {N} findings to todo.md. Run /hatch3r-board-fill to triage them into an epic with full dependency analysis."`
300
315
 
301
- 3. Cache the deferred findings list for use in Steps 8 and 9.
316
+ 3. Cache the deferred findings list for use in Steps 8 and 9. Update run cache `deferred_findings`.
302
317
 
303
318
  If no findings are routed to [DEFER] (including the "fix all" shortcut), skip this sub-step entirely.
304
319
 
@@ -306,99 +321,19 @@ If no findings are routed to [DEFER] (including the "fix all" shortcut), skip th
306
321
 
307
322
  ### Step 6: Fix Implementation (Sub-Agent Delegation)
308
323
 
309
- Delegate [FIX NOW] findings to specialist sub-agents via the Task tool. Group findings by specialist and parallelize where possible. [DEFER] findings have been appended to `todo.md` in Step 5c and are excluded from this step.
310
-
311
- If all findings were deferred (no [FIX NOW] items), skip Step 6 entirely and proceed to Step 7.
312
-
313
- #### 6a. Group Findings by Specialist
314
-
315
- | Finding Category | Sub-Agent | Protocol |
316
- |-----------------|-----------|----------|
317
- | Bugs, missing features, error handling, logic fixes | `hatch3r-implementer` | hatch3r-implementer agent protocol |
318
- | Dead code, unused imports, type fixes, lint errors | `hatch3r-lint-fixer` | hatch3r-lint-fixer agent protocol |
319
- | Missing tests, insufficient coverage | `hatch3r-test-writer` | hatch3r-test-writer agent protocol |
320
-
321
- If findings span multiple independent areas, spawn one `hatch3r-implementer` per area to parallelize.
322
-
323
- #### 6b. Spawn Sub-Agents
324
-
325
- Use the Task tool with `subagent_type: "generalPurpose"`. Launch as many independent sub-agents in parallel as the platform supports.
324
+ > Full details: see `commands/revision/revision-delegation.md`
326
325
 
327
- Each sub-agent prompt MUST include:
328
- - The specific findings to address (file paths, line numbers, descriptions, expected behavior).
329
- - Instruction to follow the corresponding agent protocol (e.g., "Follow the hatch3r-implementer agent protocol").
330
- - All `scope: always` rule directives from `.agents/rules/` -- sub-agents do not inherit rules automatically.
331
- - Acceptance criteria from linked issues (if available from Step 1b).
332
- - Relevant learnings from `.agents/learnings/` (if found in Step 1d).
333
- - Explicit instruction: do NOT create branches, commits, or PRs.
334
- - Confidence expression requirement: rate every recommendation and finding as high/medium/low confidence per the quality charter (`agents/shared/quality-charter.md`). High = verified against current code. Medium = pattern-based, not fully verified. Low = best judgment, recommend human review.
326
+ Delegate [FIX NOW] findings to specialist sub-agents. The delegation protocol covers complexity assessment (using `hatch3r-deep-context` scoring), blast-radius-aware finding grouping, expanded sub-agent prompt templates, and cross-agent conflict resolution.
335
327
 
336
- #### 6c. Await and Integrate Results
337
-
338
- 1. Await all sub-agents. Collect their structured results (files changed, tests written, issues encountered).
339
- 2. If any sub-agent reports BLOCKED or PARTIAL, **ASK** the user how to proceed (skip, provide guidance, fix manually).
340
- 3. If sub-agents modified overlapping files, review for conflicts and resolve.
341
- 4. Apply all changes to the working tree.
328
+ If all findings were deferred (no [FIX NOW] items), skip Step 6 entirely and proceed to Step 7.
342
329
 
343
330
  ---
344
331
 
345
332
  ### Step 7: Quality Verification
346
333
 
347
- Run the project's quality checks. Refer to `package.json` scripts, `README.md`, or `AGENTS.md` for the appropriate commands.
348
-
349
- #### 7a. Run Quality Gates
350
-
351
- 1. Lint check (e.g., `npm run lint`)
352
- 2. Type check (e.g., `npm run typecheck`)
353
- 3. Test suite (e.g., `npm run test`)
354
-
355
- #### 7b. Verify User-Reported Issues
356
-
357
- Walk through each critical and important finding from Step 5. Verify it is addressed by the changes made in Step 6. If acceptance criteria exist from linked issues, verify each criterion.
358
-
359
- For each verified finding and acceptance criterion, rate verification confidence: high (fix confirmed via tests or direct observation), medium (code change addresses the issue but edge cases not independently tested), low (fix applied but uncertain of completeness).
360
-
361
- #### 7c. Review Loop
362
-
363
- Run an iterative review loop (max 3 iterations) until 0 Critical + 0 Warning findings remain:
334
+ > Full details: see `commands/revision/revision-quality.md`
364
335
 
365
- 1. Spawn `hatch3r-reviewer` sub-agent via the Task tool (`subagent_type: "generalPurpose"`).
366
-
367
- The reviewer prompt MUST include:
368
- - The diff of all changes made (use `git diff` on the working tree).
369
- - All `scope: always` rule directives from `.agents/rules/`.
370
- - Iteration number and previous findings (if not the first iteration).
371
- - Confidence expression requirement: rate every recommendation and finding as high/medium/low confidence per the quality charter (`agents/shared/quality-charter.md`). High = verified against current code. Medium = pattern-based, not fully verified. Low = best judgment, recommend human review.
372
-
373
- 2. Process reviewer output:
374
- - If **0 Critical and 0 Warning** findings: review loop is clean. Proceed to Step 7d.
375
- - If Critical or Warning findings remain: spawn `hatch3r-fixer` sub-agent to address them, then re-run the reviewer (next iteration).
376
-
377
- 3. If 3 iterations complete and findings remain, **ASK** the user whether to proceed or fix manually.
378
-
379
- After each reviewer iteration, assess the reviewer's findings confidence: if the reviewer rates any finding as low-confidence, flag it separately in the ASK prompt so the user can prioritize human review of uncertain findings.
380
-
381
- 4. After any fixes, re-run quality gates (Step 7a) to verify nothing broke.
382
-
383
- #### 7d. Final Quality
384
-
385
- After the review loop is clean, spawn both agents in parallel via the Task tool:
386
-
387
- 1. `hatch3r-test-writer` — write or update tests for code changes.
388
- 2. `hatch3r-security-auditor` — security review of code changes.
389
-
390
- Both prompts MUST include:
391
- - The diff of all changes made.
392
- - All `scope: always` rule directives from `.agents/rules/`.
393
- - Confidence expression requirement: rate every recommendation and finding as high/medium/low confidence per the quality charter (`agents/shared/quality-charter.md`). High = verified against current code. Medium = pattern-based, not fully verified. Low = best judgment, recommend human review.
394
-
395
- Apply any resulting changes (new tests, security fixes). Re-run quality gates (Step 7a) if changes were made.
396
-
397
- #### 7e. Handle Failures
398
-
399
- - If quality checks fail: identify the specific failures, fix them directly (for simple issues) or loop back to Step 6 with specific failures.
400
- - Max 2 retry loops on quality check failures. After 2 retries, **ASK** the user for guidance: "Quality checks still failing. Fix confidence: {high/medium/low — based on whether root cause is identified}."
401
- - If a user-reported issue was not fully addressed: **ASK** the user whether to attempt another fix or defer.
336
+ Two-stage quality pipeline: Stage 1 runs a sequential review loop (`hatch3r-reviewer` -> `hatch3r-fixer`, max 3 iterations). Stage 2 spawns final quality specialists in parallel — mandatory (`hatch3r-test-writer`, `hatch3r-security-auditor`), evaluated (`hatch3r-docs-writer`), and conditional (`hatch3r-a11y-auditor`, `hatch3r-perf-profiler`, `hatch3r-lint-fixer`).
402
337
 
403
338
  ---
404
339
 
@@ -429,6 +364,8 @@ git push
429
364
 
430
365
  If `git push` fails (e.g., remote branch does not exist yet), use `git push -u origin {branch}`.
431
366
 
367
+ **Post-commit board integration:** If board context exists, update the PR description with a revision summary. See `commands/revision/revision-board-integration.md` for the full procedure.
368
+
432
369
  ---
433
370
 
434
371
  ### Step 9: Merge Readiness Assessment
@@ -459,7 +396,17 @@ Verdict: READY / NOT READY ({remaining items})
459
396
 
460
397
  A deferred finding counts as "tracked" not "unaddressed" -- it does not block merge readiness.
461
398
 
462
- #### 9b. Present Assessment
399
+ #### 9b. Board Housekeeping
400
+
401
+ > Full details: see `commands/revision/revision-board-integration.md`
402
+
403
+ When board context exists, run the board housekeeping steps:
404
+ - **9b.i. Refresh Board Dashboard** (mandatory when `meta:board-overview` exists).
405
+ - **9b.ii. Lightweight Reconciliation** — verify PR body integrity, deferred findings in todo.md, and issue status consistency.
406
+
407
+ When no board context exists, skip 9b entirely.
408
+
409
+ #### 9c. Present Assessment
463
410
 
464
411
  **ASK:** "Revision complete. {verdict}. Options: (a) ready to merge, (b) run another revision cycle with new feedback, (c) done for now."
465
412
 
@@ -489,27 +436,8 @@ Capture revision-specific learnings. Focus on patterns that inform future implem
489
436
 
490
437
  ---
491
438
 
492
- ## Error Handling
493
-
494
- - **Git diff failure**: If `git diff` fails (e.g., no commits on branch, detached HEAD), **ASK** the user for the correct branch or base ref.
495
- - **No changes detected**: If the diff is empty, inform the user and exit. There is nothing to revise.
496
- - **PR/issue fetch failure**: Proceed without PR/issue context. Work from the diff alone. Warn the user that acceptance criteria are unavailable.
497
- - **Sub-agent failure**: Retry once. If the retry fails, fall back to direct implementation for that finding.
498
- - **Quality check failure after 2 retries**: Present the specific failures and **ASK** the user whether to proceed with a partial fix commit or continue debugging.
499
- - **Push failure**: Present the error. Common fixes: `git push -u origin {branch}` for new branches, `git pull --rebase` for diverged branches.
500
- - **Context degradation (>25 turns)**: Suggest starting a fresh chat with a progress summary. The revision command is designed for fresh contexts -- it can be re-run.
501
-
502
- ## Guardrails
503
-
504
- - **Never skip ASK checkpoints.** Every significant decision requires user confirmation.
505
- - **Never skip the proactive scan (Step 4)** -- even if the user reports no issues. Agents leave leftovers.
506
- - **Always run quality checks (Step 7)** before committing. Never commit code that fails lint, typecheck, or tests.
507
- - **Stay within the revision scope.** Fix what was reported and what the scan found. Do not refactor unrelated code, add new features, or expand beyond the original implementation's intent.
508
- - **Always commit and push** at the end of a revision cycle. The user invoked this command to get fixes merged -- do not exit without committing (unless the user explicitly abandons).
509
- - **Respect the original implementation's architecture.** Revision fixes issues within the existing patterns. If the architecture itself is flawed, note it as a finding but do not restructure -- suggest a separate refactor instead.
510
- - **One sub-agent per concern.** Delegate to specialist sub-agents based on finding type. Do not ask the implementer to also fix lint issues or write tests.
511
- - **Git safety.** Never force-push. Never rewrite history. Always create new commits for revision changes.
512
- - **This command composes existing hatch3r agents** -- it does not replace them. The reviewer, implementer, lint-fixer, and test-writer agents handle the actual work.
513
- - **Critical findings default to FIX NOW.** If the user overrides this, execute the Critical Deferral Protocol (Step 5b): structured warning with specific risk, require written rationale, record in todo.md with `Critical-deferred` tag, and flag for elevated triage in board-fill. The user is never blocked — rationale adds accountability, not a veto.
514
- - **Deferred findings go to `todo.md`, not directly to GitHub issues.** The board-fill pipeline handles triage, epic creation, dependency analysis, and readiness assessment. Revision does not shortcut this process.
515
- - **Always format deferred items as a single epic block** in `todo.md`, regardless of count. This ensures board-fill groups them together during the next run.
439
+ ## Auto-Advance Mode, Error Handling, and Guardrails
440
+
441
+ > Full details: see `commands/revision/revision-modes.md`
442
+
443
+ The modes file contains: auto-advance mode (`--auto`), safety guardrails, error handling, and session report format for revision.
@@ -3,6 +3,7 @@ id: hatch3r-roadmap
3
3
  type: command
4
4
  description: Generate a dual-lens phased roadmap (business milestones + technical milestones) from specs and vision using parallel researcher sub-agents, output to todo.md in the format that hatch3r-board-fill expects.
5
5
  tags: [planning, greenfield]
6
+ quality_charter: agents/shared/quality-charter.md
6
7
  ---
7
8
  # Roadmap — Generate Phased Roadmap from Specs & Vision
8
9
 
@@ -353,7 +354,7 @@ Business-Critical Path: {biz milestone 1} → {biz milestone 2} → {launch}
353
354
 
354
355
  **ASK:** "Here is the proposed dual-lens roadmap with business and technical milestones. Review:
355
356
  - Are the business milestones and their timelines realistic?
356
- - Are the technical prerequisites correctly mapped?
357
+ - Are the technical prerequisites mapped with accurate dependency links?
357
358
  - Adjust priorities, add/remove items, change grouping?
358
359
  (confirm / adjust)"
359
360
 
@@ -396,7 +397,7 @@ Write `todo.md` in the exact format that `hatch3r-board-fill` expects, with `[BI
396
397
  **Format requirements:**
397
398
 
398
399
  - Each item on one line as `- [ ] **[BIZ/TECH/BOTH] {bold title}**: {description}`.
399
- - Include `Ref:` with source spec/ADR path when the item was derived from a specific document. Use `docs/specs/business/` or `docs/specs/technical/` paths as appropriate.
400
+ - Include `Ref:` with source spec/ADR path when the item was derived from a specific document. Use `docs/specs/business/` or `docs/specs/technical/` paths matching the item's category.
400
401
  - For business items: include revenue/conversion/retention impact where known.
401
402
  - For technical items: include what business milestone they enable where applicable.
402
403
  - For time-sensitive items: include deadline or market window.
@@ -465,7 +466,7 @@ If yes or review-first: spawn a `hatch3r-docs-writer` sub-agent via the Task too
465
466
  ```markdown
466
467
  # {Project Name} — Agent Instructions
467
468
 
468
- > Auto-generated by hatch3r-roadmap on {today's date}. Review and adjust as needed.
469
+ > Auto-generated by hatch3r-roadmap on {today's date}. Review and adjust before use.
469
470
 
470
471
  ## Project Purpose
471
472
 
@@ -560,7 +561,7 @@ Hatch3r's breadth across 13+ adapters (Claude, Cursor, Windsurf, Cline, Copilot,
560
561
  - **Never overwrite todo.md without explicit user confirmation.**
561
562
  - **todo.md format must be compatible with board-fill** — markdown checklist with bold titles, priority headers matching `## P{N} — {Label}`, items tagged with `[BIZ]`/`[TECH]`/`[BOTH]`.
562
563
  - **Keep items at the right granularity** — epic-level for complex features (XL effort), standalone for simple tasks (S/M effort).
563
- - **Always reference source documentation** (specs, ADRs) where items were derived from. Use `docs/specs/business/` or `docs/specs/technical/` paths as appropriate.
564
+ - **Always reference source documentation** (specs, ADRs) where items were derived from. Use `docs/specs/business/` or `docs/specs/technical/` paths matching the item's category.
564
565
  - **Do not duplicate work already tracked in GitHub issues.**
565
566
  - **Effort estimates are rough and clearly labeled as estimates.**
566
567
  - **Respect existing priority conventions in the project.**
@@ -3,6 +3,7 @@ id: hatch3r-rule-customize
3
3
  type: command
4
4
  description: Configure per-rule customization including scope overrides, description changes, enable/disable control, and project-specific markdown instructions
5
5
  tags: [customize]
6
+ quality_charter: agents/shared/quality-charter.md
6
7
  ---
7
8
 
8
9
  ## Agent Pipeline
@@ -3,6 +3,7 @@ id: hatch3r-security-audit
3
3
  type: command
4
4
  description: Create a full-product security audit epic with one sub-issue per project module
5
5
  tags: [maintenance, security]
6
+ quality_charter: agents/shared/quality-charter.md
6
7
  ---
7
8
 
8
9
  ## Agent Pipeline
@@ -3,6 +3,7 @@ id: hatch3r-skill-customize
3
3
  type: command
4
4
  description: Configure per-skill customization including description overrides, enable/disable control, and project-specific markdown instructions
5
5
  tags: [customize]
6
+ quality_charter: agents/shared/quality-charter.md
6
7
  ---
7
8
 
8
9
  ## Agent Pipeline
@@ -3,6 +3,7 @@ id: hatch3r-test-plan
3
3
  type: command
4
4
  description: Plan a comprehensive test strategy -- spawn parallel researchers, produce test plan spec with coverage targets, priority ordering, test case outlines, and structured todo.md entries for board-fill.
5
5
  tags: [core, planning]
6
+ quality_charter: agents/shared/quality-charter.md
6
7
  ---
7
8
 
8
9
  ## Agent Pipeline
@@ -58,7 +59,7 @@ Test Planning Brief:
58
59
  Constraints: {list}
59
60
  ```
60
61
 
61
- **ASK:** "Does this capture the test planning scope correctly? Adjust anything before I send this to the research phase."
62
+ **ASK:** "Does this capture the test planning scope? Adjust anything before I send this to the research phase."
62
63
 
63
64
  #### Step 1b: Dimension Probing (Test Strategy Elicitation)
64
65
 
@@ -76,7 +77,7 @@ After the test planning brief is confirmed, probe for missing requirements acros
76
77
  - **Flaky test tolerance**: Existing flaky tests? Quarantine process in place? Retry budget in CI?
77
78
  3. Skip dimensions that the brief already addresses clearly.
78
79
 
79
- **ASK:** "Before research begins, I have {N} questions to ensure the test plan covers everything:
80
+ **ASK:** "Before research begins, I have {N} questions to confirm the test plan covers all relevant dimensions:
80
81
  {numbered question list -- each with the dimension label and why the answer matters}
81
82
 
82
83
  Answer these now, or say 'use defaults' for any where you're comfortable with a reasonable default."
@@ -3,6 +3,7 @@ id: hatch3r-workflow
3
3
  type: command
4
4
  description: Guided development lifecycle with 4 phases (Analyze, Plan, Implement, Review) and scale-adaptive Quick Mode for small tasks.
5
5
  tags: [core, implementation]
6
+ quality_charter: agents/shared/quality-charter.md
6
7
  ---
7
8
  # Development Workflow -- Guided Lifecycle for Structured Implementation
8
9
 
@@ -304,6 +305,10 @@ Each specialist sub-agent prompt MUST include:
304
305
 
305
306
  Await all specialist sub-agents. Apply their feedback (fixes, additional tests, documentation updates).
306
307
 
308
+ #### 4b.1. Re-Review After Phase 4 Fixes
309
+
310
+ If any Phase 4 specialist produced fixes (not just findings), run a lightweight re-review to catch regressions introduced by the specialist changes. Spawn `hatch3r-reviewer` with a focused prompt covering only the files modified by Phase 4 specialists. If the re-review finds Critical findings, spawn `hatch3r-fixer` and re-review once more (max 1 additional iteration). This prevents Phase 4 fixes from bypassing the review gate.
311
+
307
312
  #### 4c. Verify Against Acceptance Criteria
308
313
 
309
314
  Check each acceptance criterion from the original task or issue. Mark as met or not-met with evidence.
@@ -0,0 +1,87 @@
1
+ ---
2
+ id: hatch3r-revision-board-integration
3
+ type: command
4
+ description: Board integration for revision. Covers run cache schema, post-commit PR updates, dashboard refresh (Step 9a), and lightweight reconciliation (Step 9b).
5
+ tags: [implementation, team]
6
+ quality_charter: agents/shared/quality-charter.md
7
+ ---
8
+ # Revision — Board Integration
9
+
10
+ Board integration protocols for `hatch3r-revision`. Referenced from the core command file. All board integration steps are conditional — they execute only when board context exists (PR with linked issues found in Step 1b). When no board context exists, skip all steps in this file silently.
11
+
12
+ ---
13
+
14
+ ## Run Cache
15
+
16
+ Initialize at the start of the revision workflow (before Step 1). Maintain throughout the run:
17
+
18
+ | Key | Type | Description |
19
+ |-----|------|-------------|
20
+ | `diff_cache` | `string` | Cached diff from Step 1 (reused per token-saving directives) |
21
+ | `findings` | `Map<id, {description, severity, route, status}>` | All findings with triage routing and fix status |
22
+ | `fixed_findings` | `id[]` | Finding IDs resolved in this run |
23
+ | `deferred_findings` | `id[]` | Finding IDs written to todo.md |
24
+ | `quality_agents` | `{agent, status, findings_count}[]` | Specialist agents spawned and their results |
25
+ | `pr_updated` | `boolean` | Whether PR description was updated with revision summary |
26
+ | `errors` | `{step, message, recoverable}[]` | All errors encountered during the run |
27
+
28
+ ---
29
+
30
+ ## Post-Commit Board Integration (After Step 8)
31
+
32
+ After committing and pushing revision changes, update the PR if board context exists:
33
+
34
+ 1. **Update PR description** with a revision summary appended to the existing body:
35
+
36
+ ```markdown
37
+ ---
38
+ ## Revision Summary ({date})
39
+
40
+ **Fixed ({N}):**
41
+ - {finding description} ({severity})
42
+ - ...
43
+
44
+ **Deferred to todo.md ({M}):**
45
+ - {finding description} ({severity})
46
+ - ...
47
+
48
+ **Quality agents:** {list of agents spawned}
49
+ **Overall confidence:** {high/medium/low}
50
+ ```
51
+
52
+ 2. Do NOT change issue status labels. Revision does not alter the issue lifecycle — the original PR's `Closes #N` references handle that on merge.
53
+
54
+ 3. Do NOT modify `Closes #N` / `Relates to #N` references in the PR body. The original references from board-pickup are authoritative.
55
+
56
+ ---
57
+
58
+ ## Step 9a: Refresh Board Dashboard
59
+
60
+ **This step is mandatory when board context exists. Skip silently when no board context.**
61
+
62
+ If a `meta:board-overview` issue exists on the board, refresh it now using cached board data. Use the same procedure as `hatch3r-board-pickup` Step 9a: update with current board state reflecting any changes from this revision session.
63
+
64
+ Do NOT re-fetch all issues. Use cached data from Step 1 combined with mutations from this run (findings fixed, PR updated). Skip silently if no `meta:board-overview` issue exists.
65
+
66
+ ---
67
+
68
+ ## Step 9b: Lightweight Reconciliation
69
+
70
+ **This step is mandatory when board context exists. Skip silently when no board context.**
71
+
72
+ Run a focused reconciliation (not the full board-shared reconciliation procedure, since revision does not create or update issues):
73
+
74
+ 1. **PR body integrity:** Verify the PR body still contains correct `Closes #N` references for all linked issues after the revision summary was appended. If any references were accidentally removed or corrupted, restore them.
75
+
76
+ 2. **Deferred findings integrity:** If findings were deferred in Step 5c, verify they are written to `todo.md` with correct severity tags and epic grouping format. Report any write failures.
77
+
78
+ 3. **Orphaned status check:** For each issue linked to this PR, verify the issue still has `status:in-review` label. If any issue has drifted to a different status (e.g., manually changed during the revision session), warn the user.
79
+
80
+ Output a reconciliation report:
81
+
82
+ ```
83
+ Reconciliation:
84
+ PR body: {ok / {N} references restored}
85
+ Deferred findings: {ok / {N} write failures}
86
+ Issue status: {ok / {N} status drift warnings}
87
+ ```
@@ -0,0 +1,93 @@
1
+ ---
2
+ id: hatch3r-revision-delegation
3
+ type: command
4
+ description: Fix delegation protocol for revision Step 6. Covers complexity-aware grouping, blast radius context, sub-agent prompt templates, and cross-agent conflict resolution.
5
+ tags: [implementation, team]
6
+ quality_charter: agents/shared/quality-charter.md
7
+ ---
8
+ # Revision — Fix Delegation (Step 6)
9
+
10
+ Delegation details for Step 6 of `hatch3r-revision`. Referenced from the core command file.
11
+
12
+ ---
13
+
14
+ ## 6.pre: Complexity Assessment
15
+
16
+ Before delegating [FIX NOW] findings, score the aggregate fix batch using `hatch3r-deep-context` complexity signals. Score across the full set of findings, not per-finding:
17
+
18
+ | Signal | Weight | Detection |
19
+ |--------|--------|-----------|
20
+ | Findings span multiple modules/layers | +3 | Count distinct directories across all [FIX NOW] findings |
21
+ | Any finding involves behavioral contract changes (API, types, events) | +2 | Check finding descriptions for interface/signature changes |
22
+ | Findings touch security-sensitive areas (auth, payments, data access) | +2 | Match affected files against security-sensitive directories |
23
+ | Total affected files > 5 | +2 | Count distinct files across all findings |
24
+ | Any finding requires new dependencies or integrations | +2 | Check whether fixes introduce new imports or services |
25
+
26
+ ### Tier Assignment
27
+
28
+ | Total Weight | Tier | Action |
29
+ |-------------|------|--------|
30
+ | 0–2 | 1 (Light) | Proceed directly to 6a. No research needed |
31
+ | 3–5 | 2 (Standard) | Spawn `hatch3r-researcher` with `similar-implementation` at `quick` depth before delegating. Use discovered reference patterns to inform fix conventions |
32
+ | 6+ | 3 (Deep) | Spawn `hatch3r-researcher` with `codebase-impact` at `deep` depth. **Warn the user** that fix scope may warrant a new board issue rather than a revision fix |
33
+
34
+ For Tier 2/3: cache researcher output (reference conventions, blast radius data) for inclusion in sub-agent prompts below.
35
+
36
+ ---
37
+
38
+ ## 6a. Group Findings by Specialist
39
+
40
+ | Finding Category | Sub-Agent | Protocol |
41
+ |-----------------|-----------|----------|
42
+ | Bugs, missing features, error handling, logic fixes | `hatch3r-implementer` | hatch3r-implementer agent protocol |
43
+ | Dead code, unused imports, type fixes, lint errors | `hatch3r-lint-fixer` | hatch3r-lint-fixer agent protocol |
44
+ | Missing tests, insufficient coverage | `hatch3r-test-writer` | hatch3r-test-writer agent protocol |
45
+
46
+ ### Blast-Radius-Aware Grouping
47
+
48
+ When multiple findings affect the same file or module, batch them to a single sub-agent to avoid cross-agent file conflicts:
49
+
50
+ 1. Build a file-to-findings map from all [FIX NOW] items.
51
+ 2. Findings in the same file go to the same sub-agent instance, even if they span categories (use the highest-priority specialist: implementer > lint-fixer > test-writer).
52
+ 3. Findings in disjoint files can run in parallel sub-agents.
53
+ 4. If findings span independent areas within the same specialist type, spawn one sub-agent per area to parallelize.
54
+
55
+ ---
56
+
57
+ ## 6b. Spawn Sub-Agents
58
+
59
+ Use the Task tool with `subagent_type: "generalPurpose"`. Launch independent sub-agents in parallel.
60
+
61
+ Each sub-agent prompt MUST include:
62
+
63
+ 1. The specific findings to address (file paths, line numbers, descriptions, expected behavior).
64
+ 2. Instruction to follow the corresponding agent protocol (e.g., "Follow the hatch3r-implementer agent protocol").
65
+ 3. All `scope: always` rule directives from `.agents/rules/` — sub-agents do not inherit rules automatically.
66
+ 4. Acceptance criteria from linked issues (if available from Step 1b).
67
+ 5. Relevant learnings from `.agents/learnings/` (if found in Step 1d).
68
+ 6. Explicit instruction: do NOT create branches, commits, or PRs.
69
+ 7. Confidence expression requirement: rate every recommendation and finding as high/medium/low confidence per the quality charter (`agents/shared/quality-charter.md`). High = verified against current code. Medium = pattern-based, not fully verified. Low = best judgment, recommend human review.
70
+ 8. Revision-specific constraint: "You are fixing existing code, not implementing new features. Stay within the architecture established by the original implementation."
71
+
72
+ **When Tier 2/3 research was performed (6.pre):**
73
+
74
+ 9. Reference conventions from `similar-implementation` output — triggers the implementer's Convention Lock step.
75
+ 10. Blast radius data from `codebase-impact` output (Tier 3) — transitive dependency trace informing which consumers and contracts the fix must preserve.
76
+
77
+ ---
78
+
79
+ ## 6c. Await and Integrate Results
80
+
81
+ 1. Await all sub-agents. Collect their structured results (files changed, tests written, issues encountered).
82
+ 2. If any sub-agent reports BLOCKED or PARTIAL, **ASK** the user how to proceed (skip, provide guidance, fix manually).
83
+
84
+ ### Cross-Agent Conflict Resolution
85
+
86
+ When sub-agents modified overlapping files:
87
+
88
+ - **Disjoint regions** (different functions, different sections): accept both sets of changes.
89
+ - **Overlapping regions** (same function or block): merge using the larger-scope change as the base, applying the smaller change on top. If merging is ambiguous, present both versions to the user.
90
+ - **Semantic conflicts** (contradictory logic): surface to the user with both sub-agents' rationale. Do not auto-resolve semantic conflicts.
91
+
92
+ 3. Apply all resolved changes to the working tree.
93
+ 4. Update the run cache with fix results (files changed, findings addressed).