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.
- package/README.md +93 -322
- package/agents/hatch3r-a11y-auditor.md +24 -6
- package/agents/hatch3r-architect.md +20 -1
- package/agents/hatch3r-ci-watcher.md +31 -8
- package/agents/hatch3r-context-rules.md +14 -2
- package/agents/hatch3r-dependency-auditor.md +21 -5
- package/agents/hatch3r-devops.md +37 -6
- package/agents/hatch3r-docs-writer.md +19 -3
- package/agents/hatch3r-fixer.md +171 -0
- package/agents/hatch3r-implementer.md +84 -11
- package/agents/hatch3r-learnings-loader.md +69 -13
- package/agents/hatch3r-lint-fixer.md +19 -14
- package/agents/hatch3r-perf-profiler.md +18 -1
- package/agents/hatch3r-researcher.md +440 -5
- package/agents/hatch3r-reviewer.md +97 -5
- package/agents/hatch3r-security-auditor.md +23 -5
- package/agents/hatch3r-test-writer.md +21 -10
- package/checks/README.md +49 -0
- package/checks/code-quality.md +49 -0
- package/checks/performance.md +58 -0
- package/checks/security.md +58 -0
- package/checks/testing.md +53 -0
- package/commands/board/pickup-azure-devops.md +81 -0
- package/commands/board/pickup-delegation-multi.md +197 -0
- package/commands/board/pickup-delegation.md +100 -0
- package/commands/board/pickup-github.md +82 -0
- package/commands/board/pickup-gitlab.md +81 -0
- package/commands/board/pickup-modes.md +143 -0
- package/commands/board/pickup-post-impl.md +120 -0
- package/commands/board/shared-azure-devops.md +149 -0
- package/commands/board/shared-board-overview.md +215 -0
- package/commands/board/shared-github.md +169 -0
- package/commands/board/shared-gitlab.md +142 -0
- package/commands/hatch3r-agent-customize.md +40 -2
- package/commands/hatch3r-api-spec.md +294 -32
- package/commands/hatch3r-benchmark.md +386 -32
- package/commands/hatch3r-board-fill.md +161 -25
- package/commands/hatch3r-board-groom.md +595 -0
- package/commands/hatch3r-board-init.md +203 -46
- package/commands/hatch3r-board-pickup.md +79 -457
- package/commands/hatch3r-board-refresh.md +98 -27
- package/commands/hatch3r-board-shared.md +87 -238
- package/commands/hatch3r-bug-plan.md +16 -3
- package/commands/hatch3r-codebase-map.md +43 -10
- package/commands/hatch3r-command-customize.md +6 -0
- package/commands/hatch3r-context-health.md +5 -0
- package/commands/hatch3r-cost-tracking.md +5 -0
- package/commands/hatch3r-debug.md +426 -0
- package/commands/hatch3r-dep-audit.md +7 -1
- package/commands/hatch3r-feature-plan.md +74 -12
- package/commands/hatch3r-healthcheck.md +17 -1
- package/commands/hatch3r-hooks.md +16 -10
- package/commands/hatch3r-learn.md +15 -9
- package/commands/hatch3r-migration-plan.md +333 -33
- package/commands/hatch3r-onboard.md +327 -38
- package/commands/hatch3r-project-spec.md +46 -10
- package/commands/hatch3r-quick-change.md +336 -0
- package/commands/hatch3r-recipe.md +6 -0
- package/commands/hatch3r-refactor-plan.md +29 -13
- package/commands/hatch3r-release.md +13 -3
- package/commands/hatch3r-revision.md +395 -0
- package/commands/hatch3r-roadmap.md +18 -3
- package/commands/hatch3r-rule-customize.md +6 -0
- package/commands/hatch3r-security-audit.md +17 -1
- package/commands/hatch3r-skill-customize.md +6 -0
- package/commands/hatch3r-test-plan.md +532 -0
- package/commands/hatch3r-workflow.md +113 -38
- package/dist/cli/index.js +5184 -2593
- package/dist/cli/index.js.map +1 -0
- package/github-agents/hatch3r-docs-agent.md +1 -0
- package/github-agents/hatch3r-lint-agent.md +1 -0
- package/github-agents/hatch3r-security-agent.md +1 -0
- package/github-agents/hatch3r-test-agent.md +1 -0
- package/hooks/hatch3r-ci-failure.md +30 -0
- package/hooks/hatch3r-file-save.md +22 -0
- package/hooks/hatch3r-post-merge.md +23 -0
- package/hooks/hatch3r-pre-commit.md +23 -0
- package/hooks/hatch3r-pre-push.md +22 -0
- package/hooks/hatch3r-session-start.md +22 -0
- package/mcp/mcp.json +22 -3
- package/package.json +4 -7
- package/prompts/hatch3r-bug-triage.md +1 -0
- package/prompts/hatch3r-code-review.md +1 -0
- package/prompts/hatch3r-pr-description.md +1 -0
- package/rules/hatch3r-accessibility-standards.md +1 -0
- package/rules/hatch3r-agent-orchestration.md +326 -53
- package/rules/hatch3r-agent-orchestration.mdc +225 -0
- package/rules/hatch3r-api-design.md +4 -1
- package/rules/hatch3r-browser-verification.md +33 -1
- package/rules/hatch3r-browser-verification.mdc +29 -0
- package/rules/hatch3r-ci-cd.md +5 -1
- package/rules/hatch3r-ci-cd.mdc +4 -1
- package/rules/hatch3r-code-standards.md +18 -0
- package/rules/hatch3r-code-standards.mdc +10 -1
- package/rules/hatch3r-component-conventions.md +4 -1
- package/rules/hatch3r-data-classification.md +1 -0
- package/rules/hatch3r-deep-context.md +94 -0
- package/rules/hatch3r-deep-context.mdc +69 -0
- package/rules/hatch3r-dependency-management.md +13 -0
- package/rules/hatch3r-feature-flags.md +4 -1
- package/rules/hatch3r-git-conventions.md +1 -0
- package/rules/hatch3r-i18n.md +4 -1
- package/rules/hatch3r-learning-consult.md +4 -2
- package/rules/hatch3r-learning-consult.mdc +3 -2
- package/rules/hatch3r-migrations.md +12 -0
- package/rules/hatch3r-observability.md +293 -1
- package/rules/hatch3r-performance-budgets.md +5 -2
- package/rules/hatch3r-performance-budgets.mdc +1 -1
- package/rules/hatch3r-secrets-management.md +11 -3
- package/rules/hatch3r-secrets-management.mdc +10 -3
- package/rules/hatch3r-security-patterns.md +23 -3
- package/rules/hatch3r-security-patterns.mdc +8 -2
- package/rules/hatch3r-testing.md +1 -0
- package/rules/hatch3r-theming.md +4 -1
- package/rules/hatch3r-tooling-hierarchy.md +42 -15
- package/rules/hatch3r-tooling-hierarchy.mdc +27 -4
- package/skills/hatch3r-a11y-audit/SKILL.md +1 -0
- package/skills/hatch3r-agent-customize/SKILL.md +3 -0
- package/skills/hatch3r-api-spec/SKILL.md +1 -0
- package/skills/hatch3r-architecture-review/SKILL.md +6 -2
- package/skills/hatch3r-bug-fix/SKILL.md +4 -1
- package/skills/hatch3r-ci-pipeline/SKILL.md +1 -0
- package/skills/hatch3r-command-customize/SKILL.md +1 -0
- package/skills/hatch3r-context-health/SKILL.md +2 -1
- package/skills/hatch3r-cost-tracking/SKILL.md +1 -0
- package/skills/hatch3r-dep-audit/SKILL.md +6 -2
- package/skills/hatch3r-feature/SKILL.md +9 -2
- package/skills/hatch3r-gh-agentic-workflows/SKILL.md +130 -21
- package/skills/hatch3r-incident-response/SKILL.md +11 -5
- package/skills/hatch3r-issue-workflow/SKILL.md +12 -7
- package/skills/hatch3r-logical-refactor/SKILL.md +1 -0
- package/skills/hatch3r-migration/SKILL.md +1 -0
- package/skills/hatch3r-perf-audit/SKILL.md +2 -1
- package/skills/hatch3r-pr-creation/SKILL.md +20 -10
- package/skills/hatch3r-qa-validation/SKILL.md +2 -1
- package/skills/hatch3r-recipe/SKILL.md +1 -0
- package/skills/hatch3r-refactor/SKILL.md +7 -1
- package/skills/hatch3r-release/SKILL.md +15 -11
- package/skills/hatch3r-rule-customize/SKILL.md +1 -0
- package/skills/hatch3r-skill-customize/SKILL.md +1 -0
- package/skills/hatch3r-visual-refactor/SKILL.md +1 -0
- package/dist/cli/hooks-ZOTFDEA3.js +0 -59
- package/rules/hatch3r-error-handling.md +0 -17
- package/rules/hatch3r-error-handling.mdc +0 -15
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: hatch3r-debug
|
|
3
|
+
type: command
|
|
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
|
+
tags: [core, implementation]
|
|
6
|
+
---
|
|
7
|
+
# Debug — Instrument, Diagnose, and Fix from Runtime Evidence
|
|
8
|
+
|
|
9
|
+
Standalone debug-and-fix command that instruments the codebase with strategic debug logging, pauses for the user to reproduce the issue and provide runtime logs, performs root cause analysis from the collected evidence, implements the fix, and removes all debug artifacts. Five-stage workflow: Gather Context → Add Debug Logging → Collect Logs (user checkpoint) → Root Cause Analysis → Implement Fix. Works independently — no board integration, no GitHub issue required.
|
|
10
|
+
|
|
11
|
+
**When to use this command vs. other bug-related commands:**
|
|
12
|
+
|
|
13
|
+
- Use `hatch3r-debug` when: the bug is reproducible but the root cause is unclear, you need runtime evidence (log output) to diagnose, or static analysis alone is insufficient.
|
|
14
|
+
- Use `hatch3r-bug-plan` when: the bug is complex/ambiguous and needs a structured investigation plan with multiple researchers, phased fix items, and board integration.
|
|
15
|
+
- Use `hatch3r-bug-fix` skill directly when: the root cause is already known and the fix is localized.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Agent Pipeline
|
|
20
|
+
|
|
21
|
+
| Stage | Agent(s) | Parallel | Required |
|
|
22
|
+
|-------|----------|----------|----------|
|
|
23
|
+
| 1. Context | User input | No | Yes |
|
|
24
|
+
| 2. Debug Logging | `hatch3r-researcher` → `hatch3r-implementer` | Sequential | Yes |
|
|
25
|
+
| 3. Log Collection | User provides logs (ASK checkpoint) | No | Yes |
|
|
26
|
+
| 4. Root Cause Analysis | `hatch3r-researcher` (mode: `root-cause`) | No | Yes |
|
|
27
|
+
| 5a. Fix | `hatch3r-implementer` | No | Yes |
|
|
28
|
+
| 5b. Review Loop | `hatch3r-reviewer` → `hatch3r-fixer` (max 3) | No | Yes |
|
|
29
|
+
| 5c. Final Quality | `hatch3r-test-writer` + `hatch3r-security-auditor` | Yes | Yes |
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Scope
|
|
34
|
+
|
|
35
|
+
This command intentionally skips:
|
|
36
|
+
- Board context (`hatch3r-board-shared`)
|
|
37
|
+
- GitHub issues, PRs, and Projects v2 sync
|
|
38
|
+
- Learnings capture
|
|
39
|
+
- ADR or investigation report generation
|
|
40
|
+
- Documentation updates
|
|
41
|
+
|
|
42
|
+
It retains:
|
|
43
|
+
- Quality checks (lint, typecheck, test) — always mandatory
|
|
44
|
+
- Sub-agent delegation for all non-trivial work
|
|
45
|
+
- Full review pipeline in Stage 5 (reviewer, test-writer, security-auditor)
|
|
46
|
+
- `scope: always` rules from `.agents/rules/`
|
|
47
|
+
- Debug artifact cleanup guarantee
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Browser Automation
|
|
52
|
+
|
|
53
|
+
At the start of the command (before Stage 1), ask the user once whether to enable browser verification for this session.
|
|
54
|
+
|
|
55
|
+
**ASK:** "Enable browser verification for this debug session? If yes, I'll use the browser to verify debug logs appear in Stage 2 and verify the fix works in Stage 5. (yes / no)"
|
|
56
|
+
|
|
57
|
+
If the user enables browser verification:
|
|
58
|
+
- **Stage 2** — after adding debug logging, launch the application in the browser, reproduce the issue, and verify that `[HATCH3R-DEBUG]` log lines appear in the browser console or application output.
|
|
59
|
+
- **Stage 5** — after implementing the fix, launch the application in the browser, attempt to reproduce the original issue, and verify it no longer occurs.
|
|
60
|
+
|
|
61
|
+
If the user declines, skip all browser steps. Do not ask again during the session.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Global Rule Overrides
|
|
66
|
+
|
|
67
|
+
- **Git commands are fully permitted** during Stage 5 (Implement Fix), including `git add`, `git commit`, and `git push`. This override applies to delegated sub-agents invoked during fix implementation.
|
|
68
|
+
|
|
69
|
+
## Token-Saving Directives
|
|
70
|
+
|
|
71
|
+
1. **Do not re-read files already cached.** Once researcher or implementer outputs are collected, reference them in memory — do not re-invoke sub-agents for the same information.
|
|
72
|
+
2. **Limit documentation reads.** When reading project files for context, read TOC/headers first (~30 lines), expand only relevant sections.
|
|
73
|
+
3. **Structured output only.** All sub-agent prompts require structured markdown output — no prose dumps.
|
|
74
|
+
4. **No shared context loading.** Do NOT read `hatch3r-board-shared`. This is a standalone command.
|
|
75
|
+
5. **Targeted file reads only.** Read only files in the affected area identified in Stage 1.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Workflow
|
|
80
|
+
|
|
81
|
+
Execute these stages in order. **Do not skip any stage.** Ask the user at every checkpoint marked with ASK.
|
|
82
|
+
|
|
83
|
+
### Stage 1: Gather Bug Context
|
|
84
|
+
|
|
85
|
+
**Goal:** Understand the bug, its symptoms, affected area, and reproduction path before instrumenting anything.
|
|
86
|
+
|
|
87
|
+
#### 1a. Collect Bug Description
|
|
88
|
+
|
|
89
|
+
**ASK:** "Tell me about the bug you want to debug. I need:
|
|
90
|
+
- **What goes wrong** (symptoms, error messages, unexpected behavior)
|
|
91
|
+
- **What should happen** (expected behavior)
|
|
92
|
+
- **Affected area** (which feature, module, or page is impacted)
|
|
93
|
+
- **Reproduction steps** (how to trigger the bug — actions, inputs, sequence)
|
|
94
|
+
- **Environment** (browser, OS, environment, version — if relevant)
|
|
95
|
+
- **Frequency** (always reproducible, intermittent, environment-specific)
|
|
96
|
+
|
|
97
|
+
You can also paste an error log, stack trace, or screenshot description and I'll extract what I need."
|
|
98
|
+
|
|
99
|
+
#### 1b. Load Project Context
|
|
100
|
+
|
|
101
|
+
1. Check for existing documentation:
|
|
102
|
+
- `docs/specs/` — project specifications (read TOC/headers first, expand relevant sections only)
|
|
103
|
+
- `README.md` — project overview and setup instructions
|
|
104
|
+
- `AGENTS.md` or `.agents/rules/` — agent rules and project conventions
|
|
105
|
+
2. If `.agents/learnings/` exists, scan for learnings relevant to the affected area. Match by area and tags against the bug description.
|
|
106
|
+
3. Scan the affected code area — read the primary files involved, trace imports and dependencies one level deep.
|
|
107
|
+
|
|
108
|
+
**Knowledge hierarchy:** project specs → codebase exploration → Context7 MCP (`resolve-library-id` then `query-docs`) → web research. Exhaust each level before escalating to the next.
|
|
109
|
+
|
|
110
|
+
#### 1c. Classify Scope and Severity
|
|
111
|
+
|
|
112
|
+
Evaluate the bug and present a structured summary:
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
Bug Context:
|
|
116
|
+
Summary: {one-line description}
|
|
117
|
+
Symptoms: {what goes wrong, from the user's perspective}
|
|
118
|
+
Expected: {what should happen}
|
|
119
|
+
Affected area: {modules, files, or features impacted}
|
|
120
|
+
Reproduction: {steps, frequency, environment}
|
|
121
|
+
Severity: {Critical/High/Med/Low — with reasoning}
|
|
122
|
+
Scope estimate: {number of files likely involved}
|
|
123
|
+
Context loaded: {specs, learnings, rules found}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
**ASK:** "Does this capture the bug correctly? Adjust anything before I proceed to add debug logging."
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
### Stage 2: Add Debug Logging
|
|
131
|
+
|
|
132
|
+
**Goal:** Instrument the affected code with strategic debug logging to capture runtime evidence for diagnosis.
|
|
133
|
+
|
|
134
|
+
#### 2a. Analyze Code for Instrumentation Points (Researcher)
|
|
135
|
+
|
|
136
|
+
Spawn a `hatch3r-researcher` sub-agent via the Task tool (`subagent_type: "generalPurpose"`).
|
|
137
|
+
|
|
138
|
+
The researcher prompt MUST include:
|
|
139
|
+
- The confirmed bug context from Stage 1c.
|
|
140
|
+
- The affected files and modules identified in Stage 1b.
|
|
141
|
+
- Instruction to follow the **hatch3r-researcher agent protocol** with mode `symptom-trace`.
|
|
142
|
+
- Instruction to identify specific instrumentation points: decision branches, data flow boundaries, error handlers, state transitions, and external call sites in the affected area.
|
|
143
|
+
- All `scope: always` rule directives from `.agents/rules/`.
|
|
144
|
+
|
|
145
|
+
The researcher must produce a structured list of recommended instrumentation points:
|
|
146
|
+
|
|
147
|
+
```
|
|
148
|
+
Instrumentation Points:
|
|
149
|
+
1. {file}:{line range} — {why: decision branch / data boundary / error path / state transition}
|
|
150
|
+
2. {file}:{line range} — {why}
|
|
151
|
+
...
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Await the researcher result before proceeding.
|
|
155
|
+
|
|
156
|
+
#### 2b. Add Debug Logging (Implementer)
|
|
157
|
+
|
|
158
|
+
Spawn a `hatch3r-implementer` sub-agent via the Task tool (`subagent_type: "generalPurpose"`).
|
|
159
|
+
|
|
160
|
+
The implementer prompt MUST include:
|
|
161
|
+
- The researcher's instrumentation points from Stage 2a.
|
|
162
|
+
- The confirmed bug context from Stage 1c.
|
|
163
|
+
- All `scope: always` rule directives from `.agents/rules/`.
|
|
164
|
+
- Explicit instruction: do NOT create branches, commits, or PRs.
|
|
165
|
+
|
|
166
|
+
**Debug logging rules** (include these verbatim in the implementer prompt):
|
|
167
|
+
- Every debug log line MUST be prefixed with `[HATCH3R-DEBUG]` for easy identification and removal.
|
|
168
|
+
- Log the relevant variable values, function arguments, return values, or state at each instrumentation point.
|
|
169
|
+
- Use the project's existing logging mechanism (e.g., `console.log`, `logger.debug`, `print`) — do not introduce new logging dependencies.
|
|
170
|
+
- Keep debug logs minimal but informative — include the file name and a short description in each log line (e.g., `[HATCH3R-DEBUG] auth/login.ts:validateToken — token payload: {...}`).
|
|
171
|
+
- Do NOT modify application logic. Debug logging is observation-only.
|
|
172
|
+
- Do NOT add debug logging outside the affected area identified by the researcher.
|
|
173
|
+
|
|
174
|
+
Await the implementer result.
|
|
175
|
+
|
|
176
|
+
#### 2c. Verify Instrumentation
|
|
177
|
+
|
|
178
|
+
1. Collect the list of all files modified and the exact log statements added.
|
|
179
|
+
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
|
+
|
|
182
|
+
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
|
+
#### 2d. Present Debug Logging Summary
|
|
185
|
+
|
|
186
|
+
```
|
|
187
|
+
Debug Logging Added:
|
|
188
|
+
Files instrumented: {N}
|
|
189
|
+
Log statements added: {N}
|
|
190
|
+
Locations:
|
|
191
|
+
1. {file}:{line} — {description of what is logged}
|
|
192
|
+
2. {file}:{line} — {description}
|
|
193
|
+
...
|
|
194
|
+
Build status: {passing / issues fixed}
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
**ASK:** "Debug logging is in place. Here are the instrumented locations. Please:
|
|
198
|
+
1. Run the application
|
|
199
|
+
2. Reproduce the bug
|
|
200
|
+
3. Provide the log output (paste it here, provide a file path, or paste terminal output)
|
|
201
|
+
|
|
202
|
+
I'll wait for the logs before proceeding."
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
### Stage 3: Collect Logs (ASK Checkpoint)
|
|
207
|
+
|
|
208
|
+
**Goal:** Receive runtime log output from the user after they reproduce the issue with debug logging active.
|
|
209
|
+
|
|
210
|
+
This stage is entirely user-driven. **STOP and WAIT** for the user to provide log data.
|
|
211
|
+
|
|
212
|
+
#### 3a. Accept Log Input
|
|
213
|
+
|
|
214
|
+
Accept logs in any of these formats:
|
|
215
|
+
- **Pasted text**: log output pasted directly into the chat
|
|
216
|
+
- **File path**: path to a log file on disk (read the file)
|
|
217
|
+
- **Terminal output**: raw terminal output with the debug log lines
|
|
218
|
+
|
|
219
|
+
#### 3b. Parse and Structure Log Data
|
|
220
|
+
|
|
221
|
+
1. Extract all lines containing `[HATCH3R-DEBUG]` from the provided log output.
|
|
222
|
+
2. Preserve surrounding context lines (non-debug lines immediately before and after each debug line) for flow understanding.
|
|
223
|
+
3. Order the debug lines chronologically if timestamps are present.
|
|
224
|
+
4. Identify patterns: unexpected values, missing log lines (instrumentation points that should have fired but didn't), error traces, and anomalous state transitions.
|
|
225
|
+
|
|
226
|
+
Present the structured log analysis:
|
|
227
|
+
|
|
228
|
+
```
|
|
229
|
+
Log Analysis:
|
|
230
|
+
Total log lines received: {N}
|
|
231
|
+
Debug lines extracted: {N} (of {M} instrumentation points)
|
|
232
|
+
Missing instrumentation: {list of expected log points that did not fire}
|
|
233
|
+
Anomalies detected:
|
|
234
|
+
1. {file}:{line} — expected {X}, got {Y}
|
|
235
|
+
2. {file}:{line} — {description of anomaly}
|
|
236
|
+
...
|
|
237
|
+
Error traces: {any error stack traces found}
|
|
238
|
+
Execution flow: {brief narrative of what the logs reveal about the execution path}
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
**ASK:** "Here is the structured log analysis. Does this match what you observed? Provide additional logs or context if needed, or confirm to proceed to root cause analysis."
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
### Stage 4: Root Cause Analysis
|
|
246
|
+
|
|
247
|
+
**Goal:** Diagnose the root cause from the structured log evidence.
|
|
248
|
+
|
|
249
|
+
#### 4a. Spawn Root Cause Researcher
|
|
250
|
+
|
|
251
|
+
Spawn a `hatch3r-researcher` sub-agent via the Task tool (`subagent_type: "generalPurpose"`).
|
|
252
|
+
|
|
253
|
+
The researcher prompt MUST include:
|
|
254
|
+
- The confirmed bug context from Stage 1c.
|
|
255
|
+
- The structured log analysis from Stage 3b (full parsed output).
|
|
256
|
+
- The instrumentation point list from Stage 2a (to correlate expected vs. actual behavior).
|
|
257
|
+
- Instruction to follow the **hatch3r-researcher agent protocol** with mode `root-cause` and depth `deep`.
|
|
258
|
+
- All `scope: always` rule directives from `.agents/rules/`.
|
|
259
|
+
- Instruction to produce ranked hypotheses with evidence from the log data.
|
|
260
|
+
|
|
261
|
+
**Knowledge hierarchy for the researcher:** project specs → codebase → Context7 MCP → web research. Use `gh` CLI (e.g., `gh issue list`, `gh pr list`) for reading GitHub data; prefer `gh` over GitHub MCP tools.
|
|
262
|
+
|
|
263
|
+
Await the researcher result.
|
|
264
|
+
|
|
265
|
+
#### 4b. Present Diagnosis
|
|
266
|
+
|
|
267
|
+
Present the root cause diagnosis from the researcher:
|
|
268
|
+
|
|
269
|
+
```
|
|
270
|
+
Diagnosis Report:
|
|
271
|
+
Root cause: {description of the identified root cause}
|
|
272
|
+
Confidence: {High/Med/Low — with reasoning}
|
|
273
|
+
Evidence:
|
|
274
|
+
1. {log line or code reference supporting the diagnosis}
|
|
275
|
+
2. {log line or code reference}
|
|
276
|
+
...
|
|
277
|
+
Affected components: {list of files/modules involved in the root cause}
|
|
278
|
+
Secondary findings: {any additional issues discovered during analysis}
|
|
279
|
+
|
|
280
|
+
Recommended fix:
|
|
281
|
+
Approach: {description of the fix}
|
|
282
|
+
Files to modify: {list}
|
|
283
|
+
Risk: {Low/Med/High}
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
**ASK:** "Here is the diagnosis. Root cause: {summary}, confidence: {level}. Confirm to proceed with the fix, or adjust the diagnosis."
|
|
287
|
+
|
|
288
|
+
---
|
|
289
|
+
|
|
290
|
+
### Stage 5: Implement Fix
|
|
291
|
+
|
|
292
|
+
**Goal:** Fix the root cause, remove all debug logging, verify quality, and ensure no debug artifacts remain.
|
|
293
|
+
|
|
294
|
+
#### 5a. Core Fix (Implementer)
|
|
295
|
+
|
|
296
|
+
Spawn a `hatch3r-implementer` sub-agent via the Task tool (`subagent_type: "generalPurpose"`).
|
|
297
|
+
|
|
298
|
+
The implementer prompt MUST include:
|
|
299
|
+
- The confirmed diagnosis from Stage 4b (root cause, evidence, recommended fix approach).
|
|
300
|
+
- The full list of files modified in Stage 2b (debug logging locations) for cleanup reference.
|
|
301
|
+
- All `scope: always` rule directives from `.agents/rules/`.
|
|
302
|
+
- Explicit instruction: do NOT create branches, commits, or PRs.
|
|
303
|
+
|
|
304
|
+
**Fix implementation rules** (include these verbatim in the implementer prompt):
|
|
305
|
+
1. **Fix the root cause** as described in the diagnosis. Follow the recommended approach unless a better alternative is found during implementation — document any deviation.
|
|
306
|
+
2. **Remove ALL debug logging** added in Stage 2. Search for every `[HATCH3R-DEBUG]` occurrence across the entire codebase and remove each log statement. Verify zero `[HATCH3R-DEBUG]` occurrences remain after cleanup.
|
|
307
|
+
3. **Do not leave debug artifacts.** No commented-out debug lines, no disabled log statements, no leftover imports added solely for debug logging.
|
|
308
|
+
4. **Preserve existing logging.** Only remove log statements that contain `[HATCH3R-DEBUG]`. Do not modify or remove pre-existing application logs.
|
|
309
|
+
|
|
310
|
+
Await the implementer result.
|
|
311
|
+
|
|
312
|
+
#### 5b. Debug Cleanup Verification
|
|
313
|
+
|
|
314
|
+
After the implementer completes, independently verify that all debug artifacts are removed:
|
|
315
|
+
|
|
316
|
+
1. Search the entire codebase for `[HATCH3R-DEBUG]`. If any occurrences remain, remove them.
|
|
317
|
+
2. Search for any imports, variables, or utility functions that were added solely to support debug logging. Remove them.
|
|
318
|
+
3. Confirm the file count matches expectations — every file instrumented in Stage 2 should either be restored to its pre-debug state (if no fix was needed there) or contain only the fix changes.
|
|
319
|
+
|
|
320
|
+
#### 5c. Review Loop (Reviewer → Fixer)
|
|
321
|
+
|
|
322
|
+
Run a review-fix loop, maximum 3 iterations, until the reviewer reports a clean result.
|
|
323
|
+
|
|
324
|
+
**Each iteration:**
|
|
325
|
+
|
|
326
|
+
1. Spawn `hatch3r-reviewer` sub-agent via the Task tool (`subagent_type: "generalPurpose"`).
|
|
327
|
+
|
|
328
|
+
The reviewer prompt MUST include:
|
|
329
|
+
- The diff of all changes (use `git diff` on the working tree).
|
|
330
|
+
- The original bug context from Stage 1c.
|
|
331
|
+
- The diagnosis from Stage 4b.
|
|
332
|
+
- All `scope: always` rule directives from `.agents/rules/`.
|
|
333
|
+
- Instruction to verify: correctness of the fix, no remaining debug artifacts, code quality, no regressions introduced.
|
|
334
|
+
|
|
335
|
+
2. If the reviewer reports findings (critical or warning level):
|
|
336
|
+
- Spawn `hatch3r-fixer` sub-agent via the Task tool (`subagent_type: "generalPurpose"`) with the reviewer's findings.
|
|
337
|
+
- The fixer prompt MUST include all `scope: always` rule directives and the specific findings to address.
|
|
338
|
+
- Await the fixer result, then loop back to the reviewer.
|
|
339
|
+
|
|
340
|
+
3. If the reviewer reports clean (no critical or warning findings), exit the loop.
|
|
341
|
+
|
|
342
|
+
4. If 3 iterations complete without a clean result:
|
|
343
|
+
|
|
344
|
+
**ASK:** "Review loop completed 3 iterations with remaining findings: {summary}. Options: (a) proceed with current state, (b) I'll fix the remaining issues manually, (c) keep iterating."
|
|
345
|
+
|
|
346
|
+
#### 5d. Final Quality (Parallel)
|
|
347
|
+
|
|
348
|
+
After the review loop completes clean (or the user proceeds), spawn these two sub-agents **in parallel** via the Task tool (`subagent_type: "generalPurpose"`):
|
|
349
|
+
|
|
350
|
+
1. **`hatch3r-test-writer`** — write regression tests for the fix. The prompt MUST include:
|
|
351
|
+
- The bug context from Stage 1c (what was broken).
|
|
352
|
+
- The fix diff (what was changed).
|
|
353
|
+
- The root cause from Stage 4b.
|
|
354
|
+
- Instruction to write tests that would have caught this bug — regression tests targeting the specific failure mode.
|
|
355
|
+
- All `scope: always` rule directives from `.agents/rules/`.
|
|
356
|
+
|
|
357
|
+
2. **`hatch3r-security-auditor`** — security review of the fix. The prompt MUST include:
|
|
358
|
+
- The fix diff.
|
|
359
|
+
- The affected files and data flows.
|
|
360
|
+
- All `scope: always` rule directives from `.agents/rules/`.
|
|
361
|
+
|
|
362
|
+
Await both sub-agents. Apply any findings (additional tests, security fixes).
|
|
363
|
+
|
|
364
|
+
#### 5e. Final Quality Checks
|
|
365
|
+
|
|
366
|
+
Run the project's quality gates:
|
|
367
|
+
|
|
368
|
+
```bash
|
|
369
|
+
npm run lint && npm run typecheck && npm run test
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
Adapt commands to project conventions (check `package.json`, `Makefile`, `README.md`). Fix any failures before proceeding. Max 2 retry loops on quality check failures. After 2 retries:
|
|
373
|
+
|
|
374
|
+
**ASK:** "Quality checks still failing after 2 fix attempts: {specific failures}. Options: (a) I'll fix manually, (b) keep trying, (c) abort."
|
|
375
|
+
|
|
376
|
+
If browser verification is enabled: launch the application in the browser, attempt to reproduce the original bug, and verify it no longer occurs.
|
|
377
|
+
|
|
378
|
+
#### 5f. Present Fix Summary
|
|
379
|
+
|
|
380
|
+
```
|
|
381
|
+
Debug & Fix Complete:
|
|
382
|
+
Root cause: {one-line summary}
|
|
383
|
+
Confidence: {level}
|
|
384
|
+
Files modified: {list — fix changes only, no debug artifacts}
|
|
385
|
+
Debug cleanup: {N} log statements removed, 0 [HATCH3R-DEBUG] remaining
|
|
386
|
+
Review: {clean after {N} iterations / user-approved}
|
|
387
|
+
Tests: {N} regression tests added
|
|
388
|
+
Security: {clean / findings addressed}
|
|
389
|
+
Quality: lint {pass/fail}, types {pass/fail}, tests {pass/fail}
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
**ASK:** "Fix complete. All debug logging removed. Quality checks pass. How should I handle git? (a) commit only, (b) commit and push, (c) skip git — leave changes in working tree"
|
|
393
|
+
|
|
394
|
+
If the user chooses to commit:
|
|
395
|
+
- Use commit message format: `fix: {short description of the bug fix}`
|
|
396
|
+
- Include a commit body with: root cause summary, affected files, and a note that debug instrumentation was added and removed during diagnosis.
|
|
397
|
+
|
|
398
|
+
---
|
|
399
|
+
|
|
400
|
+
## Error Handling
|
|
401
|
+
|
|
402
|
+
- **Researcher sub-agent failure (Stage 2a or 4a):** Retry the failed sub-agent once. If it fails again, present partial results and ASK the user whether to proceed with manual analysis or abort.
|
|
403
|
+
- **Implementer sub-agent failure (Stage 2b or 5a):** Retry once. If the retry fails, fall back to direct implementation and warn the user that the change may be less thorough.
|
|
404
|
+
- **Quality check failure after 2 retries:** Present specific failures and ASK the user whether to commit partial progress, keep trying, or abort.
|
|
405
|
+
- **User provides insufficient logs (Stage 3):** If the log output contains zero `[HATCH3R-DEBUG]` lines, warn the user that the debug logging may not have been reached during reproduction. Suggest verifying that the correct code path was exercised, then ASK for new logs.
|
|
406
|
+
- **No clear root cause (Stage 4):** If all hypotheses are low-confidence, state this clearly. Recommend adding more targeted debug logging (loop back to Stage 2 with refined instrumentation points) or switching to `hatch3r-bug-plan` for a broader investigation. ASK the user how to proceed.
|
|
407
|
+
- **Debug artifacts remain after cleanup (Stage 5b):** If `[HATCH3R-DEBUG]` occurrences are found after the implementer's cleanup pass, remove them directly. Do not proceed until zero occurrences remain.
|
|
408
|
+
- **Review loop exhaustion (Stage 5c):** After 3 iterations without a clean review, present remaining findings and ASK the user for direction.
|
|
409
|
+
- **Context degradation (>20 turns):** Suggest starting a fresh chat with a progress summary capturing the current stage, diagnosis, and remaining work.
|
|
410
|
+
|
|
411
|
+
## Guardrails
|
|
412
|
+
|
|
413
|
+
- **Never skip ASK checkpoints.** Every stage with an ASK must pause for user confirmation.
|
|
414
|
+
- **All debug logs MUST use the `[HATCH3R-DEBUG]` prefix.** No exceptions. This enables reliable cleanup.
|
|
415
|
+
- **All debug logs MUST be removed in Stage 5.** The fix must not ship with any `[HATCH3R-DEBUG]` artifacts. Verify zero occurrences before presenting the fix summary.
|
|
416
|
+
- **Debug logging is observation-only.** Stage 2 must not alter application logic, control flow, or state. Only log statements are added.
|
|
417
|
+
- **Never auto-commit without ASK.** The user always decides the git action.
|
|
418
|
+
- **Stay within the bug scope.** Do not fix unrelated issues discovered during debugging. Note them but do not act without explicit user approval.
|
|
419
|
+
- **Use `subagent_type: "generalPurpose"` for all Task tool delegations.** Every sub-agent spawn in this command uses this type.
|
|
420
|
+
- **Respect the knowledge hierarchy** for external information: project specs → codebase exploration → Context7 MCP → web research. Exhaust each level before escalating.
|
|
421
|
+
- **Prefer `gh` CLI for GitHub reads** (e.g., `gh issue view`, `gh pr list`). Fall back to GitHub MCP tools only if `gh` is unavailable.
|
|
422
|
+
- **No board operations.** Never create issues, update project boards, or sync with GitHub Projects. This is a standalone command.
|
|
423
|
+
- **Respect `scope: always` rules** when delegating to sub-agents. Sub-agents do not inherit rules automatically — include them in every prompt.
|
|
424
|
+
- **This command composes existing hatch3r agents** (researcher, implementer, reviewer, fixer, test-writer, security-auditor) — it does not replace them.
|
|
425
|
+
- **Browser verification is opt-in.** Ask once at command start. Never enable browser steps without user consent.
|
|
426
|
+
- **Never force a diagnosis.** If the logs are inconclusive, say so. Do not fabricate a root cause to proceed.
|
|
@@ -2,7 +2,13 @@
|
|
|
2
2
|
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
|
+
tags: [maintenance, security]
|
|
5
6
|
---
|
|
7
|
+
|
|
8
|
+
## Agent Pipeline
|
|
9
|
+
|
|
10
|
+
This command runs as a single orchestrator without sub-agent delegation. Dependency scanning uses CLI tools (npm audit, npm outdated) and research uses Context7 MCP and web search.
|
|
11
|
+
|
|
6
12
|
# Dependency Audit — Scan, Assess, and Upgrade Dependencies
|
|
7
13
|
|
|
8
14
|
Scan, assess, and upgrade npm dependencies for **{owner}/{repo}** (root and any workspace packages such as `functions/` or `packages/*`). 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.
|
|
@@ -11,7 +17,7 @@ Scan, assess, and upgrade npm dependencies for **{owner}/{repo}** (root and any
|
|
|
11
17
|
|
|
12
18
|
## Shared Context
|
|
13
19
|
|
|
14
|
-
**Read the project's shared board context at the start of the run** (e.g., `.
|
|
20
|
+
**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.
|
|
15
21
|
|
|
16
22
|
## Global Rule Overrides
|
|
17
23
|
|
|
@@ -2,7 +2,17 @@
|
|
|
2
2
|
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
|
+
tags: [core, planning]
|
|
5
6
|
---
|
|
7
|
+
|
|
8
|
+
## Agent Pipeline
|
|
9
|
+
|
|
10
|
+
| Stage | Agent(s) | Parallel | Required |
|
|
11
|
+
|-------|----------|----------|----------|
|
|
12
|
+
| 1. Research | `hatch3r-researcher` (4 parallel: codebase-impact, feature-design, architecture, risk-assessment) | Yes | Yes |
|
|
13
|
+
| 2. Document Generation | `hatch3r-docs-writer` (spec, ADRs) | Yes | Yes |
|
|
14
|
+
| 3. Todo Generation | Orchestrator (inline) | No | Yes |
|
|
15
|
+
|
|
6
16
|
# Feature Plan — Single Feature Specification from Idea to Board-Ready Epic
|
|
7
17
|
|
|
8
18
|
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.
|
|
@@ -48,6 +58,32 @@ Feature Brief:
|
|
|
48
58
|
|
|
49
59
|
**ASK:** "Does this capture the feature correctly? Adjust anything before I send this to the research phase."
|
|
50
60
|
|
|
61
|
+
#### Step 1b: Dimension Probing (Requirements Elicitation)
|
|
62
|
+
|
|
63
|
+
After the feature brief is confirmed, probe for missing requirements across key dimensions. Scan the feature description for ambiguities and generate targeted follow-up questions.
|
|
64
|
+
|
|
65
|
+
1. Analyze the confirmed feature brief for vague language, unstated assumptions, and missing dimensions.
|
|
66
|
+
2. Generate 5–10 targeted questions from the most relevant dimensions for this feature type:
|
|
67
|
+
- **Data**: What data is needed? Schema shape? Source? Volume expectations? Validation rules?
|
|
68
|
+
- **Behavior**: What happens on success? On failure? On edge cases? Concurrent access?
|
|
69
|
+
- **UI/UX**: Loading states? Empty states? Error states? Responsive behavior? Accessibility?
|
|
70
|
+
- **Security**: Auth model? Data sensitivity? Input validation? Rate limiting?
|
|
71
|
+
- **Performance**: Expected data volume? Caching? Pagination? Bundle impact?
|
|
72
|
+
- **Integration**: Which existing features does this interact with? Shared state? Event chains?
|
|
73
|
+
- **Migration**: Existing data or behavior that changes? Backward compatibility?
|
|
74
|
+
- **Observability**: Logging? Metrics? Error tracking for the new behavior?
|
|
75
|
+
- **Testing**: What constitutes "working"? Acceptance test scenarios?
|
|
76
|
+
- **Rollout**: Feature flags? Phased rollout? Rollback strategy?
|
|
77
|
+
3. Skip dimensions that the feature brief already addresses clearly.
|
|
78
|
+
|
|
79
|
+
**ASK:** "Before research begins, I have {N} questions to ensure we don't miss anything:
|
|
80
|
+
{numbered question list — each with the dimension label and why the answer matters}
|
|
81
|
+
|
|
82
|
+
Answer these now, or say 'use defaults' for any where you're comfortable with a reasonable default."
|
|
83
|
+
|
|
84
|
+
4. Record the user's answers as **Resolved Requirements**. These are passed to the researchers and ultimately to the implementer.
|
|
85
|
+
5. For any dimension where the user chose defaults, note the assumed default explicitly.
|
|
86
|
+
|
|
51
87
|
---
|
|
52
88
|
|
|
53
89
|
### Step 2: Load Project Context
|
|
@@ -56,10 +92,10 @@ Feature Brief:
|
|
|
56
92
|
- `docs/specs/` — project specifications (read TOC/headers first, expand relevant sections only)
|
|
57
93
|
- `docs/adr/` — architectural decision records (scan for decisions relevant to the feature area)
|
|
58
94
|
- `README.md` — project overview
|
|
59
|
-
-
|
|
95
|
+
- `.agents/hatch.json` — board configuration
|
|
60
96
|
- Existing `todo.md` — current backlog (check for overlap or related items)
|
|
61
97
|
2. Scan GitHub issues via `search_issues` for existing work related to the feature. Note duplicates or partial overlaps.
|
|
62
|
-
3. If
|
|
98
|
+
3. If `.agents/learnings/` exists, scan for learnings relevant to the feature area. Match by area and tags against the feature brief.
|
|
63
99
|
4. Present a context summary:
|
|
64
100
|
|
|
65
101
|
```
|
|
@@ -82,19 +118,27 @@ Spawn one sub-agent per research domain below concurrently, each following the *
|
|
|
82
118
|
|
|
83
119
|
**Each sub-agent prompt must include:**
|
|
84
120
|
- The full confirmed feature brief
|
|
121
|
+
- The Resolved Requirements from Step 1b (user's answers to dimension-probing questions)
|
|
85
122
|
- The project context summary from Step 2
|
|
86
123
|
- Instruction to follow the **hatch3r-researcher agent protocol**
|
|
87
124
|
- The assigned mode (one per sub-agent) and depth level `deep`
|
|
88
125
|
|
|
89
126
|
| Sub-Agent | Researcher Mode | Focus |
|
|
90
127
|
|-----------|----------------|-------|
|
|
91
|
-
| 1 | `codebase-impact` | Map affected files, modules, integration points, coupling,
|
|
128
|
+
| 1 | `codebase-impact` | Map affected files, modules, integration points, coupling, existing patterns, and transitive dependency trace |
|
|
92
129
|
| 2 | `feature-design` | Break down into sub-tasks, user stories, acceptance criteria, edge cases, effort |
|
|
93
130
|
| 3 | `architecture` | Data model, API contracts, component design, ADR candidates, dependencies |
|
|
94
131
|
| 4 | `risk-assessment` | Technical risks, security, performance, breaking changes, common pitfalls |
|
|
132
|
+
| 5 | `similar-implementation` | Find analogous existing features, extract their conventions, recommend patterns to follow |
|
|
95
133
|
|
|
96
134
|
Each sub-agent produces the structured output defined by its mode in the hatch3r-researcher agent specification.
|
|
97
135
|
|
|
136
|
+
The `similar-implementation` sub-agent's output is critical for convention alignment — it identifies reference implementations whose patterns the new feature should follow. This output is passed to the implementer as "Reference Conventions" and used in Step 4 for convention alignment.
|
|
137
|
+
|
|
138
|
+
The `codebase-impact` sub-agent uses `deep` depth, which includes transitive dependency tracing (import chains up to 3 levels), API consumer maps, and blast radius summary.
|
|
139
|
+
|
|
140
|
+
**Each sub-agent prompt must also include** the Resolved Requirements from Step 1b (user's answers to dimension-probing questions) so researchers can factor in the user's explicit decisions.
|
|
141
|
+
|
|
98
142
|
Wait for all sub-agents to complete before proceeding.
|
|
99
143
|
|
|
100
144
|
---
|
|
@@ -106,14 +150,17 @@ Wait for all sub-agents to complete before proceeding.
|
|
|
106
150
|
```
|
|
107
151
|
Research Summary:
|
|
108
152
|
|
|
109
|
-
Feature:
|
|
110
|
-
Affected files:
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
153
|
+
Feature: {name}
|
|
154
|
+
Affected files: {N} files across {M} modules
|
|
155
|
+
Blast radius: {N} direct + {M} transitive files at risk
|
|
156
|
+
Sub-tasks: {N} tasks ({X} parallelizable)
|
|
157
|
+
Effort: {total estimate}
|
|
158
|
+
ADRs needed: {N} architectural decisions
|
|
159
|
+
Risks: {N} risks ({X} high, {Y} med, {Z} low)
|
|
160
|
+
Breaking changes: {N} ({list if any})
|
|
161
|
+
Convention reference: {reference module} — follow patterns from {name}
|
|
162
|
+
Convention alignment: {N}/{M} aspects aligned, {divergences if any}
|
|
163
|
+
Priority: {recommended P-level}
|
|
117
164
|
```
|
|
118
165
|
|
|
119
166
|
2. **Highlight conflicts** between researchers. Common conflict types:
|
|
@@ -199,6 +246,21 @@ Determine the next sequential number by scanning existing files in `docs/specs/`
|
|
|
199
246
|
|------|----------|------------|
|
|
200
247
|
| {risk} | {level} | {strategy} |
|
|
201
248
|
|
|
249
|
+
## Convention Alignment
|
|
250
|
+
|
|
251
|
+
Reference implementation: {module/feature name} ({file path})
|
|
252
|
+
|
|
253
|
+
| Aspect | Convention to Follow | Reference Files |
|
|
254
|
+
|--------|---------------------|----------------|
|
|
255
|
+
| File structure | {pattern} | {example files from reference} |
|
|
256
|
+
| State management | {pattern} | {example files from reference} |
|
|
257
|
+
| Error handling | {pattern} | {example files from reference} |
|
|
258
|
+
| Data fetching | {pattern} | {example files from reference} |
|
|
259
|
+
| Test structure | {pattern} | {example files from reference} |
|
|
260
|
+
|
|
261
|
+
Divergences from reference:
|
|
262
|
+
- {aspect}: {what differs and why}
|
|
263
|
+
|
|
202
264
|
## Implementation Order
|
|
203
265
|
|
|
204
266
|
{Topological ordering of sub-tasks with parallel lanes identified}
|
|
@@ -360,7 +422,7 @@ If yes, instruct the user to invoke the `hatch3r-board-fill` command. Note that
|
|
|
360
422
|
- **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
423
|
- **Conflicting researcher outputs:** Present both options side by side with trade-offs. Ask the user to decide. Do not silently pick one.
|
|
362
424
|
- **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
|
|
425
|
+
- **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
426
|
- **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
427
|
- **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
428
|
|
|
@@ -2,7 +2,21 @@
|
|
|
2
2
|
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
|
+
tags: [maintenance]
|
|
5
6
|
---
|
|
7
|
+
|
|
8
|
+
## Agent Pipeline
|
|
9
|
+
|
|
10
|
+
This command creates QA audit issues and epics. It does not spawn implementation sub-agents.
|
|
11
|
+
|
|
12
|
+
| Stage | Agent(s) | Parallel | Required |
|
|
13
|
+
|-------|----------|----------|----------|
|
|
14
|
+
| 1. Context & Pre-flight | Orchestrator (inline) | No | Yes |
|
|
15
|
+
| 2. Issue Creation | Orchestrator (GitHub MCP) | No | Yes |
|
|
16
|
+
| 3. Board Sync | Orchestrator (Projects v2 sync) | No | Yes |
|
|
17
|
+
|
|
18
|
+
All issue operations MUST follow the Projects v2 Enforcement rules defined in `hatch3r-board-shared`.
|
|
19
|
+
|
|
6
20
|
# Healthcheck — Full Product QA & Testing Audit
|
|
7
21
|
|
|
8
22
|
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.
|
|
@@ -11,7 +25,7 @@ Create a healthcheck epic on **{owner}/{repo}** with one sub-issue per logical p
|
|
|
11
25
|
|
|
12
26
|
## Shared Context
|
|
13
27
|
|
|
14
|
-
**Read the project's shared board context at the start of the run** (e.g., `.
|
|
28
|
+
**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, Project Reference, Projects v2 sync procedure, and Board Overview template. Cache all values for the duration of this run.
|
|
15
29
|
|
|
16
30
|
## Token-Saving Directives
|
|
17
31
|
|
|
@@ -282,6 +296,8 @@ Link to parent epic via `sub_issue_write`.
|
|
|
282
296
|
|
|
283
297
|
### Step 7: Board Integration
|
|
284
298
|
|
|
299
|
+
All issue and epic operations in this command MUST follow the Projects v2 Enforcement rules defined in `hatch3r-board-shared`.
|
|
300
|
+
|
|
285
301
|
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
302
|
|
|
287
303
|
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.
|