hatch3r 1.3.0 → 1.5.0

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 (175) hide show
  1. package/README.md +12 -7
  2. package/agents/hatch3r-a11y-auditor.md +18 -11
  3. package/agents/hatch3r-architect.md +27 -12
  4. package/agents/hatch3r-ci-watcher.md +30 -9
  5. package/agents/hatch3r-context-rules.md +18 -8
  6. package/agents/hatch3r-dependency-auditor.md +30 -15
  7. package/agents/hatch3r-devops.md +18 -13
  8. package/agents/hatch3r-docs-writer.md +33 -12
  9. package/agents/hatch3r-fixer.md +46 -9
  10. package/agents/hatch3r-implementer.md +21 -9
  11. package/agents/hatch3r-learnings-loader.md +24 -7
  12. package/agents/hatch3r-lint-fixer.md +18 -9
  13. package/agents/hatch3r-perf-profiler.md +26 -10
  14. package/agents/hatch3r-researcher.md +57 -919
  15. package/agents/hatch3r-reviewer.md +29 -10
  16. package/agents/hatch3r-security-auditor.md +25 -10
  17. package/agents/hatch3r-test-writer.md +29 -9
  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 +31 -0
  39. package/agents/shared/quality-charter.md +96 -0
  40. package/checks/README.md +1 -0
  41. package/checks/accessibility.md +55 -0
  42. package/commands/board/pickup-azure-devops.md +5 -0
  43. package/commands/board/pickup-delegation-multi.md +9 -1
  44. package/commands/board/pickup-delegation.md +4 -0
  45. package/commands/board/pickup-github.md +5 -0
  46. package/commands/board/pickup-gitlab.md +5 -0
  47. package/commands/board/pickup-modes.md +1 -0
  48. package/commands/board/pickup-post-impl.md +9 -1
  49. package/commands/board/shared-azure-devops.md +14 -3
  50. package/commands/board/shared-board-overview.md +1 -0
  51. package/commands/board/shared-github.md +2 -0
  52. package/commands/board/shared-gitlab.md +10 -2
  53. package/commands/hatch3r-agent-customize.md +6 -1
  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 +124 -7
  58. package/commands/hatch3r-board-init.md +7 -3
  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 +71 -5
  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 +6 -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 +6 -1
  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 +31 -3
  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 +138 -17
  81. package/commands/hatch3r-roadmap.md +5 -4
  82. package/commands/hatch3r-rule-customize.md +5 -0
  83. package/commands/hatch3r-security-audit.md +1 -0
  84. package/commands/hatch3r-skill-customize.md +5 -0
  85. package/commands/hatch3r-test-plan.md +3 -2
  86. package/commands/hatch3r-workflow.md +15 -1
  87. package/dist/cli/index.js +7595 -4548
  88. package/dist/cli/index.js.map +1 -1
  89. package/hooks/hatch3r-ci-failure.md +1 -0
  90. package/hooks/hatch3r-file-save.md +1 -0
  91. package/hooks/hatch3r-post-merge.md +1 -0
  92. package/hooks/hatch3r-pre-commit.md +1 -0
  93. package/hooks/hatch3r-pre-push.md +1 -0
  94. package/hooks/hatch3r-session-start.md +1 -0
  95. package/package.json +30 -12
  96. package/rules/hatch3r-accessibility-standards.md +2 -1
  97. package/rules/hatch3r-accessibility-standards.mdc +1 -1
  98. package/rules/hatch3r-agent-orchestration-detail.md +207 -0
  99. package/rules/hatch3r-agent-orchestration-detail.mdc +202 -0
  100. package/rules/hatch3r-agent-orchestration.md +161 -318
  101. package/rules/hatch3r-agent-orchestration.mdc +212 -154
  102. package/rules/hatch3r-api-design.md +2 -1
  103. package/rules/hatch3r-api-design.mdc +1 -1
  104. package/rules/hatch3r-browser-verification.md +4 -2
  105. package/rules/hatch3r-browser-verification.mdc +1 -0
  106. package/rules/hatch3r-ci-cd.md +2 -1
  107. package/rules/hatch3r-ci-cd.mdc +1 -1
  108. package/rules/hatch3r-code-standards.md +15 -2
  109. package/rules/hatch3r-code-standards.mdc +22 -2
  110. package/rules/hatch3r-component-conventions.md +2 -1
  111. package/rules/hatch3r-component-conventions.mdc +1 -1
  112. package/rules/hatch3r-data-classification.md +2 -1
  113. package/rules/hatch3r-data-classification.mdc +1 -1
  114. package/rules/hatch3r-deep-context.md +26 -1
  115. package/rules/hatch3r-deep-context.mdc +54 -8
  116. package/rules/hatch3r-dependency-management.md +2 -1
  117. package/rules/hatch3r-dependency-management.mdc +17 -5
  118. package/rules/hatch3r-feature-flags.md +2 -0
  119. package/rules/hatch3r-feature-flags.mdc +1 -0
  120. package/rules/hatch3r-git-conventions.md +2 -1
  121. package/rules/hatch3r-git-conventions.mdc +2 -1
  122. package/rules/hatch3r-i18n.md +2 -1
  123. package/rules/hatch3r-i18n.mdc +1 -1
  124. package/rules/hatch3r-learning-consult.md +11 -1
  125. package/rules/hatch3r-learning-consult.mdc +11 -1
  126. package/rules/hatch3r-migrations.md +2 -1
  127. package/rules/hatch3r-migrations.mdc +12 -1
  128. package/rules/hatch3r-observability-logging.md +34 -0
  129. package/rules/hatch3r-observability-logging.mdc +30 -0
  130. package/rules/hatch3r-observability-metrics.md +74 -0
  131. package/rules/hatch3r-observability-metrics.mdc +70 -0
  132. package/rules/hatch3r-observability-tracing-detail.md +160 -0
  133. package/rules/hatch3r-observability-tracing-detail.mdc +63 -0
  134. package/rules/hatch3r-observability-tracing.md +86 -0
  135. package/rules/hatch3r-observability-tracing.mdc +77 -0
  136. package/rules/hatch3r-observability.md +9 -448
  137. package/rules/hatch3r-observability.mdc +7 -159
  138. package/rules/hatch3r-performance-budgets.md +2 -0
  139. package/rules/hatch3r-performance-budgets.mdc +1 -0
  140. package/rules/hatch3r-secrets-management.md +2 -1
  141. package/rules/hatch3r-secrets-management.mdc +1 -1
  142. package/rules/hatch3r-security-patterns.md +3 -2
  143. package/rules/hatch3r-security-patterns.mdc +12 -1
  144. package/rules/hatch3r-testing.md +12 -2
  145. package/rules/hatch3r-testing.mdc +11 -2
  146. package/rules/hatch3r-theming.md +3 -2
  147. package/rules/hatch3r-theming.mdc +1 -1
  148. package/rules/hatch3r-tooling-hierarchy.md +3 -2
  149. package/rules/hatch3r-tooling-hierarchy.mdc +19 -5
  150. package/skills/hatch3r-a11y-audit/SKILL.md +11 -4
  151. package/skills/hatch3r-agent-customize/SKILL.md +5 -72
  152. package/skills/hatch3r-api-spec/SKILL.md +9 -2
  153. package/skills/hatch3r-architecture-review/SKILL.md +7 -0
  154. package/skills/hatch3r-bug-fix/SKILL.md +16 -7
  155. package/skills/hatch3r-ci-pipeline/SKILL.md +8 -1
  156. package/skills/hatch3r-command-customize/SKILL.md +5 -62
  157. package/skills/hatch3r-context-health/SKILL.md +23 -2
  158. package/skills/hatch3r-cost-tracking/SKILL.md +16 -6
  159. package/skills/hatch3r-customize/SKILL.md +124 -0
  160. package/skills/hatch3r-dep-audit/SKILL.md +9 -2
  161. package/skills/hatch3r-feature/SKILL.md +12 -4
  162. package/skills/hatch3r-gh-agentic-workflows/SKILL.md +7 -0
  163. package/skills/hatch3r-incident-response/SKILL.md +7 -0
  164. package/skills/hatch3r-issue-workflow/SKILL.md +8 -1
  165. package/skills/hatch3r-logical-refactor/SKILL.md +8 -1
  166. package/skills/hatch3r-migration/SKILL.md +7 -0
  167. package/skills/hatch3r-perf-audit/SKILL.md +9 -2
  168. package/skills/hatch3r-pr-creation/SKILL.md +8 -1
  169. package/skills/hatch3r-qa-validation/SKILL.md +8 -1
  170. package/skills/hatch3r-recipe/SKILL.md +8 -1
  171. package/skills/hatch3r-refactor/SKILL.md +10 -2
  172. package/skills/hatch3r-release/SKILL.md +8 -1
  173. package/skills/hatch3r-rule-customize/SKILL.md +5 -65
  174. package/skills/hatch3r-skill-customize/SKILL.md +5 -62
  175. package/skills/hatch3r-visual-refactor/SKILL.md +12 -5
