hatch3r 1.0.0 → 1.2.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 (144) hide show
  1. package/README.md +93 -322
  2. package/agents/hatch3r-a11y-auditor.md +24 -6
  3. package/agents/hatch3r-architect.md +20 -1
  4. package/agents/hatch3r-ci-watcher.md +31 -8
  5. package/agents/hatch3r-context-rules.md +14 -2
  6. package/agents/hatch3r-dependency-auditor.md +21 -5
  7. package/agents/hatch3r-devops.md +37 -6
  8. package/agents/hatch3r-docs-writer.md +19 -3
  9. package/agents/hatch3r-fixer.md +171 -0
  10. package/agents/hatch3r-implementer.md +84 -11
  11. package/agents/hatch3r-learnings-loader.md +69 -13
  12. package/agents/hatch3r-lint-fixer.md +19 -14
  13. package/agents/hatch3r-perf-profiler.md +18 -1
  14. package/agents/hatch3r-researcher.md +440 -5
  15. package/agents/hatch3r-reviewer.md +97 -5
  16. package/agents/hatch3r-security-auditor.md +23 -5
  17. package/agents/hatch3r-test-writer.md +21 -10
  18. package/checks/README.md +49 -0
  19. package/checks/code-quality.md +49 -0
  20. package/checks/performance.md +58 -0
  21. package/checks/security.md +58 -0
  22. package/checks/testing.md +53 -0
  23. package/commands/board/pickup-azure-devops.md +81 -0
  24. package/commands/board/pickup-delegation-multi.md +197 -0
  25. package/commands/board/pickup-delegation.md +100 -0
  26. package/commands/board/pickup-github.md +82 -0
  27. package/commands/board/pickup-gitlab.md +81 -0
  28. package/commands/board/pickup-modes.md +143 -0
  29. package/commands/board/pickup-post-impl.md +120 -0
  30. package/commands/board/shared-azure-devops.md +149 -0
  31. package/commands/board/shared-board-overview.md +215 -0
  32. package/commands/board/shared-github.md +169 -0
  33. package/commands/board/shared-gitlab.md +142 -0
  34. package/commands/hatch3r-agent-customize.md +40 -2
  35. package/commands/hatch3r-api-spec.md +294 -32
  36. package/commands/hatch3r-benchmark.md +386 -32
  37. package/commands/hatch3r-board-fill.md +161 -25
  38. package/commands/hatch3r-board-groom.md +595 -0
  39. package/commands/hatch3r-board-init.md +203 -46
  40. package/commands/hatch3r-board-pickup.md +79 -457
  41. package/commands/hatch3r-board-refresh.md +98 -27
  42. package/commands/hatch3r-board-shared.md +87 -238
  43. package/commands/hatch3r-bug-plan.md +16 -3
  44. package/commands/hatch3r-codebase-map.md +43 -10
  45. package/commands/hatch3r-command-customize.md +6 -0
  46. package/commands/hatch3r-context-health.md +5 -0
  47. package/commands/hatch3r-cost-tracking.md +5 -0
  48. package/commands/hatch3r-debug.md +426 -0
  49. package/commands/hatch3r-dep-audit.md +7 -1
  50. package/commands/hatch3r-feature-plan.md +74 -12
  51. package/commands/hatch3r-healthcheck.md +17 -1
  52. package/commands/hatch3r-hooks.md +16 -10
  53. package/commands/hatch3r-learn.md +15 -9
  54. package/commands/hatch3r-migration-plan.md +333 -33
  55. package/commands/hatch3r-onboard.md +327 -38
  56. package/commands/hatch3r-project-spec.md +46 -10
  57. package/commands/hatch3r-quick-change.md +336 -0
  58. package/commands/hatch3r-recipe.md +6 -0
  59. package/commands/hatch3r-refactor-plan.md +29 -13
  60. package/commands/hatch3r-release.md +13 -3
  61. package/commands/hatch3r-revision.md +395 -0
  62. package/commands/hatch3r-roadmap.md +18 -3
  63. package/commands/hatch3r-rule-customize.md +6 -0
  64. package/commands/hatch3r-security-audit.md +17 -1
  65. package/commands/hatch3r-skill-customize.md +6 -0
  66. package/commands/hatch3r-test-plan.md +532 -0
  67. package/commands/hatch3r-workflow.md +113 -38
  68. package/dist/cli/index.js +5184 -2593
  69. package/dist/cli/index.js.map +1 -0
  70. package/github-agents/hatch3r-docs-agent.md +1 -0
  71. package/github-agents/hatch3r-lint-agent.md +1 -0
  72. package/github-agents/hatch3r-security-agent.md +1 -0
  73. package/github-agents/hatch3r-test-agent.md +1 -0
  74. package/hooks/hatch3r-ci-failure.md +30 -0
  75. package/hooks/hatch3r-file-save.md +22 -0
  76. package/hooks/hatch3r-post-merge.md +23 -0
  77. package/hooks/hatch3r-pre-commit.md +23 -0
  78. package/hooks/hatch3r-pre-push.md +22 -0
  79. package/hooks/hatch3r-session-start.md +22 -0
  80. package/mcp/mcp.json +22 -3
  81. package/package.json +4 -7
  82. package/prompts/hatch3r-bug-triage.md +1 -0
  83. package/prompts/hatch3r-code-review.md +1 -0
  84. package/prompts/hatch3r-pr-description.md +1 -0
  85. package/rules/hatch3r-accessibility-standards.md +1 -0
  86. package/rules/hatch3r-agent-orchestration.md +326 -53
  87. package/rules/hatch3r-agent-orchestration.mdc +225 -0
  88. package/rules/hatch3r-api-design.md +4 -1
  89. package/rules/hatch3r-browser-verification.md +33 -1
  90. package/rules/hatch3r-browser-verification.mdc +29 -0
  91. package/rules/hatch3r-ci-cd.md +5 -1
  92. package/rules/hatch3r-ci-cd.mdc +4 -1
  93. package/rules/hatch3r-code-standards.md +18 -0
  94. package/rules/hatch3r-code-standards.mdc +10 -1
  95. package/rules/hatch3r-component-conventions.md +4 -1
  96. package/rules/hatch3r-data-classification.md +1 -0
  97. package/rules/hatch3r-deep-context.md +94 -0
  98. package/rules/hatch3r-deep-context.mdc +69 -0
  99. package/rules/hatch3r-dependency-management.md +13 -0
  100. package/rules/hatch3r-feature-flags.md +4 -1
  101. package/rules/hatch3r-git-conventions.md +1 -0
  102. package/rules/hatch3r-i18n.md +4 -1
  103. package/rules/hatch3r-learning-consult.md +4 -2
  104. package/rules/hatch3r-learning-consult.mdc +3 -2
  105. package/rules/hatch3r-migrations.md +12 -0
  106. package/rules/hatch3r-observability.md +293 -1
  107. package/rules/hatch3r-performance-budgets.md +5 -2
  108. package/rules/hatch3r-performance-budgets.mdc +1 -1
  109. package/rules/hatch3r-secrets-management.md +11 -3
  110. package/rules/hatch3r-secrets-management.mdc +10 -3
  111. package/rules/hatch3r-security-patterns.md +23 -3
  112. package/rules/hatch3r-security-patterns.mdc +8 -2
  113. package/rules/hatch3r-testing.md +1 -0
  114. package/rules/hatch3r-theming.md +4 -1
  115. package/rules/hatch3r-tooling-hierarchy.md +42 -15
  116. package/rules/hatch3r-tooling-hierarchy.mdc +27 -4
  117. package/skills/hatch3r-a11y-audit/SKILL.md +1 -0
  118. package/skills/hatch3r-agent-customize/SKILL.md +3 -0
  119. package/skills/hatch3r-api-spec/SKILL.md +1 -0
  120. package/skills/hatch3r-architecture-review/SKILL.md +6 -2
  121. package/skills/hatch3r-bug-fix/SKILL.md +4 -1
  122. package/skills/hatch3r-ci-pipeline/SKILL.md +1 -0
  123. package/skills/hatch3r-command-customize/SKILL.md +1 -0
  124. package/skills/hatch3r-context-health/SKILL.md +2 -1
  125. package/skills/hatch3r-cost-tracking/SKILL.md +1 -0
  126. package/skills/hatch3r-dep-audit/SKILL.md +6 -2
  127. package/skills/hatch3r-feature/SKILL.md +9 -2
  128. package/skills/hatch3r-gh-agentic-workflows/SKILL.md +130 -21
  129. package/skills/hatch3r-incident-response/SKILL.md +11 -5
  130. package/skills/hatch3r-issue-workflow/SKILL.md +12 -7
  131. package/skills/hatch3r-logical-refactor/SKILL.md +1 -0
  132. package/skills/hatch3r-migration/SKILL.md +1 -0
  133. package/skills/hatch3r-perf-audit/SKILL.md +2 -1
  134. package/skills/hatch3r-pr-creation/SKILL.md +20 -10
  135. package/skills/hatch3r-qa-validation/SKILL.md +2 -1
  136. package/skills/hatch3r-recipe/SKILL.md +1 -0
  137. package/skills/hatch3r-refactor/SKILL.md +7 -1
  138. package/skills/hatch3r-release/SKILL.md +15 -11
  139. package/skills/hatch3r-rule-customize/SKILL.md +1 -0
  140. package/skills/hatch3r-skill-customize/SKILL.md +1 -0
  141. package/skills/hatch3r-visual-refactor/SKILL.md +1 -0
  142. package/dist/cli/hooks-ZOTFDEA3.js +0 -59
  143. package/rules/hatch3r-error-handling.md +0 -17
  144. package/rules/hatch3r-error-handling.mdc +0 -15
