hatch3r 1.0.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 (132) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +437 -0
  3. package/agents/hatch3r-a11y-auditor.md +126 -0
  4. package/agents/hatch3r-architect.md +160 -0
  5. package/agents/hatch3r-ci-watcher.md +123 -0
  6. package/agents/hatch3r-context-rules.md +97 -0
  7. package/agents/hatch3r-dependency-auditor.md +164 -0
  8. package/agents/hatch3r-devops.md +138 -0
  9. package/agents/hatch3r-docs-writer.md +97 -0
  10. package/agents/hatch3r-implementer.md +162 -0
  11. package/agents/hatch3r-learnings-loader.md +108 -0
  12. package/agents/hatch3r-lint-fixer.md +104 -0
  13. package/agents/hatch3r-perf-profiler.md +123 -0
  14. package/agents/hatch3r-researcher.md +642 -0
  15. package/agents/hatch3r-reviewer.md +81 -0
  16. package/agents/hatch3r-security-auditor.md +119 -0
  17. package/agents/hatch3r-test-writer.md +134 -0
  18. package/commands/hatch3r-agent-customize.md +146 -0
  19. package/commands/hatch3r-api-spec.md +49 -0
  20. package/commands/hatch3r-benchmark.md +50 -0
  21. package/commands/hatch3r-board-fill.md +504 -0
  22. package/commands/hatch3r-board-init.md +315 -0
  23. package/commands/hatch3r-board-pickup.md +672 -0
  24. package/commands/hatch3r-board-refresh.md +198 -0
  25. package/commands/hatch3r-board-shared.md +369 -0
  26. package/commands/hatch3r-bug-plan.md +410 -0
  27. package/commands/hatch3r-codebase-map.md +1182 -0
  28. package/commands/hatch3r-command-customize.md +94 -0
  29. package/commands/hatch3r-context-health.md +112 -0
  30. package/commands/hatch3r-cost-tracking.md +139 -0
  31. package/commands/hatch3r-dep-audit.md +171 -0
  32. package/commands/hatch3r-feature-plan.md +379 -0
  33. package/commands/hatch3r-healthcheck.md +307 -0
  34. package/commands/hatch3r-hooks.md +282 -0
  35. package/commands/hatch3r-learn.md +217 -0
  36. package/commands/hatch3r-migration-plan.md +51 -0
  37. package/commands/hatch3r-onboard.md +56 -0
  38. package/commands/hatch3r-project-spec.md +1153 -0
  39. package/commands/hatch3r-recipe.md +179 -0
  40. package/commands/hatch3r-refactor-plan.md +426 -0
  41. package/commands/hatch3r-release.md +328 -0
  42. package/commands/hatch3r-roadmap.md +556 -0
  43. package/commands/hatch3r-rule-customize.md +114 -0
  44. package/commands/hatch3r-security-audit.md +370 -0
  45. package/commands/hatch3r-skill-customize.md +93 -0
  46. package/commands/hatch3r-workflow.md +377 -0
  47. package/dist/cli/hooks-ZOTFDEA3.js +59 -0
  48. package/dist/cli/index.d.ts +2 -0
  49. package/dist/cli/index.js +3584 -0
  50. package/github-agents/hatch3r-docs-agent.md +46 -0
  51. package/github-agents/hatch3r-lint-agent.md +41 -0
  52. package/github-agents/hatch3r-security-agent.md +54 -0
  53. package/github-agents/hatch3r-test-agent.md +66 -0
  54. package/hooks/hatch3r-ci-failure.md +10 -0
  55. package/hooks/hatch3r-file-save.md +11 -0
  56. package/hooks/hatch3r-post-merge.md +10 -0
  57. package/hooks/hatch3r-pre-commit.md +11 -0
  58. package/hooks/hatch3r-pre-push.md +10 -0
  59. package/hooks/hatch3r-session-start.md +10 -0
  60. package/mcp/mcp.json +62 -0
  61. package/package.json +84 -0
  62. package/prompts/hatch3r-bug-triage.md +155 -0
  63. package/prompts/hatch3r-code-review.md +131 -0
  64. package/prompts/hatch3r-pr-description.md +173 -0
  65. package/rules/hatch3r-accessibility-standards.md +77 -0
  66. package/rules/hatch3r-accessibility-standards.mdc +75 -0
  67. package/rules/hatch3r-agent-orchestration.md +160 -0
  68. package/rules/hatch3r-api-design.md +176 -0
  69. package/rules/hatch3r-api-design.mdc +176 -0
  70. package/rules/hatch3r-browser-verification.md +73 -0
  71. package/rules/hatch3r-browser-verification.mdc +73 -0
  72. package/rules/hatch3r-ci-cd.md +70 -0
  73. package/rules/hatch3r-ci-cd.mdc +68 -0
  74. package/rules/hatch3r-code-standards.md +102 -0
  75. package/rules/hatch3r-code-standards.mdc +100 -0
  76. package/rules/hatch3r-component-conventions.md +102 -0
  77. package/rules/hatch3r-component-conventions.mdc +102 -0
  78. package/rules/hatch3r-data-classification.md +85 -0
  79. package/rules/hatch3r-data-classification.mdc +83 -0
  80. package/rules/hatch3r-dependency-management.md +17 -0
  81. package/rules/hatch3r-dependency-management.mdc +15 -0
  82. package/rules/hatch3r-error-handling.md +17 -0
  83. package/rules/hatch3r-error-handling.mdc +15 -0
  84. package/rules/hatch3r-feature-flags.md +112 -0
  85. package/rules/hatch3r-feature-flags.mdc +112 -0
  86. package/rules/hatch3r-git-conventions.md +47 -0
  87. package/rules/hatch3r-git-conventions.mdc +45 -0
  88. package/rules/hatch3r-i18n.md +90 -0
  89. package/rules/hatch3r-i18n.mdc +90 -0
  90. package/rules/hatch3r-learning-consult.md +29 -0
  91. package/rules/hatch3r-learning-consult.mdc +27 -0
  92. package/rules/hatch3r-migrations.md +17 -0
  93. package/rules/hatch3r-migrations.mdc +15 -0
  94. package/rules/hatch3r-observability.md +165 -0
  95. package/rules/hatch3r-observability.mdc +165 -0
  96. package/rules/hatch3r-performance-budgets.md +109 -0
  97. package/rules/hatch3r-performance-budgets.mdc +109 -0
  98. package/rules/hatch3r-secrets-management.md +76 -0
  99. package/rules/hatch3r-secrets-management.mdc +74 -0
  100. package/rules/hatch3r-security-patterns.md +211 -0
  101. package/rules/hatch3r-security-patterns.mdc +211 -0
  102. package/rules/hatch3r-testing.md +89 -0
  103. package/rules/hatch3r-testing.mdc +87 -0
  104. package/rules/hatch3r-theming.md +51 -0
  105. package/rules/hatch3r-theming.mdc +51 -0
  106. package/rules/hatch3r-tooling-hierarchy.md +92 -0
  107. package/rules/hatch3r-tooling-hierarchy.mdc +79 -0
  108. package/skills/hatch3r-a11y-audit/SKILL.md +131 -0
  109. package/skills/hatch3r-agent-customize/SKILL.md +75 -0
  110. package/skills/hatch3r-api-spec/SKILL.md +66 -0
  111. package/skills/hatch3r-architecture-review/SKILL.md +96 -0
  112. package/skills/hatch3r-bug-fix/SKILL.md +129 -0
  113. package/skills/hatch3r-ci-pipeline/SKILL.md +76 -0
  114. package/skills/hatch3r-command-customize/SKILL.md +67 -0
  115. package/skills/hatch3r-context-health/SKILL.md +76 -0
  116. package/skills/hatch3r-cost-tracking/SKILL.md +65 -0
  117. package/skills/hatch3r-dep-audit/SKILL.md +82 -0
  118. package/skills/hatch3r-feature/SKILL.md +129 -0
  119. package/skills/hatch3r-gh-agentic-workflows/SKILL.md +150 -0
  120. package/skills/hatch3r-incident-response/SKILL.md +86 -0
  121. package/skills/hatch3r-issue-workflow/SKILL.md +139 -0
  122. package/skills/hatch3r-logical-refactor/SKILL.md +73 -0
  123. package/skills/hatch3r-migration/SKILL.md +76 -0
  124. package/skills/hatch3r-perf-audit/SKILL.md +114 -0
  125. package/skills/hatch3r-pr-creation/SKILL.md +85 -0
  126. package/skills/hatch3r-qa-validation/SKILL.md +86 -0
  127. package/skills/hatch3r-recipe/SKILL.md +67 -0
  128. package/skills/hatch3r-refactor/SKILL.md +86 -0
  129. package/skills/hatch3r-release/SKILL.md +93 -0
  130. package/skills/hatch3r-rule-customize/SKILL.md +70 -0
  131. package/skills/hatch3r-skill-customize/SKILL.md +67 -0
  132. package/skills/hatch3r-visual-refactor/SKILL.md +89 -0