@@ -3,6 +3,7 @@ id: hatch3r-board-pickup-delegation-multi
3
3
  type: command
4
4
  description: Multi-issue sub-agent delegation protocols for board-pickup Steps 6b (epics) and 6c (batch). Covers level-by-level parallel execution, shared context, and quality pipelines.
5
5
  tags: [board, team]
6
+ quality_charter: agents/shared/quality-charter.md
6
7
  ---
7
8
  # Board Pickup — Multi-Issue Delegation (Steps 6b, 6c)
8
9
 
@@ -80,6 +81,7 @@ For each dependency level, starting at Level 1:
80
81
  - Relevant learnings from `.agents/learnings/` (from Step 6.pre).
81
82
  - Instruction to use GitHub MCP for issue reads, and follow the project's tooling hierarchy for external knowledge augmentation.
82
83
  - Explicit instruction: do NOT create branches, commits, or PRs.
84
+ - 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.
83
85
 
84
86
  3. **Await all sub-agents in the current level.** Collect their structured results (files changed, tests written, issues encountered).
85
87
 
@@ -147,6 +149,7 @@ For each dependency level, starting at Level 1:
147
149
  - All `scope: always` rule directives from `.agents/rules/` — subagents do not inherit rules automatically.
148
150
  - Relevant learnings from `.agents/learnings/` (from Step 6.pre).
149
151
  - Explicit instruction: do NOT create branches, commits, or PRs.
152
+ - 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.
150
153
 
151
154
  3. **Await all sub-agents in the current level.** Collect their structured results (files changed, tests written, issues encountered).
152
155
 
@@ -161,7 +164,11 @@ For each dependency level, starting at Level 1:
161
164
  After all implementer sub-agents complete across all levels:
162
165
 
163
166
  1. Run a combined quality check across all changes from all issues.
164
- 2. Resolve any cross-issue file conflicts or integration issues.
167
+ 2. **File conflict resolution:** When parallel sub-agents modify the same file, apply this resolution protocol:
168
+ - **Disjoint regions:** Accept both changes (non-overlapping edits to different functions/sections).
169
+ - **Overlapping regions:** If changes touch the same lines or function, merge manually using the sub-agent that modified the larger scope as the base, then apply the smaller-scope change on top. Run tests after merge.
170
+ - **Semantic conflicts:** If two sub-agents make contradictory changes to the same interface, type, or contract, halt and surface both changes to the user with the conflict description. Do not auto-resolve semantic conflicts.
171
+ - **Prevention:** Step 3 (collision detection) should move file-overlapping issues to sequential dependency levels. Conflicts at this stage indicate a missed overlap in Step 3.4.
165
172
  3. Verify no regressions between parallel sub-agent outputs.
166
173
 
167
174
  ### 6c.5. Post-Implementation Quality Pipeline
@@ -176,6 +183,7 @@ After all implementations complete, run the two-stage quality pipeline across th
176
183
  - **Reference conventions** from Step 6c.2 (if available) — so the fixer maintains established patterns when applying fixes.
177
184
  3. Re-spawn **`hatch3r-reviewer`** to verify fixes.
178
185
  4. Repeat steps 2-3 for a maximum of **3 iterations** until the reviewer reports 0 Critical + 0 Warning findings.
186
+ 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.
179
187
  5. If still not clean after 3 iterations, **ASK** the user how to proceed.
180
188
 
181
189
  **Stage 2 — Final Quality (parallel, after review loop is clean):**
@@ -3,6 +3,7 @@ id: hatch3r-board-pickup-delegation
3
3
  type: command
4
4
  description: Single-issue sub-agent delegation protocol for board-pickup Step 6a. Covers research, implementation, and quality pipeline for standalone issues.
5
5
  tags: [board, team]
6
+ quality_charter: agents/shared/quality-charter.md
6
7
  ---
7
8
  # Board Pickup — Single-Issue Delegation (Step 6a)
8
9
 
