hatch3r 1.5.0 → 1.6.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 +18 -2
- package/agents/hatch3r-a11y-auditor.md +2 -0
- package/agents/hatch3r-dependency-auditor.md +18 -0
- package/agents/hatch3r-devops.md +20 -0
- package/agents/hatch3r-fixer.md +28 -12
- package/agents/hatch3r-implementer.md +26 -12
- package/agents/hatch3r-learnings-loader.md +23 -1
- package/agents/hatch3r-researcher.md +101 -114
- package/agents/hatch3r-reviewer.md +27 -1
- package/agents/hatch3r-security-auditor.md +2 -0
- package/agents/modes/architecture.md +1 -0
- package/agents/modes/boundary-analysis.md +1 -0
- package/agents/modes/codebase-impact.md +1 -0
- package/agents/modes/complexity-risk.md +1 -0
- package/agents/modes/coverage-analysis.md +1 -0
- package/agents/modes/feature-design.md +1 -0
- package/agents/modes/impact-analysis.md +1 -0
- package/agents/modes/migration-path.md +1 -0
- package/agents/modes/refactoring-strategy.md +1 -0
- package/agents/modes/regression.md +1 -0
- package/agents/modes/requirements-elicitation.md +1 -0
- package/agents/modes/risk-assessment.md +1 -0
- package/agents/modes/risk-prioritization.md +1 -0
- package/agents/modes/root-cause.md +1 -0
- package/agents/modes/symptom-trace.md +1 -0
- package/agents/modes/test-pattern.md +1 -0
- package/agents/shared/external-knowledge.md +5 -5
- package/agents/shared/injection-patterns.md +78 -0
- package/agents/shared/prompt-structure.md +44 -0
- package/checks/accessibility.md +2 -0
- package/checks/code-quality.md +2 -0
- package/checks/performance.md +2 -0
- package/checks/security.md +2 -0
- package/checks/testing.md +2 -0
- package/commands/board/pickup-delegation-multi.md +2 -2
- package/commands/board/pickup-delegation.md +2 -2
- package/commands/board/pickup-post-impl.md +21 -0
- package/commands/board/shared-github.md +4 -2
- package/commands/hatch3r-agent-customize.md +2 -1
- package/commands/hatch3r-api-spec.md +2 -0
- package/commands/hatch3r-benchmark.md +2 -0
- package/commands/hatch3r-board-fill.md +96 -9
- package/commands/hatch3r-board-groom.md +1 -0
- package/commands/hatch3r-board-init.md +31 -1
- package/commands/hatch3r-board-pickup.md +10 -0
- package/commands/hatch3r-board-refresh.md +1 -0
- package/commands/hatch3r-board-shared.md +5 -1
- package/commands/hatch3r-bug-plan.md +3 -1
- package/commands/hatch3r-codebase-map.md +3 -1
- package/commands/hatch3r-command-customize.md +2 -1
- package/commands/hatch3r-context-health.md +1 -0
- package/commands/hatch3r-cost-tracking.md +1 -0
- package/commands/hatch3r-debug.md +2 -0
- package/commands/hatch3r-dep-audit.md +1 -0
- package/commands/hatch3r-feature-plan.md +3 -1
- package/commands/hatch3r-healthcheck.md +2 -1
- package/commands/hatch3r-hooks.md +1 -0
- package/commands/hatch3r-learn.md +8 -5
- package/commands/hatch3r-migration-plan.md +2 -0
- package/commands/hatch3r-onboard.md +2 -0
- package/commands/hatch3r-project-spec.md +3 -1
- package/commands/hatch3r-quick-change.md +14 -2
- package/commands/hatch3r-recipe.md +1 -0
- package/commands/hatch3r-refactor-plan.md +2 -0
- package/commands/hatch3r-release.md +1 -0
- package/commands/hatch3r-revision.md +57 -120
- package/commands/hatch3r-roadmap.md +3 -1
- package/commands/hatch3r-rule-customize.md +2 -1
- package/commands/hatch3r-security-audit.md +2 -1
- package/commands/hatch3r-skill-customize.md +2 -1
- package/commands/hatch3r-test-plan.md +2 -0
- package/commands/hatch3r-workflow.md +15 -3
- package/commands/revision/revision-board-integration.md +87 -0
- package/commands/revision/revision-delegation.md +93 -0
- package/commands/revision/revision-modes.md +91 -0
- package/commands/revision/revision-quality.md +97 -0
- package/dist/cli/index.js +8528 -5017
- package/dist/cli/index.js.map +1 -1
- 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/package.json +7 -1
- package/rules/hatch3r-accessibility-standards.mdc +1 -0
- package/rules/hatch3r-agent-orchestration-detail.mdc +1 -0
- package/rules/hatch3r-agent-orchestration.md +38 -5
- package/rules/hatch3r-agent-orchestration.mdc +39 -5
- package/rules/hatch3r-api-design.md +1 -1
- package/rules/hatch3r-api-design.mdc +2 -1
- package/rules/hatch3r-browser-verification.md +1 -1
- package/rules/hatch3r-browser-verification.mdc +3 -3
- package/rules/hatch3r-ci-cd.mdc +1 -0
- package/rules/hatch3r-code-standards.md +1 -1
- package/rules/hatch3r-code-standards.mdc +2 -2
- package/rules/hatch3r-component-conventions.md +3 -3
- package/rules/hatch3r-component-conventions.mdc +2 -2
- package/rules/hatch3r-data-classification.mdc +1 -0
- package/rules/hatch3r-dependency-management.md +1 -1
- package/rules/hatch3r-dependency-management.mdc +2 -1
- package/rules/hatch3r-feature-flags.md +1 -1
- package/rules/hatch3r-feature-flags.mdc +1 -1
- package/rules/hatch3r-git-conventions.md +1 -1
- package/rules/hatch3r-git-conventions.mdc +2 -2
- package/rules/hatch3r-i18n.md +2 -2
- package/rules/hatch3r-i18n.mdc +1 -1
- package/rules/hatch3r-learning-consult.md +1 -1
- package/rules/hatch3r-learning-consult.mdc +2 -2
- package/rules/hatch3r-migrations.mdc +1 -0
- package/rules/hatch3r-observability-tracing-detail.mdc +99 -6
- package/rules/hatch3r-observability-tracing.mdc +20 -15
- package/rules/hatch3r-performance-budgets.md +1 -1
- package/rules/hatch3r-performance-budgets.mdc +1 -1
- package/rules/hatch3r-secrets-management.mdc +1 -0
- package/rules/hatch3r-security-patterns.md +1 -1
- package/rules/hatch3r-security-patterns.mdc +3 -2
- package/rules/hatch3r-testing.md +1 -1
- package/rules/hatch3r-testing.mdc +3 -2
- package/rules/hatch3r-theming.md +2 -2
- package/rules/hatch3r-theming.mdc +2 -2
- package/rules/hatch3r-tooling-hierarchy.md +1 -1
- package/rules/hatch3r-tooling-hierarchy.mdc +3 -2
- package/skills/hatch3r-a11y-audit/SKILL.md +21 -55
- package/skills/hatch3r-a11y-audit/references/manual-audit-checklist.md +58 -0
- package/skills/hatch3r-agent-customize/SKILL.md +1 -1
- package/skills/hatch3r-command-customize/SKILL.md +1 -1
- package/skills/hatch3r-gh-agentic-workflows/SKILL.md +42 -136
- package/skills/hatch3r-gh-agentic-workflows/references/azure-devops.md +60 -0
- package/skills/hatch3r-gh-agentic-workflows/references/gitlab-ci.md +51 -0
- package/skills/hatch3r-issue-workflow/SKILL.md +8 -27
- package/skills/hatch3r-issue-workflow/references/delegation-patterns.md +51 -0
- package/skills/hatch3r-rule-customize/SKILL.md +1 -1
- package/skills/hatch3r-skill-customize/SKILL.md +1 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
id: hatch3r-onboard
|
|
3
3
|
type: command
|
|
4
|
+
orchestrator: true
|
|
5
|
+
agentPipeline: [hatch3r-researcher, hatch3r-docs-writer]
|
|
4
6
|
description: Generate a comprehensive onboarding guide for a new developer joining the project -- spawn parallel researchers to analyze codebase structure, architecture, and conventions, then produce a tailored onboarding document with setup instructions, architecture walkthrough, coding conventions, key workflows, tribal knowledge, and a quick-reference cheat sheet.
|
|
5
7
|
tags: [brownfield, team]
|
|
6
8
|
quality_charter: agents/shared/quality-charter.md
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
id: hatch3r-project-spec
|
|
3
3
|
type: command
|
|
4
|
-
|
|
4
|
+
orchestrator: true
|
|
5
|
+
agentPipeline: [hatch3r-researcher, hatch3r-docs-writer]
|
|
6
|
+
description: Translate a greenfield vision into future-state design artifacts -- ADRs, domain model, API contracts, per-module technical specs, and a board-ready todo.md
|
|
5
7
|
tags: [planning, greenfield]
|
|
6
8
|
quality_charter: agents/shared/quality-charter.md
|
|
7
9
|
---
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
id: hatch3r-quick-change
|
|
3
3
|
type: command
|
|
4
|
+
orchestrator: true
|
|
5
|
+
agentPipeline: [hatch3r-implementer, hatch3r-lint-fixer, hatch3r-reviewer, hatch3r-fixer, hatch3r-test-writer, hatch3r-security-auditor]
|
|
4
6
|
description: Lightweight command for small changes not worth tracking on the board. Adaptive ceremony with inline or sub-agent implementation, batch support, and soft scope guards.
|
|
5
7
|
tags: [core, implementation]
|
|
6
8
|
quality_charter: agents/shared/quality-charter.md
|
|
@@ -65,6 +67,14 @@ It retains:
|
|
|
65
67
|
4. **No learnings capture.** Quick changes are too small to produce meaningful learnings. Existing learnings are consulted via a lightweight file-path scan (Step 2c) with a 150-token budget — no new learnings are written.
|
|
66
68
|
5. **Minimal rule loading.** Load `scope: always` rules only when spawning sub-agents in Steps 4b or 6.
|
|
67
69
|
|
|
70
|
+
## Confidence Propagation Contract
|
|
71
|
+
|
|
72
|
+
Every sub-agent delegation prompt in this command MUST include the confidence expression requirement below (verbatim). Sub-agents are invoked with the `quality_charter: agents/shared/quality-charter.md` reference in their frontmatter, but the orchestrator repeats the directive to override runtime prompt defaults per the charter §1 rule.
|
|
73
|
+
|
|
74
|
+
> Confidence expression requirement: rate every recommendation and finding as high/medium/low confidence per the quality charter (`agents/shared/quality-charter.md`). High = verified against current code. Medium = pattern-based, not fully verified. Low = best judgment, recommend human review.
|
|
75
|
+
|
|
76
|
+
Downstream propagation: every ASK checkpoint that reports verification quality, every gate that evaluates a sub-agent verdict, and every output block that surfaces merge-readiness MUST carry a high/medium/low confidence rating sourced from the upstream sub-agent. Dropping the signal between stages is a gate failure.
|
|
77
|
+
|
|
68
78
|
---
|
|
69
79
|
|
|
70
80
|
## Workflow
|
|
@@ -259,9 +269,11 @@ The reviewer prompt MUST include:
|
|
|
259
269
|
- All `scope: always` rule directives from `.agents/rules/`.
|
|
260
270
|
- Iteration number and previous findings (if not the first iteration).
|
|
261
271
|
- Confidence expression requirement: rate every recommendation and finding as high/medium/low confidence per the quality charter (`agents/shared/quality-charter.md`). High = verified against current code. Medium = pattern-based, not fully verified. Low = best judgment, recommend human review.
|
|
272
|
+
- Requirement that the reviewer output include a top-level `confidence: high | medium | low` field (not just per-finding) so the gate in step 2 can evaluate it deterministically.
|
|
262
273
|
|
|
263
|
-
2. Process reviewer output:
|
|
264
|
-
- If **0 Critical
|
|
274
|
+
2. Process reviewer output (confidence-aware gate):
|
|
275
|
+
- If **0 Critical + 0 Warning AND reviewer confidence != low**: review loop is clean. Proceed to Step 6b.
|
|
276
|
+
- If **0 Critical + 0 Warning AND reviewer confidence == low**: trigger a second reviewer pass before exiting. Do not proceed to 6b until the second pass returns non-low confidence OR the user explicitly accepts the low-confidence PASS.
|
|
265
277
|
- If Critical or Warning findings remain: spawn `hatch3r-fixer` sub-agent to address them, then re-run the reviewer (next iteration).
|
|
266
278
|
The fixer prompt MUST include: the reviewer findings, all `scope: always` rule directives, and the confidence expression requirement (high/medium/low per the quality charter).
|
|
267
279
|
- **Suggestions**: skip. The point of quick-change is speed.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
id: hatch3r-recipe
|
|
3
3
|
type: command
|
|
4
|
+
orchestrator: false
|
|
4
5
|
description: Execute shareable workflow recipes that compose agents, skills, and commands into guided sequences for common development scenarios
|
|
5
6
|
tags: [core]
|
|
6
7
|
quality_charter: agents/shared/quality-charter.md
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
id: hatch3r-refactor-plan
|
|
3
3
|
type: command
|
|
4
|
+
orchestrator: true
|
|
5
|
+
agentPipeline: [hatch3r-researcher, hatch3r-docs-writer]
|
|
4
6
|
description: Plan a refactoring or migration effort -- spawn parallel researchers, produce refactoring spec, ADR(s), and phased todo.md entries for board-fill.
|
|
5
7
|
tags: [planning]
|
|
6
8
|
quality_charter: agents/shared/quality-charter.md
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
id: hatch3r-revision
|
|
3
3
|
type: command
|
|
4
|
-
|
|
4
|
+
orchestrator: true
|
|
5
|
+
agentPipeline: [hatch3r-implementer, hatch3r-lint-fixer, hatch3r-test-writer, hatch3r-reviewer, hatch3r-fixer, hatch3r-security-auditor, hatch3r-docs-writer, hatch3r-a11y-auditor, hatch3r-perf-profiler]
|
|
6
|
+
description: User-guided revision of agent-implemented code in a fresh context window. Reconstructs what was done, interviews the user for feedback, fixes issues, cleans up leftovers, and drives toward merge readiness. Delegation, quality pipeline, modes, and board integration details are in commands/revision/.
|
|
5
7
|
tags: [implementation, team]
|
|
6
8
|
quality_charter: agents/shared/quality-charter.md
|
|
7
9
|
---
|
|
@@ -15,7 +17,10 @@ quality_charter: agents/shared/quality-charter.md
|
|
|
15
17
|
| 3. Leftover Scan + Triage Routing | Orchestrator (inline) | No | Yes |
|
|
16
18
|
| 4. Fix Implementation | `hatch3r-implementer`, `hatch3r-lint-fixer`, `hatch3r-test-writer` | Per finding type | [FIX NOW] items only |
|
|
17
19
|
| 5a. Review Loop | `hatch3r-reviewer` -> `hatch3r-fixer` (max 3 iterations) | No (sequential) | Yes |
|
|
18
|
-
| 5b. Final Quality | `hatch3r-test-writer`
|
|
20
|
+
| 5b. Final Quality — Testing | `hatch3r-test-writer` | Yes | Yes (code changes) |
|
|
21
|
+
| 5c. Final Quality — Security | `hatch3r-security-auditor` | Yes | Yes (code changes) |
|
|
22
|
+
| 5d. Final Quality — Docs | `hatch3r-docs-writer` | Yes | When APIs/architecture/UX affected |
|
|
23
|
+
| 5e. Final Quality — Conditional | `hatch3r-lint-fixer`, `hatch3r-a11y-auditor`, `hatch3r-perf-profiler` | Yes | When triggered |
|
|
19
24
|
|
|
20
25
|
## Browser Automation
|
|
21
26
|
|
|
@@ -37,7 +42,7 @@ The user is the reviewer. The agent is the interviewer and fixer.
|
|
|
37
42
|
|
|
38
43
|
## Shared Context
|
|
39
44
|
|
|
40
|
-
**If board context exists** (current branch has an associated PR linked to
|
|
45
|
+
**If board context exists** (current branch has an associated PR linked to issues), **read the `hatch3r-board-shared` command at the start of the run.** It contains Board Configuration, Platform Detection, Platform Context, Board Sync Procedure, and tooling directives. Cache all values for the duration of this run.
|
|
41
46
|
|
|
42
47
|
If no board context exists (plain instruction, no PR, no linked issues), skip shared context loading and work from the git diff alone.
|
|
43
48
|
|
|
@@ -52,6 +57,18 @@ If no board context exists (plain instruction, no PR, no linked issues), skip sh
|
|
|
52
57
|
3. **Do NOT re-read shared context files** -- their content is available via always-applied rules or inline in this command.
|
|
53
58
|
4. **Limit documentation reads.** Read project documentation selectively -- TOC/headers first, full content only for relevant sections.
|
|
54
59
|
|
|
60
|
+
## Confidence Propagation Contract
|
|
61
|
+
|
|
62
|
+
Every sub-agent delegation prompt in this command (including those defined in `commands/revision/revision-delegation.md` and `commands/revision/revision-quality.md`) MUST include the confidence expression requirement below (verbatim). Sub-agents are invoked with the `quality_charter: agents/shared/quality-charter.md` reference in their frontmatter, but the orchestrator repeats the directive to override runtime prompt defaults per the charter §1 rule.
|
|
63
|
+
|
|
64
|
+
> Confidence expression requirement: rate every recommendation and finding as high/medium/low confidence per the quality charter (`agents/shared/quality-charter.md`). High = verified against current code. Medium = pattern-based, not fully verified. Low = best judgment, recommend human review.
|
|
65
|
+
|
|
66
|
+
Downstream propagation: every ASK checkpoint that reports verification quality, every gate that evaluates a sub-agent verdict, and every output block that surfaces merge-readiness MUST carry a high/medium/low confidence rating sourced from the upstream sub-agent. Dropping the signal between stages is a gate failure.
|
|
67
|
+
|
|
68
|
+
## Run Cache
|
|
69
|
+
|
|
70
|
+
Initialize the run cache at the start of the workflow. See `commands/revision/revision-board-integration.md` for the full schema. The cache tracks: diff, findings with triage routing and fix status, quality agents spawned, errors encountered.
|
|
71
|
+
|
|
55
72
|
---
|
|
56
73
|
|
|
57
74
|
## Workflow
|
|
@@ -68,16 +85,22 @@ Rebuild full context in the fresh window. No prior implementation context is ass
|
|
|
68
85
|
2. Determine the default branch from `.agents/hatch.json` (`board.defaultBranch`). Fall back to `main` if unavailable.
|
|
69
86
|
3. Compute the diff: `git diff {defaultBranch}...HEAD --stat` for a summary, then `git diff {defaultBranch}...HEAD` for the full diff.
|
|
70
87
|
4. Parse the diff summary: files changed, lines added/removed, file types affected.
|
|
71
|
-
5. Identify affected areas from the file paths (e.g., `src/routes/`
|
|
88
|
+
5. Identify affected areas from the file paths (e.g., `src/routes/` -> API, `src/components/` -> UI, `tests/` -> testing).
|
|
72
89
|
|
|
73
90
|
#### 1b. Find Associated PR and Issues
|
|
74
91
|
|
|
75
|
-
|
|
76
|
-
|
|
92
|
+
> Platform-specific CLI commands: see `commands/board/shared-{platform}.md` for PR/issue lookup
|
|
93
|
+
|
|
94
|
+
1. Detect the platform from `.agents/hatch.json` (`board.platform`). Fall back to GitHub if unavailable.
|
|
95
|
+
2. Search for an open PR on this branch using the platform CLI:
|
|
96
|
+
- **GitHub:** `gh pr list --head {branch} --state open --json number,title,body,url --limit 1`
|
|
97
|
+
- **Azure DevOps:** `az repos pr list --source-branch {branch} --status active --top 1`
|
|
98
|
+
- **GitLab:** `glab mr list --source-branch {branch} --state opened --per-page 1`
|
|
99
|
+
3. If a PR exists:
|
|
77
100
|
- Read the PR body.
|
|
78
101
|
- Extract linked issues from `Closes #N`, `Fixes #N`, `Relates to #N` references.
|
|
79
|
-
- For each linked issue:
|
|
80
|
-
|
|
102
|
+
- For each linked issue: fetch title, body, labels, and acceptance criteria using the platform CLI.
|
|
103
|
+
4. If no PR exists: note this and work from the branch diff alone.
|
|
81
104
|
|
|
82
105
|
#### 1c. Load Project Rules
|
|
83
106
|
|
|
@@ -96,6 +119,7 @@ Present a reconstruction summary to the user:
|
|
|
96
119
|
```
|
|
97
120
|
Revision Context:
|
|
98
121
|
Branch: {branch}
|
|
122
|
+
Platform: {GitHub / Azure DevOps / GitLab}
|
|
99
123
|
PR: #{N} — {title} ({url}) | No PR found
|
|
100
124
|
Linked issues: #{N} — {title} (×{count}) | None
|
|
101
125
|
Diff: {files_changed} files changed (+{additions} / -{deletions})
|
|
@@ -265,7 +289,7 @@ If the user attempts to defer a Critical finding, execute the Critical Deferral
|
|
|
265
289
|
Deferral rationale: {user's stated rationale}
|
|
266
290
|
```
|
|
267
291
|
|
|
268
|
-
4. **Flag for triage.** The `Critical-deferred` tag
|
|
292
|
+
4. **Flag for triage.** The `Critical-deferred` tag signals board-fill to surface this item with elevated visibility during the next triage cycle. Board-fill should treat `Critical-deferred` items as priority:p0 candidates regardless of other signals.
|
|
269
293
|
|
|
270
294
|
The user is never blocked — this protocol adds accountability, not a veto.
|
|
271
295
|
|
|
@@ -299,7 +323,7 @@ If any findings are routed to [DEFER]:
|
|
|
299
323
|
2. Present summary:
|
|
300
324
|
`"Deferred {N} findings to todo.md. Run /hatch3r-board-fill to triage them into an epic with full dependency analysis."`
|
|
301
325
|
|
|
302
|
-
3. Cache the deferred findings list for use in Steps 8 and 9.
|
|
326
|
+
3. Cache the deferred findings list for use in Steps 8 and 9. Update run cache `deferred_findings`.
|
|
303
327
|
|
|
304
328
|
If no findings are routed to [DEFER] (including the "fix all" shortcut), skip this sub-step entirely.
|
|
305
329
|
|
|
@@ -307,99 +331,19 @@ If no findings are routed to [DEFER] (including the "fix all" shortcut), skip th
|
|
|
307
331
|
|
|
308
332
|
### Step 6: Fix Implementation (Sub-Agent Delegation)
|
|
309
333
|
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
If all findings were deferred (no [FIX NOW] items), skip Step 6 entirely and proceed to Step 7.
|
|
313
|
-
|
|
314
|
-
#### 6a. Group Findings by Specialist
|
|
315
|
-
|
|
316
|
-
| Finding Category | Sub-Agent | Protocol |
|
|
317
|
-
|-----------------|-----------|----------|
|
|
318
|
-
| Bugs, missing features, error handling, logic fixes | `hatch3r-implementer` | hatch3r-implementer agent protocol |
|
|
319
|
-
| Dead code, unused imports, type fixes, lint errors | `hatch3r-lint-fixer` | hatch3r-lint-fixer agent protocol |
|
|
320
|
-
| Missing tests, insufficient coverage | `hatch3r-test-writer` | hatch3r-test-writer agent protocol |
|
|
334
|
+
> Full details: see `commands/revision/revision-delegation.md`
|
|
321
335
|
|
|
322
|
-
|
|
336
|
+
Delegate [FIX NOW] findings to specialist sub-agents. The delegation protocol covers complexity assessment (using `hatch3r-deep-context` scoring), blast-radius-aware finding grouping, expanded sub-agent prompt templates, and cross-agent conflict resolution.
|
|
323
337
|
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
Use the Task tool with `subagent_type: "generalPurpose"`. Launch as many independent sub-agents in parallel as the platform supports.
|
|
327
|
-
|
|
328
|
-
Each sub-agent prompt MUST include:
|
|
329
|
-
- The specific findings to address (file paths, line numbers, descriptions, expected behavior).
|
|
330
|
-
- Instruction to follow the corresponding agent protocol (e.g., "Follow the hatch3r-implementer agent protocol").
|
|
331
|
-
- All `scope: always` rule directives from `.agents/rules/` -- sub-agents do not inherit rules automatically.
|
|
332
|
-
- Acceptance criteria from linked issues (if available from Step 1b).
|
|
333
|
-
- Relevant learnings from `.agents/learnings/` (if found in Step 1d).
|
|
334
|
-
- Explicit instruction: do NOT create branches, commits, or PRs.
|
|
335
|
-
- Confidence expression requirement: rate every recommendation and finding as high/medium/low confidence per the quality charter (`agents/shared/quality-charter.md`). High = verified against current code. Medium = pattern-based, not fully verified. Low = best judgment, recommend human review.
|
|
336
|
-
|
|
337
|
-
#### 6c. Await and Integrate Results
|
|
338
|
-
|
|
339
|
-
1. Await all sub-agents. Collect their structured results (files changed, tests written, issues encountered).
|
|
340
|
-
2. If any sub-agent reports BLOCKED or PARTIAL, **ASK** the user how to proceed (skip, provide guidance, fix manually).
|
|
341
|
-
3. If sub-agents modified overlapping files, review for conflicts and resolve.
|
|
342
|
-
4. Apply all changes to the working tree.
|
|
338
|
+
If all findings were deferred (no [FIX NOW] items), skip Step 6 entirely and proceed to Step 7.
|
|
343
339
|
|
|
344
340
|
---
|
|
345
341
|
|
|
346
342
|
### Step 7: Quality Verification
|
|
347
343
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
#### 7a. Run Quality Gates
|
|
351
|
-
|
|
352
|
-
1. Lint check (e.g., `npm run lint`)
|
|
353
|
-
2. Type check (e.g., `npm run typecheck`)
|
|
354
|
-
3. Test suite (e.g., `npm run test`)
|
|
355
|
-
|
|
356
|
-
#### 7b. Verify User-Reported Issues
|
|
357
|
-
|
|
358
|
-
Walk through each critical and important finding from Step 5. Verify it is addressed by the changes made in Step 6. If acceptance criteria exist from linked issues, verify each criterion.
|
|
359
|
-
|
|
360
|
-
For each verified finding and acceptance criterion, rate verification confidence: high (fix confirmed via tests or direct observation), medium (code change addresses the issue but edge cases not independently tested), low (fix applied but uncertain of completeness).
|
|
344
|
+
> Full details: see `commands/revision/revision-quality.md`
|
|
361
345
|
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
Run an iterative review loop (max 3 iterations) until 0 Critical + 0 Warning findings remain:
|
|
365
|
-
|
|
366
|
-
1. Spawn `hatch3r-reviewer` sub-agent via the Task tool (`subagent_type: "generalPurpose"`).
|
|
367
|
-
|
|
368
|
-
The reviewer prompt MUST include:
|
|
369
|
-
- The diff of all changes made (use `git diff` on the working tree).
|
|
370
|
-
- All `scope: always` rule directives from `.agents/rules/`.
|
|
371
|
-
- Iteration number and previous findings (if not the first iteration).
|
|
372
|
-
- Confidence expression requirement: rate every recommendation and finding as high/medium/low confidence per the quality charter (`agents/shared/quality-charter.md`). High = verified against current code. Medium = pattern-based, not fully verified. Low = best judgment, recommend human review.
|
|
373
|
-
|
|
374
|
-
2. Process reviewer output:
|
|
375
|
-
- If **0 Critical and 0 Warning** findings: review loop is clean. Proceed to Step 7d.
|
|
376
|
-
- If Critical or Warning findings remain: spawn `hatch3r-fixer` sub-agent to address them, then re-run the reviewer (next iteration).
|
|
377
|
-
|
|
378
|
-
3. If 3 iterations complete and findings remain, **ASK** the user whether to proceed or fix manually.
|
|
379
|
-
|
|
380
|
-
After each reviewer iteration, assess the reviewer's findings confidence: if the reviewer rates any finding as low-confidence, flag it separately in the ASK prompt so the user can prioritize human review of uncertain findings.
|
|
381
|
-
|
|
382
|
-
4. After any fixes, re-run quality gates (Step 7a) to verify nothing broke.
|
|
383
|
-
|
|
384
|
-
#### 7d. Final Quality
|
|
385
|
-
|
|
386
|
-
After the review loop is clean, spawn both agents in parallel via the Task tool:
|
|
387
|
-
|
|
388
|
-
1. `hatch3r-test-writer` — write or update tests for code changes.
|
|
389
|
-
2. `hatch3r-security-auditor` — security review of code changes.
|
|
390
|
-
|
|
391
|
-
Both prompts MUST include:
|
|
392
|
-
- The diff of all changes made.
|
|
393
|
-
- All `scope: always` rule directives from `.agents/rules/`.
|
|
394
|
-
- Confidence expression requirement: rate every recommendation and finding as high/medium/low confidence per the quality charter (`agents/shared/quality-charter.md`). High = verified against current code. Medium = pattern-based, not fully verified. Low = best judgment, recommend human review.
|
|
395
|
-
|
|
396
|
-
Apply any resulting changes (new tests, security fixes). Re-run quality gates (Step 7a) if changes were made.
|
|
397
|
-
|
|
398
|
-
#### 7e. Handle Failures
|
|
399
|
-
|
|
400
|
-
- If quality checks fail: identify the specific failures, fix them directly (for simple issues) or loop back to Step 6 with specific failures.
|
|
401
|
-
- Max 2 retry loops on quality check failures. After 2 retries, **ASK** the user for guidance: "Quality checks still failing. Fix confidence: {high/medium/low — based on whether root cause is identified}."
|
|
402
|
-
- If a user-reported issue was not fully addressed: **ASK** the user whether to attempt another fix or defer.
|
|
346
|
+
Two-stage quality pipeline: Stage 1 runs a sequential review loop (`hatch3r-reviewer` -> `hatch3r-fixer`, max 3 iterations). Stage 2 spawns final quality specialists in parallel — mandatory (`hatch3r-test-writer`, `hatch3r-security-auditor`), evaluated (`hatch3r-docs-writer`), and conditional (`hatch3r-a11y-auditor`, `hatch3r-perf-profiler`, `hatch3r-lint-fixer`).
|
|
403
347
|
|
|
404
348
|
---
|
|
405
349
|
|
|
@@ -430,6 +374,8 @@ git push
|
|
|
430
374
|
|
|
431
375
|
If `git push` fails (e.g., remote branch does not exist yet), use `git push -u origin {branch}`.
|
|
432
376
|
|
|
377
|
+
**Post-commit board integration:** If board context exists, update the PR description with a revision summary. See `commands/revision/revision-board-integration.md` for the full procedure.
|
|
378
|
+
|
|
433
379
|
---
|
|
434
380
|
|
|
435
381
|
### Step 9: Merge Readiness Assessment
|
|
@@ -460,7 +406,17 @@ Verdict: READY / NOT READY ({remaining items})
|
|
|
460
406
|
|
|
461
407
|
A deferred finding counts as "tracked" not "unaddressed" -- it does not block merge readiness.
|
|
462
408
|
|
|
463
|
-
#### 9b.
|
|
409
|
+
#### 9b. Board Housekeeping
|
|
410
|
+
|
|
411
|
+
> Full details: see `commands/revision/revision-board-integration.md`
|
|
412
|
+
|
|
413
|
+
When board context exists, run the board housekeeping steps:
|
|
414
|
+
- **9b.i. Refresh Board Dashboard** (mandatory when `meta:board-overview` exists).
|
|
415
|
+
- **9b.ii. Lightweight Reconciliation** — verify PR body integrity, deferred findings in todo.md, and issue status consistency.
|
|
416
|
+
|
|
417
|
+
When no board context exists, skip 9b entirely.
|
|
418
|
+
|
|
419
|
+
#### 9c. Present Assessment
|
|
464
420
|
|
|
465
421
|
**ASK:** "Revision complete. {verdict}. Options: (a) ready to merge, (b) run another revision cycle with new feedback, (c) done for now."
|
|
466
422
|
|
|
@@ -490,27 +446,8 @@ Capture revision-specific learnings. Focus on patterns that inform future implem
|
|
|
490
446
|
|
|
491
447
|
---
|
|
492
448
|
|
|
493
|
-
## Error Handling
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
- **Sub-agent failure**: Retry once. If the retry fails, fall back to direct implementation for that finding.
|
|
499
|
-
- **Quality check failure after 2 retries**: Present the specific failures and **ASK** the user whether to proceed with a partial fix commit or continue debugging.
|
|
500
|
-
- **Push failure**: Present the error. Common fixes: `git push -u origin {branch}` for new branches, `git pull --rebase` for diverged branches.
|
|
501
|
-
- **Context degradation (>25 turns)**: Suggest starting a fresh chat with a progress summary. The revision command is designed for fresh contexts -- it can be re-run.
|
|
502
|
-
|
|
503
|
-
## Guardrails
|
|
504
|
-
|
|
505
|
-
- **Never skip ASK checkpoints.** Every significant decision requires user confirmation.
|
|
506
|
-
- **Never skip the proactive scan (Step 4)** -- even if the user reports no issues. Agents leave leftovers.
|
|
507
|
-
- **Always run quality checks (Step 7)** before committing. Never commit code that fails lint, typecheck, or tests.
|
|
508
|
-
- **Stay within the revision scope.** Fix what was reported and what the scan found. Do not refactor unrelated code, add new features, or expand beyond the original implementation's intent.
|
|
509
|
-
- **Always commit and push** at the end of a revision cycle. The user invoked this command to get fixes merged -- do not exit without committing (unless the user explicitly abandons).
|
|
510
|
-
- **Respect the original implementation's architecture.** Revision fixes issues within the existing patterns. If the architecture itself is flawed, note it as a finding but do not restructure -- suggest a separate refactor instead.
|
|
511
|
-
- **One sub-agent per concern.** Delegate to specialist sub-agents based on finding type. Do not ask the implementer to also fix lint issues or write tests.
|
|
512
|
-
- **Git safety.** Never force-push. Never rewrite history. Always create new commits for revision changes.
|
|
513
|
-
- **This command composes existing hatch3r agents** -- it does not replace them. The reviewer, implementer, lint-fixer, and test-writer agents handle the actual work.
|
|
514
|
-
- **Critical findings default to FIX NOW.** If the user overrides this, execute the Critical Deferral Protocol (Step 5b): structured warning with specific risk, require written rationale, record in todo.md with `Critical-deferred` tag, and flag for elevated triage in board-fill. The user is never blocked — rationale adds accountability, not a veto.
|
|
515
|
-
- **Deferred findings go to `todo.md`, not directly to GitHub issues.** The board-fill pipeline handles triage, epic creation, dependency analysis, and readiness assessment. Revision does not shortcut this process.
|
|
516
|
-
- **Always format deferred items as a single epic block** in `todo.md`, regardless of count. This ensures board-fill groups them together during the next run.
|
|
449
|
+
## Auto-Advance Mode, Error Handling, and Guardrails
|
|
450
|
+
|
|
451
|
+
> Full details: see `commands/revision/revision-modes.md`
|
|
452
|
+
|
|
453
|
+
The modes file contains: auto-advance mode (`--auto`), safety guardrails, error handling, and session report format for revision.
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
id: hatch3r-roadmap
|
|
3
3
|
type: command
|
|
4
|
-
|
|
4
|
+
orchestrator: true
|
|
5
|
+
agentPipeline: [hatch3r-researcher, hatch3r-docs-writer]
|
|
6
|
+
description: Sequence delivery phases over time into a dependency-ordered milestone plan with business and technical lenses, emitting a todo.md rollout schedule rather than design docs
|
|
5
7
|
tags: [planning, greenfield]
|
|
6
8
|
quality_charter: agents/shared/quality-charter.md
|
|
7
9
|
---
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
id: hatch3r-rule-customize
|
|
3
3
|
type: command
|
|
4
|
-
|
|
4
|
+
orchestrator: false
|
|
5
|
+
description: Edit rule scope globs, toggle always-on versus conditional activation, and adjust precedence tier via .hatch3r/rules/ YAML overrides plus markdown appends
|
|
5
6
|
tags: [customize]
|
|
6
7
|
quality_charter: agents/shared/quality-charter.md
|
|
7
8
|
---
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
id: hatch3r-security-audit
|
|
3
3
|
type: command
|
|
4
|
-
|
|
4
|
+
orchestrator: false
|
|
5
|
+
description: Open an OWASP ASI security epic reviewing auth boundaries, input validation, and supply-chain risks with one hardening sub-issue per module plus trust-boundary audit
|
|
5
6
|
tags: [maintenance, security]
|
|
6
7
|
quality_charter: agents/shared/quality-charter.md
|
|
7
8
|
---
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
id: hatch3r-skill-customize
|
|
3
3
|
type: command
|
|
4
|
-
|
|
4
|
+
orchestrator: false
|
|
5
|
+
description: Rewrite skill dispatch descriptions for model auto-selection, gate per-preset exposure, and control slash-command surfacing via .hatch3r/skills/ YAML overrides
|
|
5
6
|
tags: [customize]
|
|
6
7
|
quality_charter: agents/shared/quality-charter.md
|
|
7
8
|
---
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
id: hatch3r-test-plan
|
|
3
3
|
type: command
|
|
4
|
+
orchestrator: true
|
|
5
|
+
agentPipeline: [hatch3r-researcher, hatch3r-docs-writer]
|
|
4
6
|
description: Plan a comprehensive test strategy -- spawn parallel researchers, produce test plan spec with coverage targets, priority ordering, test case outlines, and structured todo.md entries for board-fill.
|
|
5
7
|
tags: [core, planning]
|
|
6
8
|
quality_charter: agents/shared/quality-charter.md
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
id: hatch3r-workflow
|
|
3
3
|
type: command
|
|
4
|
+
orchestrator: true
|
|
5
|
+
agentPipeline: [hatch3r-researcher, hatch3r-implementer, hatch3r-reviewer, hatch3r-fixer, hatch3r-test-writer, hatch3r-security-auditor, hatch3r-docs-writer, hatch3r-lint-fixer, hatch3r-a11y-auditor, hatch3r-perf-profiler]
|
|
4
6
|
description: Guided development lifecycle with 4 phases (Analyze, Plan, Implement, Review) and scale-adaptive Quick Mode for small tasks.
|
|
5
7
|
tags: [core, implementation]
|
|
6
8
|
quality_charter: agents/shared/quality-charter.md
|
|
@@ -47,6 +49,14 @@ If **no**: all browser verification steps are skipped silently throughout the en
|
|
|
47
49
|
|
|
48
50
|
Follow the **Token-Saving Directives** in `hatch3r-board-shared`.
|
|
49
51
|
|
|
52
|
+
## Confidence Propagation Contract
|
|
53
|
+
|
|
54
|
+
Every sub-agent delegation prompt in this command MUST include the confidence expression requirement below (verbatim). Sub-agents are invoked with the `quality_charter: agents/shared/quality-charter.md` reference in their frontmatter, but the orchestrator repeats the directive to override runtime prompt defaults per the charter §1 rule.
|
|
55
|
+
|
|
56
|
+
> Confidence expression requirement: rate every recommendation and finding as high/medium/low confidence per the quality charter (`agents/shared/quality-charter.md`). High = verified against current code. Medium = pattern-based, not fully verified. Low = best judgment, recommend human review.
|
|
57
|
+
|
|
58
|
+
Downstream propagation: every ASK checkpoint that reports verification quality, every gate that evaluates a sub-agent verdict, and every output block that surfaces merge-readiness MUST carry a high/medium/low confidence rating sourced from the upstream sub-agent. Dropping the signal between stages is a gate failure.
|
|
59
|
+
|
|
50
60
|
---
|
|
51
61
|
|
|
52
62
|
## Workflow
|
|
@@ -262,13 +272,15 @@ Fix any issues before proceeding. If quality checks fail, loop back and resolve
|
|
|
262
272
|
|
|
263
273
|
Spawn a `hatch3r-reviewer` sub-agent via the Task tool (`subagent_type: "generalPurpose"`). Include the diff and acceptance criteria in the prompt.
|
|
264
274
|
|
|
265
|
-
1. **Review:** Await the reviewer result.
|
|
266
|
-
2. **
|
|
275
|
+
1. **Review:** Await the reviewer result. Extract Critical and Warning findings AND the reviewer's top-level `confidence` field (high/medium/low).
|
|
276
|
+
2. **Confidence-aware gate:**
|
|
277
|
+
- **0 Critical + 0 Warning AND reviewer confidence != low:** Review loop is clean. Proceed to 4b.
|
|
278
|
+
- **0 Critical + 0 Warning AND reviewer confidence == low:** Trigger a second reviewer pass before exiting. Do not proceed to 4b until the second pass returns non-low confidence OR the user explicitly accepts the low-confidence PASS at the ASK checkpoint in step 5.
|
|
267
279
|
3. **If Critical or Warning findings exist:** Spawn a `hatch3r-fixer` sub-agent with the reviewer output. The fixer applies fixes for all Critical and Warning findings.
|
|
268
280
|
4. **Re-review:** After the fixer completes, spawn `hatch3r-reviewer` again to verify fixes.
|
|
269
281
|
5. **Repeat** steps 2-4 for a maximum of **3 iterations**. If still not clean after 3 iterations, **ASK** the user how to proceed (force continue / manual fix / abort).
|
|
270
282
|
|
|
271
|
-
After each reviewer iteration, assess the reviewer's findings confidence: if the reviewer rates any finding as low-confidence, flag it separately in the ASK prompt so the user can prioritize human review of uncertain findings.
|
|
283
|
+
After each reviewer iteration, assess the reviewer's findings confidence: if the reviewer rates any finding as low-confidence, flag it separately in the ASK prompt so the user can prioritize human review of uncertain findings. The reviewer sub-agent output MUST include a top-level `confidence: high | medium | low` field (not just per-finding) so step 2 can evaluate it deterministically.
|
|
272
284
|
|
|
273
285
|
Each reviewer/fixer sub-agent prompt MUST include:
|
|
274
286
|
- The agent protocol to follow.
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: hatch3r-revision-board-integration
|
|
3
|
+
type: command
|
|
4
|
+
description: Board integration for revision. Covers run cache schema, post-commit PR updates, dashboard refresh (Step 9a), and lightweight reconciliation (Step 9b).
|
|
5
|
+
tags: [implementation, team]
|
|
6
|
+
quality_charter: agents/shared/quality-charter.md
|
|
7
|
+
---
|
|
8
|
+
# Revision — Board Integration
|
|
9
|
+
|
|
10
|
+
Board integration protocols for `hatch3r-revision`. Referenced from the core command file. All board integration steps are conditional — they execute only when board context exists (PR with linked issues found in Step 1b). When no board context exists, skip all steps in this file silently.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Run Cache
|
|
15
|
+
|
|
16
|
+
Initialize at the start of the revision workflow (before Step 1). Maintain throughout the run:
|
|
17
|
+
|
|
18
|
+
| Key | Type | Description |
|
|
19
|
+
|-----|------|-------------|
|
|
20
|
+
| `diff_cache` | `string` | Cached diff from Step 1 (reused per token-saving directives) |
|
|
21
|
+
| `findings` | `Map<id, {description, severity, route, status}>` | All findings with triage routing and fix status |
|
|
22
|
+
| `fixed_findings` | `id[]` | Finding IDs resolved in this run |
|
|
23
|
+
| `deferred_findings` | `id[]` | Finding IDs written to todo.md |
|
|
24
|
+
| `quality_agents` | `{agent, status, findings_count}[]` | Specialist agents spawned and their results |
|
|
25
|
+
| `pr_updated` | `boolean` | Whether PR description was updated with revision summary |
|
|
26
|
+
| `errors` | `{step, message, recoverable}[]` | All errors encountered during the run |
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Post-Commit Board Integration (After Step 8)
|
|
31
|
+
|
|
32
|
+
After committing and pushing revision changes, update the PR if board context exists:
|
|
33
|
+
|
|
34
|
+
1. **Update PR description** with a revision summary appended to the existing body:
|
|
35
|
+
|
|
36
|
+
```markdown
|
|
37
|
+
---
|
|
38
|
+
## Revision Summary ({date})
|
|
39
|
+
|
|
40
|
+
**Fixed ({N}):**
|
|
41
|
+
- {finding description} ({severity})
|
|
42
|
+
- ...
|
|
43
|
+
|
|
44
|
+
**Deferred to todo.md ({M}):**
|
|
45
|
+
- {finding description} ({severity})
|
|
46
|
+
- ...
|
|
47
|
+
|
|
48
|
+
**Quality agents:** {list of agents spawned}
|
|
49
|
+
**Overall confidence:** {high/medium/low}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
2. Do NOT change issue status labels. Revision does not alter the issue lifecycle — the original PR's `Closes #N` references handle that on merge.
|
|
53
|
+
|
|
54
|
+
3. Do NOT modify `Closes #N` / `Relates to #N` references in the PR body. The original references from board-pickup are authoritative.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Step 9a: Refresh Board Dashboard
|
|
59
|
+
|
|
60
|
+
**This step is mandatory when board context exists. Skip silently when no board context.**
|
|
61
|
+
|
|
62
|
+
If a `meta:board-overview` issue exists on the board, refresh it now using cached board data. Use the same procedure as `hatch3r-board-pickup` Step 9a: update with current board state reflecting any changes from this revision session.
|
|
63
|
+
|
|
64
|
+
Do NOT re-fetch all issues. Use cached data from Step 1 combined with mutations from this run (findings fixed, PR updated). Skip silently if no `meta:board-overview` issue exists.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Step 9b: Lightweight Reconciliation
|
|
69
|
+
|
|
70
|
+
**This step is mandatory when board context exists. Skip silently when no board context.**
|
|
71
|
+
|
|
72
|
+
Run a focused reconciliation (not the full board-shared reconciliation procedure, since revision does not create or update issues):
|
|
73
|
+
|
|
74
|
+
1. **PR body integrity:** Verify the PR body still contains correct `Closes #N` references for all linked issues after the revision summary was appended. If any references were accidentally removed or corrupted, restore them.
|
|
75
|
+
|
|
76
|
+
2. **Deferred findings integrity:** If findings were deferred in Step 5c, verify they are written to `todo.md` with correct severity tags and epic grouping format. Report any write failures.
|
|
77
|
+
|
|
78
|
+
3. **Orphaned status check:** For each issue linked to this PR, verify the issue still has `status:in-review` label. If any issue has drifted to a different status (e.g., manually changed during the revision session), warn the user.
|
|
79
|
+
|
|
80
|
+
Output a reconciliation report:
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
Reconciliation:
|
|
84
|
+
PR body: {ok / {N} references restored}
|
|
85
|
+
Deferred findings: {ok / {N} write failures}
|
|
86
|
+
Issue status: {ok / {N} status drift warnings}
|
|
87
|
+
```
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: hatch3r-revision-delegation
|
|
3
|
+
type: command
|
|
4
|
+
description: Fix delegation protocol for revision Step 6. Covers complexity-aware grouping, blast radius context, sub-agent prompt templates, and cross-agent conflict resolution.
|
|
5
|
+
tags: [implementation, team]
|
|
6
|
+
quality_charter: agents/shared/quality-charter.md
|
|
7
|
+
---
|
|
8
|
+
# Revision — Fix Delegation (Step 6)
|
|
9
|
+
|
|
10
|
+
Delegation details for Step 6 of `hatch3r-revision`. Referenced from the core command file.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 6.pre: Complexity Assessment
|
|
15
|
+
|
|
16
|
+
Before delegating [FIX NOW] findings, score the aggregate fix batch using `hatch3r-deep-context` complexity signals. Score across the full set of findings, not per-finding:
|
|
17
|
+
|
|
18
|
+
| Signal | Weight | Detection |
|
|
19
|
+
|--------|--------|-----------|
|
|
20
|
+
| Findings span multiple modules/layers | +3 | Count distinct directories across all [FIX NOW] findings |
|
|
21
|
+
| Any finding involves behavioral contract changes (API, types, events) | +2 | Check finding descriptions for interface/signature changes |
|
|
22
|
+
| Findings touch security-sensitive areas (auth, payments, data access) | +2 | Match affected files against security-sensitive directories |
|
|
23
|
+
| Total affected files > 5 | +2 | Count distinct files across all findings |
|
|
24
|
+
| Any finding requires new dependencies or integrations | +2 | Check whether fixes introduce new imports or services |
|
|
25
|
+
|
|
26
|
+
### Tier Assignment
|
|
27
|
+
|
|
28
|
+
| Total Weight | Tier | Action |
|
|
29
|
+
|-------------|------|--------|
|
|
30
|
+
| 0–2 | 1 (Light) | Proceed directly to 6a. No research needed |
|
|
31
|
+
| 3–5 | 2 (Standard) | Spawn `hatch3r-researcher` with `similar-implementation` at `quick` depth before delegating. Use discovered reference patterns to inform fix conventions |
|
|
32
|
+
| 6+ | 3 (Deep) | Spawn `hatch3r-researcher` with `codebase-impact` at `deep` depth. **Warn the user** that fix scope may warrant a new board issue rather than a revision fix |
|
|
33
|
+
|
|
34
|
+
For Tier 2/3: cache researcher output (reference conventions, blast radius data) for inclusion in sub-agent prompts below.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## 6a. Group Findings by Specialist
|
|
39
|
+
|
|
40
|
+
| Finding Category | Sub-Agent | Protocol |
|
|
41
|
+
|-----------------|-----------|----------|
|
|
42
|
+
| Bugs, missing features, error handling, logic fixes | `hatch3r-implementer` | hatch3r-implementer agent protocol |
|
|
43
|
+
| Dead code, unused imports, type fixes, lint errors | `hatch3r-lint-fixer` | hatch3r-lint-fixer agent protocol |
|
|
44
|
+
| Missing tests, insufficient coverage | `hatch3r-test-writer` | hatch3r-test-writer agent protocol |
|
|
45
|
+
|
|
46
|
+
### Blast-Radius-Aware Grouping
|
|
47
|
+
|
|
48
|
+
When multiple findings affect the same file or module, batch them to a single sub-agent to avoid cross-agent file conflicts:
|
|
49
|
+
|
|
50
|
+
1. Build a file-to-findings map from all [FIX NOW] items.
|
|
51
|
+
2. Findings in the same file go to the same sub-agent instance, even if they span categories (use the highest-priority specialist: implementer > lint-fixer > test-writer).
|
|
52
|
+
3. Findings in disjoint files can run in parallel sub-agents.
|
|
53
|
+
4. If findings span independent areas within the same specialist type, spawn one sub-agent per area to parallelize.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## 6b. Spawn Sub-Agents
|
|
58
|
+
|
|
59
|
+
Use the Task tool with `subagent_type: "generalPurpose"`. Launch independent sub-agents in parallel.
|
|
60
|
+
|
|
61
|
+
Each sub-agent prompt MUST include:
|
|
62
|
+
|
|
63
|
+
1. The specific findings to address (file paths, line numbers, descriptions, expected behavior).
|
|
64
|
+
2. Instruction to follow the corresponding agent protocol (e.g., "Follow the hatch3r-implementer agent protocol").
|
|
65
|
+
3. All `scope: always` rule directives from `.agents/rules/` — sub-agents do not inherit rules automatically.
|
|
66
|
+
4. Acceptance criteria from linked issues (if available from Step 1b).
|
|
67
|
+
5. Relevant learnings from `.agents/learnings/` (if found in Step 1d).
|
|
68
|
+
6. Explicit instruction: do NOT create branches, commits, or PRs.
|
|
69
|
+
7. Confidence expression requirement: rate every recommendation and finding as high/medium/low confidence per the quality charter (`agents/shared/quality-charter.md`). High = verified against current code. Medium = pattern-based, not fully verified. Low = best judgment, recommend human review.
|
|
70
|
+
8. Revision-specific constraint: "You are fixing existing code, not implementing new features. Stay within the architecture established by the original implementation."
|
|
71
|
+
|
|
72
|
+
**When Tier 2/3 research was performed (6.pre):**
|
|
73
|
+
|
|
74
|
+
9. Reference conventions from `similar-implementation` output — triggers the implementer's Convention Lock step.
|
|
75
|
+
10. Blast radius data from `codebase-impact` output (Tier 3) — transitive dependency trace informing which consumers and contracts the fix must preserve.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## 6c. Await and Integrate Results
|
|
80
|
+
|
|
81
|
+
1. Await all sub-agents. Collect their structured results (files changed, tests written, issues encountered).
|
|
82
|
+
2. If any sub-agent reports BLOCKED or PARTIAL, **ASK** the user how to proceed (skip, provide guidance, fix manually).
|
|
83
|
+
|
|
84
|
+
### Cross-Agent Conflict Resolution
|
|
85
|
+
|
|
86
|
+
When sub-agents modified overlapping files:
|
|
87
|
+
|
|
88
|
+
- **Disjoint regions** (different functions, different sections): accept both sets of changes.
|
|
89
|
+
- **Overlapping regions** (same function or block): merge using the larger-scope change as the base, applying the smaller change on top. If merging is ambiguous, present both versions to the user.
|
|
90
|
+
- **Semantic conflicts** (contradictory logic): surface to the user with both sub-agents' rationale. Do not auto-resolve semantic conflicts.
|
|
91
|
+
|
|
92
|
+
3. Apply all resolved changes to the working tree.
|
|
93
|
+
4. Update the run cache with fix results (files changed, findings addressed).
|