@@ -1,17 +1,22 @@
1
1
  ---
2
2
  id: hatch3r-board-shared
3
- type: command
4
- description: Shared context and procedures for all board commands. Provides GitHub context from hatch.json, Projects v2 sync, and tooling directives.
3
+ type: shared-context
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
+ tags: [board, team]
5
6
  ---
6
7
  # Board Shared Reference
7
8
 
8
- Shared context for `hatch3r-board-fill`, `hatch3r-board-pickup`, `hatch3r-board-refresh`, and related board commands. Read once per run and cache.
9
+ Shared context for `hatch3r-board-fill`, `hatch3r-board-groom`, `hatch3r-board-pickup`, `hatch3r-board-refresh`, and related board commands. Read once per run and cache.
10
+
11
+ ## Agent Pipeline
12
+
13
+ This command provides shared context and procedures for board commands. It does not spawn sub-agents directly.
9
14
 
10
15
  ---
11
16
 
12
17
  ## Board Configuration
13
18
 
14
- All board commands read project-specific configuration from `/.agents/hatch.json`. The GitHub owner and repo are defined at the top level (`owner`, `repo`). Board-specific configuration (Projects v2 IDs, label taxonomy, branch conventions, area labels) lives under the `board` key. **Read `/.agents/hatch.json` at the start of every run and cache both top-level and `board` config for the duration.**
19
+ All board commands read project-specific configuration from `.agents/hatch.json`. The GitHub owner and repo are defined at the top level (`owner`, `repo`). Board-specific configuration (Projects v2 IDs, label taxonomy, branch conventions, area labels) lives under the `board` key. **Read `.agents/hatch.json` at the start of every run and cache both top-level and `board` config for the duration.**
15
20
 
16
21
  **Owner/repo resolution:** Use top-level `owner`/`repo`. Fall back to `board.owner`/`board.repo` if top-level values are empty (backward compatibility).
17
22
 