@@ -58,6 +59,7 @@ The implementer sub-agent prompt MUST include:
58
59
  - All `scope: always` rule directives from `.agents/rules/` — subagents do not inherit rules automatically.
59
60
  - Relevant learnings from `.agents/learnings/` (from Step 6.pre).
60
61
  - Explicit instruction: do NOT create branches, commits, or PRs.
62
+ - 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.
61
63
 
62
64
  Await the implementer sub-agent. Collect its structured result (files changed, tests written, issues encountered).
63
65
 
@@ -73,6 +75,7 @@ After implementation completes, run the two-stage quality pipeline. Use the Task
73
75
  - **Reference conventions** from Step 6a.1 (if available) — so the fixer maintains established patterns when applying fixes.
74
76
  3. Re-spawn **`hatch3r-reviewer`** to verify fixes.
75
77
  4. Repeat steps 2-3 for a maximum of **3 iterations** until the reviewer reports 0 Critical + 0 Warning findings.
78
+ 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.
76
79
  5. If still not clean after 3 iterations, **ASK** the user how to proceed.
77
80
 
78
81
  **Stage 2 — Final Quality (parallel, after review loop is clean):**
@@ -96,5 +99,6 @@ Each specialist sub-agent prompt MUST include:
96
99
  - All `scope: always` rule directives from `.agents/rules/` (subagents do not inherit rules automatically).
97
100
  - The diff or file changes to review.
98
101
  - The issue's acceptance criteria.
102
+ - 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.
99
103
 
100
104
  Await all specialist sub-agents. Apply their feedback (fixes, additional tests, documentation updates) before proceeding to Step 7.
@@ -3,6 +3,7 @@ id: hatch3r-board-pickup-github
3
3
  type: command
4
4
  description: GitHub-specific platform procedures for board-pickup. Covers gh CLI commands for issue listing, status updates, collision detection, PR creation, and label transitions.
5
5
  tags: [board, team, github]
6
+ quality_charter: agents/shared/quality-charter.md
6
7
  ---
7
8
  # Board Pickup — GitHub Platform Details
8
9
 
@@ -31,6 +32,10 @@ Platform-specific procedures for GitHub. Referenced from `hatch3r-board-pickup`.
31
32
  **Open PRs:**
32
33
  - `gh pr list -R {owner}/{repo} --state open` (fall back to `search_pull_requests` MCP).
33
34
 
35
+ **Closed PRs for selected issue (abandoned work detection):**
36
+ - `gh pr list -R {owner}/{repo} --state closed --search "closes #{N}"` — check if any recently closed (not merged) PRs reference this issue.
37
+ - If found: Surface to the user: "Note: PR #{M} was closed without merge for issue #{N}. The previous work may be partially relevant. Options: (a) review the closed PR branch, (b) start fresh, (c) pick a different issue."
38
+
34
39
  ---
35
40
 
36
41
  ## Step 4: Update Issue Status — GitHub
@@ -3,6 +3,7 @@ id: hatch3r-board-pickup-gitlab
3
3
  type: command
4
4
  description: GitLab-specific platform procedures for board-pickup. Covers glab CLI commands for issue listing, status updates, collision detection, MR creation, and label transitions.
5
5
  tags: [board, team, gitlab]
6
+ quality_charter: agents/shared/quality-charter.md
6
7
  ---
7
8
  # Board Pickup — GitLab Platform Details
8
9
 
@@ -31,6 +32,10 @@ Platform-specific procedures for GitLab. Referenced from `hatch3r-board-pickup`.
31
32
  **Open MRs:**
32
33
  - `glab mr list -R {namespace}/{project} --state opened`.
33
34
 
35
+ **Closed MRs for selected issue (abandoned work detection):**
36
+ - `glab mr list -R {namespace}/{project} --state closed` — check if any recently closed (not merged) MRs reference `Closes #{N}`.
37
+ - If found: Surface to the user: "Note: MR !{M} was closed without merge for issue #{N}. The previous work may be partially relevant. Options: (a) review the closed MR branch, (b) start fresh, (c) pick a different issue."
38
+
34
39
  ---
35
40
 
36
41
  ## Step 4: Update Issue Status — GitLab
@@ -3,6 +3,7 @@ id: hatch3r-board-pickup-modes
3
3
  type: command
4
4
  description: Auto-advance mode, error handling, and guardrails for board-pickup. Covers --auto/--unattended operation, safety guardrails, and specification generation.
5
5
  tags: [board, team]
6
+ quality_charter: agents/shared/quality-charter.md
6
7
  ---
7
8
  # Board Pickup — Modes, Guardrails, and Error Handling
8
9
 
@@ -3,6 +3,7 @@ id: hatch3r-board-pickup-post-impl
3
3
  type: command
4
4
  description: Post-implementation steps for board-pickup (Steps 7-10). Covers quality verification, commit/push, PR/MR creation, label transitions, board sync, dashboard refresh, reconciliation, and learnings capture.
5
5
  tags: [board, team]
6
+ quality_charter: agents/shared/quality-charter.md
6
7
  ---
7
8
  # Board Pickup — Post-Implementation Steps (7-10)
8
9
 
@@ -16,6 +17,8 @@ Run the project's quality checks (linting, type checking, tests). Refer to the p
16
17
 
17
18
  Verify: all AC met, tests passing, no lint errors, dead code removed, project-specific invariants respected.
18
19
 
20
+ Rate confidence in quality verification: high (all checks pass with comprehensive coverage), medium (checks pass but coverage gaps exist), low (checks pass minimally, recommend additional human review).
21
+
19
22
  ---
20
23
 
21
24
  ## Step 7a: Commit & Push
@@ -83,7 +86,12 @@ Follow the project's PR/MR creation skill or conventions:
83
86
 
84
87
  1. If all sub-issues addressed, confirm the PR body uses `Closes #<epic-number>` so the epic will auto-close on merge and transition to Done.
85
88
  2. Remind user `Closes #N` auto-closes on merge.
86
- 3. If partial:
89
+ 3. **Post-merge board state advisory:** After merge, `Closes #N` will auto-close the issue, but label and board status updates to `status:done` / "Done" depend on platform automation:
90
+ - **GitHub:** Automatic IF the Projects V2 "Item closed" workflow is enabled (verify in Project > Workflows). Labels are NOT auto-updated — `status:in-review` remains on the closed issue.
91
+ - **Azure DevOps:** Verify the "Complete linked work items after merging" checkbox is checked during PR completion. State transitions to "Closed" only when this option is selected.
92
+ - **GitLab:** Labels are NOT updated on auto-close. `status::in-review` remains. Consider setting up a CI pipeline trigger on issue close events for automated cleanup.
93
+ - If automation is not configured, `board-groom` with the `health-fix` action will detect and fix the drift during the next grooming session.
94
+ 4. If partial:
87
95
 