@@ -0,0 +1,379 @@
1
+ ---
2
+ id: hatch3r-feature-plan
3
+ type: command
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
+ ---
6
+ # Feature Plan — Single Feature Specification from Idea to Board-Ready Epic
7
+
8
+ Take a single feature idea and produce a complete feature specification (`docs/specs/`), architectural decision records (`docs/adr/`) when needed, and structured `todo.md` entries (epic + sub-items) ready for `hatch3r-board-fill`. Spawns parallel researcher sub-agents (codebase impact, feature design, architecture, risk & pitfalls) to analyze the feature 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.
9
+
10
+ ---
11
+
12
+ ## Shared Context
13
+
14
+ **Read the `hatch3r-board-shared` command at the start of the run** if it exists. While this command does not perform board operations directly, it establishes patterns and context (GitHub owner/repo, tooling directives) that downstream commands like `hatch3r-board-fill` rely on. Cache any values found.
15
+
16
+ ## Token-Saving Directives
17
+
18
+ 1. **Do not re-read files already cached.** Once researcher outputs are collected, reference them in memory — do not re-invoke sub-agents.
19
+ 2. **Limit documentation reads.** When reading existing project files for context, read TOC/headers first (~30 lines), expand only relevant sections.
20
+ 3. **Structured output only.** All sub-agent prompts require structured markdown output — no prose dumps.
21
+
22
+ ---
23
+
24
+ ## Workflow
25
+
26
+ Execute these steps in order. **Do not skip any step.** Ask the user at every checkpoint marked with ASK.
27
+
28
+ ### Step 1: Gather Feature Description
29
+
30
+ 1. **ASK:** "Tell me about the feature you want to plan. I need:
31
+ - **Feature name**
32
+ - **Description / goal** (one paragraph — what does it do and why is it needed?)
33
+ - **Target personas** (who benefits from this feature?)
34
+ - **Known constraints** (timeline, tech mandates, backward compatibility, etc.)
35
+
36
+ You can also point me to an existing spec section, PRD passage, or GitHub issue and I'll extract these from it."
37
+
38
+ 2. If the user provides a document reference or issue, read it and extract the four fields above.
39
+ 3. Present a structured summary:
40
+
41
+ ```
42
+ Feature Brief:
43
+ Name: {name}
44
+ Goal: {one-paragraph description}
45
+ Personas: {list with brief impact}
46
+ Constraints: {list}
47
+ ```
48
+
49
+ **ASK:** "Does this capture the feature correctly? Adjust anything before I send this to the research phase."
50
+
51
+ ---
52
+
53
+ ### Step 2: Load Project Context
54
+
55
+ 1. Check for existing documentation:
56
+ - `docs/specs/` — project specifications (read TOC/headers first, expand relevant sections only)
57
+ - `docs/adr/` — architectural decision records (scan for decisions relevant to the feature area)
58
+ - `README.md` — project overview
59
+ - `/.agents/hatch.json` — board configuration
60
+ - Existing `todo.md` — current backlog (check for overlap or related items)
61
+ 2. Scan GitHub issues via `search_issues` for existing work related to the feature. Note duplicates or partial overlaps.
62
+ 3. If `/.agents/learnings/` exists, scan for learnings relevant to the feature area. Match by area and tags against the feature brief.
63
+ 4. Present a context summary:
64
+
65
+ ```
66
+ Context Loaded:
67
+ Specs: {N} files in docs/specs/ ({relevant ones listed})
68
+ ADRs: {N} files in docs/adr/ ({relevant ones listed})
69
+ Existing todo.md: {found with N items / not found}
70
+ Related issues: {N} open issues with overlap ({list issue numbers})
71
+ Learnings: {N} relevant learnings ({areas})
72
+ Gaps: {list any missing context}
73
+ ```
74
+
75
+ **ASK:** "Here is the context I loaded. Provide additional constraints, related work, or context? (or confirm to proceed)"
76
+
77
+ ---
78
+
79
+ ### Step 3: Spawn Parallel Researcher Sub-Agents
80
+
81
+ Spawn one sub-agent per research domain below concurrently, each following the **hatch3r-researcher agent protocol**. Each receives the confirmed feature brief from Step 1 and the context summary from Step 2.
82
+
83
+ **Each sub-agent prompt must include:**
84
+ - The full confirmed feature brief
85
+ - The project context summary from Step 2
86
+ - Instruction to follow the **hatch3r-researcher agent protocol**
87
+ - The assigned mode (one per sub-agent) and depth level `deep`
88
+
89
+ | Sub-Agent | Researcher Mode | Focus |
90
+ |-----------|----------------|-------|
91
+ | 1 | `codebase-impact` | Map affected files, modules, integration points, coupling, and existing patterns |
92
+ | 2 | `feature-design` | Break down into sub-tasks, user stories, acceptance criteria, edge cases, effort |
93
+ | 3 | `architecture` | Data model, API contracts, component design, ADR candidates, dependencies |
94
+ | 4 | `risk-assessment` | Technical risks, security, performance, breaking changes, common pitfalls |
95
+
96
+ Each sub-agent produces the structured output defined by its mode in the hatch3r-researcher agent specification.
97
+
98
+ Wait for all sub-agents to complete before proceeding.
99
+
100
+ ---
101
+
102
+ ### Step 4: Synthesize & Review Research
103
+
104
+ 1. Present a **merged summary** combining key findings from all researchers:
105
+
106
+ ```
107
+ Research Summary:
108
+
109
+ Feature: {name}
110
+ Affected files: {N} files across {M} modules
111
+ Sub-tasks: {N} tasks ({X} parallelizable)
112
+ Effort: {total estimate}
113
+ ADRs needed: {N} architectural decisions
114
+ Risks: {N} risks ({X} high, {Y} med, {Z} low)
115
+ Breaking changes: {N} ({list if any})
116
+ Priority: {recommended P-level}
117
+ ```
118
+
119
+ 2. **Highlight conflicts** between researchers. Common conflict types:
120
+ - Feature design researcher scopes work that the risk researcher flags as dangerous
121
+ - Architecture researcher proposes a pattern that contradicts existing codebase conventions found by the codebase impact researcher
122
+ - Effort estimates that seem inconsistent with the scope of changes identified
123
+
124
+ 3. For each conflict, present both sides and a recommended resolution.
125
+
126
+ **ASK:** "Here is the merged research summary. Conflicts (if any) are highlighted above. Options:
127
+ - **Confirm** to proceed with spec and todo generation
128
+ - **Adjust** specific findings (tell me what to change)
129
+ - **Re-run** a specific researcher with updated parameters
130
+ - **Descope** to reduce the feature size"
131
+
132
+ ---
133
+
134
+ ### Step 5: Generate Feature Spec
135
+
136
+ From the merged researcher outputs, generate a feature specification document. Present all content for review before writing any files.
137
+
138
+ #### Feature Spec — `docs/specs/{NN}_{feature-slug}.md`
139
+
140
+ Determine the next sequential number by scanning existing files in `docs/specs/`. Use slugified feature name (lowercase, hyphens).
141
+
142
+ ```markdown
143
+ # {Feature Name}
144
+
145
+ ## Overview
146
+
147
+ {2-3 sentence summary of the feature and its purpose, derived from the confirmed feature brief}
148
+
149
+ ## Scope
150
+
151
+ ### In Scope
152
+ - {item derived from feature design researcher}
153
+
154
+ ### Out of Scope
155
+ - {item — explicitly listed to prevent scope creep}
156
+
157
+ ## Personas Affected
158
+
159
+ | Persona | Impact | Key Flows |
160
+ |---------|--------|-----------|
161
+ | {name} | {how this feature affects them} | {flows} |
162
+
163
+ ## Requirements
164
+
165
+ | Req ID | Requirement | Priority | Source |
166
+ |--------|-------------|----------|--------|
167
+ | {feature-slug}-R01 | {requirement} | P0/P1/P2/P3 | {researcher / feature brief} |
168
+
169
+ ## Sub-Features
170
+
171
+ | # | Sub-Feature | User Story | Acceptance Criteria | Effort |
172
+ |---|-------------|-----------|---------------------|--------|
173
+ | 1 | {title} | {story} | {criteria as checklist} | S/M/L/XL |
174
+
175
+ ## Architecture
176
+
177
+ ### Data Model Changes
178
+ {From architecture researcher — tables, schemas, migrations}
179
+
180
+ ### API / Interface Contracts
181
+ {From architecture researcher — endpoints, interfaces}
182
+
183
+ ### Component Design
184
+ {From architecture researcher — new and modified components}
185
+
186
+ ## Dependencies
187
+
188
+ | Depends On | Type | Status | Notes |
189
+ |-----------|------|--------|-------|
190
+ | {dependency} | Hard/Soft | Exists/Needs building | {notes} |
191
+
192
+ ## Edge Cases
193
+
194
+ - {edge case}: {expected behavior}
195
+
196
+ ## Risks & Mitigations
197
+
198
+ | Risk | Severity | Mitigation |
199
+ |------|----------|------------|
200
+ | {risk} | {level} | {strategy} |
201
+
202
+ ## Implementation Order
203
+
204
+ {Topological ordering of sub-tasks with parallel lanes identified}
205
+
206
+ 1. {task} (prerequisite — no dependencies)
207
+ 2. {task} (depends on 1)
208
+ 3. {task} + {task} (parallel — both depend on 2)
209
+ 4. {task} (depends on 3)
210
+
211
+ ---
212
+
213
+ **Owner / Reviewers / Last updated**
214
+ Owner: {tbd}
215
+ Reviewers: {tbd}
216
+ Last updated: {today's date}
217
+ ```
218
+
219
+ If a glossary exists (`docs/specs/00_glossary.md`), reference its stable IDs where applicable. If the feature introduces new entities or events, note them for glossary update.
220
+
221
+ **ASK:** "Here is the generated feature spec. Review the content before I write the file:
222
+ - `{NN}_{feature-slug}.md` — {sub-feature count} sub-features, {requirement count} requirements, {risk count} risks
223
+
224
+ Confirm, or tell me what to adjust."
225
+
226
+ ---
227
+
228
+ ### Step 6: Generate ADR(s) (If Applicable)
229
+
230
+ Only proceed if the architecture researcher identified decisions requiring ADRs in Step 3. If no ADRs are needed, skip to Step 7.
231
+
232
+ From the architecture researcher's "Architectural Decisions Requiring ADRs" output, create one ADR per decision.
233
+
234
+ #### ADR Format — `docs/adr/{NNNN}_{decision-slug}.md`
235
+
236
+ Determine the next sequential number by scanning existing files in `docs/adr/`. Use slugified decision titles.
237
+
238
+ ```markdown
239
+ # ADR-{NNNN}: {Decision Title}
240
+
241
+ ## Status
242
+
243
+ Proposed
244
+
245
+ ## Date
246
+
247
+ {today's date}
248
+
249
+ ## Context
250
+
251
+ {Why this decision is needed — business and technical context, derived from the feature brief and architecture researcher findings}
252
+
253
+ ## Decision
254
+
255
+ {What was decided and why}
256
+
257
+ ## Alternatives Considered
258
+
259
+ | Alternative | Pros | Cons | Why Not |
260
+ |-------------|------|------|---------|
261
+ | {option} | {pros} | {cons} | {reason} |
262
+
263
+ ## Consequences
264
+
265
+ ### Positive
266
+ - {consequence}
267
+
268
+ ### Negative
269
+ - {consequence}
270
+
271
+ ### Risks
272
+ - {risk}: {mitigation}
273
+
274
+ ## Related
275
+
276
+ - Feature spec: `docs/specs/{NN}_{feature-slug}.md`
277
+ ```
278
+
279
+ **ASK:** "Here are {N} ADR(s) generated from architectural decisions for this feature. Review before I write the files:
280
+ {list with titles}
281
+
282
+ Confirm, or tell me what to adjust."
283
+
284
+ ---
285
+
286
+ ### Step 7: Generate todo.md Entries
287
+
288
+ From the feature design researcher's sub-task catalog and the synthesized research, generate structured `todo.md` entries in the format that `hatch3r-board-fill` expects.
289
+
290
+ #### Entry Structure
291
+
292
+ One **epic-level entry** with a description referencing the feature spec, followed by **individual sub-item entries** if the feature breaks into 2+ sub-tasks:
293
+
294
+ ```markdown
295
+ - [ ] **{Feature name} epic**: {Feature overview, scope, key sub-tasks}. Ref: docs/specs/{NN}_{feature-slug}.md.
296
+ - [ ] **{Sub-task 1 title}**: {Description with acceptance criteria summary}. Ref: docs/specs/{NN}_{feature-slug}.md.
297
+ - [ ] **{Sub-task 2 title}**: {Description with acceptance criteria summary}. Ref: docs/specs/{NN}_{feature-slug}.md.
298
+ ```
299
+
300
+ If the feature is small enough to be a single task (effort S or M, no meaningful sub-tasks), produce a single standalone entry instead of an epic.
301
+
302
+ #### Placement
303
+
304
+ Determine the appropriate priority header based on the priority recommended in Step 4. Place entries under the matching `## P{N} — {Label}` header.
305
+
306
+ #### If `todo.md` Already Exists
307
+
308
+ **ASK:** "todo.md already exists with {N} items. How should I add the new entries?
309
+ - **(a) Append** under the appropriate priority header
310
+ - **(b) Merge** — deduplicate against existing items and reorganize
311
+ - **(c) Show me the entries** and I'll place them manually"
312
+
313
+ #### If `todo.md` Does Not Exist
314
+
315
+ Create a new `todo.md` with the appropriate priority header and the new entries.
316
+
317
+ Present the drafted entries for review.
318
+
319
+ **ASK:** "Here are the todo.md entries for this feature ({N} items — 1 epic + {M} sub-items). Review before I write:
320
+
321
+ {entries}
322
+
323
+ Confirm, or tell me what to adjust."
324
+
325
+ ---
326
+
327
+ ### Step 8: Write All Files
328
+
329
+ After all content is confirmed:
330
+
331
+ 1. Write the feature spec to `docs/specs/{NN}_{feature-slug}.md`. Create the `docs/specs/` directory if it does not exist.
332
+ 2. Write ADR(s) to `docs/adr/{NNNN}_{decision-slug}.md` (if any). Create the `docs/adr/` directory if it does not exist.
333
+ 3. Write or update `todo.md` at the project root.
334
+ 4. If a glossary exists and the feature introduces new entities/events, note glossary updates needed (do not modify the glossary automatically — flag for manual update or a follow-up `project-spec` run).
335
+ 5. Present a summary of all files created or modified:
336
+
337
+ ```
338
+ Files Created/Updated:
339
+ docs/specs/
340
+ {NN}_{feature-slug}.md — {sub-feature count} sub-features, {requirement count} requirements
341
+ docs/adr/
342
+ {NNNN}_{decision}.md — {decision title} (if applicable)
343
+ ...
344
+ todo.md — {N} entries added ({1} epic + {M} sub-items)
345
+ Glossary update needed: {yes/no — list new entities/events if yes}
346
+ ```
347
+
348
+ ---
349
+
350
+ ### Step 9 (Optional): Chain into Board-Fill
351
+
352
+ **ASK:** "All files written. Run `hatch3r-board-fill` to create GitHub issues from the new todo.md entries? (yes / not now)"
353
+
354
+ If yes, instruct the user to invoke the `hatch3r-board-fill` command. Note that board-fill will perform its own deduplication, grouping, dependency analysis, and readiness assessment on the entries.
355
+
356
+ ---
357
+
358
+ ## Error Handling
359
+
360
+ - **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).
361
+ - **Conflicting researcher outputs:** Present both options side by side with trade-offs. Ask the user to decide. Do not silently pick one.
362
+ - **File write failure:** Report the error and provide the full file content so the user can create the file manually.
363
+ - **Missing project context:** If no `hatch3r-board-shared` or `/.agents/hatch.json` exists, proceed without board context — this command does not require board configuration.
364
+ - **No existing specs or docs:** Proceed without spec references. Warn that the feature spec will be less contextualized without existing project documentation. Recommend running `hatch3r-project-spec` or `hatch3r-codebase-map` first for best results.
365
+ - **Duplicate detection:** If the feature overlaps significantly with existing todo.md items or GitHub issues found in Step 2, present the overlap and ASK whether to proceed (augment existing / replace / abort).
366
+
367
+ ## Guardrails
368
+
369
+ - **Never skip ASK checkpoints.** Every step with an ASK must pause for user confirmation.
370
+ - **Never write files without user review and confirmation.** All generated content is presented first.
371
+ - **Always delegate research to the hatch3r-researcher agent protocol.** Researcher sub-agents handle Context7 MCP, web research, and the tooling hierarchy internally.
372
+ - **Stay within the feature scope** defined by the user in Step 1. Do not invent sub-features the user did not describe or imply. Flag scope expansion opportunities but do not act on them without explicit approval.
373
+ - **todo.md must be compatible with board-fill format** — markdown checklist with bold titles, grouped by priority, referencing source specs.
374
+ - **ADRs use the same format as `hatch3r-project-spec`** — Status, Date, Context, Decision, Alternatives, Consequences.
375
+ - **Feature spec must reference existing glossary IDs** where a glossary exists. Do not create conflicting stable IDs.
376
+ - **Do not over-specify.** Keep the spec at the right level of detail for board-fill to create actionable issues. Avoid implementation details that belong in code.
377
+ - **All 4 researchers must complete before proceeding to Step 4.** Do not generate specs from partial research.
378
+ - **Respect the project's tooling hierarchy** for knowledge augmentation: project docs first, then codebase exploration, then Context7 MCP, then web research.
379
+ - **Preserve existing todo.md content.** Never overwrite or reorganize existing items without explicit user approval.
@@ -0,0 +1,307 @@
1
+ ---
2
+ id: hatch3r-healthcheck
3
+ type: command
4
+ description: Create a full-product QA and testing audit epic with one sub-issue per project module
5
+ ---
6
+ # Healthcheck — Full Product QA & Testing Audit
7
+
8
+ Create a healthcheck epic on **{owner}/{repo}** with one sub-issue per logical project module, plus cross-module wiring and vision/roadmap alignment audits. Each sub-issue is a deep static-analysis audit task that, when picked up by the board workflow, produces a findings epic with actionable sub-issues for achieving full QA and testing coverage. The command only creates the initial audit epic — it does NOT execute any audits.
9
+
10
+ ---
11
+
12
+ ## Shared Context
13
+
14
+ **Read the project's shared board context at the start of the run** (e.g., `.cursor/commands/board-shared.md` or equivalent). It contains GitHub Context, Project Reference, Projects v2 sync procedure, and Board Overview template. Cache all values for the duration of this run.
15
+
16
+ ## Token-Saving Directives
17
+
18
+ Follow any **Token-Saving Directives** in the shared context file.
19
+
20
+ ---
21
+
22
+ ## Module Discovery
23
+
24
+ The product is divided into logical modules. Discover modules from the project structure:
25
+
26
+ 1. **Scan for modules:** Inspect top-level directories (e.g., `src/`, `functions/`, `packages/`) and identify logical units.
27
+ 2. **Map to specs:** If `docs/specs/` exists, map each module to relevant spec files.
28
+ 3. **Build taxonomy:** Produce a table of modules with their directories and primary specs.
29
+
30
+ Example structure (adapt to project):
31
+
32
+ | # | Module | Directories | Primary Specs |
33
+ |---|--------|-------------|----------------|
34
+ | 1 | Core Engine | `src/engine/` | `02_core-engine.md` |
35
+ | 2 | Events | `src/events/` | `03_event-model.md` |
36
+ | ... | ... | ... | ... |
37
+
38
+ Plus two cross-cutting audits:
39
+
40
+ | # | Audit | Scope |
41
+ |---|-------|-------|
42
+ | W | Cross-Module Wiring | Integration points between all modules |
43
+ | R | Product vs Vision, Roadmap & Concept Alignment | Implementation vs product vision, roadmap, and specs |
44
+
45
+ ---
46
+
47
+ ## Workflow
48
+
49
+ Execute these steps in order. **Do not skip any step.** Ask the user at every checkpoint marked with ASK.
50
+
51
+ ### Step 1: Load Context & Pre-Flight Check
52
+
53
+ 1. Read the shared board context and cache GitHub Context, Projects v2 config, and sync procedure.
54
+ 2. If `docs/specs/00_glossary.md` exists, read the first 30 lines for TOC/section headers.
55
+ 3. Scan for existing healthcheck epics: `search_issues` with `owner: {owner}`, `repo: {repo}`, query `label:meta:healthcheck state:open`.
56
+ 4. If an open healthcheck epic exists:
57
+
58
+ **ASK:** "An open healthcheck epic already exists: #{number} — {title}. (a) Abort, (b) close the existing one and create a new healthcheck, (c) proceed and create a second healthcheck."
59
+
60
+ 5. Fetch all open issues (`list_issues`, paginate, exclude `meta:board-overview`). Cache for Board Overview regeneration in Step 7.
61
+
62
+ ---
63
+
64
+ ### Step 2: Determine Audit Modules
65
+
66
+ 1. Build the module taxonomy from directory structure (see Module Discovery above).
67
+ 2. If the user specified specific modules in their invocation, filter the taxonomy to only those modules. The two cross-cutting audits (Wiring, Roadmap) are always included unless the user explicitly excludes them.
68
+ 3. Validate that the directories for each selected module exist in the workspace. Warn if any directory is missing.
69
+
70
+ Present the selected modules:
71
+
72
+ ```
73
+ Healthcheck Audit Scope:
74
+
75
+ Level 1 (parallel):
76
+ 1. {Module 1} — {path}/
77
+ 2. {Module 2} — {path}/
78
+ ...
79
+
80
+ Level 2 (after all Level 1 complete):
81
+ W. Cross-Module Wiring — integration points
82
+ R. Product vs Vision, Roadmap & Concept Alignment — vision + roadmap + specs
83
+ ```
84
+
85
+ **ASK:** "These modules will be audited. Confirm, add, or remove modules."
86
+
87
+ ---
88
+
89
+ ### Step 3: Create Healthcheck Epic
90
+
91
+ Create the parent epic via `issue_write` with `method: create`, `owner: {owner}`, `repo: {repo}`.
92
+
93
+ **Title:** `[Healthcheck]: Full Product QA & Testing Audit`
94
+
95
+ **Labels:** `type:epic`, `meta:healthcheck`, `status:ready`, `executor:agent`, `priority:p1`, `area:testing`
96
+
97
+ **Body:**
98
+
99
+ ```markdown
100
+ ## Overview
101
+
102
+ Full-product healthcheck audit covering {N} logical modules plus cross-module wiring and roadmap alignment analysis. Each sub-issue performs a deep static analysis of one module and produces a findings epic with actionable sub-issues for achieving full QA and testing coverage.
103
+
104
+ ## Sub-Issues
105
+
106
+ ### Level 1 — Module Audits (parallel)
107
+
108
+ - [ ] #{part-1} — Audit: {Module 1}
109
+ - [ ] #{part-2} — Audit: {Module 2}
110
+ ...
111
+
112
+ ### Level 2 — Cross-Cutting Audits (after all Level 1)
113
+
114
+ - [ ] #{wiring} — Audit: Cross-Module Wiring
115
+ - [ ] #{roadmap} — Audit: Product vs Vision, Roadmap & Concept Alignment
116
+
117
+ ## Implementation Order
118
+
119
+ ### 1
120
+
121
+ - [ ] #{part-1} — Audit: {Module 1}
122
+ - [ ] #{part-2} — Audit: {Module 2}
123
+ ...all module audits...
124
+
125
+ ### 2 -- after #{part-1}, #{part-2}, ... #{part-N}
126
+
127
+ - [ ] #{wiring} — Audit: Cross-Module Wiring
128
+ - [ ] #{roadmap} — Audit: Product vs Vision, Roadmap & Concept Alignment
129
+
130
+ ## Acceptance Criteria
131
+
132
+ - [ ] All sub-issue audits completed
133
+ - [ ] One findings epic created per audited module (with `meta:healthcheck-findings` label)
134
+ - [ ] All findings epics have sub-issues with acceptance criteria
135
+ - [ ] All findings epics integrated into Projects v2 board
136
+ - [ ] Cross-cutting findings epics have correct dependencies on module findings epics
137
+
138
+ ## Dependencies
139
+
140
+ None.
141
+ ```
142
+
143
+ Record the returned `number` and internal numeric `id` for the epic.
144
+
145
+ ---
146
+
147
+ ### Step 4: Create Module Audit Sub-Issues
148
+
149
+ For each module in the selected taxonomy, create a sub-issue via `issue_write` with `method: create`.
150
+
151
+ **Title:** `Audit: {Module Name}`
152
+
153
+ **Labels:** `type:qa`, `status:ready`, `executor:agent`, `priority:p1`
154
+
155
+ **Body:** Use the Module Audit Sub-Issue Template below, filling in the module-specific fields.
156
+
157
+ After creating each sub-issue, link it to the parent epic via `sub_issue_write` with `method: add`, using the parent `issue_number` and the child's internal numeric `id`.
158
+
159
+ Record all returned sub-issue numbers for use in Step 5.
160
+
161
+ #### Module Audit Sub-Issue Template
162
+
163
+ ```markdown
164
+ ## Audit: {Module Name}
165
+
166
+ > Parent: #{healthcheck-epic-number} — [Healthcheck]: Full Product QA & Testing Audit
167
+
168
+ ### Scope
169
+
170
+ **Directories:** {comma-separated directory paths from taxonomy}
171
+ **Primary Specs:** {spec filenames from taxonomy}
172
+ **Test Directories:** Search `tests/unit/`, `tests/integration/`, `tests/e2e/`, `tests/rules/` for files matching this module.
173
+
174
+ ### Audit Protocol
175
+
176
+ Perform a deep static analysis of this module. Do NOT execute tests or modify code — review source files, spec documents, and existing test files only.
177
+
178
+ #### 1. Test Coverage Analysis
179
+
180
+ - List all exported functions, classes, and modules in the scope directories
181
+ - Map each to existing test files in `tests/`
182
+ - Identify untested code paths and missing test scenarios
183
+ - Assess test quality: meaningful assertions, edge cases, error paths
184
+
185
+ #### 2. Spec Compliance
186
+
187
+ - Read the referenced specs fully
188
+ - Compare implementation against every requirement in the spec
189
+ - Flag deviations, partial implementations, and missing features
190
+
191
+ #### 3. Testing Pyramid Assessment
192
+
193
+ - Unit tests: coverage percentage estimate and quality assessment
194
+ - Integration tests: cross-module interactions and contract tests
195
+ - E2E tests: critical user flows covered for this module
196
+ - Security tests: invariants validated
197
+ - Performance tests: budget compliance verified
198
+
199
+ #### 4. Code Quality
200
+
201
+ - Error handling completeness (all error paths covered)
202
+ - Edge case coverage (boundary values, empty states, overflow)
203
+ - Input validation at module boundaries
204
+ - TypeScript strict mode compliance (no `any`, no `@ts-ignore` without linked issue)
205
+ - Max function length and file length compliance per project standards
206
+
207
+ #### 5. Performance & Privacy
208
+
209
+ - Performance budget compliance per project quality docs
210
+ - Privacy invariant adherence per project security docs
211
+
212
+ ### Output — Findings Epic
213
+
214
+ After completing the audit, create a findings epic on GitHub.
215
+
216
+ **Create via `issue_write`:**
217
+
218
+ - **Title:** `[QA Findings]: {Module Name}`
219
+ - **Labels:** `type:epic`, `meta:healthcheck-findings`, `status:ready`, `executor:agent`, `priority:p1`
220
+ - **Body:** Overview of findings count and severity, sub-issues checklist, implementation order, acceptance criteria ("done when all finding sub-issues are resolved").
221
+
222
+ **Create sub-issues** — one per actionable finding. Each must include:
223
+
224
+ - Problem description with evidence (file paths, line references, spec section)
225
+ - Suggested fix approach
226
+ - Acceptance criteria (specific and testable)
227
+ - Labels: `type:qa` for test gaps, `type:bug` for spec deviations, `type:refactor` for code quality, plus relevant `area:*` label
228
+
229
+ **Link sub-issues** to the findings epic via `sub_issue_write`.
230
+
231
+ **Board integration** — for the findings epic and every sub-issue:
232
+
233
+ Follow the **Projects v2 Sync Procedure** from `hatch3r-board-shared` (gh CLI primary). Set status to Ready using the project's status field option ID.
234
+
235
+ ### Completion
236
+
237
+ Return to the parent orchestrator with:
238
+
239
+ - Findings epic issue number
240
+ - Total findings count
241
+ - Breakdown by type (test gaps, spec deviations, code quality, performance, privacy)
242
+ - Any blockers encountered
243
+ ```
244
+
245
+ ---
246
+
247
+ ### Step 5: Create Cross-Cutting Audit Sub-Issues
248
+
249
+ Create two additional sub-issues with dependencies on all module audit sub-issues.
250
+
251
+ #### 5a. Cross-Module Wiring Audit
252
+
253
+ **Title:** `Audit: Cross-Module Wiring`
254
+
255
+ **Labels:** `type:qa`, `status:ready`, `executor:agent`, `priority:p1`, `has-dependencies`
256
+
257
+ **Body:** Scope: Analyze integration points between all project modules. This audit runs AFTER all module audits complete — use their findings for additional context. Follow the same Output — Findings Epic instructions as module audits. Include Dependencies section: Blocked by #{part-audit-1}, #{part-audit-2}, ... #{part-audit-N}
258
+
259
+ Link to parent epic via `sub_issue_write`.
260
+
261
+ #### 5b. Product vs Vision, Roadmap & Concept Alignment Audit
262
+
263
+ **Title:** `Audit: Product vs Vision, Roadmap & Concept Alignment`
264
+
265
+ **Labels:** `type:qa`, `status:ready`, `executor:agent`, `priority:p1`, `has-dependencies`
266
+
267
+ **Body:** Scope: Compare the current implementation against the product vision, roadmap, and all specification documents. This audit runs AFTER all module audits complete. Include Dependencies section: Blocked by #{part-audit-1}, #{part-audit-2}, ... #{part-audit-N}. Follow the same Output — Findings Epic instructions.
268
+
269
+ Link to parent epic via `sub_issue_write`.
270
+
271
+ ---
272
+
273
+ ### Step 6: Finalize Epic & Set Dependencies
274
+
275
+ 1. **Update the healthcheck epic body** with the actual sub-issue numbers in the Sub-Issues checklist and Implementation Order section. Use `issue_write` with `method: update`.
276
+
277
+ 2. **Verify dependency sections** on the wiring and roadmap sub-issues contain the correct module audit sub-issue numbers.
278
+
279
+ 3. Present a summary with epic number, sub-issues, and total count.
280
+
281
+ ---
282
+
283
+ ### Step 7: Board Integration
284
+
285
+ 1. **Projects v2 Sync:** Follow the **Projects v2 Sync Procedure** from `hatch3r-board-shared` (gh CLI primary) for the healthcheck epic and ALL sub-issues. Set status to Ready using the project's status field option ID.
286
+
287
+ 2. **Board Overview Regeneration:** Regenerate the Board Overview using the **Board Overview Template** from the shared context. Use cached board data from Step 1, updated with the newly created healthcheck epic. Skip silently if no board overview issue exists.
288
+
289
+ ---
290
+
291
+ ## Error Handling
292
+
293
+ - `search_issues` failure: retry once, then warn and proceed (assume no existing healthcheck).
294
+ - `issue_write` failure: report the error, retry once. If still failing, present the drafted body for manual creation.
295
+ - `sub_issue_write` failure: report but do not delete the created sub-issue. Note the unlinking for manual fix.
296
+ - Projects v2 sync failure (gh CLI or MCP): warn and continue. Board sync can be fixed later via board-refresh.
297
+
298
+ ## Guardrails
299
+
300
+ - **Never skip ASK checkpoints.**
301
+ - **Use GitHub MCP tools for issue operations** (create, update, link). For Projects v2 board integration, follow the sync procedure from hatch3r-board-shared (gh CLI primary).
302
+ - **The command ONLY creates issues.** It does NOT execute any audits, run tests, or modify code.
303
+ - **Always include the `meta:healthcheck` label** on the healthcheck epic.
304
+ - **Always include `meta:healthcheck-findings`** in the output instructions for audit sub-issues.
305
+ - **Preserve dependency ordering.** Level 2 sub-issues must reference all Level 1 sub-issues in their Dependencies section.
306
+ - **Board Overview is auto-maintained.** Exclude it from all analysis. One board overview issue at a time.
307
+ - **Do not expand scope.** The command creates exactly the discovered modules plus the two cross-cutting audits. No additional issue types.