@@ -54,259 +59,89 @@ All board commands read project-specific configuration from `/.agents/hatch.json
54
59
 
55
60
  If any field is `null` or missing, the corresponding feature is disabled (e.g., null `projectNumber` → skip Projects v2 sync).
56
61
 
57
- **`models`** — Optional. Preferred AI models for agents. `models.default` applies to all agents; `models.agents` overrides per agent. Use aliases (`opus`, `sonnet`, `codex`, `gemini-pro`) or full model IDs. Resolution order: `.hatch3r/agents/{id}.customize.yaml` > manifest per-agent > agent frontmatter > manifest default. See [docs/model-selection.md](../docs/model-selection.md) and [docs/adapter-capability-matrix.md](../docs/adapter-capability-matrix.md#agent-model-customization).
62
+ **`models`** — Optional. Preferred AI models for agents. `models.default` applies to all agents; `models.agents` overrides per agent. Use aliases (`opus`, `sonnet`, `codex`, `gemini-pro`) or full model IDs. Resolution order: `.hatch3r/agents/{id}.customize.yaml` > manifest per-agent > agent frontmatter > manifest default. See [Model Selection](https://docs.hatch3r.com/docs/guides/model-selection) and [Adapter Capability Matrix](https://docs.hatch3r.com/docs/reference/adapter-capability-matrix#agent-model-customization).
58
63
 
59
64
  ---
60
65
 
61
- ## GitHub Context
62
-
63
- Derived from `/.agents/hatch.json` board config:
66
+ ## Platform Detection
64
67
 
65
- - **Owner:** top-level `owner` (fallback: `board.owner`)
66
- - **Repository:** top-level `repo` (fallback: `board.repo`)
67
- - **Default branch:** `board.defaultBranch` (fallback: `"main"`)
68
- - **Type labels:** `board.labels.types`
69
- - **Executor labels:** `board.labels.executors`
70
- - **Status labels:** `board.labels.statuses`
71
- - **Dependency label:** `has-dependencies`
72
- - **Meta labels:** `board.labels.meta`
73
- - **Branch convention:** `board.branchConvention`
74
- - **Issue templates:** Check `.github/ISSUE_TEMPLATE/` if present in the repository.
75
- - **PR template:** Check `.github/PULL_REQUEST_TEMPLATE.md` if present.
68
+ Read `platform` from `.agents/hatch.json`. This determines all CLI commands, API patterns, and terminology for this run. If `platform` is missing or empty, default to `github`.
76
69
 
77
- ### Project Reference (cache for the full run)
70
+ > Platform-specific details: see `commands/board/shared-github.md`
71
+ > Platform-specific details: see `commands/board/shared-azure-devops.md`
72
+ > Platform-specific details: see `commands/board/shared-gitlab.md`
78
73
 
79
- If `board.projectNumber` is not null, verify via `gh project view {board.projectNumber} --owner {board.owner}` or `gh project field-list {board.projectNumber} --owner {board.owner}` on first use.
80
-
81
- - **Owner:** `board.owner`, **owner type:** infer from context (`org` or `user`)
82
- - **Project number:** `board.projectNumber`
83
- - **Status field ID:** `board.statusFieldId`
84
- - **Status option IDs:** Read from `board.statusOptions` (keys: `backlog`, `ready`, `inProgress`, `inReview`, `done`)
74
+ Each platform sub-file contains: CLI command reference, MCP tool reference, terminology mapping, platform context, board sync procedure, sub-issue linking, board sync enforcement details, and CLI-first tooling directives.
85
75
 
86
76
  ---
87
77
 
88
- ## Projects v2 Sync Procedure
89
-
90
- > **Skip entirely if `board.projectNumber` is null.**
91
-
92
- Use this procedure whenever a status label is set or changes and the board needs to reflect it. Labels are the source of truth; Projects v2 sync keeps the board view consistent. This includes newly created issues -- sync their initial status immediately after adding them to the board.
93
-
94
- **Prerequisites:** `gh auth refresh -s project` (Projects v2 via gh requires the `project` scope). gh CLI 2.40+ recommended.
95
-
96
- **Status label → Projects v2 option mapping:**
97
-
98
- Read the mapping from `board.statusOptions` in `/.agents/hatch.json`:
78
+ ## Board Sync Procedure
99
79
 
100
- | Label | Option ID from hatch.json |
101
- | -------------------- | ---------------------------------- |
102
- | `status:triage` | `board.statusOptions.backlog` |
103
- | `status:ready` | `board.statusOptions.ready` |
104
- | `status:in-progress` | `board.statusOptions.inProgress` |
105
- | `status:in-review` | `board.statusOptions.inReview` |
106
- | `status:blocked` | `board.statusOptions.backlog` |
80
+ > **Skip entirely if `board.projectNumber` is null (GitHub/GitLab) or project is not configured (Azure DevOps).**
107
81
 
108
- **Steps for each issue to sync (gh CLI primary):**
82
+ Use this procedure whenever a status label is set or changes and the board needs to reflect it. Labels are the source of truth; board sync keeps the board view consistent. This includes newly created issues -- sync their initial status immediately after adding them to the board.
109
83
 
110
- 1. **Resolve project node ID** (once per run, cache for the run): `gh project view {board.projectNumber} --owner {board.owner} --format json -q '.id'`. Required for step 3.
111
- 2. **Add to board + capture item ID:** `gh project item-add {board.projectNumber} --owner {board.owner} --url https://github.com/{board.owner}/{board.repo}/issues/{N} --format json -q '.id'`. **Capture the item ID from the output.** This call is idempotent -- if the item already exists on the board it returns the existing item with its ID.
112
- 3. **Update status:** `gh project item-edit --id {item_id} --project-id {project_node_id} --field-id {board.statusFieldId} --single-select-option-id {option_id}` using the label→option mapping from the table above.
113
- 4. **Verify (first sync per run only):** After step 3, optionally confirm via `gh project item-list {board.projectNumber} --owner {board.owner} --format json` that the item's status matches. If it does not, retry step 3 once.
114
-
115
- **For PRs:** Use `--url https://github.com/{board.owner}/{board.repo}/pull/{N}` in step 2.
116
-
117
- **Fallback (rare):** If item-add does not return an item ID, use `gh project item-list {board.projectNumber} --owner {board.owner} --format json` and match by issue/PR content to obtain the item ID. Then proceed with step 3.
118
-
119
- **MCP fallback:** If gh CLI fails, `project` scope is unavailable, or gh version is too old, fall back to `projects_write` / `projects_get` / `projects_list` with `method: add_project_item`, `method: update_project_item`, `method: get_project_item`, `method: list_project_items` as in the legacy procedure.
120
-
121
- **Resilience:** If any call fails, retry once. If it still fails, surface a warning to the user and continue with the next item. If gh CLI and MCP are both unavailable, skip sync silently and warn: "Projects v2 sync skipped -- run `gh auth refresh -s project` or enable the `projects` toolset in your MCP configuration."
84
+ > Platform-specific details: see `commands/board/shared-github.md` (GitHub Projects V2 Sync)
85
+ > Platform-specific details: see `commands/board/shared-azure-devops.md` (Azure Boards Work Item State Sync)
86
+ > Platform-specific details: see `commands/board/shared-gitlab.md` (GitLab Board Label-Based Sync)
122
87
 
123
88
  ---
124
89
 