88
96
  **ASK:** "PR created. N remaining sub-issues on epic #X. Continue with next sub-issue or stop?"
89
97
 
@@ -3,6 +3,7 @@ id: hatch3r-board-shared-azure-devops
3
3
  type: shared-context
4
4
  description: Azure DevOps-specific platform details for board shared context. Covers Work Items, Azure Boards, az CLI, and MCP tools.
5
5
  tags: [board, team, azure-devops]
6
+ quality_charter: agents/shared/quality-charter.md
6
7
  ---
7
8
  # Board Shared Reference — Azure DevOps Platform Details
8
9
 
@@ -86,7 +87,11 @@ Azure Boards syncs via Work Item State changes. There is no separate "add to boa
86
87
  | `status:in-progress` | `Active` |
87
88
  | `status:in-review` | `Resolved` |
88
89
  | `status:blocked` | `New` |
89
- | (done) | `Closed` |
90
+ | `status:done` | `Closed` |
91
+
92
+ **Known limitation — Ready vs. In Progress granularity:** Both `status:ready` and `status:in-progress` map to the `Active` Work Item State because Azure DevOps built-in process templates (Agile, Scrum, CMMI) do not include a "Ready" state. The distinction is preserved in Work Item Tags (e.g., tag `status:ready` vs. `status:in-progress`), which hatch3r board commands always set alongside the State update. For projects that need board-level distinction:
93
+ - **Custom process template:** Add a "Ready" state to the work item type in your Azure DevOps process template. Update the mapping above accordingly.
94
+ - **Board column mapping:** Configure Azure Boards to use tag-based swim lanes or column splits to distinguish "Ready" from "In Progress" within the "Active" column.
90
95
 
91
96
  **Steps for each work item to sync:**
92
97
 
@@ -110,8 +115,14 @@ Azure Boards syncs via Work Item State changes. There is no separate "add to boa
110
115
  `az boards work-item relation add --id {child_id} --relation-type "System.LinkTypes.Hierarchy-Reverse" --target-id {parent_id}`.
111
116
  Record link status as `native`.
112
117
 
113
- 2. **Fallback 1 — Comment trace:**
114
- If relation add fails:
118
+ 2. **Fallback 1 — Advisory body-reference:**
119
+ If relation add fails, establish an advisory link via work item descriptions:
120
+ - Read the parent work item description. Append a sub-issue checklist entry: `- [ ] #{child} {title}` to the parent's description via `az boards work-item update --id {epic} --description "..."`.
121
+ - Read the child work item description. Prepend `> Parent: #{epic}` to the child's description via `az boards work-item update --id {child} --description "..."`.
122
+ - Record link status as `advisory`.
123
+
124
+ 3. **Fallback 2 — Comment trace:**
125
+ If both primary and Fallback 1 fail:
115
126
  `az boards work-item update --id {epic} --discussion "Sub-issue: #{child} — {title} (linking failed)"`.
116
127
  Record link status as `comment-only`.
117
128
 
@@ -3,6 +3,7 @@ id: hatch3r-board-shared-overview
3
3
  type: shared-context
4
4
  description: Board overview dashboard template, model pool, model selection heuristic, and lane computation algorithm. Referenced from hatch3r-board-shared.
5
5
  tags: [board, team]
6
+ quality_charter: agents/shared/quality-charter.md
6
7
  ---
7
8
  # Board Overview Reference
8
9
 
@@ -3,6 +3,7 @@ id: hatch3r-board-shared-github
3
3
  type: shared-context
4
4
  description: GitHub-specific platform details for board shared context. Covers GitHub Issues, Projects V2, gh CLI, and MCP tools.
5
5
  tags: [board, team, github]
6
+ quality_charter: agents/shared/quality-charter.md
6
7
  ---
7
8
  # Board Shared Reference — GitHub Platform Details
8
9
 
@@ -95,6 +96,7 @@ Read the mapping from `board.statusOptions` in `.agents/hatch.json`:
95
96
  | `status:ready` | `board.statusOptions.ready` |
96
97
  | `status:in-progress` | `board.statusOptions.inProgress` |
97
98
  | `status:in-review` | `board.statusOptions.inReview` |
99
+ | `status:done` | `board.statusOptions.done` |
98
100
  | `status:blocked` | `board.statusOptions.backlog` |
99
101
 
100
102
  **Steps for each issue to sync (gh CLI primary):**
@@ -3,6 +3,7 @@ id: hatch3r-board-shared-gitlab
3
3
  type: shared-context
4
4
  description: GitLab-specific platform details for board shared context. Covers GitLab Issues, Issue Boards, glab CLI, and label-based sync.
5
5
  tags: [board, team, gitlab]
6
+ quality_charter: agents/shared/quality-charter.md
6
7
  ---
7
8
  # Board Shared Reference — GitLab Platform Details
8
9
 
@@ -83,6 +84,7 @@ GitLab board lists are label-based. Each status corresponds to a scoped label:
83
84
  | `status:ready` | `status::ready` |
84
85
  | `status:in-progress` | `status::in-progress` |
85
86
  | `status:in-review` | `status::in-review` |
87
+ | `status:done` | `status::done` |
86
88
  | `status:blocked` | `status::blocked` |
87
89
 
88
90
  **Steps for each issue to sync:**
@@ -104,8 +106,14 @@ GitLab board lists are label-based. Each status corresponds to a scoped label:
104
106
  `glab api projects/{project_id}/issues/{parent_iid}/links --method POST --field target_project_id={project_id} --field target_issue_iid={child_iid}`.
105
107
  Record link status as `native`.
106
108
 
107
- 2. **Fallback 1 — Comment trace:**
108
- If API linking fails:
109
+ 2. **Fallback 1 — Advisory body-reference:**
110
+ If API linking fails, establish an advisory link via issue descriptions:
111
+ - Read the parent epic body. Add a sub-issue checklist entry: `- [ ] #{child} {title}` to the epic's body via `glab issue update {epic} -R {namespace}/{project} --description "..."`.
112
+ - Read the child issue body. Prepend `> Parent: #{epic}` to the child's body via `glab issue update {child} -R {namespace}/{project} --description "..."`.
113
+ - Record link status as `advisory`.
114
+
115
+ 3. **Fallback 2 — Comment trace:**
116
+ If both primary and Fallback 1 fail:
109
117
  `glab issue note {epic} -R {namespace}/{project} --message "Sub-issue: #{child} — {title} (linking failed)"`.
