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-init
3
3
  type: command
4
4
  description: Initialize a project board (GitHub Projects V2, Azure Boards, or GitLab Issue Boards) with hatch3r's label taxonomy, status fields, and board structure. Platform detected from hatch.json.
5
5
  tags: [board, team]
6
+ quality_charter: agents/shared/quality-charter.md
6
7
  ---
7
8
 
8
9
  ## Agent Pipeline
@@ -249,9 +250,10 @@ Execute all planned mutations in sequence. No further questions unless a mutatio
249
250
  ```
250
251
  2. Look for a field named "Status" (case-insensitive match).
251
252
  3. If no Status field exists, create one via the `createProjectV2Field` mutation with type `SINGLE_SELECT`.
252
- 4. Ensure these status options exist on the field: **Backlog**, **Ready**, **In Progress**, **In Review**, **Done**.
253
+ 4. Verify these status options exist on the field: **Backlog**, **Ready**, **In Progress**, **In Review**, **Done**.
253
254
  - For missing options, use the `updateProjectV2Field` mutation (or the appropriate mutation for adding options to a single-select field) to add them.
254
255
  5. Capture the field ID and each option's ID.
256
+ 6. **Verify built-in "Done on close" automation:** After board creation, check the Projects V2 built-in workflows. Navigate to Project settings > Workflows > "Item closed" and verify it is enabled with Status mapped to "Done". Also verify "Pull request merged" maps Status to "Done". These workflows are on by default for UI-created projects but may not be enabled for API-created projects. Without these workflows, the board status will remain "In Review" after PR merge until `board-groom` detects the drift.
255
257
 
256
258
  **If platform is `azure-devops`:**
257
259
 
@@ -262,6 +264,7 @@ Execute all planned mutations in sequence. No further questions unless a mutatio
262
264
  2. Map hatch3r statuses to Work Item States: **Backlog** → `New`, **Ready** → `Active`, **In Progress** → `Active`, **In Review** → `Resolved`, **Done** → `Closed`.
263
265
  3. If using a custom process, verify these states exist. Azure DevOps built-in processes (Agile, Scrum, CMMI) include these states by default.
264
266
  4. Store the state mapping in `board.statusOptions` for use by other board commands.
267
+ 5. **Note — Ready vs. In Progress:** Azure DevOps built-in processes map both "Ready" and "In Progress" to the `Active` state. The distinction is maintained via hatch3r tags on work items. For board-level visibility, consider configuring Azure Boards column splits: in the Board Settings, split the "Active" column into "Active - Ready" and "Active - In Progress" using tag-based rules. Projects with custom Azure DevOps process templates can alternatively add a "Ready" state to the work item type.
265
268
 
266
269
  **If platform is `gitlab`:**
267
270
 
@@ -270,8 +273,9 @@ Execute all planned mutations in sequence. No further questions unless a mutatio
270
273
  glab api projects/{project_id}/boards/{board_id}/lists --method POST --field label_id={label_id}
271
274
  ```
272
275
  2. Create scoped labels for each status first (see Step 2.3), then create board lists referencing those labels.
273
- 3. Required board lists: **Backlog** (`status::triage`), **Ready** (`status::ready`), **In Progress** (`status::in-progress`), **In Review** (`status::in-review`).
276
+ 3. Required board lists: **Backlog** (`status::triage`), **Ready** (`status::ready`), **In Progress** (`status::in-progress`), **In Review** (`status::in-review`), **Done** (`status::done`).
274
277
  4. Store the board list IDs in `board.statusOptions`.
278
+ 5. **Note — Labels not auto-updated on close:** GitLab does not update labels when an issue is auto-closed via `Closes #N`. The `status::in-review` scoped label will remain on closed issues. This drift is detected and fixed by `board-groom` during the `health-fix` action. For automated cleanup, consider setting up a GitLab CI pipeline trigger on issue close events to apply `status::done`. Note: scoped labels require GitLab **Premium or Ultimate** tier.
275
279
 
276
280
  #### 2.3: Create Label Taxonomy
277
281
 
@@ -282,7 +286,7 @@ Execute all planned mutations in sequence. No further questions unless a mutatio
282
286
  |-----------|--------|
283
287
  | Type | `type:bug`, `type:feature`, `type:refactor`, `type:qa`, `type:docs`, `type:infra` |
284
288
  | Executor | `executor:agent`, `executor:human`, `executor:hybrid` |
285
- | Status | `status:triage`, `status:ready`, `status:in-progress`, `status:in-review`, `status:blocked` |
289
+ | Status | `status:triage`, `status:ready`, `status:in-progress`, `status:in-review`, `status:done`, `status:blocked` |
286
290
  | Priority | `priority:p0`, `priority:p1`, `priority:p2`, `priority:p3` |
287
291
  | Risk | `risk:low`, `risk:med`, `risk:high` |
288
292
  | Meta | `meta:board-overview`, `has-dependencies` |
@@ -3,6 +3,7 @@ id: hatch3r-board-pickup
3
3
  type: command
4
4
  description: Pick up one or more epics/issues from the project board for development. Handles dependency-aware selection, collision detection, branching, parallel sub-agent delegation, and batch execution. Supports GitHub, Azure DevOps, and GitLab. Platform-specific details are in commands/board/pickup-{platform}.md.