125
- ## Board Overview
126
-
127
- If `meta:board-overview` is included in `board.labels.meta`, board commands will look for an open issue with that label to use as a live dashboard. This dashboard is auto-maintained and MUST be regenerated at the end of every board command run that mutates issues. For on-demand regeneration without running a full board command, use `hatch3r-board-refresh`.
128
-
129
- Teams can extend the dashboard with project-specific sections, but the following structure and model recommendations are required.
130
-
131
- ### Frontier Model Pool
90
+ ## Sub-Issue Linking Procedure
132
91
 
133
- When populating the board overview, assign a recommended model to each issue. The pool uses aliases that map to the project's configured model versions in `hatch.json`. Specific model IDs are intentionally omitted here to avoid staleness as model versions change configure actual model IDs in `hatch.json` under `models`.
92
+ Use this procedure whenever a child issue must be linked to a parent epic. Board commands that create sub-issues MUST follow the platform-specific fallback chain and record the link status.
134
93
 
135
- | Alias | Strength | Use When |
136
- | ----- | -------- | -------- |
137
- | `opus` | Code quality, multi-file refactoring, security, deep reasoning | Complex refactors, security-critical, architectural changes, `risk:high` |
138
- | `codex` | Agentic coding, long-running tasks, tool orchestration | Multi-step implementations, polyglot codebases, complex tool integrations |
139
- | `gemini-pro` | Large context windows, multimodal, web development | Massive context needs (large epics), web/frontend work |
140
- | `sonnet` | Balance of quality and speed | Standard features, bugs, docs, QA — when the top-tier model is overkill |
94
+ > Platform-specific details: see `commands/board/shared-github.md` (Sub-Issue Linking — GitHub)
95
+ > Platform-specific details: see `commands/board/shared-azure-devops.md` (Sub-Issue Linking — Azure DevOps)
96
+ > Platform-specific details: see `commands/board/shared-gitlab.md` (Sub-Issue Linking GitLab)
141
97
 
142
- ### Model Selection Heuristic (Quality-First)
143
-
144
- 1. **Default:** `opus` — highest code quality baseline.
145
- 2. **Override to `codex`** if the issue involves heavy agentic coding, long-running multi-step tasks, or multi-language requirements.
146
- 3. **Override to `gemini-pro`** if the issue requires processing very large context (large epic with many sub-issues spanning many files) or is primarily web/frontend work.
147
- 4. **Downgrade to `sonnet`** ONLY for straightforward issues: simple bugs (`risk:low`), documentation (`type:docs`), QA validation (`type:qa`), or issues with clear bounded scope and no architectural impact.
148
-
149
- ### Board Overview Issue Format
150
-
151
- Issue listings in the board overview MUST include a `Model` column. All board commands that regenerate the dashboard MUST use this canonical template. Omit any status section that has zero issues (except Status Summary, which always appears). Omit Board Health sub-sections that have no findings. Sort issues within each status group by priority (`P0` first), then by issue number.
152
-
153
- ```markdown
154
- ## Board Overview
155
-
156
- **Project:** {owner}/{repo}
157
- **Last refreshed:** {ISO date}
158
-
159
- ---
160
-
161
- ## Status Summary
162
-
163
- | Status | Count |
164
- |--------|-------|
165
- | Backlog / Triage | {count} |
166
- | Ready | {count} |
167
- | In Progress | {count} |
168
- | In Review | {count} |
169
- | Externally Blocked | {count} |
170
- | **Total Open** | **{count}** |
98
+ Cache link status per child (`native` / `advisory` / `comment-only`) in the run cache under `link_results`.
171
99
 
172
100
  ---
173
101
 
174
- ## In Progress
175
-
176
- | # | Title | Type | Pri | Executor | Model |
177
- |---|-------|------|-----|----------|-------|
178
- | #{N} | {title} | {type} | {pri} | {executor} | {model} |
179
-
180
- ## In Review
181
-
182
- | # | Title | Type | Pri | Executor | Model |
183
- |---|-------|------|-----|----------|-------|
184
- | #{N} | {title} | {type} | {pri} | {executor} | {model} |
185
-
186
- ## Implementation Lanes
187
-
188
- Issues grouped into independent parallel work streams.
189
- Different lanes can be worked concurrently; within a lane, follow the listed order.
190
-
191
- ### Lane 1: {area/theme}
192
-
193
- | Order | # | Title | Type | Pri | Executor | Model |
194
- |-------|---|-------|------|-----|----------|-------|
195
- | 1 | #{N} | {title} | {type} | {pri} | {executor} | {model} |
196
- | 2 | #{M} | {title} | {type} | {pri} | {executor} | {model} |
197
-
198
- ### Lane 2: {area/theme}
102
+ ## Board Sync Enforcement
199
103
 
200
- | Order | # | Title | Type | Pri | Executor | Model |
201
- |-------|---|-------|------|-----|----------|-------|
202
- | 1 | #{N} | {title} | {type} | {pri} | {executor} | {model} |
104
+ 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).
203
105
 
204
- ## Cross-Epic Dependencies
205
-
206
- Dependency relationships between epics. Omit if no cross-epic dependencies exist.
207
-
208
- | Upstream Epic | Downstream Epic | Via |
209
- |---------------|-----------------|-----|
210
- | #{epicA} {title} | #{epicB} {title} | #{subX} blocks #{subY} |
211
-
212
- ## Waiting on Dependencies
213
-
214
- `status:ready` issues with one or more unsatisfied blockers. Not yet available for pickup.
215
-
216
- | # | Title | Type | Waiting On | Model |
217
- |---|-------|------|------------|-------|
218
- | #{N} | {title} | {type} | #{blocker} ({blocker status}) | {model} |
219
-
220
- ## Externally Blocked
221
-
222
- Issues with `status:blocked` -- waiting on external factors (approvals, environments, third-party services).
223
-
224
- | # | Title | Type | Reason | Model |
225
- |---|-------|------|--------|-------|
226
- | #{N} | {title} | {type} | {blocker reason} | {model} |
227
-
228
- ## Backlog / Triage
229
-
230
- | # | Title | Type | Pri | Executor | Model |
231
- |---|-------|------|-----|----------|-------|
232
- | #{N} | {title} | {type} | {pri} | {executor} | {model} |
106
+ 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.
107
+ 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.
108
+ 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.
109
+ 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.
110
+ 5. **Fallback: never silently skip sync.** See platform sub-files for escalation paths. Silent skipping is prohibited.
111
+ 6. **Cross-reference: every epic/work item and sub-issue must have its board item ID tracked for subsequent updates.** After adding an item to the board, store the returned item ID in the run cache keyed by issue number.
112
+ 7. **`has-dependencies` label consistency:** Every issue with a non-empty `## Dependencies` section (containing at least one `Blocked by` or `Recommended after` reference) MUST have the `has-dependencies` label. Issues whose `## Dependencies` section contains only `None` MUST NOT have the label. Board commands enforce this during creation and update.
233
113
 