110
118
  Record link status as `comment-only`.
111
119
 
@@ -3,6 +3,7 @@ id: hatch3r-agent-customize
3
3
  type: command
4
4
  description: Configure per-agent customization including model overrides, description changes, 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
@@ -153,7 +154,7 @@ Some agents have `protected: true` in their canonical frontmatter. This field ma
153
154
 
154
155
  ```yaml
155
156
  ---
156
- id: hatch3r-reviewer
157
+ id: hatch3r-example-agent
157
158
  description: Expert code reviewer for the project...
158
159
  protected: true
159
160
  model: standard
@@ -175,6 +176,10 @@ The `protected` field is set in the canonical agent definition and cannot be ove
175
176
  - Invalid YAML produces warnings but does not prevent agent execution (graceful degradation)
176
177
  - Customization files should be committed to the repository
177
178
 
179
+ ## Unified Skill
180
+
181
+ This command's workflow is handled by the `hatch3r-customize` skill with `type: agent`. The skill provides root-cause analysis, multi-stakeholder review, and quality gate steps that extend the workflow above. Invoke the skill directly or use this command for the agent-specific reference documentation (model resolution, protected agents, per-agent examples).
182
+
178
183
  ## Related
179
184
 
180
185
  - Skill customization: `hatch3r-skill-customize` command
@@ -3,6 +3,7 @@ id: hatch3r-api-spec
3
3
  type: command
4
4
  description: Generate or validate an OpenAPI specification from the codebase. Scans route definitions, extracts schemas, and produces a complete API spec.
5
5
  tags: [planning]
6
+ quality_charter: agents/shared/quality-charter.md
6
7
  ---
7
8
 
8
9
  ## Agent Pipeline
@@ -3,6 +3,7 @@ id: hatch3r-benchmark
3
3
  type: command
4
4
  description: Run and analyze performance benchmarks. Compare results against baselines, identify regressions, and produce performance reports.
5
5
  tags: [review, performance]
6
+ quality_charter: agents/shared/quality-charter.md
6
7
  ---
7
8
 
8
9
  ## Agent Pipeline
@@ -60,7 +61,7 @@ Benchmark Brief:
60
61
  Metrics: {time / memory / throughput / all}
61
62
  ```
62
63
 
63
- **ASK:** "Does this capture the benchmark plan correctly? Adjust anything before I begin discovery."
64
+ **ASK:** "Does this capture the benchmark plan? Adjust anything before I begin discovery."
64
65
 
65
66
  ---
66
67
 
@@ -287,7 +288,7 @@ Files Created/Updated:
287
288
 
288
289
  **ASK:** "Results saved. Should these become the new baseline for future comparisons? (yes — overwrites previous baseline / no — keep existing baseline)"
289
290
 
290
- If yes, ensure `results.json` is structured as the canonical baseline for the next `previous-run` comparison.
291
+ If yes, save `results.json` as the canonical baseline for the next `previous-run` comparison.
291
292
 
292
293
  ---
293
294
 
@@ -392,7 +393,7 @@ The benchmark report follows this structure:
392
393
  - **Always exclude the cold start run from statistics.** The first iteration warms caches and JIT — including it skews results.
393
394
  - **Never overwrite baseline without confirmation.** Step 10 explicitly asks before promoting results to baseline status.
394
395
  - **Preserve existing `.benchmarks/results.json` history.** Append new runs; do not truncate historical data without user approval.
395
- - **Do not benchmark in debug mode.** Ensure `NODE_ENV=production` and no debug flags are active unless explicitly requested.
396
+ - **Do not benchmark in debug mode.** Verify `NODE_ENV=production` and no debug flags are active unless explicitly requested.
396
397
  - **Respect the project's tooling hierarchy** for knowledge augmentation: project docs first, then codebase exploration, then Context7 MCP, then web research.
397
398
  - **Report, don't interpret subjectively.** Present statistical facts. Flag regressions by threshold, not opinion. Let the user decide what matters.
398
399
 
@@ -3,6 +3,7 @@ id: hatch3r-board-fill
3
3
  type: command
4
4
  description: Create epics and issues/work items from todo.md, reorganize the board with dependency analysis, readiness assessment, and implementation ordering. Supports GitHub, Azure DevOps, and GitLab.
5
5
  tags: [board, team]
6
+ quality_charter: agents/shared/quality-charter.md
6
7
  ---
7
8
 
8
9
  ## Agent Pipeline
