hatch3r 1.9.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -143
- package/dist/cli/index.js +28453 -15831
- package/dist/content/agents/hatch3r-architect.md +39 -9
- package/dist/content/agents/hatch3r-brownfield-spec.md +254 -0
- package/dist/content/agents/hatch3r-ci-watcher.md +8 -1
- package/dist/content/agents/hatch3r-context-rules.md +19 -1
- package/dist/content/agents/hatch3r-creator.md +65 -26
- package/dist/content/agents/hatch3r-dependency-drafter.md +162 -0
- package/dist/content/agents/hatch3r-devops.md +11 -1
- package/dist/content/agents/hatch3r-docs-writer.md +11 -1
- package/dist/content/agents/hatch3r-edge-case-analyst.md +134 -0
- package/dist/content/agents/hatch3r-enhancability.md +192 -0
- package/dist/content/agents/hatch3r-fixer.md +59 -8
- package/dist/content/agents/hatch3r-greenfield-spec.md +256 -0
- package/dist/content/agents/hatch3r-handoff-loader.md +29 -3
- package/dist/content/agents/hatch3r-handoff-preparer.md +10 -1
- package/dist/content/agents/hatch3r-implementer.md +139 -8
- package/dist/content/agents/hatch3r-incident-responder.md +96 -0
- package/dist/content/agents/hatch3r-learnings-loader.md +122 -88
- package/dist/content/agents/hatch3r-lint-fixer.md +15 -3
- package/dist/content/agents/hatch3r-maintainability.md +183 -0
- package/dist/content/agents/hatch3r-pack-installer.md +113 -0
- package/dist/content/agents/hatch3r-performance.md +179 -0
- package/dist/content/agents/hatch3r-reliability.md +193 -0
- package/dist/content/agents/hatch3r-researcher.md +27 -4
- package/dist/content/agents/hatch3r-reviewer.md +153 -103
- package/dist/content/agents/hatch3r-scalability.md +162 -0
- package/dist/content/agents/hatch3r-security.md +197 -0
- package/dist/content/agents/hatch3r-testability.md +204 -0
- package/dist/content/agents/hatch3r-ui.md +175 -0
- package/dist/content/agents/hatch3r-ux.md +160 -0
- package/dist/content/agents/modes/requirements-elicitation.md +1 -1
- package/dist/content/agents/modes/user-flows.md +2 -2
- package/dist/content/agents/shared/clarification-default-block.md +44 -0
- package/dist/content/agents/shared/confidence-gate.md +42 -0
- package/dist/content/agents/shared/cq-specialist-roster.md +26 -0
- package/dist/content/agents/shared/efficiency-patterns.md +32 -1
- package/dist/content/agents/shared/injection-patterns.md +18 -7
- package/dist/content/agents/shared/principles.md +60 -0
- package/dist/content/agents/shared/prompt-structure.md +7 -1
- package/dist/content/agents/shared/quality-charter.md +48 -12
- package/dist/content/agents/shared/quality-specialist-frame.md +141 -0
- package/dist/content/agents/shared/rigor-contract.md +151 -0
- package/dist/content/agents/shared/severity-mapping.md +92 -0
- package/dist/content/agents/shared/triage-vocabulary.md +46 -0
- package/dist/content/agents/shared/user-content-templates.md +34 -8
- package/dist/content/agents/shared/user-question-protocol.md +45 -3
- package/dist/content/checks/README.md +5 -0
- package/dist/content/checks/accessibility.md +14 -7
- package/dist/content/checks/code-quality.md +1 -1
- package/dist/content/checks/performance.md +7 -4
- package/dist/content/checks/security.md +6 -6
- package/dist/content/checks/testing.md +1 -1
- package/dist/content/commands/board/pickup-delegation-multi.md +37 -10
- package/dist/content/commands/board/pickup-delegation.md +7 -5
- package/dist/content/commands/board/pickup-modes.md +1 -0
- package/dist/content/commands/board/pickup-post-impl.md +1 -1
- package/dist/content/commands/hatch3r-api-spec.md +79 -2
- package/dist/content/commands/hatch3r-auth-scaffold.md +250 -0
- package/dist/content/commands/hatch3r-benchmark.md +90 -7
- package/dist/content/commands/hatch3r-board-fill.md +97 -11
- package/dist/content/commands/hatch3r-board-pickup.md +93 -9
- package/dist/content/commands/hatch3r-bug-pipeline.md +240 -0
- package/dist/content/commands/hatch3r-bug-plan.md +79 -3
- package/dist/content/commands/hatch3r-codebase-map.md +80 -4
- package/dist/content/commands/hatch3r-create.md +105 -7
- package/dist/content/commands/hatch3r-debug.md +102 -14
- package/dist/content/commands/hatch3r-diagnose.md +238 -0
- package/dist/content/commands/hatch3r-feature-plan.md +125 -5
- package/dist/content/commands/hatch3r-handoff.md +83 -3
- package/dist/content/commands/hatch3r-healthcheck.md +105 -5
- package/dist/content/commands/hatch3r-incident-response.md +228 -0
- package/dist/content/commands/hatch3r-migration-plan.md +79 -3
- package/dist/content/commands/hatch3r-onboard.md +94 -3
- package/dist/content/commands/hatch3r-pack-install.md +243 -0
- package/dist/content/commands/hatch3r-pr-resolve.md +106 -23
- package/dist/content/commands/hatch3r-project-spec.md +82 -6
- package/dist/content/commands/hatch3r-quick-change.md +108 -13
- package/dist/content/commands/hatch3r-refactor-plan.md +78 -2
- package/dist/content/commands/hatch3r-release.md +401 -0
- package/dist/content/commands/hatch3r-revision.md +98 -12
- package/dist/content/commands/hatch3r-roadmap.md +92 -10
- package/dist/content/commands/hatch3r-security-audit.md +105 -5
- package/dist/content/commands/hatch3r-slo-scaffold.md +246 -0
- package/dist/content/commands/hatch3r-spec.md +216 -0
- package/dist/content/commands/hatch3r-test-plan.md +85 -9
- package/dist/content/commands/hatch3r-workflow.md +165 -41
- package/dist/content/commands/revision/revision-delegation.md +6 -5
- package/dist/content/commands/revision/revision-modes.md +49 -4
- package/dist/content/commands/revision/revision-quality.md +10 -7
- package/dist/content/commands/shared/orchestration-frame.md +119 -0
- package/dist/content/github-agents/hatch3r-docs-agent.md +21 -1
- package/dist/content/github-agents/hatch3r-lint-agent.md +21 -1
- package/dist/content/github-agents/hatch3r-security-agent.md +21 -1
- package/dist/content/github-agents/hatch3r-test-agent.md +21 -1
- package/dist/content/hooks/hatch3r-file-save.md +1 -1
- package/dist/content/hooks/hatch3r-pre-push.md +4 -4
- package/dist/content/hooks/hatch3r-review-loop-cap.md +52 -0
- package/dist/content/mcp/mcp.json +7 -5
- package/dist/content/rules/hatch3r-accessibility-standards.md +14 -2
- package/dist/content/rules/hatch3r-accessibility-standards.mdc +12 -1
- package/dist/content/rules/hatch3r-agent-orchestration-detail.md +58 -19
- package/dist/content/rules/hatch3r-agent-orchestration-detail.mdc +58 -19
- package/dist/content/rules/hatch3r-agent-orchestration.md +87 -213
- package/dist/content/rules/hatch3r-agent-orchestration.mdc +87 -213
- package/dist/content/rules/hatch3r-ai-evals.md +5 -4
- package/dist/content/rules/hatch3r-ai-evals.mdc +3 -3
- package/dist/content/rules/hatch3r-ai-ux-patterns.md +6 -2
- package/dist/content/rules/hatch3r-ai-ux-patterns.mdc +4 -1
- package/dist/content/rules/hatch3r-android-patterns.md +107 -0
- package/dist/content/rules/hatch3r-android-patterns.mdc +102 -0
- package/dist/content/rules/hatch3r-anti-duplication.md +115 -0
- package/dist/content/rules/hatch3r-anti-duplication.mdc +115 -0
- package/dist/content/rules/hatch3r-api-design.md +5 -1
- package/dist/content/rules/hatch3r-api-design.mdc +3 -0
- package/dist/content/rules/hatch3r-api-versioning.md +2 -1
- package/dist/content/rules/hatch3r-auth-patterns.md +3 -1
- package/dist/content/rules/hatch3r-auth-patterns.mdc +1 -0
- package/dist/content/rules/hatch3r-browser-verification.md +2 -0
- package/dist/content/rules/hatch3r-browser-verification.mdc +2 -0
- package/dist/content/rules/hatch3r-capability-matrix.md +108 -0
- package/dist/content/rules/hatch3r-capability-matrix.mdc +108 -0
- package/dist/content/rules/hatch3r-ci-cd.md +8 -1
- package/dist/content/rules/hatch3r-ci-cd.mdc +6 -0
- package/dist/content/rules/hatch3r-clarification-default.md +73 -0
- package/dist/content/rules/hatch3r-clarification-default.mdc +73 -0
- package/dist/content/rules/hatch3r-code-standards.md +23 -47
- package/dist/content/rules/hatch3r-code-standards.mdc +22 -46
- package/dist/content/rules/hatch3r-component-conventions.md +3 -0
- package/dist/content/rules/hatch3r-component-conventions.mdc +3 -0
- package/dist/content/rules/hatch3r-container-hardening.md +11 -2
- package/dist/content/rules/hatch3r-container-hardening.mdc +9 -1
- package/dist/content/rules/hatch3r-contract-testing.md +2 -1
- package/dist/content/rules/hatch3r-cost-visibility.md +135 -0
- package/dist/content/rules/hatch3r-cost-visibility.mdc +135 -0
- package/dist/content/rules/hatch3r-cq-rule-frame.md +54 -0
- package/dist/content/rules/hatch3r-cq-rule-frame.mdc +49 -0
- package/dist/content/rules/hatch3r-data-classification.md +3 -1
- package/dist/content/rules/hatch3r-data-classification.mdc +2 -1
- package/dist/content/rules/hatch3r-deep-context.md +13 -13
- package/dist/content/rules/hatch3r-deep-context.mdc +13 -13
- package/dist/content/rules/hatch3r-dependency-management.md +16 -3
- package/dist/content/rules/hatch3r-dependency-management.mdc +15 -3
- package/dist/content/rules/hatch3r-design-system-detection.md +2 -1
- package/dist/content/rules/hatch3r-dotnet-patterns.md +104 -0
- package/dist/content/rules/hatch3r-dotnet-patterns.mdc +99 -0
- package/dist/content/rules/hatch3r-edge-case-discipline.md +65 -0
- package/dist/content/rules/hatch3r-edge-case-discipline.mdc +65 -0
- package/dist/content/rules/hatch3r-enhancability.md +147 -0
- package/dist/content/rules/hatch3r-enhancability.mdc +142 -0
- package/dist/content/rules/hatch3r-event-schema-evolution.md +2 -1
- package/dist/content/rules/hatch3r-fan-out-discipline.md +91 -0
- package/dist/content/rules/hatch3r-fan-out-discipline.mdc +91 -0
- package/dist/content/rules/hatch3r-feature-flags.md +2 -0
- package/dist/content/rules/hatch3r-feature-flags.mdc +2 -0
- package/dist/content/rules/hatch3r-flutter-patterns.md +88 -0
- package/dist/content/rules/hatch3r-flutter-patterns.mdc +83 -0
- package/dist/content/rules/hatch3r-git-conventions.md +4 -1
- package/dist/content/rules/hatch3r-git-conventions.mdc +2 -0
- package/dist/content/rules/hatch3r-go-patterns.md +98 -0
- package/dist/content/rules/hatch3r-go-patterns.mdc +93 -0
- package/dist/content/rules/hatch3r-handoff-readiness.md +10 -0
- package/dist/content/rules/hatch3r-handoff-readiness.mdc +10 -0
- package/dist/content/rules/hatch3r-i18n.md +2 -0
- package/dist/content/rules/hatch3r-i18n.mdc +2 -0
- package/dist/content/rules/hatch3r-iteration-summary.md +75 -57
- package/dist/content/rules/hatch3r-iteration-summary.mdc +77 -54
- package/dist/content/rules/hatch3r-learning-system.md +202 -0
- package/dist/content/rules/hatch3r-learning-system.mdc +202 -0
- package/dist/content/rules/hatch3r-maintainability.md +157 -0
- package/dist/content/rules/hatch3r-maintainability.mdc +152 -0
- package/dist/content/rules/hatch3r-migrations.md +2 -1
- package/dist/content/rules/hatch3r-observability-logging.md +1 -1
- package/dist/content/rules/hatch3r-observability-metrics.md +1 -1
- package/dist/content/rules/hatch3r-observability-tracing.md +45 -36
- package/dist/content/rules/hatch3r-observability-tracing.mdc +44 -35
- package/dist/content/rules/hatch3r-operability.md +2 -1
- package/dist/content/rules/hatch3r-passkey-server.md +2 -1
- package/dist/content/rules/hatch3r-performance-budgets.md +2 -0
- package/dist/content/rules/hatch3r-performance-budgets.mdc +2 -0
- package/dist/content/rules/hatch3r-php-laravel-patterns.md +109 -0
- package/dist/content/rules/hatch3r-php-laravel-patterns.mdc +104 -0
- package/dist/content/rules/hatch3r-progressive-delivery.md +5 -1
- package/dist/content/rules/hatch3r-progressive-delivery.mdc +3 -0
- package/dist/content/rules/hatch3r-proof-model.md +131 -0
- package/dist/content/rules/hatch3r-proof-model.mdc +131 -0
- package/dist/content/rules/hatch3r-python-patterns.md +70 -0
- package/dist/content/rules/hatch3r-python-patterns.mdc +65 -0
- package/dist/content/rules/hatch3r-react-native-patterns.md +83 -0
- package/dist/content/rules/hatch3r-react-native-patterns.mdc +78 -0
- package/dist/content/rules/hatch3r-resilience-patterns.md +2 -1
- package/dist/content/rules/hatch3r-reviewer-calibration.md +84 -0
- package/dist/content/rules/hatch3r-reviewer-calibration.mdc +84 -0
- package/dist/content/rules/hatch3r-right-sizing.md +68 -0
- package/dist/content/rules/hatch3r-right-sizing.mdc +66 -0
- package/dist/content/rules/hatch3r-ruby-rails-patterns.md +111 -0
- package/dist/content/rules/hatch3r-ruby-rails-patterns.mdc +106 -0
- package/dist/content/rules/hatch3r-rust-patterns.md +107 -0
- package/dist/content/rules/hatch3r-rust-patterns.mdc +102 -0
- package/dist/content/rules/hatch3r-scalability.md +137 -0
- package/dist/content/rules/hatch3r-scalability.mdc +132 -0
- package/dist/content/rules/hatch3r-secrets-management.md +10 -1
- package/dist/content/rules/hatch3r-secrets-management.mdc +8 -0
- package/dist/content/rules/hatch3r-security-patterns.md +36 -34
- package/dist/content/rules/hatch3r-security-patterns.mdc +35 -34
- package/dist/content/rules/hatch3r-security.md +97 -0
- package/dist/content/rules/hatch3r-security.mdc +92 -0
- package/dist/content/rules/hatch3r-swiftui-patterns.md +98 -0
- package/dist/content/rules/hatch3r-swiftui-patterns.mdc +93 -0
- package/dist/content/rules/hatch3r-testability.md +115 -0
- package/dist/content/rules/hatch3r-testability.mdc +110 -0
- package/dist/content/rules/hatch3r-testing.md +4 -1
- package/dist/content/rules/hatch3r-testing.mdc +2 -0
- package/dist/content/rules/hatch3r-theming.md +2 -0
- package/dist/content/rules/hatch3r-theming.mdc +2 -0
- package/dist/content/rules/hatch3r-tool-currency.md +91 -0
- package/dist/content/rules/hatch3r-tool-currency.mdc +86 -0
- package/dist/content/rules/hatch3r-tooling-hierarchy.md +29 -31
- package/dist/content/rules/hatch3r-tooling-hierarchy.mdc +27 -30
- package/dist/content/rules/hatch3r-typescript-patterns.md +58 -0
- package/dist/content/rules/hatch3r-typescript-patterns.mdc +53 -0
- package/dist/content/rules/hatch3r-ux-states-and-flows.md +11 -4
- package/dist/content/rules/hatch3r-ux-states-and-flows.mdc +9 -3
- package/dist/content/skills/hatch3r-a11y-audit/SKILL.md +10 -8
- package/dist/content/skills/hatch3r-a11y-audit/references/manual-audit-checklist.md +7 -5
- package/dist/content/skills/hatch3r-adhoc-orchestrate/SKILL.md +131 -0
- package/dist/content/skills/hatch3r-ai-feature/SKILL.md +4 -6
- package/dist/content/skills/hatch3r-api-spec/SKILL.md +27 -2
- package/dist/content/skills/hatch3r-architecture-review/SKILL.md +4 -7
- package/dist/content/skills/hatch3r-board-groom/SKILL.md +11 -0
- package/dist/content/skills/hatch3r-board-init/SKILL.md +17 -1
- package/dist/content/skills/hatch3r-board-refresh/SKILL.md +12 -1
- package/dist/content/skills/hatch3r-board-shared/SKILL.md +38 -1
- package/dist/content/skills/hatch3r-browser-verify/SKILL.md +307 -0
- package/dist/content/skills/hatch3r-bug-fix/SKILL.md +15 -2
- package/dist/content/skills/hatch3r-ci-pipeline/SKILL.md +17 -7
- package/dist/content/skills/hatch3r-cli-fd/SKILL.md +33 -1
- package/dist/content/skills/hatch3r-cli-fzf/SKILL.md +33 -1
- package/dist/content/skills/hatch3r-cli-gh/SKILL.md +50 -1
- package/dist/content/skills/hatch3r-cli-jq/SKILL.md +40 -6
- package/dist/content/skills/hatch3r-cli-ripgrep/SKILL.md +33 -1
- package/dist/content/skills/hatch3r-cli-toolbox/SKILL.md +130 -23
- package/dist/content/skills/hatch3r-containerize/SKILL.md +157 -0
- package/dist/content/skills/hatch3r-context-health/SKILL.md +9 -7
- package/dist/content/skills/hatch3r-cost-tracking/SKILL.md +37 -17
- package/dist/content/skills/hatch3r-customize/SKILL.md +5 -8
- package/dist/content/skills/hatch3r-dep-audit/SKILL.md +23 -7
- package/dist/content/skills/hatch3r-design-system-detect/SKILL.md +3 -7
- package/dist/content/skills/hatch3r-docs-writing/SKILL.md +159 -0
- package/dist/content/skills/hatch3r-enhancability-verify/SKILL.md +152 -0
- package/dist/content/skills/hatch3r-feature/SKILL.md +53 -3
- package/dist/content/skills/hatch3r-feedback/SKILL.md +103 -0
- package/dist/content/skills/hatch3r-gh-agentic-workflows/SKILL.md +10 -8
- package/dist/content/skills/hatch3r-handoff-prepare/SKILL.md +4 -7
- package/dist/content/skills/hatch3r-handoff-resume/SKILL.md +4 -7
- package/dist/content/{commands/hatch3r-hooks.md → skills/hatch3r-hooks/SKILL.md} +48 -137
- package/dist/content/skills/hatch3r-incident-response/SKILL.md +66 -7
- package/dist/content/skills/hatch3r-issue-workflow/SKILL.md +11 -0
- package/dist/content/skills/hatch3r-learn/SKILL.md +317 -0
- package/dist/content/skills/hatch3r-logical-refactor/SKILL.md +6 -7
- package/dist/content/skills/hatch3r-maintainability-verify/SKILL.md +146 -0
- package/dist/content/skills/hatch3r-migration/SKILL.md +8 -7
- package/dist/content/skills/hatch3r-observability-verify/SKILL.md +17 -12
- package/dist/content/skills/hatch3r-perf-audit/SKILL.md +13 -9
- package/dist/content/skills/hatch3r-pr-creation/SKILL.md +4 -7
- package/dist/content/skills/hatch3r-qa-validation/SKILL.md +6 -5
- package/dist/content/skills/hatch3r-recipe/SKILL.md +63 -60
- package/dist/content/skills/hatch3r-refactor/SKILL.md +6 -7
- package/dist/content/skills/hatch3r-release/SKILL.md +123 -11
- package/dist/content/skills/hatch3r-reliability-verify/SKILL.md +9 -5
- package/dist/content/{commands/hatch3r-report.md → skills/hatch3r-report/SKILL.md} +20 -17
- package/dist/content/skills/hatch3r-scalability-verify/SKILL.md +145 -0
- package/dist/content/skills/hatch3r-security-verify/SKILL.md +144 -0
- package/dist/content/skills/hatch3r-team-convention-author/SKILL.md +126 -0
- package/dist/content/skills/hatch3r-testability-verify/SKILL.md +147 -0
- package/dist/content/skills/hatch3r-ui-ux-verify/SKILL.md +19 -11
- package/dist/content/skills/hatch3r-visual-refactor/SKILL.md +11 -7
- package/package.json +50 -31
- package/dist/cli/index.d.ts +0 -2
- package/dist/cli/index.js.map +0 -1
- package/dist/content/agents/hatch3r-a11y-auditor.md +0 -159
- package/dist/content/agents/hatch3r-dependency-auditor.md +0 -219
- package/dist/content/agents/hatch3r-perf-profiler.md +0 -166
- package/dist/content/agents/hatch3r-security-auditor.md +0 -180
- package/dist/content/agents/hatch3r-test-writer.md +0 -171
- package/dist/content/commands/hatch3r-learn.md +0 -312
- package/dist/content/rules/hatch3r-learning-consult.md +0 -42
- package/dist/content/rules/hatch3r-learning-consult.mdc +0 -38
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: hatch3r-diagnose
|
|
3
|
+
type: command
|
|
4
|
+
orchestrator: true
|
|
5
|
+
agentPipeline: [hatch3r-researcher, hatch3r-fixer]
|
|
6
|
+
description: "Troubleshoot a hatch3r framework issue (setup, config, adapter wiring, drift). Gathers state, delegates root-cause analysis to hatch3r-researcher, proposes a fix, and applies it via hatch3r-fixer after one confirmation gate."
|
|
7
|
+
argument-hint: "[symptom]"
|
|
8
|
+
tags: [maintenance, devops, ctx:brownfield-only]
|
|
9
|
+
quality_charter: agents/shared/quality-charter.md
|
|
10
|
+
efficiency_patterns: agents/shared/efficiency-patterns.md
|
|
11
|
+
cache_friendly: true
|
|
12
|
+
parallel_tool_default: true
|
|
13
|
+
efficiency_tier: standard
|
|
14
|
+
triage_tiers: [1, 2, 3]
|
|
15
|
+
sub_agents_spawned:
|
|
16
|
+
count: 2
|
|
17
|
+
rationale: One hatch3r-researcher (root-cause mode against the captured state bundle) plus one hatch3r-fixer (applies the single proposed remediation). Independent symptom domains fan out to N parallel researchers; serialization holds only on the diagnose -> fix dependency edge. Cost-dominance per CONSTITUTION §2 P8 — token cost never serializes the diagnosis from the fix when both are needed.
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## §0 Detect Ambiguity (P8 B1)
|
|
21
|
+
|
|
22
|
+
Before any action, scan the user's request for unresolved questions in symptom scope, target adapter, or expected-vs-actual behavior. If the symptom maps to two or more distinct failure domains (e.g., "sync is broken" could mean adapter output drift OR a manifest schema mismatch OR a path-traversal guard rejection), ask the user via the platform-native question tool per `agents/shared/user-question-protocol.md` — do not guess which subsystem to probe. Proceed without asking ONLY when the symptom names a single subsystem and a single expected behavior. Any residual ambiguity discovered mid-diagnosis re-invokes the same protocol. Source: `.claude/rules/clarification-default.md`.
|
|
23
|
+
|
|
24
|
+
## Agent Pipeline
|
|
25
|
+
|
|
26
|
+
| Stage | Agent(s) | Parallel | Required |
|
|
27
|
+
|-------|----------|----------|----------|
|
|
28
|
+
| 1. Capture state bundle | Orchestrator (inline, read-only) | No | Yes |
|
|
29
|
+
| 2. Triage symptom domain | Orchestrator (inline) | No | Yes |
|
|
30
|
+
| 3. Root-cause analysis | `hatch3r-researcher` (`root-cause` + `symptom-trace` modes) | Per independent symptom domain | Yes |
|
|
31
|
+
| 4. Propose remediation + ASK gate | Orchestrator (inline) | No | Yes |
|
|
32
|
+
| 5. Apply fix | `hatch3r-fixer` | Per fix group | When user accepts a code/config fix |
|
|
33
|
+
| 6. Verify + Iteration Summary | Orchestrator (inline) | No | Yes |
|
|
34
|
+
|
|
35
|
+
**Parallel-safety conditions** (per `rules/hatch3r-agent-orchestration.md` §Parallel Safety): when the captured state surfaces two or more independent symptom domains (e.g., one adapter's output drift AND an unrelated manifest field), fan out one `hatch3r-researcher` per domain — each reads a disjoint file set, aggregation is deterministic (union of root-cause records), and no shared mutable state exists. A single symptom domain spawns one researcher.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
# Diagnose -- Troubleshoot a hatch3r Framework Issue
|
|
40
|
+
|
|
41
|
+
Closes the **symptom -> root cause -> fix** loop on a hatch3r setup, configuration, adapter-wiring, or drift problem in a repo where hatch3r is installed. Captures a read-only state bundle, delegates root-cause analysis to `hatch3r-researcher`, presents one remediation with an ASK gate, then delegates the fix to `hatch3r-fixer` and verifies.
|
|
42
|
+
|
|
43
|
+
Use `hatch3r-diagnose` when a hatch3r command misbehaves, adapter output looks wrong, `hatch3r status`/`hatch3r verify` reports drift, or the install is in an unexpected state. Use `/hatch3r-healthcheck` for a routine read-only health report with no fix step; use `/hatch3r-debug` for application-code debugging unrelated to the hatch3r framework itself.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Argument Parsing
|
|
48
|
+
|
|
49
|
+
Optional positional argument: `<symptom>` (free-text description of the problem).
|
|
50
|
+
|
|
51
|
+
- If supplied: seed the Step 2 triage with the described symptom.
|
|
52
|
+
- If omitted: capture the full state bundle (Step 1) and ASK the user which symptom to investigate before delegating — a blind full-surface diagnosis is over-fan-out per `rules/hatch3r-fan-out-discipline.md`.
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Step 1: Capture State Bundle (read-only)
|
|
57
|
+
|
|
58
|
+
Gather the diagnostic state once; cache and pass it into the Step 3 researcher prompt so the sub-agent does not re-read. All commands are read-only.
|
|
59
|
+
|
|
60
|
+
| Probe | Command | Captures |
|
|
61
|
+
|-------|---------|----------|
|
|
62
|
+
| Version | `npx hatch3r --version` | installed CLI version |
|
|
63
|
+
| Manifest | read `.hatch3r/hatch.json` | `schemaVersion`, adapters, `managedFiles`, board config |
|
|
64
|
+
| Drift | `npx hatch3r status` (and `npx hatch3r verify` if status is ambiguous) | adapter-output drift vs bundled canonical content |
|
|
65
|
+
| Validation | `npx hatch3r validate` | content-structure / frontmatter / cross-ref failures |
|
|
66
|
+
| On-disk adapters | list `.cursor/`, `CLAUDE.md`, `.github/` adapter outputs present | which adapters actually materialized |
|
|
67
|
+
| Recent changes | `git log --oneline -10` + `git status --short` | uncommitted edits to managed files |
|
|
68
|
+
|
|
69
|
+
Record each probe's exit code and the first failing line. A non-zero exit on `status`/`verify`/`validate` is the primary lead; an unexpected `schemaVersion` (not 3) or a missing adapter output is a secondary lead.
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Step 2: Triage Symptom Domain
|
|
74
|
+
|
|
75
|
+
Classify the captured state into one or more domains before delegating. The domain determines which researcher modes and which file globs the Step 3 prompt scopes to.
|
|
76
|
+
|
|
77
|
+
| Domain | Lead signal | Researcher scope |
|
|
78
|
+
|--------|-------------|------------------|
|
|
79
|
+
| Setup / install | missing adapter output, first-run failure, Node version mismatch | `src/cli/commands/init.ts`, `.hatch3r/hatch.json`, install logs |
|
|
80
|
+
| Config / manifest | unexpected `schemaVersion`, malformed `.hatch3r/hatch.json`, override not applied | `.hatch3r/hatch.json`, `.hatch3r/overrides/`, `src/content/` precedence |
|
|
81
|
+
| Adapter wiring | adapter output absent/malformed, customization layer ignored | `src/adapters/`, `.customize.yaml`, `.customize.md`, managed-block markers |
|
|
82
|
+
| Drift | `hatch3r status`/`verify` reports on-disk vs canonical mismatch | the specific drifted file path + `src/merge/managedBlocks.ts` |
|
|
83
|
+
|
|
84
|
+
Triage tier (calibrates fan-out and the Step 0.5 cost preview):
|
|
85
|
+
|
|
86
|
+
- **Tier 1** — single domain, single drifted file or one obvious config typo. One researcher, no parallel fan-out.
|
|
87
|
+
- **Tier 2** — single domain, multiple files, root cause not obvious from the state bundle alone. One researcher at `standard` depth.
|
|
88
|
+
- **Tier 3** — two or more independent symptom domains. One researcher per domain in parallel (per the Parallel-safety conditions above).
|
|
89
|
+
|
|
90
|
+
### Step 0.5: Emit Pre-Execution Cost Preview
|
|
91
|
+
|
|
92
|
+
Before the Step 4 ASK gate (the only mutation gate), surface the cost preview so a multi-domain diagnosis is never approved blind. Emit the `cost_estimate` block per `rules/hatch3r-cost-visibility.md` Pre-Execution Estimate, calibrated to the Step 2 tier.
|
|
93
|
+
|
|
94
|
+
```yaml
|
|
95
|
+
cost_estimate:
|
|
96
|
+
expected_sa_count: <Tier 1 ~1 researcher (+1 fixer if a fix lands); Tier 3 = N researchers + 1 fixer>
|
|
97
|
+
estimated_input_tokens_static_frame: <int>
|
|
98
|
+
estimated_web_research_queries: <int> # usually 0 — diagnosis reads local state, not the web
|
|
99
|
+
triage_tier: light | standard | deep
|
|
100
|
+
estimated_duration_min: <int>
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Post-execution actuals + delta land in the Step 6 Iteration Summary's Fan-out + Cost section per `rules/hatch3r-cost-visibility.md` Post-Execution Actuals. Token telemetry sources from `src/pipeline/observability.ts`.
|
|
104
|
+
|
|
105
|
+
### Effort Override (Decision 17)
|
|
106
|
+
|
|
107
|
+
`--effort=light|standard|deep` forces the named tier, bypassing the Step 2 auto-classification. The override wins; record both the auto-detected tier and the override so the cost block reports the budget delta. No override passed → the auto-classification stands.
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Step 3: Root-Cause Analysis (sub-agent delegation)
|
|
112
|
+
|
|
113
|
+
Delegate to `hatch3r-researcher` via the Task tool with the `root-cause` and `symptom-trace` modes (`agents/modes/root-cause.md`, `agents/modes/symptom-trace.md`). Launch one researcher per independent symptom domain in parallel.
|
|
114
|
+
|
|
115
|
+
Each researcher prompt MUST include:
|
|
116
|
+
|
|
117
|
+
1. The Step 1 state bundle verbatim (probe outputs + exit codes) so the sub-agent does not re-run probes.
|
|
118
|
+
2. The Step 2 domain classification and the scoped file globs for that domain.
|
|
119
|
+
3. The user's symptom description (or the answer to the Step 1 ASK).
|
|
120
|
+
4. All `scope: always` rule directives from `rules/` (loaded once at session start).
|
|
121
|
+
5. The confidence expression requirement (verbatim): rate every finding high/medium/low per `agents/shared/quality-charter.md` §1 — high = root cause reproduced against the captured state; medium = pattern-based; low = best judgment, recommend human review.
|
|
122
|
+
6. Explicit: do NOT create files, modify code, create branches/commits, or change board status — return a structured root-cause record only (the researcher's standing contract).
|
|
123
|
+
|
|
124
|
+
Await all researchers. Each returns a root-cause record with a `causal_chain` (≥3 steps: symptom → driver → root) and a proposed remediation. If a researcher returns `BLOCKED_AMBIGUITY` or `BLOCKED_PREMISE_CHALLENGE`, halt and surface the blocker to the user per the researcher's BLOCKED Output Schema — do not proceed to a fix on a contested premise.
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Step 4: Propose Remediation + ASK Checkpoint (only mutation gate)
|
|
129
|
+
|
|
130
|
+
Consolidate the researcher root-cause records into one remediation table. Each row: `[#] {domain} • {root cause one-line} • {proposed fix} • {confidence} • {reversible? yes/no}`.
|
|
131
|
+
|
|
132
|
+
```
|
|
133
|
+
hatch3r-diagnose — PR #n/a (Tier {1|2|3})
|
|
134
|
+
|
|
135
|
+
Findings:
|
|
136
|
+
[1] adapter-wiring • CLAUDE.md managed block hand-edited, so `hatch3r status` reports drift • re-run `hatch3r sync` to regenerate the block (discards the hand-edit) • high • reversible
|
|
137
|
+
[2] config • .hatch3r/hatch.json schemaVersion is 2; current is 3 • run `hatch3r update` to migrate the manifest • high • reversible (snapshot taken)
|
|
138
|
+
|
|
139
|
+
Tier: 2
|
|
140
|
+
Confidence: high — root cause reproduced against the captured state bundle.
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
ASK (only gate), per `agents/shared/user-question-protocol.md`:
|
|
144
|
+
|
|
145
|
+
> Diagnosed {N} root cause(s). Review the proposed remediation:
|
|
146
|
+
> - `accept` — apply every proposed fix via hatch3r-fixer
|
|
147
|
+
> - `fix N` — apply only finding N
|
|
148
|
+
> - `explain N` — print the full causal chain + counter-argument for finding N
|
|
149
|
+
> - `skip` — report the diagnosis only; apply nothing
|
|
150
|
+
>
|
|
151
|
+
> (accept / fix N / explain N / skip)
|
|
152
|
+
|
|
153
|
+
If a proposed fix is irreversible (deletes a file, drops a manifest field, force-resets a managed block over uncommitted edits), the ASK MUST state that explicitly and default to `skip` per the irreversible-action trigger in `.claude/rules/clarification-default.md`. After the user accepts, the run is autonomous through Step 6.
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## Step 5: Apply Fix (sub-agent delegation)
|
|
158
|
+
|
|
159
|
+
For each accepted finding, delegate to `hatch3r-fixer` via the Task tool. Group same-file fixes into one fixer invocation; dispatch disjoint-file fixes in parallel.
|
|
160
|
+
|
|
161
|
+
Each fixer prompt MUST include:
|
|
162
|
+
|
|
163
|
+
1. The finding as a structured reviewer-style record: `[CRITICAL|WARNING] {file} — {root cause} — {suggested fix}` (the fixer consumes Critical/Warning findings per its Fix Protocol).
|
|
164
|
+
2. The researcher's causal chain so the fixer fixes the root cause, not the symptom.
|
|
165
|
+
3. All `scope: always` rule directives.
|
|
166
|
+
4. The confidence expression requirement (verbatim).
|
|
167
|
+
5. Explicit: do NOT create branches, commits, or PRs — the fixer's standing boundary; this command stops before commit for human review.
|
|
168
|
+
|
|
169
|
+
Await the fixer's structured result. Capture its `Delegation proof ID` per file (quoted verbatim in the Step 6 attestation) and its `Reviewer re-run required` signal. When a fix touches framework source under `src/`, honor the fixer's reviewer-loop continuation signal — but this command does not run the full Phase 3 review loop; it surfaces `Reviewer re-run required: true` as a Suggested Next Action in Step 6 rather than auto-spawning a reviewer.
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## Step 6: Verify + Iteration Summary
|
|
174
|
+
|
|
175
|
+
Re-run the relevant Step 1 probe(s) to confirm the fix cleared the symptom: re-run `hatch3r status` after a drift/adapter fix, `hatch3r validate` after a content fix, `npx tsc --noEmit` after a `src/` fix. Record each re-run command and its exit code.
|
|
176
|
+
|
|
177
|
+
### End-of-Turn Delegation Attestation (Bypass Protection)
|
|
178
|
+
|
|
179
|
+
> Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → End-of-Turn Delegation Attestation. Per-command mutated-file slot: `<path>` via `hatch3r-fixer` when Step 5 applied a fix. A skip-path run (Step 4 `skip`, diagnosis-only) mutated nothing — state `inline_edits_by_orchestrator: none` and `mutating_subagent_invocations: 0`.
|
|
180
|
+
|
|
181
|
+
### Iteration Summary (mandatory output)
|
|
182
|
+
|
|
183
|
+
Emit the canonical iteration summary per `rules/hatch3r-iteration-summary.md`:
|
|
184
|
+
|
|
185
|
+
```markdown
|
|
186
|
+
## Iteration Summary
|
|
187
|
+
|
|
188
|
+
**Status:** SUCCESS | PARTIAL | FAILED | BLOCKED
|
|
189
|
+
**Outcome:** {one sentence — e.g., "Diagnosed manifest schema drift; migrated .hatch3r/hatch.json to schemaVersion 3; hatch3r status now clean."}
|
|
190
|
+
|
|
191
|
+
**Done:**
|
|
192
|
+
- {finding} → fixed via hatch3r-fixer (proof: {id}); verified by {re-run command} exit 0
|
|
193
|
+
|
|
194
|
+
**Not Done / Deferred / Unverified:**
|
|
195
|
+
- (or: `None — full scope completed`)
|
|
196
|
+
|
|
197
|
+
**Open Questions / Blockers:**
|
|
198
|
+
- (or: `None`)
|
|
199
|
+
|
|
200
|
+
**Fan-out + Cost:** sub_agents_spawned: { count, rationale } + cost_estimate / cost_actuals / delta
|
|
201
|
+
**Confidence:** {high | medium | low} — {basis from researcher + fixer outputs}
|
|
202
|
+
**Suggested Next Action:** {one line — e.g., "Commit the manifest migration; re-run /hatch3r-diagnose if drift reappears."}
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Status decision rules:
|
|
206
|
+
- **SUCCESS** — every accepted fix applied and the re-run probe confirms the symptom cleared.
|
|
207
|
+
- **PARTIAL** — some fixes applied, others BLOCKED, or a re-run probe still reports a residual symptom.
|
|
208
|
+
- **FAILED** — the fixer returned BLOCKED on every finding; no change landed.
|
|
209
|
+
- **BLOCKED** — a researcher returned `BLOCKED_PREMISE_CHALLENGE`, or an irreversible fix needs a user decision not yet given.
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## Per-Turn Pipeline-State Header (Bypass Protection)
|
|
214
|
+
|
|
215
|
+
> Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Per-Turn Pipeline-State Header. Phase mapping for diagnose: `1` = state capture + triage, `2` = researcher root-cause dispatch, `3` = fixer apply + verify + summary. Tier 1 runs are exempt per the Tier 1 exemption.
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
## Guardrails
|
|
220
|
+
|
|
221
|
+
1. **One ASK gate.** Step 4 is the only user-facing checkpoint. State capture (Step 1) and root-cause analysis (Step 3) are read-only and need no gate.
|
|
222
|
+
2. **No commit or push.** This command stops before commit so the maintainer reviews every change. Git operations are out of scope.
|
|
223
|
+
3. **Read-only probes.** Step 1 runs only read-only hatch3r and git commands; it never mutates the install or the manifest.
|
|
224
|
+
4. **No blind full-surface diagnosis.** A symptom must be named (argument or Step 1 ASK) before delegating — fan-out scales with named symptom domains, not the whole install.
|
|
225
|
+
5. **Irreversible-fix consent.** Any fix that deletes a file, drops a manifest field, or overwrites uncommitted managed-block edits requires an explicit ASK with `skip` as the default.
|
|
226
|
+
|
|
227
|
+
## Resumability (Decision 27/30)
|
|
228
|
+
|
|
229
|
+
diagnose is checkpoint-light — Step 1 state capture and Step 3 root-cause analysis are read-only, so an interrupted run re-captures cheaply; the only mutation point is Step 5 (fixer apply), so checkpoint there to avoid re-applying a fix already landed.
|
|
230
|
+
|
|
231
|
+
> Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Checkpoint Contract. Per-command slots: workspace `.diagnose-workspace/`; step range the Step 1 → Step 6 progression; `wave` = the per-finding fix index in Step 5; snapshot/rollback paths every file a Step 5 fixer touches. Write points: after Step 1 state capture, after the Step 3 researcher batch returns, after the Step 4 ASK decision, and after each Step 5 fixer returns. The read-only steps record their result so a resume skips re-running probes when the baseline SHA is unchanged.
|
|
232
|
+
|
|
233
|
+
## References
|
|
234
|
+
|
|
235
|
+
- `agents/hatch3r-researcher.md` -> `root-cause` / `symptom-trace` modes, BLOCKED Output Schema (accessed 2026-06-02, in-repo canonical, official-docs) — the diagnosis-stage delegate and its structured root-cause-record contract.
|
|
236
|
+
- `agents/hatch3r-fixer.md` -> Fix Protocol, Return Structured Result, Delegation proof ID (accessed 2026-06-02, in-repo canonical, official-docs) — the fix-stage delegate and the forgery-resistant attribution token quoted in the attestation.
|
|
237
|
+
- `agents/shared/user-question-protocol.md` (accessed 2026-06-02, in-repo canonical, official-docs) — B1 gate format for the Step 1 symptom ASK and the Step 4 remediation ASK.
|
|
238
|
+
- `rules/hatch3r-agent-orchestration.md` -> Per-Turn Pipeline-State Header, End-of-Turn Delegation Attestation (accessed 2026-06-02, in-repo canonical, official-docs) — bypass-protection block formats.
|
|
@@ -2,22 +2,24 @@
|
|
|
2
2
|
id: hatch3r-feature-plan
|
|
3
3
|
type: command
|
|
4
4
|
orchestrator: true
|
|
5
|
-
agentPipeline: [hatch3r-researcher, hatch3r-docs-writer]
|
|
5
|
+
agentPipeline: [hatch3r-researcher, hatch3r-docs-writer, hatch3r-ui, hatch3r-ux, hatch3r-security, hatch3r-reliability, hatch3r-testability, hatch3r-scalability, hatch3r-performance, hatch3r-maintainability, hatch3r-enhancability]
|
|
6
6
|
description: Design a new capability -- draft user stories, acceptance criteria, data model, API surface, and sub-issue breakdown as an epic-shaped todo.md for greenfield features
|
|
7
7
|
tags: [planning, orchestration]
|
|
8
8
|
quality_charter: agents/shared/quality-charter.md
|
|
9
9
|
efficiency_patterns: agents/shared/efficiency-patterns.md
|
|
10
10
|
cache_friendly: true
|
|
11
11
|
parallel_tool_default: true
|
|
12
|
+
efficiency_tier: deep
|
|
12
13
|
triage_tiers: [1, 2, 3]
|
|
14
|
+
supports_resume: true
|
|
13
15
|
sub_agents_spawned:
|
|
14
|
-
count:
|
|
15
|
-
rationale: Four parallel hatch3r-researcher modes per feature brief — codebase-impact, feature-design, architecture, risk-pitfalls — dispatched concurrently in Step 3; a docs-writer composes the spec on their merged output.
|
|
16
|
+
count: 13
|
|
17
|
+
rationale: Four parallel hatch3r-researcher modes per feature brief — codebase-impact, feature-design, architecture, risk-pitfalls — dispatched concurrently in Step 3; a docs-writer composes the spec on their merged output; the 9 CQ vector specialists (ui/ux/security/reliability/testability/scalability/performance/maintainability/enhancability) advise pre-write on the measurable floors that the spec must encode (axe-core threshold, OAuth depth, OTel + SLO scaffolding, mandate-map test class, etc.). Cost-dominance per CONSTITUTION §2 P8 — token cost never serializes independent work.
|
|
16
18
|
---
|
|
17
19
|
|
|
18
20
|
## §0 Detect Ambiguity (P8 B1)
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
> Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → §0 Detect Ambiguity (P8 B1). Triggers: contradictory inputs, missing target, unknown convention.
|
|
21
23
|
|
|
22
24
|
## Agent Pipeline
|
|
23
25
|
|
|
@@ -27,6 +29,8 @@ Before any action, scan the user's request and provided context for unresolved q
|
|
|
27
29
|
| 2. Document Generation | `hatch3r-docs-writer` (spec, ADRs) | Yes | Yes |
|
|
28
30
|
| 3. Todo Generation | Orchestrator (inline) | No | Yes |
|
|
29
31
|
|
|
32
|
+
**Parallel-safety conditions** (per `rules/hatch3r-agent-orchestration.md` §Parallel Safety): every parallel fan-out above holds all three — read-only or disjoint writes, deterministic aggregation, no shared mutable state.
|
|
33
|
+
|
|
30
34
|
# Feature Plan — Single Feature Specification from Idea to Board-Ready Epic
|
|
31
35
|
|
|
32
36
|
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.
|
|
@@ -45,6 +49,16 @@ Take a single feature idea and produce a complete feature specification (`docs/s
|
|
|
45
49
|
|
|
46
50
|
---
|
|
47
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 spec 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
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
48
62
|
## Workflow
|
|
49
63
|
|
|
50
64
|
Execute these steps in order. **Do not skip any step.** Ask the user at every checkpoint marked with ASK.
|
|
@@ -59,6 +73,29 @@ Classify the feature-planning request before delegating:
|
|
|
59
73
|
|
|
60
74
|
If Tier 1, run the reduced researcher set and skip Step 6 (ADRs). If Tier 2, run the standard pipeline below. If Tier 3, run the full pipeline including ADR generation and confirm spec scope explicitly before writing files.
|
|
61
75
|
|
|
76
|
+
### Step 0.5: Emit Pre-Execution Cost Preview
|
|
77
|
+
|
|
78
|
+
Before the first sub-agent dispatch (Step 3), surface the cost preview so a multi-researcher feature-planning run is never started blind. Emit the `cost_estimate` block per `rules/hatch3r-cost-visibility.md` Pre-Execution Estimate, calibrated to the Step 0 triage tier:
|
|
79
|
+
|
|
80
|
+
```yaml
|
|
81
|
+
cost_estimate:
|
|
82
|
+
expected_sa_count: <triage tier → Tier 1 ~2, Tier 2 ~6, Tier 3 up to 13>
|
|
83
|
+
estimated_input_tokens_static_frame: <int>
|
|
84
|
+
estimated_web_research_queries: <int>
|
|
85
|
+
triage_tier: light | standard | deep
|
|
86
|
+
estimated_duration_min: <int>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Post-execution actuals + delta land in the iteration summary's Fan-out + Cost section per `rules/hatch3r-cost-visibility.md` Post-Execution Actuals. Token telemetry sources from `src/pipeline/observability.ts`.
|
|
90
|
+
|
|
91
|
+
### Effort Override (Decision 17)
|
|
92
|
+
|
|
93
|
+
Auto-tiering can misclassify — a single-module feature scored as Deep, or a cross-cutting feature scored as Light. The user override is the recovery path mandated by hatch3r's universal `--effort` override contract ("User overridable via `--effort` flag"):
|
|
94
|
+
|
|
95
|
+
- `--effort=light|standard|deep` forces the named tier, bypassing the Step 0 auto-classification.
|
|
96
|
+
- The override wins over the auto-detected tier; record both the auto-detected tier and the override in the run context so the Cost estimate block reports the budget delta.
|
|
97
|
+
- No override passed → the Step 0 auto-classification stands.
|
|
98
|
+
|
|
62
99
|
---
|
|
63
100
|
|
|
64
101
|
### Step 1: Gather Feature Description
|
|
@@ -100,7 +137,7 @@ After the feature brief is confirmed, probe for missing requirements across key
|
|
|
100
137
|
- **Observability**: Logging? Metrics? Error tracking for the new behavior?
|
|
101
138
|
- **Testing**: What constitutes "working"? Acceptance test scenarios?
|
|
102
139
|
- **Rollout**: Feature flags? Phased rollout? Rollback strategy?
|
|
103
|
-
3. Skip dimensions that the feature brief already addresses
|
|
140
|
+
3. Skip dimensions that the feature brief already addresses with a stated answer.
|
|
104
141
|
|
|
105
142
|
**ASK:** "Before research begins, I have {N} questions to confirm coverage of all feature dimensions:
|
|
106
143
|
{numbered question list — each with the dimension label and why the answer matters}
|
|
@@ -412,6 +449,35 @@ Confirm, or tell me what to adjust."
|
|
|
412
449
|
|
|
413
450
|
---
|
|
414
451
|
|
|
452
|
+
### Step 7.5: Deterministic Plan-Lint (Evaluator gate before write)
|
|
453
|
+
|
|
454
|
+
Steps 3-4 are the Planner (researchers) and Steps 5-7 are the Generator (spec/ADR/todo drafting). Before any file is written in Step 8, run an Evaluator pass over the drafted plan — the third role of Anthropic's Planner/Generator/Evaluator pattern (the gather-context → take-action → verify-work loop in `agents/shared/quality-charter.md`). The human ASK checkpoints in Steps 4-7 catch judgment-level disagreements; this gate catches structural defects the human eye skips on a long spec. It is rules-based (string/reference assertions over the drafted artifacts), not LLM-as-judge — the `rules-based > visual > LLM-as-judge` hierarchy applies, so each assertion below either passes or names the offending row.
|
|
455
|
+
|
|
456
|
+
Run all three assertions against the drafted spec (Step 5), ADR(s) (Step 6), and todo entries (Step 7). Each is a binary predicate over text already drafted; none require re-invoking a sub-agent.
|
|
457
|
+
|
|
458
|
+
| # | Assertion | Pass condition | Fail action |
|
|
459
|
+
|---|-----------|----------------|-------------|
|
|
460
|
+
| L1 | **Acceptance criteria are testable predicates.** Every cell in the Sub-Features `Acceptance Criteria` column (Step 5) and every acceptance-criteria summary in a todo entry (Step 7) states an observable subject plus a verifiable condition. | No criterion is a bare adjective or unfalsifiable phrase (`works`, `is fast`, `handles errors`, `looks good`, `as expected`) with no measurable subject + condition. A criterion phrased as a checklist item with a concrete trigger and outcome passes. | List each non-testable criterion by sub-feature title; rewrite it as `given <state>, when <action>, then <observable outcome>` (or a measurable threshold) before proceeding. |
|
|
461
|
+
| L2 | **Every `Depends On` resolves to a listed prerequisite.** Each entry in the spec Dependencies table `Depends On` column (Step 5) and each "depends on N" reference in the Implementation Order maps to either another sub-feature/sub-task listed in this spec, an entry in the same Dependencies table, or a named existing artifact marked `Status: Exists`. | Zero dangling dependencies — no `Depends On` value that names nothing in the spec and is not flagged `Needs building` or `Exists`. | Name each unresolved dependency and its source row; add the missing prerequisite to the Dependencies table (with `Type` + `Status`) or correct the reference before proceeding. |
|
|
462
|
+
| L3 | **Edge Cases carry zero empty `expected behavior`.** Every row in the spec `## Edge Cases` section (Step 5) and every row of an Edge-Case Ledger carried from `hatch3r-architect` / `agents/hatch3r-edge-case-analyst.md` has a non-empty `expected behavior` value. | No edge case is listed with a blank, `{expected behavior}` placeholder, or `TBD`/`TODO` expected-behavior cell. | List each edge case with a missing `expected behavior`; fill it from the risk-assessment researcher output, or move the row to `Out of Scope` with a one-line justification before proceeding. |
|
|
463
|
+
|
|
464
|
+
Emit the lint verdict with the spec-readiness confidence rating per the Confidence Propagation Contract:
|
|
465
|
+
|
|
466
|
+
```
|
|
467
|
+
plan_lint:
|
|
468
|
+
L1_testable_acceptance_criteria: pass | fail (<N> non-testable: <titles>)
|
|
469
|
+
L2_dependencies_resolve: pass | fail (<N> dangling: <names>)
|
|
470
|
+
L3_edge_cases_have_expected: pass | fail (<N> empty: <ids>)
|
|
471
|
+
verdict: pass | fail
|
|
472
|
+
confidence: high | medium | low # sourced from upstream researcher confidence per the Confidence Propagation Contract
|
|
473
|
+
```
|
|
474
|
+
|
|
475
|
+
**On `fail`:** do not advance to Step 8. Apply the per-assertion Fail action above to repair the drafted content in place, re-present the corrected rows under the relevant Step 5-7 ASK, then re-run this gate. A failing plan-lint is never written to disk — the gate is the last checkpoint before mutation, so structural defects cannot reach the implementer.
|
|
476
|
+
|
|
477
|
+
**On `pass`:** proceed to Step 8.
|
|
478
|
+
|
|
479
|
+
---
|
|
480
|
+
|
|
415
481
|
### Step 8: Write All Files
|
|
416
482
|
|
|
417
483
|
After all content is confirmed:
|
|
@@ -443,6 +509,59 @@ If yes, instruct the user to invoke the `hatch3r-board-fill` command. Note that
|
|
|
443
509
|
|
|
444
510
|
---
|
|
445
511
|
|
|
512
|
+
## Resumability (Decision 27/30)
|
|
513
|
+
|
|
514
|
+
feature-plan is long-running — a Tier 3 cross-cutting feature fans out four parallel hatch3r-researcher modes (codebase-impact, feature-design, architecture, risk-pitfalls) in Step 3, then assembles the spec via docs-writer with the 9 CQ vector specialists (ui/ux/security/reliability/testability/scalability/performance/maintainability/enhancability) advising pre-write on the measurable floors the spec must encode. Per hatch3r's workspace-checkpointed resumability contract, checkpoint progress so an interrupted run re-enters at the last completed step rather than re-running the four-researcher + nine-specialist fan-out.
|
|
515
|
+
|
|
516
|
+
> Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Checkpoint Contract. Per-command slots: workspace `.feature-plan-workspace/`; step range Step 0 → Step 8; `wave` = researcher-batch index, then CQ-specialist-batch index; doc dirs `docs/specs/`, `docs/adr/`, `todo.md`; `meta` adds `featureSlug`. Write points: after Step 1 feature-brief context locks, after Step 2 scope ASK, after the Step 3 four-researcher fan-out returns, after the CQ-specialist advisory batch returns, after Step 4 spec synthesis is confirmed by ASK, after each Step 5 file write, after Step 6 todo.md epic + sub-item generation, and after the optional Step 7 chain-to-`hatch3r-board-fill` handoff.
|
|
517
|
+
|
|
518
|
+
---
|
|
519
|
+
|
|
520
|
+
## Per-Turn Pipeline-State Header (Bypass Protection)
|
|
521
|
+
|
|
522
|
+
> Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Per-Turn Pipeline-State Header. Phase mapping for feature-plan: `1` = feature intake + scope decomposition, `2` = researcher/spec sub-agent dispatch, `3` = plan synthesis + acceptance-criteria drafting + Step 7.5 deterministic plan-lint (Evaluator gate), `4` = plan write + iteration-summary. Tier 1 runs are exempt per the Tier 1 exemption.
|
|
523
|
+
|
|
524
|
+
## End-of-Turn Delegation Attestation (Bypass Protection)
|
|
525
|
+
|
|
526
|
+
> Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → End-of-Turn Delegation Attestation. Per-command mutated-file slot: plan document, sub-plan files, criteria spec.
|
|
527
|
+
|
|
528
|
+
## Iteration Summary (mandatory output)
|
|
529
|
+
|
|
530
|
+
Emit the canonical 9-section iteration summary per `rules/hatch3r-iteration-summary.md` as the final user-facing output. The validation gate at `.claude/rules/capability-lifecycle.md` blocks SUCCESS declarations without this block (CONSTITUTION §6 Decision 23).
|
|
531
|
+
|
|
532
|
+
The 9 sections:
|
|
533
|
+
|
|
534
|
+
1. **Request** — verbatim restatement of the user's ask in one sentence.
|
|
535
|
+
2. **Fan-out + Cost** — `sub_agents_spawned: { count, rationale }` plus the `cost_estimate` / `cost_actuals` / `delta` blocks (see Cost Visibility below).
|
|
536
|
+
3. **Web Research** — every URL fetched with access date + trust tier per `agents/shared/rigor-contract.md` (0 acceptable when no research was needed).
|
|
537
|
+
4. **Files Mutated** — list with diff summary (lines added / removed / files created).
|
|
538
|
+
5. **Gates Passed / Failed** — explicit list per `.claude/rules/capability-lifecycle.md` Gate Checklist.
|
|
539
|
+
6. **Pillar Impact Attribution** — `progress_toward_pillar: <axis>.<pillar_id>+<delta>` per CONSTITUTION §6 Decision 17.
|
|
540
|
+
7. **Verification Commands** — exact commands run with exit codes plus key output lines (≤200 chars).
|
|
541
|
+
8. **Open Questions / Blockers** — explicit `None` if fully closed.
|
|
542
|
+
9. **Learnings Captured** — IDs of any learnings written to `.hatch3r/learnings/` this run per `rules/hatch3r-learning-system.md`.
|
|
543
|
+
|
|
544
|
+
### Cost Visibility (Decision 24)
|
|
545
|
+
|
|
546
|
+
> Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Cost Estimate for the 5-field `cost_estimate` schema and the post-execution `cost_actuals` + `delta` contract; both land in Section 2 above.
|
|
547
|
+
|
|
548
|
+
## Cost estimate (Decision 24)
|
|
549
|
+
|
|
550
|
+
This command emits cost transparency per `rules/hatch3r-cost-visibility.md` and CONSTITUTION §6 Decision 24/29:
|
|
551
|
+
|
|
552
|
+
- **Pre-execution `cost_estimate`** — emitted in Step 0.5 before the first researcher dispatch.
|
|
553
|
+
- **Post-execution `cost_actuals` + `delta`** — appended to the iteration summary's Fan-out + Cost section per `rules/hatch3r-iteration-summary.md` §2.
|
|
554
|
+
|
|
555
|
+
Per-tier `expected_sa_count` calibration (from frontmatter `sub_agents_spawned.count: 13` × tier heuristic in `rules/hatch3r-cost-visibility.md` Pre-Execution Estimate): Tier 1 ≈ 2 (reduced researcher set + docs-writer); Tier 2 ≈ 6; Tier 3 up to 13 (4-5 parallel researcher modes + docs-writer + the 9 CQ vector specialists advising pre-write). Deltas beyond 25% absolute value carry `flagged_for_review: true`. Token telemetry sources from `src/pipeline/observability.ts`; estimation primitives from `src/pipeline/costEstimator.ts`.
|
|
556
|
+
|
|
557
|
+
---
|
|
558
|
+
|
|
559
|
+
## References
|
|
560
|
+
|
|
561
|
+
- Anthropic. "Building agents with the Claude Agent SDK." `https://www.anthropic.com/engineering/building-agents-with-the-claude-agent-sdk` (accessed 2026-06-06, Anthropic engineering, official-vendor). Source for the Planner/Generator/Evaluator decomposition and the gather-context → take-action → verify-work loop behind Step 7.5: the Evaluator role evaluates the drafted plan before execution, and the `rules-based > visual > LLM-as-judge` hierarchy is why the Step 7.5 plan-lint is binary string/reference assertions rather than an LLM critique.
|
|
562
|
+
|
|
563
|
+
---
|
|
564
|
+
|
|
446
565
|
## Error Handling
|
|
447
566
|
|
|
448
567
|
- **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).
|
|
@@ -456,6 +575,7 @@ If yes, instruct the user to invoke the `hatch3r-board-fill` command. Note that
|
|
|
456
575
|
|
|
457
576
|
- **Never skip ASK checkpoints.** Every step with an ASK must pause for user confirmation.
|
|
458
577
|
- **Never write files without user review and confirmation.** All generated content is presented first.
|
|
578
|
+
- **Never write files on a failing Step 7.5 plan-lint.** The Evaluator gate (acceptance criteria testable, dependencies resolve, edge cases carry expected behavior) must report `verdict: pass` before Step 8 — repair the drafted content and re-run the gate; a failing plan never reaches the implementer.
|
|
459
579
|
- **Always delegate research to the hatch3r-researcher agent protocol.** Researcher sub-agents handle Context7 MCP, web research, and the tooling hierarchy internally.
|
|
460
580
|
- **Stay within the feature scope** defined by the user in Step 1. Do not invent sub-features the user did not describe or imply. Flag scope expansion opportunities but do not act on them without explicit approval.
|
|
461
581
|
- **todo.md must be compatible with board-fill format** — markdown checklist with bold titles, grouped by priority, referencing source specs.
|
|
@@ -4,28 +4,32 @@ type: command
|
|
|
4
4
|
orchestrator: true
|
|
5
5
|
agentPipeline: [hatch3r-handoff-preparer]
|
|
6
6
|
description: Prepare, resume, list, complete, and prune cross-session handoff documents.
|
|
7
|
+
argument-hint: "prepare | resume [id] | list | complete <id> | prune"
|
|
7
8
|
tags: [orchestration, maintenance]
|
|
8
9
|
quality_charter: agents/shared/quality-charter.md
|
|
9
10
|
efficiency_patterns: agents/shared/efficiency-patterns.md
|
|
10
11
|
cache_friendly: true
|
|
11
12
|
parallel_tool_default: true
|
|
13
|
+
efficiency_tier: standard
|
|
12
14
|
triage_tiers: [1, 2]
|
|
13
15
|
sub_agents_spawned:
|
|
14
16
|
count: 1
|
|
15
|
-
rationale: Single hatch3r-handoff-preparer delegation for the `prepare` Tier-2 subcommand; `resume`, `list`, `complete`, `prune` run inline with no sub-agent fan-out (filesystem-read or single-file rename per the Triage table).
|
|
17
|
+
rationale: Single hatch3r-handoff-preparer delegation for the `prepare` Tier-2 subcommand; `resume`, `list`, `complete`, `prune` run inline with no sub-agent fan-out (filesystem-read or single-file rename per the Triage table). Cost-dominance per CONSTITUTION §2 P8 — token cost never serializes independent work.
|
|
16
18
|
---
|
|
17
19
|
|
|
18
20
|
## §0 Detect Ambiguity (P8 B1)
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
> Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → §0 Detect Ambiguity (P8 B1). Triggers: contradictory inputs, missing target, unknown convention.
|
|
21
23
|
|
|
22
24
|
## Agent Pipeline
|
|
23
25
|
|
|
24
26
|
The `prepare` subcommand delegates to `hatch3r-handoff-preparer` via the Task tool. The other four subcommands (`resume`, `list`, `complete`, `prune`) run inline within this command — they read, list, transition status, or archive files and do not require a sub-agent.
|
|
25
27
|
|
|
28
|
+
**Parallel-safety conditions** (per `rules/hatch3r-agent-orchestration.md` §Parallel Safety): any parallel fan-out holds all three — read-only or disjoint writes, deterministic aggregation, no shared mutable state.
|
|
29
|
+
|
|
26
30
|
## Learnings Consultation
|
|
27
31
|
|
|
28
|
-
Before starting, scan `.hatch3r/learnings/` for entries
|
|
32
|
+
Before starting, scan `.hatch3r/learnings/` for entries whose `topic`/`applies-to` cover handoff, context-switch, resume, or session-state. Apply the consult procedure in `rules/hatch3r-learning-system.md` → Mandatory Consultation Gate + Consultation Efficiency (INDEX-first scan; surface top 5 by confidence). Skip if the directory has fewer than 3 files.
|
|
29
33
|
|
|
30
34
|
# Handoff Management — Cross-Session Work Continuity
|
|
31
35
|
|
|
@@ -42,6 +46,37 @@ Classify the handoff request by subcommand and operation size before routing:
|
|
|
42
46
|
|
|
43
47
|
There is no Tier 3 for this command — multi-issue or epic-scale handoffs are out of scope; the caller decomposes into per-work-item handoffs upstream.
|
|
44
48
|
|
|
49
|
+
### Step 0.5: Emit Pre-Execution Cost Preview
|
|
50
|
+
|
|
51
|
+
The `prepare` subcommand is the only one that dispatches a sub-agent. Before invoking `hatch3r-handoff-preparer`, surface the cost preview per `rules/hatch3r-cost-visibility.md` Pre-Execution Estimate. The Tier-1 read/list/rename subcommands (`list`, `complete`, `prune --dry-run`) run inline with `expected_sa_count: 0` and may emit a one-line cost note instead of the full block:
|
|
52
|
+
|
|
53
|
+
```yaml
|
|
54
|
+
cost_estimate:
|
|
55
|
+
expected_sa_count: <prepare ~1; list/complete/prune-dry-run = 0>
|
|
56
|
+
estimated_input_tokens_static_frame: <int>
|
|
57
|
+
estimated_web_research_queries: 0 # handoff is local-only — no web research
|
|
58
|
+
triage_tier: light | standard
|
|
59
|
+
estimated_duration_min: <int>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Post-execution actuals + delta land in the Iteration Summary's Fan-out + Cost section per `rules/hatch3r-cost-visibility.md` Post-Execution Actuals. Token telemetry sources from `src/pipeline/observability.ts`.
|
|
63
|
+
|
|
64
|
+
### Effort Override (Decision 17)
|
|
65
|
+
|
|
66
|
+
This command has no Tier 3, so `--effort` maps only `light` ↔ `standard`. The override is the recovery path mandated by hatch3r's universal `--effort` override contract ("User overridable via `--effort` flag"):
|
|
67
|
+
|
|
68
|
+
- `--effort=light|standard` forces the named tier, bypassing the subcommand-derived auto-classification (Step 0). `--effort=deep` is rejected — Tier 3 is out of scope for this command.
|
|
69
|
+
- The override wins over the auto-detected tier; record both the auto-detected tier and the override in the run context so the Cost estimate block reports the budget delta.
|
|
70
|
+
- No override passed → the subcommand-derived classification stands.
|
|
71
|
+
|
|
72
|
+
## Confidence Propagation Contract
|
|
73
|
+
|
|
74
|
+
The `prepare` subcommand's `hatch3r-handoff-preparer` delegation prompt MUST include the confidence expression requirement below (verbatim), per the quality charter §1 rule (the inline subcommands produce no graded findings and are exempt).
|
|
75
|
+
|
|
76
|
+
> 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.
|
|
77
|
+
|
|
78
|
+
The preparer's readiness assessment and the `resume` drift-check verdict carry a high/medium/low confidence rating; dropping the signal into the Iteration Summary is a gate failure.
|
|
79
|
+
|
|
45
80
|
## Workflow
|
|
46
81
|
|
|
47
82
|
Execute these steps in order. **Do not skip any step.** Ask the user at every checkpoint marked with **ASK**.
|
|
@@ -117,6 +152,45 @@ ID STATUS BRANCH
|
|
|
117
152
|
|
|
118
153
|
---
|
|
119
154
|
|
|
155
|
+
## Per-Turn Pipeline-State Header (Bypass Protection)
|
|
156
|
+
|
|
157
|
+
> Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Per-Turn Pipeline-State Header. Phase mapping for handoff: `1` = action detection (prepare / load / resume / complete / prune), `2` = handoff-preparer / handoff-loader sub-agent dispatch, `3` = validation + integrity verification, `4` = report + iteration-summary. Tier 1 runs are exempt per the Tier 1 exemption.
|
|
158
|
+
|
|
159
|
+
## End-of-Turn Delegation Attestation (Bypass Protection)
|
|
160
|
+
|
|
161
|
+
> Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → End-of-Turn Delegation Attestation. Per-command mutated-file slot: handoff document written under `.hatch3r/handoffs/active/`.
|
|
162
|
+
|
|
163
|
+
## Iteration Summary (mandatory output)
|
|
164
|
+
|
|
165
|
+
Emit the canonical 9-section iteration summary per `rules/hatch3r-iteration-summary.md` as the final user-facing output. The validation gate at `.claude/rules/capability-lifecycle.md` blocks SUCCESS declarations without this block (CONSTITUTION §6 Decision 23).
|
|
166
|
+
|
|
167
|
+
The 9 sections:
|
|
168
|
+
|
|
169
|
+
1. **Request** — verbatim restatement of the user's ask in one sentence.
|
|
170
|
+
2. **Fan-out + Cost** — `sub_agents_spawned: { count, rationale }` plus the `cost_estimate` / `cost_actuals` / `delta` blocks (see Cost Visibility below).
|
|
171
|
+
3. **Web Research** — every URL fetched with access date + trust tier per `agents/shared/rigor-contract.md` (0 acceptable when no research was needed).
|
|
172
|
+
4. **Files Mutated** — list with diff summary (lines added / removed / files created).
|
|
173
|
+
5. **Gates Passed / Failed** — explicit list per `.claude/rules/capability-lifecycle.md` Gate Checklist.
|
|
174
|
+
6. **Pillar Impact Attribution** — `progress_toward_pillar: <axis>.<pillar_id>+<delta>` per CONSTITUTION §6 Decision 17.
|
|
175
|
+
7. **Verification Commands** — exact commands run with exit codes plus key output lines (≤200 chars).
|
|
176
|
+
8. **Open Questions / Blockers** — explicit `None` if fully closed.
|
|
177
|
+
9. **Learnings Captured** — IDs of any learnings written to `.hatch3r/learnings/` this run per `rules/hatch3r-learning-system.md`.
|
|
178
|
+
|
|
179
|
+
### Cost Visibility (Decision 24)
|
|
180
|
+
|
|
181
|
+
> Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Cost Estimate for the 5-field `cost_estimate` schema and the post-execution `cost_actuals` + `delta` contract; both land in Section 2 above.
|
|
182
|
+
|
|
183
|
+
## Cost estimate (Decision 24)
|
|
184
|
+
|
|
185
|
+
This command emits cost transparency per `rules/hatch3r-cost-visibility.md` and CONSTITUTION §6 Decision 24/29:
|
|
186
|
+
|
|
187
|
+
- **Pre-execution `cost_estimate`** — emitted in Step 0.5 before the `prepare` subcommand invokes `hatch3r-handoff-preparer`. Inline subcommands emit a one-line `expected_sa_count: 0` cost note.
|
|
188
|
+
- **Post-execution `cost_actuals` + `delta`** — appended to the Iteration Summary's Fan-out + Cost section per `rules/hatch3r-iteration-summary.md` §2.
|
|
189
|
+
|
|
190
|
+
Per-tier `expected_sa_count` calibration (from frontmatter `sub_agents_spawned.count: 1` × tier heuristic in `rules/hatch3r-cost-visibility.md` Pre-Execution Estimate): `prepare` ≈ 1 (one preparer delegation); `resume` ≈ 0 (inline drift check + status transition); `list`/`complete`/`prune` ≈ 0 (filesystem read or single-file rename). This command is local-only — `estimated_web_research_queries` is always 0. Deltas beyond 25% absolute value carry `flagged_for_review: true`. Token telemetry sources from `src/pipeline/observability.ts`; estimation primitives from `src/pipeline/costEstimator.ts`.
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
120
194
|
## Error Handling
|
|
121
195
|
|
|
122
196
|
- `.hatch3r/handoffs/active/` missing or empty: emit `No active handoffs. Run 'hatch3r-handoff prepare' to capture one.` and exit 0.
|
|
@@ -131,3 +205,9 @@ ID STATUS BRANCH
|
|
|
131
205
|
- **Never include secrets** (API keys, tokens, credentials) in any handoff body. The preparer scans for credential-shaped strings; reject the write if any are detected.
|
|
132
206
|
- **Never write** outside `.hatch3r/handoffs/active/` for new handoffs. Archival is the only path into `archived/`.
|
|
133
207
|
- **Always emit the Iteration Summary block** at the end of the iteration per `rules/hatch3r-iteration-summary.md`.
|
|
208
|
+
|
|
209
|
+
## References
|
|
210
|
+
|
|
211
|
+
- `agents/shared/user-question-protocol.md` (B1 gate — applies at §0 Detect Ambiguity above plus every mid-workflow ASK checkpoint per Finding D7-M14)
|
|
212
|
+
- `agents/shared/quality-charter.md` §1, §3, §7, §8 (confidence, ambiguity, measurable criteria)
|
|
213
|
+
- `rules/hatch3r-agent-orchestration.md` (Per-Turn Pipeline-State Header, End-of-Turn Delegation Attestation, Mandatory Delegation Directive)
|