5
5
  tags: [board, team]
6
+ quality_charter: agents/shared/quality-charter.md
6
7
  ---
7
8
  # Board Pickup -- Develop Issues from the Project Board
8
9
 
@@ -3,6 +3,7 @@ id: hatch3r-board-refresh
3
3
  type: command
4
4
  description: Regenerate the living board overview dashboard from current board state. Scans all open issues, computes health metrics, and updates the meta:board-overview issue.
5
5
  tags: [board, team]
6
+ quality_charter: agents/shared/quality-charter.md
6
7
  ---
7
8
 
8
9
  ## Agent Pipeline
@@ -3,6 +3,7 @@ id: hatch3r-board-shared
3
3
  type: shared-context
4
4
  description: Shared context and procedures for all board commands. Provides platform-agnostic board config, label taxonomy, branch conventions, sync enforcement, and tooling directives. Platform-specific details are in commands/board/shared-{platform}.md.
5
5
  tags: [board, team]
6
+ quality_charter: agents/shared/quality-charter.md
6
7
  ---
7
8
  # Board Shared Reference
8
9
 
@@ -25,9 +26,9 @@ Before reading configuration, validate that prerequisites are met. If any check
25
26
  > "Board commands require owner and repo. Run `npx hatch3r config` to set your repository identity, or provide them in `.agents/hatch.json` under the top-level `owner` and `repo` fields."
26
27
 
27
28
  3. **Platform authentication:** Verify CLI authentication for the configured platform:
28
- - **GitHub:** Run `gh auth status`. If it fails, stop with: "GitHub CLI not authenticated. Run `gh auth login` and ensure your PAT has the `project` scope for Projects V2 access. See: https://docs.github.com/en/issues/planning-and-tracking-with-projects"
29
- - **Azure DevOps:** Run `az account show`. If it fails, stop with: "Azure CLI not authenticated. Run `az login` or set AZURE_DEVOPS_PAT. Ensure access to organization `{namespace}`."
30
- - **GitLab:** Run `glab auth status`. If it fails, stop with: "GitLab CLI not authenticated. Run `glab auth login` or set GITLAB_TOKEN. Ensure access to project `{namespace}/{project}`."
29
+ - **GitHub:** Run `gh auth status`. If it fails, stop with: "GitHub CLI not authenticated. Run `gh auth login` and confirm your PAT has the `project` scope for Projects V2 access. See: https://docs.github.com/en/issues/planning-and-tracking-with-projects"
30
+ - **Azure DevOps:** Run `az account show`. If it fails, stop with: "Azure CLI not authenticated. Run `az login` or set AZURE_DEVOPS_PAT. Confirm access to organization `{namespace}`."
31
+ - **GitLab:** Run `glab auth status`. If it fails, stop with: "GitLab CLI not authenticated. Run `glab auth login` or set GITLAB_TOKEN. Confirm access to project `{namespace}/{project}`."
31
32
 
32
33
  4. **projectNumber set (for commands other than board-init):** For `board-fill`, `board-groom`, `board-pickup`, and `board-refresh`, if `board.projectNumber` is null, stop with:
33
34
  > "No project board configured. Run the `board-init` command first to create or connect a project board. This sets up the board.projectNumber in `.agents/hatch.json`."
@@ -65,7 +66,7 @@ All board commands read project-specific configuration from `.agents/hatch.json`
65
66
  "labels": {
66
67
  "types": ["type:bug", "type:feature", "type:refactor", "type:qa", "type:docs", "type:infra"],
67
68
  "executors": ["executor:agent", "executor:human", "executor:hybrid"],
68
- "statuses": ["status:triage", "status:ready", "status:in-progress", "status:in-review", "status:blocked"],
69
+ "statuses": ["status:triage", "status:ready", "status:in-progress", "status:in-review", "status:done", "status:blocked"],
69
70
  "meta": ["meta:board-overview"]
70
71
  },
71
72
  "branchConvention": "{type}/{short-description}",
@@ -129,7 +130,7 @@ Cache link status per child (`native` / `advisory` / `comment-only`) in the run
129
130
  Board sync is **MANDATORY**, not optional. The following rules override any "skip if null" or "skip silently" language elsewhere when the board is configured (GitHub: `board.projectNumber` set; Azure DevOps: project configured; GitLab: board configured).
130
131
 
131
132
  1. **Every issue/work item created or updated by a board command MUST be synced to the board — no exceptions.** This includes newly created issues, status changes, label updates, and any mutation that affects board state. Skipping sync for any item is a violation of this policy.
132
- 2. **Status MUST be updated after every status-changing operation.** The four canonical statuses — Ready, In Progress, In Review, Done — must be reflected on the board immediately after the corresponding label change. Do not batch status updates to "later" or defer them. See the platform sub-files for platform-specific status update commands.
133
+ 2. **Status MUST be updated after every status-changing operation.** The five canonical statuses — Ready, In Progress, In Review, Done, Blocked — must be reflected on the board immediately after the corresponding label change. Do not batch status updates to "later" or defer them. See the platform sub-files for platform-specific status update commands.
133
134
  3. **All available board fields (priority, sprint, area, iteration) MUST be populated when the data is available.** Never leave a board field empty if the information exists in the issue's labels, body, or metadata.