@@ -99,6 +100,7 @@ Scan the entire board to build an inventory of all existing work. This scan feed
99
100
  ```
100
101
  Board Health:
101
102
  Total open issues: N (X epics, Y sub-issues, Z standalone)
103
+ Standalone ratio: Z/{X+Z} ({percentage}%) — target <=10%
102
104
  Missing dependency metadata: #N, #M ...
103
105
  Missing required labels: #N — no priority, no area ...
104
106
  Potential epic grouping candidates: #N + #M (shared theme) ...
@@ -304,18 +306,35 @@ Present a brief **Context Summary**: key constraints from documentation, current
304
306
 
305
307
  ### Step 5: Propose Grouping (Epics vs. Standalone)
306
308
 
307
- **Grouping philosophy:** Minimize standalone issues to near-zero. Group aggressively into epics. Standalone only if topically isolated from every other issue AND substantial enough to stand alone.
309
+ **Grouping philosophy:** Target zero standalone issues. Every issue should belong to an epic. Standalone status is an exception that requires explicit justification, not a default. This maximizes parallelization during pickup agents can tackle multiple sub-issues of an epic concurrently, whereas standalone issues require serial pickup. Follow the **Epic Grouping Policy** in `hatch3r-board-shared`.
310
+
311
+ **Standalone threshold:** After grouping, no more than 10% of total non-sub-issue items on the board should be standalone (minimum 0, round down). If this threshold is exceeded, the post-grouping audit (Step 5d) forces additional grouping before proceeding.
308
312
 
309
313
  #### 5a. Group New Items
310
314
 
311
- 1. **Absorb into existing epics first.**
312
- 2. **Form new epics** from 2+ items sharing any connection (area, subsystem, category).
313
- 3. **Adopt orphans** into broad thematic epics (e.g., "Security & Auth Hardening", "Infrastructure & Tooling").
314
- 4. **Standalone only as last resort.**
315
+ Apply these rules in strict order. Each rule reduces the remaining ungrouped pool before the next rule fires.
316
+
317
+ 1. **Absorb into existing epics first.** For each new item, check all existing epics on the board. If the item shares any `area:*` label, touches the same subsystem, or addresses the same feature domain as an existing epic, absorb it as a sub-issue of that epic. When multiple epics match, prefer the one with the strongest thematic overlap.
318
+
319
+ 2. **Form new epics from 2+ related items.** Group remaining ungrouped items that share any connection: same `area:*` label, same subsystem, same `type:*` category, related feature domain, or semantic similarity in title/description. Two items sharing any single connection is sufficient to form an epic. Name the epic after the shared theme.
320
+
321
+ 3. **Singleton promotion.** Any single remaining item that could plausibly belong to a broader theme (even a loose one like "Developer Experience", "Code Quality", "Performance", "Security Hardening", "Infrastructure & Tooling", "Documentation & Onboarding") becomes a 1-item epic with that theme as the epic title. The rationale: a themed epic can absorb future related work, whereas a standalone cannot. Prefer existing theme names from epics already on the board.
322
+
323
+ 4. **Catch-all epic.** If any items still remain after steps 1-3 (truly topically isolated from everything), group them into a single catch-all epic named "General Improvements" (or absorb into an existing "General Improvements" epic if one exists on the board). Do NOT leave them standalone.
324
+
325
+ 5. **Standalone as true last resort.** An item may remain standalone ONLY if the user explicitly rejects grouping for it during the ASK checkpoint AND provides a justification. The AI should never propose standalone status on its own — always propose a grouping first.
315
326
 
316
327
  #### 5b. Regroup Existing Standalone Issues
317
328
 
318
- Evaluate existing standalones for grouping into existing or new epics. Same aggressive philosophy.
329
+ Scan ALL existing standalone issues on the board (from the Step 1.5 board scan). For each standalone:
330
+
331
+ 1. **Check against existing epics.** If the standalone shares an `area:*` label, subsystem, or semantic theme with any existing epic, propose absorbing it as a sub-issue.
332
+ 2. **Check against other standalones.** If 2+ existing standalones share a connection (area, subsystem, title similarity), propose forming a new epic from them.
333
+ 3. **Check against new epics.** If the standalone fits a new epic being formed in Step 5a, include it.
334
+ 4. **Singleton promotion.** Apply the same singleton promotion rule as 5a.3 — propose a thematic epic for isolated standalones.
335
+ 5. **Catch-all.** Remaining standalones go into the "General Improvements" epic per 5a.4.
336
+
337
+ Present regrouping proposals clearly separated from new-item grouping, so the user can confirm or reject existing issue regrouping independently.
319
338
 
320
339
  #### 5c. Decomposition Check
321
340
 
@@ -328,9 +347,32 @@ After grouping, evaluate whether any individual item is too large to be a single
328
347
 
329
348
  For each item flagged for decomposition, propose specific sub-issues with one-line descriptions. Items already grouped into an epic become sub-issues of that epic; standalone items that decompose become a new epic with sub-issues.
330
349
 
331
- Present grouping proposals (from 5a + 5b) and decomposition proposals (from 5c) together.
350
+ #### 5d. Post-Grouping Standalone Audit
351
+
352
+ After Steps 5a-5c, perform a standalone audit before presenting proposals to the user.
353
+
354
+ 1. **Count remaining standalones.** Calculate the standalone ratio: `standalone_count / (epic_count + standalone_count)`. Sub-issues are excluded from this ratio.
355
+
356
+ 2. **Threshold check.** If the standalone ratio exceeds 10%, the audit fails:
357
+ - Re-examine each proposed standalone against ALL epics (existing and newly proposed) using progressively looser matching:
358
+ a. Same `area:*` label (exact match).
359
+ b. Same broader domain (e.g., `area:api` and `area:middleware` are both "backend").
360
+ c. Same `type:*` category (e.g., all `type:refactor` items form a "Code Quality" epic).
361
+ d. Catch-all "General Improvements" epic.
362
+ - Repeat until the ratio is at or below 10%, or every standalone has been re-examined and the AI has exhausted all grouping options.
363
+
364
+ 3. **Justify survivors.** For each item that remains standalone after the audit, include a one-line justification in the grouping proposal explaining why it could not be grouped (e.g., "Truly unique topic with no thematic overlap to any existing or proposed epic").
365
+
366
+ 4. **Surface the metric.** Include the standalone ratio in the grouping proposal output:
367
+ ```
368
+ Grouping Audit: {standalone_count}/{total} items standalone ({percentage}%)
369
+ Threshold: <=10% — {PASS/FAIL}
370
+ {if FAIL: "N standalones could not be grouped. Justifications below."}
371
+ ```
372
+
373
+ Present grouping proposals (from 5a + 5b), decomposition proposals (from 5c), and audit results (from 5d) together.
332
374
 
333
- **ASK:** "Confirm grouping and decomposition, or: move items between groups / merge-split epics / convert epicstandalone / reject decomposition / reject existing regrouping. Are there items here that still feel too large for a single issue?"
375
+ **ASK:** "Confirm grouping, decomposition, and standalone audit results. Options: move items between groups / merge-split epics / convert epic<->standalone (requires justification) / reject decomposition / reject existing regrouping. Standalone ratio: {percentage}% ({PASS/FAIL}). Are there items here that still feel too large for a single issue?"
334
376
 
335
377
  ---
336
378
 
@@ -447,7 +489,7 @@ Acceptance criteria must be grounded in the user's stated requirements, not AI i
447
489
  3. **Codebase context (Step 4)** -- existing tests, interfaces, contracts, and architectural patterns that constrain the implementation inform technical criteria.
448
490
  4. **AI inference** -- only as a supplement for criteria the above sources don't cover. Flag AI-inferred criteria distinctly so the user can validate them.
449
491
 
450
- Each acceptance criterion must be **specific and testable**: an implementer reading it can determine pass/fail without ambiguity. Prefer "API returns 400 with validation error for missing required fields" over "API validates input properly."
492
+ Each acceptance criterion must be **specific and testable**: an implementer reading it can determine pass/fail without ambiguity. Prefer "API returns 400 with validation error for missing required fields" over "API validates input."
451
493
 
452
494
  #### Scope Section
453
495
 
@@ -580,6 +622,7 @@ Existing Issues Updated:
580
622
  | Issue # | Title | Updates Applied |
581
623
 
582
624
  Board Summary: N created, M updated, X marked ready, Y still triage, Z parallel lanes
625
+ Standalone ratio: {count}/{total} ({percentage}%) — target <=10%
583
626
  ```