234
114
  ---
235
115
 
236
- ## Board Health
237
-
238
- **Missing metadata:**
239
- - {list or "None -- all issues have required labels."}
116
+ ## End-of-Run Reconciliation Procedure
240
117
 
241
- **Stale issues:**
242
- - {list or "None -- all issues are active."}
118
+ 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.
243
119
 
244
- **Blocked chains:**
245
- - {list or "None -- no blocked dependencies."}
120
+ 1. **Board sync verification:** Re-attempt sync for any issue where `sync_results` in the run cache shows a failure. Use the full **Board Sync Procedure** fallback chain. Record final status.
121
+ 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.
122
+ 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.
123
+ 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.
246
124
 
247
- **Epic ordering discrepancies:**
248
- - {list or "None -- all epic Implementation Order sections match sub-issue Dependencies."}
125
+ ### Reconciliation Report
249
126
 
250
- ---
127
+ Output the reconciliation report immediately before the command summary:
251
128
 
252
- *This issue is auto-maintained by hatch3r board commands. Do not close.*
253
129
  ```
254
-
255
- ### Dependency Data Model
256
-
257
- `## Dependencies` sections in individual issue bodies are the **single authoritative source** of dependency data. Every issue (epic, sub-issue, standalone) tracks its own blockers in its `## Dependencies` section using two reference types:
258
-
259
- - **Hard:** `Blocked by #N` -- this issue cannot start until #N is closed. Used for true producer/consumer relationships (A creates what B consumes) and explicit sequencing requirements.
260
- - **Soft:** `Recommended after #N` -- this issue can proceed in parallel with #N, but sequential execution is recommended (e.g., shared area overlap, reduced merge conflict risk). Soft dependencies are advisory; they do not block pickup or exclude issues from Implementation Lanes.
261
-
262
- When no dependencies exist, the section contains `None`.
263
-
264
- `## Implementation Order` sections in epic bodies are a **derived convenience view** -- they visualize the dependency DAG among an epic's sub-issues as numbered levels. Board commands that create or update epics MUST regenerate `## Implementation Order` from the sub-issues' `## Dependencies` sections, not the other way around. When the two diverge, `## Dependencies` wins.
265
-
266
- ### Lane Computation Algorithm
267
-
268
- Used by both `board-refresh` and `board-fill` when generating the Implementation Lanes and Waiting on Dependencies sections. Input: all `status:ready` issues and their dependency data (from `## Dependencies` sections).
269
-
270
- 1. **Collect** all `status:ready` issues.
271
- 2. **Partition by hard-blocker satisfaction** -- for each collected issue, check all **hard** dependency references (`Blocked by #N`) in its `## Dependencies` section against the full board. An issue is **dependency-waiting** if any hard blocker is still open (regardless of the blocker's status). Soft dependencies (`Recommended after #N`) do not affect this partition. Separate into two sets:
272
- - **Available** -- all hard blockers satisfied (closed) or no hard blockers. These proceed to lane computation (step 3+).
273
- - **Dependency-waiting** -- one or more hard blockers still open. These are excluded from Implementation Lanes and listed in the **Waiting on Dependencies** section of the overview instead.
274
- 3. **Build the available sub-graph** -- extract only the inter-dependencies among available issues (from parsed `## Dependencies` sections).
275
- 4. **Group by dependency chains** -- issues with sequential dependencies go in the same lane, ordered topologically within the chain.
276
- 5. **Group by area overlap** -- independent issues (no inter-dependencies) that share `area:*` labels go in the same lane. This avoids merge conflicts on the same files when multiple agents work in parallel.
277
- 6. **General lane** -- issues with no dependencies and no area overlap form their own single-issue lanes. If three or more such issues exist, group them into a single "General" lane.
278
- 7. **Name lanes** by the dominant `area:*` label or shared theme of the issues in the lane. Use "General" for the catch-all lane.
279
- 8. **Sort lanes** by the highest-priority issue in each lane (`P0`-lane first, then `P1`, etc.). Break ties by lowest issue number.
280
- 9. **Sort within lanes** by dependency order (blockers before dependents), then by priority, then by issue number.
281
-
282
- Example output:
283
-
130
+ Reconciliation:
131
+ Board sync: {N} synced, {M} failed (list failures)
132
+ Sub-issue links: {N} native, {M} advisory, {K} comment-only
133
+ Label gaps: {N} fixed, {M} remaining (list)
134
+ PR linkage: {N} verified, {M} missing `Closes` (list)
135
+ Errors: {list or "None"}
284
136
  ```
285
- ## Implementation Lanes
286
-
287
- Issues grouped into independent parallel work streams.
288
- Different lanes can be worked concurrently; within a lane, follow the listed order.
289
137
 
290
- ### Lane 1: API
291
-
292
- | Order | # | Title | Type | Pri | Executor | Model |
293
- |-------|---|-------|------|-----|----------|-------|
294
- | 1 | #15 | Fix rate limiter | bug | P0 | agent | opus |
295
-
296
- ### Lane 2: Auth
138
+ ---
297
139
 
298
- | Order | # | Title | Type | Pri | Executor | Model |
299
- |-------|---|-------|------|-----|----------|-------|
300
- | 1 | #12 | OAuth2 PKCE flow | feature | P1 | agent | opus |
301
- | 2 | #14 | Token refresh edge cases | bug | P2 | agent | sonnet |
140
+ ## Board Overview
302
141
 
303
- ### Lane 3: General
142
+ > Full details: see `commands/board/shared-board-overview.md` (model pool, model selection heuristic, dashboard template, dependency data model, lane computation algorithm)
304
143
 
305
- | Order | # | Title | Type | Pri | Executor | Model |
306
- |-------|---|-------|------|-----|----------|-------|
307
- | 1 | #18 | Migrate to ESM | refactor | P2 | agent | opus |
308
- | 2 | #21 | Update CI matrix | infra | P3 | agent | sonnet |
309
- ```
144
+ If `meta:board-overview` is included in `board.labels.meta`, board commands will look for an open issue with that label to use as a live dashboard. This dashboard is auto-maintained and MUST be regenerated at the end of every board command run that mutates issues. For on-demand regeneration without running a full board command, use `hatch3r-board-refresh`.
310
145
 
311
146
  ---
312
147
 
@@ -314,28 +149,23 @@ Different lanes can be worked concurrently; within a lane, follow the listed ord
314
149
 
315
150
  These directives apply to ALL board commands. They supplement the project's tooling hierarchy.
316
151
 
317
- ### GitHub CLI-First
152
+ ### Platform CLI-First
153
+
154
+ All board commands MUST use the platform CLI as the primary interface for operations. CLI tools have lower token cost and faster execution than MCP equivalents.
318
155
 
319
- All board commands MUST use `gh` CLI as the primary interface for GitHub operations. CLI tools have lower token cost and faster execution than MCP equivalents.
156
+ > Platform-specific details: see `commands/board/shared-github.md` (Cross-Cutting Tooling GitHub CLI-First)
157
+ > Platform-specific details: see `commands/board/shared-azure-devops.md` (Cross-Cutting Tooling — Azure DevOps CLI-First)
158
+ > Platform-specific details: see `commands/board/shared-gitlab.md` (Cross-Cutting Tooling — GitLab CLI-First)
320
159
 
321
- **Prerequisites:** `gh auth login` must be completed, or `GITHUB_TOKEN` environment variable set. For Projects v2: `gh auth refresh -s project`.
160
+ ### Batch Operations
322
161
 
323
- | Operation | Primary (`gh` CLI) | Fallback (MCP) |
324
- | -------------------- | ----------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
325
- | List issues | `gh issue list` | `list_issues` |
326
- | Read issue details | `gh issue view` | `issue_read` |
327
- | Create/update issues | `gh issue create` / `gh issue edit` | `issue_write` |
328
- | Search issues | `gh search issues` | `search_issues` / `semantic_issues_search` |
329
- | Manage sub-issues | `sub_issue_write` (MCP only — no CLI equivalent) | `sub_issue_write` |
330
- | Add comments | `gh issue comment` | `add_issue_comment` |
331
- | Create PRs | `gh pr create` | `create_pull_request` |
332
- | Read PR details | `gh pr view` | `pull_request_read` |
333
- | Manage labels | `gh label create` / `gh label list` | `issue_write` (with labels) |
334
- | Projects v2 | `gh project item-add`, `gh project item-edit`, `gh project item-list`, `gh project field-list`, `gh project view` | `projects_write` / `projects_get` / `projects_list` |
335
- | CI/Actions | `gh run list` / `gh run view` | N/A |
336
- | Releases | `gh release create` | N/A |
162
+ All board commands MUST minimize user approval prompts by batching related operations:
337
163
 
338
- Fallback to MCP only for operations the `gh` CLI cannot handle: sub-issue management (`sub_issue_write`).
164
+ 1. **Collect before executing.** Gather all planned mutations (issue creation, label changes, sub-issue linking, board sync) into a complete batch before making any API calls.
165
+ 2. **Present batch summaries.** Before executing a batch, present the user with a summary table of all operations in the batch (e.g., issues to create, labels to apply, links to establish).
166
+ 3. **Single approval per batch.** Request ONE user confirmation for the entire batch. Do not prompt per-item when a batch summary has already been approved.
167
+ 4. **Sequential execution after approval.** Once approved, execute all operations in the batch sequentially without additional per-item prompts. Report progress inline (e.g., "Created issue #N... Linked sub-issue #M...") but do not pause for confirmation between operations.
168
+ 5. **Batch error handling.** If an individual operation within an approved batch fails, log the failure, continue with remaining operations, and summarize all failures at the end of the batch. Do not re-prompt for each failure.
339
169
 
340
170
  ### Context7 MCP + Web Research
341
171
 
@@ -367,3 +197,22 @@ These apply to all board commands. Follow them to minimize token consumption.
367
197
  4. **Limit documentation reads.** Read project documentation selectively -- TOC/headers first, full content only for relevant sections.
368
198
  5. **Do NOT read issue templates.** Required structure is provided inline in the command.
369
199
  6. **Follow the project's tooling hierarchy** for knowledge augmentation (Context7 MCP, web research).
200
+
201
+ ---
202
+
203
+ ## Run Cache Requirements
204
+
205
+ All mutating board commands MUST maintain a run cache with the following entries. The cache persists for the duration of the run and feeds into the End-of-Run Reconciliation Procedure.
206
+
207
+ | Key | Type | Description |
208
+ |-----|------|-------------|
209
+ | `created_issues` | `Map<number, {title, type, labels}>` | All issues created during this run |
210
+ | `updated_issues` | `Map<number, {title, changes[]}>` | All issues updated during this run |
211
+ | `sync_results` | `Map<number, {status: success\|failure, method: cli\|mcp\|skipped}>` | Board sync outcome per issue |
212
+ | `link_results` | `Map<number, {parent: number, status: native\|advisory\|comment-only}>` | Sub-issue link outcome per child |
213
+ | `pr_created` | `{number, branch, issues_closed[]}` or `null` | PR created during this run (if any) |
214
+ | `pr_association_map` | `Map<number, number[]>` | PR number → issue numbers it references |
215
+ | `board_item_ids` | `Map<number, string>` | Issue number → board item ID for subsequent updates |
216
+ | `errors` | `{step, issue?, message, recoverable}[]` | All errors encountered during the run |
217
+
218
+ Initialize all entries at the start of the run. Populate incrementally as operations execute. The reconciliation procedure reads these entries to detect and fix drift.
@@ -2,7 +2,17 @@
2
2
  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
+ tags: [core, planning]
5
6
  ---
7
+
8
+ ## Agent Pipeline
9
+
10
+ | Stage | Agent(s) | Parallel | Required |
11
+ |-------|----------|----------|----------|
12
+ | 1. Research | `hatch3r-researcher` (4 parallel: symptom-trace, root-cause, impact-analysis, regression) | Yes | Yes |
13
+ | 2. Document Generation | `hatch3r-docs-writer` (investigation report, ADRs) | Yes | Yes |
14
+ | 3. Todo Generation | Orchestrator (inline) | No | Yes |
15
+
6
16
  # Bug Plan — Complex Bug Investigation from Symptom to Board-Ready Fix Items
7
17
 
8
18
  Take a complex or ambiguous bug report and produce a structured investigation report (`docs/investigations/`), architectural decision records (`docs/adr/`) when the fix requires significant design choices, and structured `todo.md` entries (scoped fix items) ready for `hatch3r-board-fill`. Spawns parallel researcher sub-agents (symptom tracing, root cause investigation, impact assessment, regression research) to diagnose the bug from multiple angles before generating artifacts. AI proposes all outputs; user confirms before any files are written. Optionally chains into `hatch3r-board-fill` to create GitHub issues immediately.
@@ -66,10 +76,10 @@ Bug Brief:
66
76
  - `docs/adr/` — architectural decision records (scan for decisions relevant to the affected area)
67
77
  - `docs/investigations/` — prior investigation reports (check for related or recurring bugs)
68
78
  - `README.md` — project overview
69
- - `/.agents/hatch.json` — board configuration
79
+ - `.agents/hatch.json` — board configuration
70
80
  - Existing `todo.md` — current backlog (check for overlap or related items)
71
81
  2. Scan GitHub issues via `search_issues` for existing work related to the bug. Note duplicates, related bugs, or prior investigations.
72
- 3. If `/.agents/learnings/` exists, scan for learnings relevant to the affected area. Match by area and tags against the bug brief.
82
+ 3. If `.agents/learnings/` exists, scan for learnings relevant to the affected area. Match by area and tags against the bug brief.
73
83
  4. Present a context summary:
74
84
 
75
85
  ```
@@ -103,9 +113,12 @@ Spawn one sub-agent per research domain below concurrently, each following the *
103
113
  | 2 | `root-cause` | Rank hypotheses by likelihood, identify code smells, analyze dependencies |
104
114
  | 3 | `impact-analysis` | Map blast radius, affected flows/modules, data integrity risk, related symptoms |
105
115
  | 4 | `regression` | Analyze git history, dependency changes, identify introduction window |
116
+ | 5 | `requirements-elicitation` | Detect ambiguities in the bug report — missing reproduction details, unclear expected behavior, unstated assumptions about environment or data state |
106
117
 
107
118
  Each sub-agent produces the structured output defined by its mode in the hatch3r-researcher agent specification.
108
119
 
120
+ The `requirements-elicitation` sub-agent is particularly valuable for complex bugs because bug reports often contain ambiguous symptoms, unclear expected behavior, or missing environment/data context. Its structured questions help resolve unknowns before the investigation report is generated, reducing the chance of investigating the wrong hypothesis.
121
+
109
122
  Wait for all sub-agents to complete before proceeding.
110
123
 
111
124
  ---
@@ -389,7 +402,7 @@ If yes, instruct the user to invoke the `hatch3r-board-fill` command. Note that
389
402
  - **Sub-agent failure:** Retry the failed sub-agent once. If it fails again, present partial results from the remaining sub-agents and ask the user how to proceed (continue without that researcher's input / provide the missing information manually / abort).
390
403
  - **Conflicting researcher outputs:** Present both options side by side with trade-offs. Ask the user to decide. Do not silently pick one.
391
404
  - **File write failure:** Report the error and provide the full file content so the user can create the file manually.
392
- - **Missing project context:** If no `hatch3r-board-shared` or `/.agents/hatch.json` exists, proceed without board context — this command does not require board configuration.
405
+ - **Missing project context:** If no `hatch3r-board-shared` or `.agents/hatch.json` exists, proceed without board context — this command does not require board configuration.
393
406
  - **No existing specs or docs:** Proceed without spec references. Warn that the investigation will be less contextualized without existing project documentation. Recommend running `hatch3r-project-spec` or `hatch3r-codebase-map` first for best results.
394
407
  - **Duplicate detection:** If the bug overlaps significantly with existing todo.md items, GitHub issues, or prior investigation reports found in Step 2, present the overlap and ASK whether to proceed (augment existing / replace / abort).
395
408
  - **No clear root cause:** If all hypotheses are low-confidence, state this clearly. Recommend a focused debugging session (using `hatch3r-bug-fix` skill with the top hypothesis) rather than generating speculative fix items. ASK the user how to proceed.
@@ -2,11 +2,20 @@
2
2
  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
+ tags: [planning, brownfield]
5
6
  ---
6
7
  # Codebase Map — Brownfield Codebase Analysis & Spec Generation
7
8
 
8
9
  Analyze an existing codebase to reverse-engineer project documentation across **two dimensions**: business domain analysis and technical architecture analysis. Discovers modules, dependencies, conventions, tech stack, technical debt, business logic, domain models, and production readiness using parallel analyzer sub-agents. Outputs structured specs to `docs/specs/business/` (business domain, market context, production readiness) and `docs/specs/technical/` (modules, conventions, stack, debt), plus inferred architectural decision records to `docs/adr/`. Optionally generates a root-level `AGENTS.md` as the project's "README for agents." This command is **purely read-only** until the final write step — all analysis is static (file reading, pattern matching). Works for any language or framework.
9
10
 
11
+ ## Agent Pipeline
12
+
13
+ | Stage | Agent(s) | Parallel | Required |
14
+ |-------|----------|----------|----------|
15
+ | 1. Analysis | `hatch3r-researcher` analyzers (6 parallel: module, conventions, tech stack, concerns/debt, business domain, production readiness) | Yes | Yes |
16
+ | 2. Document Generation | `hatch3r-docs-writer` (parallel: technical spec, business spec, ADRs, health report) | Yes | Yes |
17
+ | 3. AGENTS.md | `hatch3r-docs-writer` (AGENTS.md generation/rework) | No | Yes |
18
+
10
19
  ---
11
20
 
12
21
  ## Shared Context
@@ -69,7 +78,7 @@ From config files and top-level imports, identify:
69
78
  - Check for `docs/specs/` — if exists, note contents (including `business/` and `technical/` subdirectories)
70
79
  - Check for `docs/adr/` — if exists, note contents
71
80
  - Check for `README.md`, `CONTRIBUTING.md`, `ARCHITECTURE.md`, or similar
72
- - Check for `/.agents/hatch.json` — if exists, this project already has hatch3r configuration
81
+ - Check for `.agents/hatch.json` — if exists, this project already has hatch3r configuration
73
82
  - Check for root `AGENTS.md` — if exists, note its contents
74
83
 
75
84
  If `docs/specs/` or `docs/adr/` already exist:
@@ -978,7 +987,21 @@ Strengths:
978
987
 
979
988
  ### Step 7: Write All Files
980
989
 
981
- Write all confirmed files to disk.
990
+ Spawn parallel `hatch3r-docs-writer` sub-agents via the Task tool (`subagent_type: "generalPurpose"`) to generate and write the documentation. Each docs-writer receives the merged analyzer output from Steps 3-6 and is responsible for one document category. All docs-writers run in parallel and follow the `hatch3r-docs-writer` agent protocol.
991
+
992
+ | Docs-Writer | Responsibility | Input |
993
+ |-------------|---------------|-------|
994
+ | Technical Spec Writer | `docs/specs/technical/` (glossary, overview, module specs) | Merged analyzer outputs from Sub-Agents 1-4 |
995
+ | Business Spec Writer | `docs/specs/business/` (glossary, overview, domain specs, production readiness) | Merged analyzer outputs from Sub-Agents 5-6, business context from Step 1 |
996
+ | ADR Writer | `docs/adr/` (all architectural decision records) | Inferred decisions from Step 5 |
997
+ | Health Report Writer | `docs/codebase-health.md` (if user confirmed in Step 6) | All 6 analyzer outputs, cross-reference findings from Step 3 |
998
+
999
+ Each docs-writer prompt must include:
1000
+ - The full merged analyzer output relevant to its document category
1001
+ - The confirmed scope, company stage, and business context from Step 1
1002
+ - The directory structure and file naming conventions below
1003
+ - Instruction to follow the `hatch3r-docs-writer` agent protocol
1004
+ - Instruction to create directories as needed before writing files
982
1005
 
983
1006
  #### 7a. Create Directories
984
1007
 
@@ -1080,13 +1103,27 @@ Next steps:
1080
1103
 
1081
1104
  ---
1082
1105
 
1083
- ### Step 8: AGENTS.md Generation
1106
+ ### Step 8 AGENTS.md (Mandatory)
1107
+
1108
+ This step is MANDATORY, not optional.
1084
1109
 
1085
- **ASK:** "Generate or update the root-level `AGENTS.md` with a project summary derived from the specs just created? This file serves as the 'README for agents' — consumed by OpenCode, Windsurf, and other AI coding tools so they understand your project's business context, architecture, and conventions from the first interaction.
1110
+ **If `AGENTS.md` exists at project root:**
1086
1111
 
1087
- (a) Yes generate it, (b) No skip, (c) Let me review the content first."
1112
+ **ASK:** "Your existing AGENTS.md may be outdated after generating new documentation. Would you like to rework it based on the new specs?"
1088
1113
 
1089
- If yes or review-first: generate `AGENTS.md` at the project root containing:
1114
+ - If **yes**: spawn a `hatch3r-docs-writer` sub-agent via the Task tool (`subagent_type: "generalPurpose"`) to regenerate AGENTS.md incorporating the newly generated specs, architecture overview, module map, and conventions. The docs-writer follows the `hatch3r-docs-writer` agent protocol.
1115
+ - If **no**: keep existing AGENTS.md unchanged. Log that the user declined the update.
1116
+
1117
+ **If no `AGENTS.md` exists:**
1118
+
1119
+ Generate AGENTS.md — there is no opt-out. Spawn a `hatch3r-docs-writer` sub-agent via the Task tool (`subagent_type: "generalPurpose"`) to create AGENTS.md following the `hatch3r-docs-writer` agent protocol. The docs-writer receives the full merged analyzer output and generates AGENTS.md with:
1120
+ - Project purpose and business context
1121
+ - Tech stack and architecture overview
1122
+ - Module map with responsibilities
1123
+ - Development conventions and patterns
1124
+ - Key specs and ADR references
1125
+
1126
+ The generated `AGENTS.md` should follow this structure:
1090
1127
 
1091
1128
  ```markdown
1092
1129
  # {Project Name} — Agent Instructions
@@ -1137,10 +1174,6 @@ If yes or review-first: generate `AGENTS.md` at the project root containing:
1137
1174
  - Health report: `docs/codebase-health.md`
1138
1175
  ```
1139
1176
 
1140
- If the user chose "review first," present the content and **ASK** for confirmation before writing.
1141
-
1142
- If `AGENTS.md` already exists, **ASK** before overwriting: "Root `AGENTS.md` already exists. (a) Replace entirely, (b) Append hatch3r section, (c) Skip."
1143
-
1144
1177
  ---
1145
1178
 
1146
1179
  ### Step 9: Cross-Command Handoff
@@ -2,7 +2,13 @@
2
2
  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
+ tags: [customize]
5
6
  ---
7
+
8
+ ## Agent Pipeline
9
+
10
+ This command runs as a single orchestrator without sub-agent delegation. Customization file management is performed inline.
11
+
6
12
  # Command Customization — Per-Command Configuration
7
13
 
8
14
  Customize individual command behavior for project-specific needs via `.hatch3r/commands/` configuration files. Supports structured YAML overrides and free-form markdown instruction injection, all propagated to every adapter output on sync.
@@ -2,7 +2,12 @@
2
2
  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
+ tags: [maintenance]
5
6
  ---
7
+ ## Agent Pipeline
8
+
9
+ This command monitors context health and recommends delegation. It does not spawn sub-agents directly — it recommends when the orchestrator should delegate to sub-agents due to context degradation.
10
+
6
11
  # Context Health — Conversation Context Monitoring
7
12
 
8
13
  Monitor and maintain healthy conversation context during long-running agent sessions. Detects context degradation before it impacts output quality and recommends corrective actions.
@@ -2,7 +2,12 @@
2
2
  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
+ tags: [maintenance]
5
6
  ---
7
+ ## Agent Pipeline
8
+
9
+ This command tracks token usage and costs. It does not spawn sub-agents directly — it monitors sub-agent usage across the session.
10
+
6
11
  # Cost Tracking — Token Usage and Cost Reporting
7
12
 
8
13
  Track token consumption and estimated costs across sub-agent workflows, board operations, and development sessions. Provides visibility into AI usage patterns and enforces cost guardrails.