134
135
  4. **Board overview dashboard MUST be regenerated after any batch of issue operations.** This is in addition to the per-run regeneration rule — if a board command performs multiple batches of mutations, the dashboard must reflect the final state.
135
136
  5. **Fallback: never silently skip sync.** See platform sub-files for escalation paths. Silent skipping is prohibited.
@@ -138,6 +139,65 @@ Board sync is **MANDATORY**, not optional. The following rules override any "ski
138
139
 
139
140
  ---
140
141
 
142
+ ## Epic Grouping Policy
143
+
144
+ All board commands that create or reorganize issues MUST follow this grouping policy. Epic grouping maximizes parallelization during pickup — agents can tackle multiple sub-issues of an epic concurrently, whereas standalone issues require serial pickup.
145
+
146
+ ### Standalone Threshold
147
+
148
+ **Target: zero standalone issues. Hard limit: no more than 10% of non-sub-issue items on the board should be standalone.**
149
+
150
+ Calculate: `standalone_count / (epic_count + standalone_count)`. Sub-issues are excluded from both numerator and denominator.
151
+
152
+ When the threshold is exceeded, board commands must apply progressively looser grouping strategies (area match → domain match → type match → catch-all epic) until the ratio is at or below 10%.
153
+
154
+ ### Grouping Priority Order
155
+
156
+ Apply these rules in strict priority order. Each rule reduces the remaining ungrouped pool before the next rule fires:
157
+
158
+ 1. **Absorb into existing epics** — item shares area, subsystem, or theme with an existing epic.
159
+ 2. **Form new epics** — 2+ ungrouped items share any connection (area, subsystem, type, domain, semantic similarity).
160
+ 3. **Singleton promotion** — a single item becomes a 1-item epic with a thematic name (e.g., "Performance Optimization", "Security Hardening"), positioned to absorb future related work. Prefer existing theme names from epics already on the board.
161
+ 4. **Catch-all epic** — truly isolated items go into a "General Improvements" epic (create one if it doesn't exist, absorb into it if it does).
162
+ 5. **Standalone (exception only)** — requires explicit user rejection of ALL grouping proposals AND a stated justification. The AI should never propose standalone status on its own.
163
+
164
+ ### When to Apply
165
+
166
+ - **board-fill Step 5:** Full grouping pass on new items + regrouping pass on existing standalones + post-grouping standalone audit.
167
+ - **board-groom Step 3f + Step 4j:** Detection of grouping opportunities + `regroup` action for execution.
168
+ - Both commands surface the standalone ratio in their health summaries and final reports.
169
+
170
+ ---
171
+
172
+ ## Post-Merge Terminal State
173
+
174
+ When a PR/MR merges and `Closes #N` auto-closes the referenced issues, the board item lifecycle must reach its terminal state. The `status:in-review` label should be replaced with `status:done`, and the board status should be set to "Done" using `board.statusOptions.done`.
175
+
176
+ **Platform-specific behavior and recommendations:**
177
+
178
+ - **GitHub:** The built-in Projects V2 "Item closed" workflow sets the Status field to "Done" when an issue is closed. This workflow is enabled by default for projects created via the GitHub UI, but projects created via API (as `board-init` does) may not have it enabled. **Verify** the workflow is active: Project settings > Workflows > "Item closed" > confirm Status maps to "Done". If disabled, enable it. Without this workflow, the board status will remain "In Review" until `board-groom` detects and fixes the drift. GitHub does NOT auto-update labels on close — the `status:in-review` label remains on the closed issue.
179
+ - **Azure DevOps:** Work item auto-transition to "Closed" requires the **"Complete linked work items after merging"** checkbox during PR completion. This is opt-in per PR (not automatic by default). ADO also supports `Fixes #N` / `Resolves #N` syntax in PR descriptions for state transitions. **Recommend** checking this option consistently, or configuring it as the user's default.
180
+ - **GitLab:** Labels are NOT updated on auto-close. The `status::in-review` scoped label remains on the closed issue. GitLab does not have a built-in "set label on close" automation. The `status::done` label must be applied manually, via a CI pipeline trigger on issue close events, or will be caught and fixed during `board-groom` drift remediation. Note: scoped labels (`status::done`) require GitLab **Premium or Ultimate** tier.
181
+
182
+ Board commands that detect closed issues with `status:in-review` (or any non-`status:done` status label) should treat this as drift and remediate per the platform-specific sync procedure.
183
+
184
+ ---
185
+
186
+ ## PR Closed Without Merge
187
+
188
+ When a PR/MR is closed without merging, the referenced issues remain open with `status:in-review`. This is drift that must be resolved:
189
+
190
+ 1. **Expected behavior:** Issues should revert to:
191
+ - `status:in-progress` — if the developer intends to continue work on a different branch or rework the changes.
192
+ - `status:ready` — if the work is abandoned and the issue should return to the backlog for future pickup.
193
+ 2. **Board sync:** The board status should be updated to match the new label ("In Progress" or "Ready").
194
+ 3. **Detection:** `board-groom` Step 3l detects orphaned `status:in-review` issues (those with no open PR/MR referencing them). The user decides the target state during grooming.
195
+ 4. **Collision detection:** During `board-pickup` Step 3, if collision detection finds a closed-without-merge PR for the selected issue, surface this context to the user so they can decide whether to reuse the branch, start fresh, or pick a different issue.
196
+
197
+ This situation is NOT automatically remediated because the correct target state depends on developer intent. Board commands surface it as a diagnostic for user decision.
198
+
199
+ ---
200
+
141
201
  ## End-of-Run Reconciliation Procedure
142
202
 
143
203
  Every mutating board command (`board-fill`, `board-groom`, `board-pickup`) runs this procedure as its final step before the summary output. It catches silent failures and drift accumulated during the run.
@@ -146,6 +206,11 @@ Every mutating board command (`board-fill`, `board-groom`, `board-pickup`) runs
146
206
  2. **Sub-issue link verification:** Review `link_results` in the run cache. For links recorded as `advisory`, retry the platform-specific primary link method once to upgrade to `native`. Report all non-native links (`advisory` / `comment-only`) in the reconciliation output.
147
207
  3. **Label consistency:** Verify all created/updated issues have required labels (`type:*`, `priority:*`, `executor:*`) and correct `has-dependencies` state per rule 7 of Board Sync Enforcement. Fix any gaps.
148
208
  4. **PR linkage:** For issues transitioned to `status:in-progress` or `status:in-review`, verify any associated open PR body contains `Closes #N` for the addressed issues. Auto-fix if missing by updating the PR body.
209
+ 5. **Orphaned in-review detection:** For all cached issues with `status:in-review` (not just those transitioned during this run), verify an open PR/MR exists that references `Closes #N`:
210
+ - **GitHub:** `gh pr list -R {owner}/{repo} --state open --json number,body` — parse for `Closes #{N}`.
211
+ - **Azure DevOps:** `az repos pr list --status active` — check work item links.
212
+ - **GitLab:** `glab mr list -R {namespace}/{project} --state opened` — parse descriptions for `Closes #{N}`.
213
+ Flag orphaned in-review issues (those with no associated open PR/MR) in the reconciliation report. This catches issues that drifted to `status:in-review` in previous runs but lost their PR (closed without merge, PR deleted, etc.). Also flag closed issues still labeled `status:in-review` that should be `status:done`.
149
214
 
150
215
  ### Reconciliation Report
151
216
 
@@ -157,6 +222,7 @@ Reconciliation:
157
222
  Sub-issue links: {N} native, {M} advisory, {K} comment-only
158
223
  Label gaps: {N} fixed, {M} remaining (list)
159
224
  PR linkage: {N} verified, {M} missing `Closes` (list)
225
+ Orphaned in-review: {N} open issues with no PR/MR, {M} closed issues not status:done (list)
160
226
  Errors: {list or "None"}
161
227
  ```
162
228
 
@@ -3,6 +3,7 @@ id: hatch3r-bug-plan
3
3
  type: command
4
4
  description: Plan a complex bug investigation -- spawn parallel researchers, produce diagnosis report with ranked hypotheses 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
@@ -65,7 +66,7 @@ Bug Brief:
65
66
  Prior attempts: {what has been tried, or "none"}
66
67
  ```
67
68
 
68
- **ASK:** "Does this capture the bug correctly? Adjust anything before I send this to the research phase."
69
+ **ASK:** "Does this capture the bug? Adjust anything before I send this to the research phase."
69
70
 
70
71
  ---
71
72
 
@@ -3,6 +3,7 @@ id: hatch3r-codebase-map
3
3
  type: command
4
4
  description: Reverse-engineer business and technical project specs from an existing codebase using parallel analyzer sub-agents with dual business/technical scoping
5
5
  tags: [planning, brownfield]
6
+ quality_charter: agents/shared/quality-charter.md
6
7
  ---
7
8
  # Codebase Map — Brownfield Codebase Analysis & Spec Generation
8
9
 
@@ -1001,7 +1002,7 @@ Each docs-writer prompt must include:
1001
1002
  - The confirmed scope, company stage, and business context from Step 1
1002
1003
  - The directory structure and file naming conventions below
1003
1004
  - Instruction to follow the `hatch3r-docs-writer` agent protocol
1004
- - Instruction to create directories as needed before writing files
1005
+ - Instruction to create directories before writing files if they do not exist
1005
1006
 
1006
1007
  #### 7a. Create Directories
1007
1008
 
@@ -1128,7 +1129,7 @@ The generated `AGENTS.md` should follow this structure:
1128
1129
  ```markdown
1129
1130
  # {Project Name} — Agent Instructions
1130
1131
 
1131
- > Auto-generated by hatch3r-codebase-map on {today's date}. Review and adjust as needed.
1132
+ > Auto-generated by hatch3r-codebase-map on {today's date}. Review and adjust before use.
1132
1133
 
1133
1134
  ## Project Purpose
1134
1135
 
@@ -1207,7 +1208,7 @@ Which would you like to run next? (or none)"
1207
1208
  - **Respect .gitignore** and always skip: `node_modules/`, `vendor/`, `dist/`, `build/`, `.git/`, `__pycache__/`, `.venv/`, `target/` (Rust), `bin/`, `obj/` (.NET).
1208
1209
  - **Never read `.env` files or actual secrets.** Only read `.env.example` or similar templates. If a hardcoded secret is found during analysis, flag it as a security concern but do not include the actual value in any output.
1209
1210
  - **Mark all inferred information as "Inferred."** Do not present static analysis guesses as established facts.
1210
- - **Handle monorepos correctly.** Detect workspace configuration (`workspaces` in `package.json`, `pnpm-workspace.yaml`, `turbo.json`, `nx.json`, `lerna.json`, Cargo workspaces, Go workspaces) and analyze each package as a separate module.
1211
+ - **Handle monorepos by detecting workspace configuration** (`workspaces` in `package.json`, `pnpm-workspace.yaml`, `turbo.json`, `nx.json`, `lerna.json`, Cargo workspaces, Go workspaces) and analyzing each package as a separate module.
1211
1212
  - **If `todo.md` already exists,** ASK before overwriting or appending.
1212
1213
  - **Sub-agents must not create files.** They return structured text results to the orchestrator. Only the orchestrator writes files in Step 7.
1213
1214
  - **Stage-adaptive recommendations.** Never recommend enterprise-grade solutions for pre-revenue startups. Never recommend MVP shortcuts for scale/enterprise companies. Calibrate all recommendations to the company stage from Step 1g.
@@ -3,6 +3,7 @@ id: hatch3r-command-customize
3
3
  type: command
4
4
  description: Configure per-command 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
@@ -54,7 +55,7 @@ Create `.hatch3r/commands/{command-id}.customize.md` with free-form markdown to
54
55
 
55
56
  Before creating any release:
56
57
 
57
- 1. Ensure all E2E tests pass on staging: `npm run test:e2e:staging`
58
+ 1. Run `npm run test:e2e:staging` and confirm all E2E tests pass on staging
58
59
  2. Verify the changelog has been updated in `CHANGELOG.md`
59
60
  3. Confirm the release has been approved in the `#releases` Slack channel
60
61
  4. Tag the Docker image with the release version
@@ -93,6 +94,10 @@ enabled: false
93
94
  - Invalid YAML produces warnings but does not prevent command execution (graceful degradation)
94
95
  - Customization files should be committed to the repository
95
96
 
97
+ ## Unified Skill
98
+
99
+ This command's workflow is handled by the `hatch3r-customize` skill with `type: command`. The skill provides root-cause analysis, multi-stakeholder review, and quality gate steps that extend the workflow above.
100
+
96
101
  ## Related
97
102
 
98
103
  - Agent customization: `hatch3r-agent-customize` command
@@ -3,6 +3,7 @@ id: hatch3r-context-health
3
3
  type: command
4
4
  description: Monitor conversation context health, detect degradation, and auto-suggest fresh context or sub-agent delegation
5
5
  tags: [maintenance]
6
+ quality_charter: agents/shared/quality-charter.md
6
7
  ---
7
8
  ## Agent Pipeline
8
9
 
@@ -3,6 +3,7 @@ id: hatch3r-cost-tracking
3
3
  type: command
4
4
  description: Track and report token usage and estimated costs across agent workflows and board operations
5
5
  tags: [maintenance]
6
+ quality_charter: agents/shared/quality-charter.md
6
7
  ---
7
8
  ## Agent Pipeline
8
9
 
@@ -3,6 +3,7 @@ id: hatch3r-debug
3
3
  type: command
4
4
  description: Standalone debug-and-fix workflow — add strategic debug logging, collect runtime logs from the user, perform root cause analysis, implement the fix, and clean up all debug artifacts.
5
5
  tags: [core, implementation]
6
+ quality_charter: agents/shared/quality-charter.md
6
7
  ---
7
8
  # Debug — Instrument, Diagnose, and Fix from Runtime Evidence
8
9
 
@@ -123,7 +124,7 @@ Bug Context:
123
124
  Context loaded: {specs, learnings, rules found}
124
125
  ```
125
126
 
126
- **ASK:** "Does this capture the bug correctly? Adjust anything before I proceed to add debug logging."
127
+ **ASK:** "Does this capture the bug? Adjust anything before I proceed to add debug logging."
127
128
 
128
129
  ---
129
130
 
@@ -177,7 +178,7 @@ Await the implementer result.
177
178
 
178
179
  1. Collect the list of all files modified and the exact log statements added.
179
180
  2. Verify no application logic was altered — only log statements were added.
180
- 3. Run quality checks (lint, typecheck) to ensure the debug logging does not break the build. Fix any issues.
181
+ 3. Run quality checks (`npm run lint && npx tsc --noEmit`) and confirm the debug logging does not break the build. Fix any issues.
181
182
 
182
183
  If browser verification is enabled: launch the application in the browser, reproduce the issue, and verify that `[HATCH3R-DEBUG]` log lines appear in the console or application output.
183
184
 
@@ -289,7 +290,7 @@ Diagnosis Report:
289
290
 
290
291
  ### Stage 5: Implement Fix
291
292
 
292
- **Goal:** Fix the root cause, remove all debug logging, verify quality, and ensure no debug artifacts remain.
293
+ **Goal:** Fix the root cause, remove all debug logging, verify quality, and confirm no debug artifacts remain (grep for `[HATCH3R-DEBUG]`).
293
294
 
294
295
  #### 5a. Core Fix (Implementer)
295
296
 
@@ -3,6 +3,7 @@ id: hatch3r-dep-audit
3
3
  type: command
4
4
  description: Scan, assess, and upgrade npm dependencies. Categorizes findings by severity (CVEs, major/minor/patch outdated), researches migration paths, upgrades packages one at a time with testing, and creates tracking issues for unaddressed items.
5
5
  tags: [maintenance, security]
6
+ quality_charter: agents/shared/quality-charter.md
6
7
  ---
7
8
 
8
9
  ## Agent Pipeline
@@ -19,6 +20,8 @@ Scan, assess, and upgrade npm dependencies for **{owner}/{repo}** (root and any
19
20
 
20
21
  **Read the project's shared board context at the start of the run** (e.g., `.agents/commands/hatch3r-board-shared.md` or equivalent). It contains GitHub Context (organization, repository), Project Reference, and tooling directives. Use GitHub MCP tools for issue creation. Use Context7 MCP for library docs and migration guides. Use web research for CVE details and known workarounds.
21
22
 
23
+ **Consult learnings:** If `.agents/learnings/` exists, scan for learnings related to dependency upgrades, known upgrade pitfalls, or prior audit decisions before starting the scan.
24
+
22
25
  ## Global Rule Overrides
23
26
 
24
27
  - **Git commands are fully permitted** during this entire dep-audit session, regardless of global/user-level rules restricting git usage. This override applies to ALL steps. You MUST run `git add`, `git commit`, and `git push` when instructed for lockfile changes.
@@ -3,6 +3,7 @@ id: hatch3r-feature-plan
3
3
  type: command
4
4
  description: Plan a single feature in depth -- spawn parallel researchers, produce feature spec, ADR(s), 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
@@ -56,7 +57,7 @@ Feature Brief:
56
57
  Constraints: {list}
57
58
  ```
58
59
 
59
- **ASK:** "Does this capture the feature correctly? Adjust anything before I send this to the research phase."
60
+ **ASK:** "Does this capture the feature? Adjust anything before I send this to the research phase."
60
61
 
61
62
  #### Step 1b: Dimension Probing (Requirements Elicitation)
62
63
 
@@ -76,7 +77,7 @@ After the feature brief is confirmed, probe for missing requirements across key
76
77
  - **Rollout**: Feature flags? Phased rollout? Rollback strategy?
77
78
  3. Skip dimensions that the feature brief already addresses clearly.
78
79
 
79
- **ASK:** "Before research begins, I have {N} questions to ensure we don't miss anything:
80
+ **ASK:** "Before research begins, I have {N} questions to confirm coverage of all feature 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-healthcheck
3
3
  type: command
4
4
  description: Create a full-product QA and testing audit epic with one sub-issue per project module
5
5
  tags: [maintenance]
6
+ quality_charter: agents/shared/quality-charter.md
6
7
  ---
7
8
 
8
9
  ## Agent Pipeline
@@ -3,12 +3,17 @@ id: hatch3r-hooks
3
3
  type: command
4
4
  description: Define and manage event-driven hooks that activate agents on project events
5
5
  tags: [core, devops]
6
+ quality_charter: agents/shared/quality-charter.md
6
7
  ---
7
8
 
8
9
  ## Agent Pipeline
9
10
 
10
11
  This command runs as a single orchestrator without sub-agent delegation. Hook definition and management are performed inline.
11
12
 
13
+ ## Learnings Consultation
14
+
15
+ If `.agents/learnings/` exists, scan for learnings related to hook configurations, event trigger patterns, or prior hook issues before starting.
16
+
12
17
  # Hooks — Event-Driven Agent Activation
13
18
 
14
19
  Define, edit, and manage event-driven hooks that automatically activate hatch3r agents when specific project events occur. Hook definitions are tool-agnostic — the adapter pipeline translates them into tool-native configurations during `npx hatch3r sync`.
@@ -251,7 +256,7 @@ Add `priority` and `timeout` to hook frontmatter:
251
256
 
252
257
  ```markdown
253
258
  ---
254
- id: pre-commit-lint-fixer
259
+ id: my-pre-commit-lint-fixer
255
260
  type: hook
256
261
  event: pre-commit
257
262
  agent: lint-fixer
@@ -3,6 +3,7 @@ id: hatch3r-learn
3
3
  type: command
4
4
  description: Capture learnings from development sessions into reusable knowledge files for future consultation.
5
5
  tags: [core, maintenance]
6
+ quality_charter: agents/shared/quality-charter.md
6
7
  ---
7
8
 
8
9
  ## Agent Pipeline
@@ -3,6 +3,7 @@ id: hatch3r-migration-plan
3
3
  type: command
4
4
  description: Create a phased migration plan for a major dependency or framework upgrade. Analyzes breaking changes and produces an actionable plan with rollback procedures.
5
5
  tags: [planning, brownfield]
6
+ quality_charter: agents/shared/quality-charter.md
6
7
  ---
7
8
 
8
9
  ## Agent Pipeline
@@ -61,7 +62,7 @@ Migration Brief:
61
62
  Version Gap: {N} major versions / {M} minor versions
62
63
  ```
63
64
 
64
- **ASK:** "Does this capture the migration correctly? Adjust anything before I proceed to analysis."
65
+ **ASK:** "Does this capture the migration? Adjust anything before I proceed to analysis."
65
66
 
66
67
  #### Step 1b: Dimension Probing
67
68
 
@@ -77,7 +78,7 @@ After the migration brief is confirmed, probe for missing context. Analyze the b
77
78
 
78
79
  Skip dimensions that the migration brief already addresses clearly.
79
80
 
80
- **ASK:** "Before research begins, I have {N} questions to ensure we don't miss anything:
81
+ **ASK:** "Before research begins, I have {N} questions to confirm coverage of all migration dimensions:
81
82
  {numbered question list — each with the dimension label and why the answer matters}
82
83
 
83
84
  Answer these now, or say 'use defaults' for any where you're comfortable with a reasonable default."
@@ -3,6 +3,7 @@ id: hatch3r-onboard
3
3
  type: command
4
4
  description: Generate a comprehensive onboarding guide for a new developer joining the project -- spawn parallel researchers to analyze codebase structure, architecture, and conventions, then produce a tailored onboarding document with setup instructions, architecture walkthrough, coding conventions, key workflows, tribal knowledge, and a quick-reference cheat sheet.
5
5
  tags: [brownfield, team]
6
+ quality_charter: agents/shared/quality-charter.md
6
7
  ---
7
8
 
8
9
  ## Agent Pipeline
@@ -56,7 +57,7 @@ Onboarding Brief:
56
57
  Depth: {derived — junior=detailed, mid=standard, senior=concise, staff=architecture-focused}
57
58
  ```
58
59
 
59
- **ASK:** "Does this capture the onboarding needs correctly? Adjust anything before I continue."
60
+ **ASK:** "Does this capture the onboarding needs? Adjust anything before I continue."
60
61
 
61
62
  #### Step 1b: Dimension Probing (Team Context)
62
63
 
@@ -3,6 +3,7 @@ id: hatch3r-project-spec
3
3
  type: command
4
4
  description: Generate complete business and technical project documentation (specs, ADRs, todo.md) from a project vision using parallel researcher sub-agents with dual business/technical scoping.
5
5
  tags: [planning, greenfield]
6
+ quality_charter: agents/shared/quality-charter.md
6
7
  ---
7
8
  # Project Spec — Greenfield Project Specification from Vision to Docs
8
9
 
@@ -112,7 +113,7 @@ Company Stage:
112
113
  Funding: {status}
113
114
  ```
114
115
 
115
- **ASK:** "Does this capture your vision and business context correctly? Adjust anything before I send this to the research phase."
116
+ **ASK:** "Does this capture your vision and business context? Adjust anything before I send this to the research phase."
116
117
 
117
118
  If running as part of a pipeline after `hatch3r-codebase-map`, check for `.hatch3r-session.json` and pre-fill any already-answered questions. Confirm with the user rather than re-asking.
118
119
 
@@ -1018,7 +1019,7 @@ Each docs-writer prompt must include:
1018
1019
  - The confirmed project vision, company stage, and business context from Step 1
1019
1020
  - The directory structure and file naming conventions below
1020
1021
  - Instruction to follow the `hatch3r-docs-writer` agent protocol
1021
- - Instruction to create directories as needed before writing files
1022
+ - Instruction to create directories before writing files if they do not exist
1022
1023
 
1023
1024
  After all docs-writers complete, the orchestrator handles the remaining files (todo.md, .hatch3r-session.json) and presents the summary.
1024
1025
 
@@ -1105,7 +1106,7 @@ The generated `AGENTS.md` should follow this structure:
1105
1106
  ```markdown
1106
1107
  # {Project Name} — Agent Instructions
1107
1108
 
1108
- > Auto-generated by hatch3r-project-spec on {today's date}. Review and adjust as needed.
1109
+ > Auto-generated by hatch3r-project-spec on {today's date}. Review and adjust before use.
1109
1110
 
1110
1111
  ## Project Purpose
1111
1112
 
@@ -3,6 +3,7 @@ id: hatch3r-quick-change
3
3
  type: command
4
4
  description: Lightweight command for small changes not worth tracking on the board. Adaptive ceremony with inline or sub-agent implementation, batch support, and soft scope guards.
5
5
  tags: [core, implementation]
6
+ quality_charter: agents/shared/quality-charter.md
6
7
  ---
7
8
 
8
9
  ## Agent Pipeline
@@ -40,7 +41,7 @@ This command intentionally skips:
40
41
  - GitHub issues and PRs
41
42
  - Researcher sub-agent
42
43
  - Full review pipeline (security-auditor, test-writer, docs-writer)
43
- - Learnings capture
44
+ - Learnings capture (consultation of existing learnings retained — see Step 2c)
44
45
 
45
46
  It retains:
46
47
  - Quality checks (lint, typecheck, test) -- always mandatory
@@ -48,6 +49,7 @@ It retains:
48
49
  - Light code review (reviewer for nontrivial items only)
49
50
  - `scope: always` rules from `.agents/rules/`
50
51
  - Soft scope guards to prevent misuse
52
+ - Lightweight learnings consultation (file-path scan, 150-token budget)
51
53
 
52
54
  ---
53
55
 
@@ -60,7 +62,7 @@ It retains:
60
62
  1. **No shared context loading.** Do NOT read `hatch3r-board-shared`. Do NOT fetch GitHub issues or PRs.
61
63
  2. **Minimal researcher usage.** No researcher for Tier 1 items. For Tier 2 items that proceed through quick-change, only `similar-implementation` at `quick` depth. Tier 3 items must be routed to `hatch3r-workflow`.
62
64
  3. **Targeted file reads only.** Read only files directly relevant to the described change(s).
63
- 4. **No learnings capture.** Quick changes are too small to produce meaningful learnings.
65
+ 4. **No learnings capture.** Quick changes are too small to produce meaningful learnings. Existing learnings are consulted via a lightweight file-path scan (Step 2c) with a 150-token budget — no new learnings are written.
64
66
  5. **Minimal rule loading.** Load `scope: always` rules only when spawning sub-agents in Steps 4b or 6.
65
67
 
66
68
  ---
@@ -124,6 +126,26 @@ Quick Change Scope:
124
126
  Estimated scope: {N} files, ~{N} lines
125
127
  ```
126
128
 
129
+ #### 2c. Lightweight Learnings Scan (Optional)
130
+
131
+ If `.agents/learnings/` exists:
132
+
133
+ 1. Collect the file paths from the affected areas identified in Step 1.
134
+ 2. Scan learning file frontmatter for `area` or `tags` that match the affected file paths or directories.
135
+ 3. If matches found (max 3 learnings, highest confidence first), surface them as a brief heads-up:
136
+
137
+ ```
138
+ Heads up — relevant learnings:
139
+ - [{category}] {one-line learning summary} (from: {learning filename})
140
+ - ...
141
+ ```
142
+
143
+ 4. If no matches found: continue silently. Do not mention learnings.
144
+
145
+ **Token budget:** Max 150 tokens for this entire step. Read frontmatter only — do not read learning bodies unless the frontmatter matches. Limit to 3 surfaced learnings. If more than 3 match, show the 3 with highest confidence.
146
+
147
+ If `.agents/learnings/` does not exist, skip this step silently.
148
+
127
149
  **ASK:** "Proceed with these changes? (yes / adjust)"
128
150
 
129
151
  ---
@@ -189,6 +211,7 @@ The implementer prompt MUST include:
189
211
  - Explicit instruction: do NOT create branches, commits, or PRs.
190
212
  - **Reference conventions** from `similar-implementation` output (if step 2 ran) — triggers the implementer's Convention Lock step.
191
213
  - If no researcher ran: explicit instruction that no researcher context is available; work from the change description and codebase alone.
214
+ - 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.
192
215
 
193
216
  If multiple nontrivial items affect **independent areas** (no shared files), spawn one implementer per area and run them in parallel.
194
217
 
@@ -216,7 +239,7 @@ Run the project's quality gates. Refer to `package.json` scripts, `README.md`, o
216
239
 
217
240
  Max 2 retry loops on quality check failures. After 2 retries:
218
241
 
219
- **ASK:** "Quality checks still failing after 2 fix attempts: {specific failures}. Options: (a) I'll fix manually, commit what we have, (b) keep trying, (c) abort changes."
242
+ **ASK:** "Quality checks still failing after 2 fix attempts: {specific failures}. Fix confidence: {high/medium/low — based on whether root cause is identified}. Options: (a) I'll fix manually, commit what we have, (b) keep trying, (c) abort changes."
220
243
 
221
244
  ---
222
245
 
@@ -235,13 +258,16 @@ The reviewer prompt MUST include:
235
258
  - Focus areas: **correctness and code quality only**. Skip security deep-dive, performance profiling, and documentation review.
236
259
  - All `scope: always` rule directives from `.agents/rules/`.
237
260
  - Iteration number and previous findings (if not the first iteration).
261
+ - 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.
238
262
 
239
263
  2. Process reviewer output:
240
264
  - If **0 Critical and 0 Warning** findings: review loop is clean. Proceed to Step 6b.
241
265
  - If Critical or Warning findings remain: spawn `hatch3r-fixer` sub-agent to address them, then re-run the reviewer (next iteration).
266
+ The fixer prompt MUST include: the reviewer findings, all `scope: always` rule directives, and the confidence expression requirement (high/medium/low per the quality charter).
242
267
  - **Suggestions**: skip. The point of quick-change is speed.
243
268
 
244
269
  3. If 3 iterations complete and findings remain, **ASK** the user whether to proceed or fix manually.
270
+ 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.
245
271
 
246
272
  4. After any fixes, re-run quality checks (Step 5a) to verify nothing broke.
247
273
 
@@ -255,6 +281,7 @@ After the review loop is clean, spawn both agents in parallel via the Task tool:
255
281
  Both prompts MUST include:
256
282
  - The diff of all changes made.
257
283
  - All `scope: always` rule directives from `.agents/rules/`.
284
+ - 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.
258
285
 
259
286
  Apply any resulting changes (new tests, security fixes). Re-run quality checks (Step 5a) if changes were made.
260
287
 
@@ -310,6 +337,7 @@ Quick Change Complete:
310
337
  Quality: lint {pass/fail}, types {pass/fail}, tests {pass/fail}
311
338
  Review: {skipped / N findings applied}
312
339
  Git: {committed on {branch} / committed and pushed / skipped}
340
+ Confidence: {high/medium/low — overall assessment of change correctness}
313
341
  ```
314
342
 
315
343
  ---
@@ -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