584
627
 
585
628
  ---
@@ -3,6 +3,7 @@ id: hatch3r-board-groom
3
3
  type: command
4
4
  description: Ongoing backlog refinement for existing board items. Re-prioritize, reclassify, re-scope, archive stale items, decompose oversized issues, merge duplicates, refresh dependencies, and remediate board health findings.
5
5
  tags: [board, team]
6
+ quality_charter: agents/shared/quality-charter.md
6
7
  ---
7
8
 
8
9
  ## Agent Pipeline
@@ -142,12 +143,18 @@ Analyze the distribution of priority labels across the board:
142
143
  - Flag if all issues share the same priority (undifferentiated backlog).
143
144
  - Flag issues where priority does not align with risk (e.g., `priority:p3` + `risk:high`).
144
145
 
145
- #### 3f. Grouping Opportunities
146
+ #### 3f. Grouping Opportunities & Standalone Audit
146
147
 
147
- Scan existing standalone issues for potential epic grouping:
148
+ Scan existing standalone issues for epic grouping. Apply the **Epic Grouping Policy** from `hatch3r-board-shared`:
148
149
 
149
150
  - 2+ standalone issues sharing the same `area:*` labels.
150
151
  - 2+ standalone issues with semantically similar titles or overlapping scope.
152
+ - 2+ standalone issues sharing the same `type:*` label (e.g., all `type:refactor` items).
153
+ - 2+ standalone issues in the same broader domain (e.g., `area:api` + `area:middleware` = "backend").
154
+ - **Single standalone issues** that could be absorbed into an existing epic (shared area, subsystem, or theme).
155
+ - **Single standalone issues** that could become a themed 1-item epic (singleton promotion).
156
+
157
+ Compute standalone ratio: `standalone_count / (epic_count + standalone_count)`. Flag if ratio exceeds 10%.
151
158
 
152
159
  #### 3g. Decomposition Candidates
153
160
 
@@ -173,7 +180,23 @@ For each epic, compare the sub-issue references in the epic body (checklist item
173
180
 
174
181
  If `board.projectNumber` is configured, compare label-based status (`status:*` labels) against board column status via `gh project item-list {board.projectNumber} --owner {board.owner} --format json` (GitHub) or equivalent platform call. Flag issues where the label status and board column status diverge.
175
182
 
176
- #### 3l. Present Refinement Summary
183
+ #### 3l. Orphaned In-Review Detection
184
+
185
+ For each open issue with `status:in-review`:
186
+
187
+ 1. **GitHub:** Check if any open PR body references `Closes #N` for this issue: `gh pr list -R {owner}/{repo} --state open --json number,body` — parse for `Closes #{N}`.
188
+ 2. **Azure DevOps:** Check if any active PR is linked to this work item: `az repos pr list --org https://dev.azure.com/{namespace} --project {project} --status active` — check work item relations.
189
+ 3. **GitLab:** Check if any open MR description references `Closes #N` for this issue: `glab mr list -R {namespace}/{project} --state opened` — parse descriptions for `Closes #{N}`.
190
+
191
+ Also check for closed issues with `status:in-review` (or any non-`status:done` status label) — these are issues that were auto-closed on PR merge but whose labels and board status were not updated to "Done" (see Post-Merge Terminal State in `hatch3r-board-shared`).
192
+
193
+ Flag two categories:
194
+ - **Orphaned in-review (open):** Open issues with `status:in-review` but no associated open PR/MR — likely caused by PR closure without merge.
195
+ - **Stale in-review (closed):** Closed issues still labeled `status:in-review` — should be `status:done` with board status "Done".
196
+
197
+ ---
198
+
199
+ #### 3m. Present Refinement Summary
177
200
 
178
201
  Present findings grouped by category:
179
202
 
@@ -182,6 +205,7 @@ Board Groom — Refinement Summary:
182
205
 
183
206
  Board Health:
184
207
  Total open issues: N (X epics, Y sub-issues, Z standalone)
208
+ Standalone ratio: Z/{X+Z} ({percentage}%) — target <=10%
185
209
  Missing metadata: M issues (details below)
186
210
  Stale issues: S issues
187
211
  Stale dependency refs: D issues
@@ -189,6 +213,7 @@ Board Health:
189
213
  Epic ordering discrepancies: E epics
190
214
  Unlinked sub-issues: U issues (non-native links)
191
215
  Board sync drift: V issues (label/board status mismatch)
216
+ Orphaned in-review: O issues (open with no PR/MR), S issues (closed but not status:done)
192
217
 
193
218
  Grooming Opportunities:
194
219
  Re-prioritize candidates: R issues (priority/risk misalignment, priority inflation)
@@ -199,10 +224,10 @@ Grooming Opportunities:
199
224
  Dependency cleanup: K issues (stale refs, orphaned labels)
200
225
  Link fix candidates: L issues (advisory or comment-only links)
201
226
 
202
- Available actions: [reprioritize | reclassify | re-scope | demote | archive | decompose | merge | dep-refresh | health-fix | link-fix | all]
227
+ Available actions: [reprioritize | reclassify | re-scope | demote | archive | decompose | merge | regroup | dep-refresh | health-fix | link-fix | all]
203
228
  ```
204
229
 
205
- **ASK:** "Here is the board refinement summary. Which grooming actions do you want to perform? Select one or more: reprioritize / reclassify / re-scope / demote / archive / decompose / merge / dep-refresh / health-fix / link-fix / all. You can also specify issue numbers to target specific items (e.g., 'reprioritize #5, #12')."
230
+ **ASK:** "Here is the board refinement summary. Which grooming actions do you want to perform? Select one or more: reprioritize / reclassify / re-scope / demote / archive / decompose / merge / regroup / dep-refresh / health-fix / link-fix / all. You can also specify issue numbers to target specific items (e.g., 'reprioritize #5, #12')."
206
231
 
207
232
  ---
208
233
 
@@ -446,9 +471,63 @@ Link Fix Candidates:
446
471
 
447
472
  ---
448
473
 
449
- #### 4i. Health Fix (Board Health Remediation)
474
+ #### 4i. Regroup Standalones
475
+
476
+ Group standalone issues into existing or new epics. This action executes the grouping opportunities detected in Step 3f, following the **Epic Grouping Policy** from `hatch3r-board-shared`.
477
+
478
+ 1. Present regrouping proposals from Step 3f, organized by target epic:
479
+
480
+ ```
481
+ Regroup Proposals:
482
+
483
+ Absorb into existing epics:
484
+ #{N} "{title}" → Epic #{E} "{epic title}" (shared area:api)
485
+ #{M} "{title}" → Epic #{F} "{epic title}" (semantic overlap)
486
+
487
+ Form new epics:
488
+ New epic: "Code Quality & Refactoring"
489
+ #{P} "{title}" (type:refactor)
490
+ #{Q} "{title}" (type:refactor)
491
+
492
+ Singleton promotions:
493
+ #{R} "{title}" → New 1-item epic: "Performance Optimization" (no existing epic match, but themed for future absorption)
494
+
495
+ Catch-all:
496
+ #{S} "{title}" → "General Improvements" epic (no thematic match)
497
+
498
+ Standalone ratio: before={before}%, after={projected}% (target <=10%)
499
+ ```
500
+
501
+ **ASK:** "Confirm regrouping proposals. For each: accept / reject / move to different epic. Items you reject will remain standalone. Confirm / adjust / skip."
502
+
503
+ 2. For confirmed regroupings:
504
+
505
+ **Absorb into existing epic:**
506
+ - Link the standalone as a sub-issue using the **Sub-Issue Linking Procedure** from `hatch3r-board-shared`.
507
+ - Update the epic body to include the new sub-issue in its checklist and `## Implementation Order`.
508
+
509
+ **Form new epic:**
510
+ - Create a new epic issue with Overview, Sub-issues checklist, and `## Implementation Order`.
511
+ - Link all grouped items as sub-issues using the Sub-Issue Linking Procedure.
512
+ - Apply labels: inherit the common labels from the grouped items, add `status:triage` (or `status:ready` if all sub-issues are ready).
513
+ - Sync the new epic to the board via the **Board Sync Procedure** from `hatch3r-board-shared`.
514
+
515
+ **Singleton promotion:**
516
+ - Create a new 1-item epic with the themed title.
517
+ - Link the standalone as its only sub-issue.
518
+ - The epic body notes: "This epic groups related work for {theme}. Future items in this area should be added as sub-issues."
519
+
520
+ **Catch-all:**
521
+ - If a "General Improvements" epic exists, absorb into it.
522
+ - If not, create one with all catch-all items as sub-issues.
523
+
524
+ 3. After execution, recalculate and report the standalone ratio.
525
+
526
+ ---
527
+
528
+ #### 4j. Health Fix (Board Health Remediation)
450
529
 
451
- Fix structural gaps detected in Step 3b (missing metadata).
530
+ Fix structural gaps detected in Step 3b (missing metadata), board sync drift detected in Step 3k, and orphaned in-review issues detected in Step 3l.
452
531
 
453
532
  1. For each issue with missing required labels, infer the missing labels from issue content using the same classification tables as `board-fill` Step 3:
454
533
  - Missing `type:*` → infer from title/body keywords.
@@ -475,6 +554,42 @@ Health Fix — Missing Metadata:
475
554
  - **Azure DevOps:** `az boards work-item update --id N --fields "System.Tags=..."`.
476
555
  - **GitLab:** `glab issue update N --label "..."`.
477
556
 
557
+ 4. **Board sync drift remediation:** For each issue flagged in Step 3k where label status and board column status diverge:
558
+
559
+ - **Labels are source of truth.** Update the board to match the label.
560
+ - Use the platform-specific Board Sync Procedure to set the board status to the value corresponding to the issue's current status label.
561
+ - **Special case — closed issue with `status:in-review`:** If the issue is closed (state = closed) but the label is `status:in-review` and the board shows "In Review":
562
+ 1. Replace `status:in-review` with `status:done` on the issue.
563
+ 2. Sync board status to "Done" using `board.statusOptions.done`.
564
+ - Present drift fixes in the batch:
565
+
566
+ ```
567
+ Board Sync Drift Remediation:
568
+
569
+ | # | Title | Label Status | Board Status | Action |
570
+ |---|-------|-------------|--------------|--------|
571
+ | #N | {title} | status:ready | In Progress | Sync board -> Ready |
572
+ | #M | {title} | status:in-review (closed) | In Review | Label -> status:done, board -> Done |
573
+ ```
574
+
575
+ No separate ASK — drift fixes are presented alongside the metadata fixes in the same Health Fix confirmation prompt.
576
+
577
+ 5. **Orphaned in-review remediation:** For each issue flagged in Step 3l:
578
+
579
+ a. **Closed issue with `status:in-review`** (stale in-review): Suggest replacing `status:in-review` with `status:done` and syncing board to "Done". This is the post-merge terminal state that was not reached (see Post-Merge Terminal State in `hatch3r-board-shared`).
580
+ b. **Open issue with `status:in-review` but no open PR/MR** (orphaned in-review): Present the issue with context (last PR if any, time since last update). Suggest `status:ready` (if work appears abandoned) or `status:in-progress` (if rework is likely).
581
+
582
+ ```
583
+ Orphaned In-Review Remediation:
584
+
585
+ | # | Title | State | Last PR | Suggested Status | Reason |
586
+ |---|-------|-------|---------|------------------|--------|
587
+ | #N | {title} | closed | PR #M (merged) | status:done | Closed issue still labeled in-review |
588
+ | #K | {title} | open | PR #J (closed, not merged) | status:ready | PR closed 14 days ago, no replacement |
589
+ ```
590
+
591
+ **ASK:** "Confirm or adjust status changes for in-review issues. Enter per-issue decisions (e.g., '#N -> done, #K -> in-progress'), or 'confirm all' / 'skip'."
592
+
478
593
  ---
479
594
 
480
595
  ### Step 5: Readiness Re-evaluation
@@ -555,12 +670,14 @@ Board Groom Complete:
555
670
  Archived (closed): {count} issues
556
671
  Decomposed: {count} issues → {count} new sub-issues
557
672
  Merged: {count} duplicate pairs
673
+ Regrouped: {count} standalones → {count} epics ({count} new epics created)
558
674
  Dependencies: {count} refs cleaned, {count} new deps added, {count} epics reordered
559
675
  Health fixed: {count} issues (missing metadata resolved)
560
676
  Readiness promoted: {count} issues (triage → ready)
561
677
 
562
678
  Board State:
563
679
  Total open: {count} ({epics} epics, {sub} sub-issues, {standalone} standalone)
680
+ Standalone ratio: {percentage}% (target <=10%)
564
681
  Ready: {count} ({available} available, {depWaiting} waiting on deps)
565
682
  In Progress: {count}
566
683
  In Review: {count}