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,250 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: hatch3r-auth-scaffold
|
|
3
|
+
type: command
|
|
4
|
+
orchestrator: true
|
|
5
|
+
agentPipeline: [hatch3r-implementer, hatch3r-security]
|
|
6
|
+
description: "Scaffold authentication boilerplate for a greenfield API service — OAuth 2.1 authorization-code-with-PKCE flow, OIDC ID-token validation, and hashed personal-access-token (PAT) issuance/verification. Implementer writes the code; hatch3r-security gates it against the CQ3 auth-depth floor."
|
|
7
|
+
argument-hint: "[service-name]"
|
|
8
|
+
tags: [implementation, security, floor:security, floor:content-quality]
|
|
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-implementer writes the OAuth 2.1 / OIDC / PAT boilerplate (code mutation flows through the implementer per the Mandatory Delegation Directive); one hatch3r-security gates the result against the CQ3 auth-depth floor (PKCE, exact redirect-URI match, ID-token claim validation, token-secret hashing). Independent auth modes (interactive OAuth vs machine-to-machine PAT) fan out to parallel implementers; the implement -> security-gate edge is the only serialization. Cost-dominance per CONSTITUTION §2 P8.
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## §0 Detect Ambiguity (P8 B1)
|
|
21
|
+
|
|
22
|
+
Before any action, scan the request for unresolved questions in auth mode, threat model, and identity provider. If the request does not name which flow(s) to scaffold (interactive sign-in via OAuth 2.1, machine-to-machine via PAT, or both), the OIDC provider / issuer, or the client type (public SPA vs confidential server), ask the user via the platform-native question tool per `agents/shared/user-question-protocol.md` — the token-binding decision (DPoP for browser vs bare bearer) and the redirect-URI allowlist depend on these, and a wrong assumption ships an exploitable flow. Proceed without asking ONLY when the flow set, provider, and client type are all explicit. Scaffolding auth boilerplate is high-blast-radius; default to asking. Source: `.claude/rules/clarification-default.md`.
|
|
23
|
+
|
|
24
|
+
## Agent Pipeline
|
|
25
|
+
|
|
26
|
+
| Stage | Agent(s) | Parallel | Required |
|
|
27
|
+
|-------|----------|----------|----------|
|
|
28
|
+
| 1. Parse auth spec | Orchestrator (inline) | No | Yes |
|
|
29
|
+
| 2. Confirm flow + threat model + ASK gate | Orchestrator (inline) | No | Yes |
|
|
30
|
+
| 3. Generate boilerplate | `hatch3r-implementer` | Per auth mode | Yes |
|
|
31
|
+
| 4. Gate against CQ3 auth floor | `hatch3r-security` | Per auth mode | Yes |
|
|
32
|
+
| 5. Verify + Iteration Summary | Orchestrator (inline) | No | Yes |
|
|
33
|
+
|
|
34
|
+
**Parallel-safety conditions** (per `rules/hatch3r-agent-orchestration.md` §Parallel Safety): when the spec covers both interactive OAuth and machine-to-machine PAT, fan out one `hatch3r-implementer` per mode — each writes a disjoint module (`src/auth/oauth/` vs `src/auth/pat/`), aggregation is deterministic (union of generated paths), no shared mutable state. The `hatch3r-security` gate runs once per generated mode after its implementer returns.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
# Auth Scaffold -- OAuth 2.1 + OIDC + PAT Boilerplate for a Greenfield API
|
|
39
|
+
|
|
40
|
+
Generates authentication boilerplate for a new API service to the OAuth 2.1 + OIDC + OWASP-ASVS-v5 floor: an authorization-code-with-PKCE flow, OIDC ID-token validation (issuer, audience, nonce, JWKS signature), and hashed personal-access-token issuance/verification for machine-to-machine clients. Output is project-language source plus a `.env.example` of the required secrets — never inlined credentials.
|
|
41
|
+
|
|
42
|
+
Use `/hatch3r-auth-scaffold` on a greenfield service that needs an auth layer built to the CQ3 auth-depth floor (one of the CONSTITUTION §2B floors: "Auth depth coverage: 100%"). Use the `hatch3r-security-verify` skill to audit an existing auth implementation without regenerating it; use `/hatch3r-security-audit` for a broad security review beyond the auth surface.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Argument Parsing
|
|
47
|
+
|
|
48
|
+
Optional positional argument: `<service-name>`.
|
|
49
|
+
|
|
50
|
+
- If supplied: seed Step 1 with that service.
|
|
51
|
+
- If omitted: ASK for the service, the flow set, the OIDC provider, and the client type before delegating.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Step 0: Triage
|
|
56
|
+
|
|
57
|
+
Classify the auth scaffold before delegating. The tier names map to the canonical Light/Standard/Deep vocabulary (`agents/shared/triage-vocabulary.md`); the `Tier {1|2|3}` references in Step 2 resolve to these rows.
|
|
58
|
+
|
|
59
|
+
- **Tier 1 (Light)** — a single auth mode (PAT only, or OAuth only) for a confidential server client with a named issuer. One `hatch3r-implementer` writes the single module; one `hatch3r-security` gate verifies it.
|
|
60
|
+
- **Tier 2 (Standard)** — both interactive OAuth 2.1 and machine-to-machine PAT for one client type. One implementer per mode in parallel (`src/auth/oauth/` vs `src/auth/pat/`); one security gate per generated mode.
|
|
61
|
+
- **Tier 3 (Deep)** — a public/browser client (the DPoP token-binding decision is in play), multiple identity providers, or a mixed public+confidential client matrix. Full fan-out (one implementer per mode × provider), each gated, plus the browser-bearer-is-a-High-finding threat check from Step 4 item 4.
|
|
62
|
+
|
|
63
|
+
Rule: an unspecified client type or an undecided token-binding choice fires the §0 B1 gate before tiering — a public client mis-scaffolded as confidential ships an exploitable bearer flow. Classify upward when the client type or token binding is uncertain.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Step 1: Parse Auth Spec
|
|
68
|
+
|
|
69
|
+
Collect the inputs that determine the flow shape and the token-binding decision. Cache for the Step 3 implementer prompt.
|
|
70
|
+
|
|
71
|
+
| Input | Default if unspecified | Notes |
|
|
72
|
+
|-------|------------------------|-------|
|
|
73
|
+
| Auth modes | OAuth 2.1 + PAT | interactive sign-in, machine-to-machine, or both |
|
|
74
|
+
| Client type | confidential | public (SPA/mobile, no secret) vs confidential (server, holds a secret) |
|
|
75
|
+
| OIDC provider / issuer | (required — ASK) | issuer URL → JWKS discovery; never a guessed default |
|
|
76
|
+
| Token binding | DPoP for browser/mobile; bearer acceptable for confidential server-to-server | RFC 9449 — bare bearer for a browser client is a High finding |
|
|
77
|
+
| ID-token clock skew | ≤ 300 s | documented skew window for `exp`/`iat` validation |
|
|
78
|
+
| PAT hash | Argon2id (bcrypt fallback) | long-lived secrets are stored hashed, never plaintext |
|
|
79
|
+
| Output module | `src/auth/` | `src/auth/oauth/`, `src/auth/oidc/`, `src/auth/pat/` |
|
|
80
|
+
|
|
81
|
+
The client type drives the PKCE + refresh-token requirement: OAuth 2.1 mandates PKCE on every client (public AND confidential), and refresh tokens issued to public clients MUST be sender-constrained or one-time-use.
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Step 2: Confirm Flow + Threat Model + ASK Checkpoint (only mutation gate)
|
|
86
|
+
|
|
87
|
+
Present the resolved spec and the threat-model decisions so the maintainer confirms before any auth code is written.
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
hatch3r-auth-scaffold — service: {name} (Tier {1|2|3})
|
|
91
|
+
|
|
92
|
+
Resolved spec:
|
|
93
|
+
modes: OAuth 2.1 (authorization code + PKCE) + PAT (machine-to-machine)
|
|
94
|
+
client type: confidential (holds client_secret)
|
|
95
|
+
OIDC issuer: https://{provider}/ (JWKS auto-discovered)
|
|
96
|
+
token binding: bearer (confidential server-to-server); DPoP required if a browser client is added
|
|
97
|
+
ID-token validation: iss, aud, azp, exp, nonce, JWKS signature; skew ≤ 300s
|
|
98
|
+
PAT: 256-bit random, stored Argon2id-hashed, shown once on issue
|
|
99
|
+
output: src/auth/{oauth,oidc,pat}/ + .env.example
|
|
100
|
+
|
|
101
|
+
OAuth 2.1 invariants enforced (draft-ietf-oauth-v2-1-15):
|
|
102
|
+
- PKCE (S256) on every authorization-code request
|
|
103
|
+
- exact-string redirect_uri allowlist (no wildcards)
|
|
104
|
+
- implicit grant + ROPC grant absent
|
|
105
|
+
- no bearer token in query string
|
|
106
|
+
- refresh-token rotation with reuse detection
|
|
107
|
+
|
|
108
|
+
Tier: 2
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
ASK (only gate), per `agents/shared/user-question-protocol.md`:
|
|
112
|
+
|
|
113
|
+
> Generate the auth scaffold for {name} with the flow + threat model above?
|
|
114
|
+
> - `accept` — generate the boilerplate and run the CQ3 security gate
|
|
115
|
+
> - `edit` — change a mode, client type, provider, or token binding first
|
|
116
|
+
> - `skip` — cancel; write nothing
|
|
117
|
+
>
|
|
118
|
+
> (accept / edit / skip)
|
|
119
|
+
|
|
120
|
+
After the user accepts, the run is autonomous through Step 5.
|
|
121
|
+
|
|
122
|
+
### Step 0.5: Emit Pre-Execution Cost Preview
|
|
123
|
+
|
|
124
|
+
Before the Step 2 ASK gate, emit the cost preview per `rules/hatch3r-cost-visibility.md`:
|
|
125
|
+
|
|
126
|
+
```yaml
|
|
127
|
+
cost_estimate:
|
|
128
|
+
expected_sa_count: <N auth modes × 1 implementer + N × 1 security gate>
|
|
129
|
+
estimated_input_tokens_static_frame: <int>
|
|
130
|
+
estimated_web_research_queries: <int> # 0-1 — the spec set is fixed by the references below; web only for a fresh CVE check
|
|
131
|
+
triage_tier: light | standard | deep
|
|
132
|
+
estimated_duration_min: <int>
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Post-execution actuals + delta land in the Step 5 Iteration Summary. `--effort=light|standard|deep` (Decision 17) forces the tier; record both auto and override.
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## Step 3: Generate Boilerplate (sub-agent delegation)
|
|
140
|
+
|
|
141
|
+
Delegate to `hatch3r-implementer` via the Task tool, one per auth mode. Code mutation flows through the implementer per the Mandatory Delegation Directive — the orchestrator writes no auth code inline.
|
|
142
|
+
|
|
143
|
+
Each implementer prompt MUST include the resolved spec, the target module paths, and this boilerplate contract:
|
|
144
|
+
|
|
145
|
+
**OAuth 2.1 authorization-code flow (`src/auth/oauth/`):**
|
|
146
|
+
|
|
147
|
+
1. PKCE on every authorization-code request — generate a `code_verifier` (43-128 char, high-entropy) and send the `S256` `code_challenge`; verify on the token exchange. PKCE is mandatory on public AND confidential clients in OAuth 2.1.
|
|
148
|
+
2. Exact-string `redirect_uri` allowlist — match the callback URI by exact string against a pre-registered list; no wildcard or prefix matching.
|
|
149
|
+
3. No implicit grant (`response_type=token`) and no ROPC (`grant_type=password`) — both are removed from OAuth 2.1; do not scaffold either.
|
|
150
|
+
4. Refresh-token rotation with reuse detection — rotate the refresh token on every use; on detection of a reused (already-rotated) token, revoke the entire token family. For a public client, the refresh token MUST additionally be sender-constrained (DPoP) or one-time-use.
|
|
151
|
+
5. Access tokens are never placed in a URI query string (OAuth 2.1 prohibition) — pass via the `Authorization` header.
|
|
152
|
+
|
|
153
|
+
**OIDC ID-token validation (`src/auth/oidc/`):** validate `iss` (matches the configured issuer), `aud` (matches the client_id), `azp` when `aud` is multi-valued, `exp` (with the documented ≤300 s skew), and `nonce` (matches the value sent in the auth request — replay guard), and verify the JWKS signature with a pinned `alg` allow-list before creating a session. Reject `alg: none`; reject `HS*` when the key is asymmetric (key-confusion guard). Wire RP-initiated logout (`end_session_endpoint`).
|
|
154
|
+
|
|
155
|
+
**PAT issuance/verification (`src/auth/pat/`):** generate a 256-bit cryptographically-random token, return it to the caller exactly once at issue time, and store only its Argon2id hash (bcrypt fallback) — never the plaintext. On verification, hash the presented token and compare against the stored hash in constant time. Tokens carry a scope set and an expiry; revocation is a hash-table delete.
|
|
156
|
+
|
|
157
|
+
**Secrets:** the client secret, issuer URL, and signing keys are referenced via `${env:VAR}` and emitted to `.env.example` with placeholder values — never inlined. (Project secret convention: `.claude/rules/security-patterns.md` rule 3.)
|
|
158
|
+
|
|
159
|
+
Also include in the prompt: all `scope: always` rule directives; the confidence expression requirement (verbatim, high/medium/low per `agents/shared/quality-charter.md` §1); the implementer's standing test obligation (unit tests for token validation: positive = valid token reaches the resource, negative = `alg:none`/expired/wrong-`aud` token is rejected); and the boundary "do NOT create branches, commits, or PRs". Await the structured result; capture `Files changed`, `Tests written`, and the `Delegation proof ID` per file.
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## Step 4: Gate Against CQ3 Auth Floor (sub-agent delegation)
|
|
164
|
+
|
|
165
|
+
After each mode's implementer returns, delegate to `hatch3r-security` via the Task tool — the implementer-pre-write/post-write auth invocation in that agent's "When to invoke" (touches `src/auth/**`).
|
|
166
|
+
|
|
167
|
+
The security prompt MUST include the generated file paths and require these checklist items (from `agents/hatch3r-security.md` Audit checklist):
|
|
168
|
+
|
|
169
|
+
1. **OAuth 2.1 grant hygiene** (item 1) — PKCE present on every client; implicit + ROPC absent; exact-string `redirect_uri` allowlist; refresh-token rotation with reuse detection.
|
|
170
|
+
2. **OIDC ID-token validation** (item 2) — `iss`, `aud`, `azp`, `exp`, `nonce`, JWKS signature all verified before session creation; clock-skew window documented.
|
|
171
|
+
3. **JWT BCP conformance** (item 4, RFC 8725) — `alg` pinned per issuer; `alg: none` rejected; `HS*`-with-asymmetric-key rejected (key-confusion guard).
|
|
172
|
+
4. **Sender-constrained tokens** (item 3) — DPoP on any browser/mobile access token; a bare browser bearer is a High finding.
|
|
173
|
+
5. **Token-secret storage** — the PAT is stored hashed (Argon2id/bcrypt), never plaintext (OWASP ASVS v5 V6 long-lived-secret storage).
|
|
174
|
+
|
|
175
|
+
The security gate runs the relevant verification commands from that agent's table (e.g. `rg -n "response_type=code" src/auth/ | rg -v "code_challenge"` must return empty; `rg -n "grant_type=(implicit|password)" src/auth/` must return empty) and returns its `proof_trace` + status. A `CRITICAL` finding (e.g. `alg:none` accepted, refresh rotation absent on a public client) routes the fix back through `hatch3r-implementer` (max 1 regeneration pass), then re-gates. A persistent CRITICAL ends the run at `PARTIAL` and the scaffold is flagged not-merge-ready.
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## Step 5: Verify + Iteration Summary
|
|
180
|
+
|
|
181
|
+
Run the project verification gates and record exit codes: `npm test` (or the project equivalent) for the auth unit tests, `npx tsc --noEmit`, and the security agent's grep checks re-run as a final pass.
|
|
182
|
+
|
|
183
|
+
### End-of-Turn Delegation Attestation (Bypass Protection)
|
|
184
|
+
|
|
185
|
+
> Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → End-of-Turn Delegation Attestation. Per-command mutated-file slot: `src/auth/oauth/<file>`, `src/auth/oidc/<file>`, `src/auth/pat/<file>` — all `via hatch3r-implementer`.
|
|
186
|
+
|
|
187
|
+
### Iteration Summary (mandatory output)
|
|
188
|
+
|
|
189
|
+
Emit the canonical iteration summary per `rules/hatch3r-iteration-summary.md`:
|
|
190
|
+
|
|
191
|
+
```markdown
|
|
192
|
+
## Iteration Summary
|
|
193
|
+
|
|
194
|
+
**Status:** SUCCESS | PARTIAL | FAILED | BLOCKED
|
|
195
|
+
**Outcome:** {one sentence — e.g., "Scaffolded OAuth 2.1 + OIDC + hashed-PAT auth for orders-api; security gate PASS."}
|
|
196
|
+
|
|
197
|
+
**Done:**
|
|
198
|
+
- src/auth/oauth/* → authorization-code + PKCE flow via hatch3r-implementer (proof: {id})
|
|
199
|
+
- src/auth/oidc/* → ID-token validation (iss/aud/nonce/JWKS) via hatch3r-implementer (proof: {id})
|
|
200
|
+
- src/auth/pat/* → Argon2id-hashed PAT issue/verify via hatch3r-implementer (proof: {id})
|
|
201
|
+
|
|
202
|
+
**Not Done / Deferred / Unverified:**
|
|
203
|
+
- `.env.example` placeholders — populate real issuer + client_secret before first run
|
|
204
|
+
- (or: `None — full scope completed`)
|
|
205
|
+
|
|
206
|
+
**Open Questions / Blockers:**
|
|
207
|
+
- (or: `None`)
|
|
208
|
+
|
|
209
|
+
**Fan-out + Cost:** sub_agents_spawned: { count, rationale } + cost_estimate / cost_actuals / delta
|
|
210
|
+
**Pillar Impact Attribution:** progress_toward_pillar: content-quality.CQ3+{delta}
|
|
211
|
+
**Confidence:** {high | medium | low} — {basis from implementer output + security gate verdict}
|
|
212
|
+
**Suggested Next Action:** {one line — e.g., "Populate .env, then wire the OIDC callback route into the service router."}
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
Status decision rules:
|
|
216
|
+
- **SUCCESS** — boilerplate generated, security gate PASS, auth unit tests + typecheck exit 0.
|
|
217
|
+
- **PARTIAL** — generated but the security gate left a residual High/Critical finding, or a verification gate failed.
|
|
218
|
+
- **FAILED** — the implementer returned BLOCKED on every mode; nothing written.
|
|
219
|
+
- **BLOCKED** — provider/issuer or client type contradictory or undecided, or a security gate Critical the maintainer must rule on.
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## Per-Turn Pipeline-State Header (Bypass Protection)
|
|
224
|
+
|
|
225
|
+
> Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Per-Turn Pipeline-State Header. Phase mapping: `1` = spec parse + confirm, `2` = implementer boilerplate generation, `3` = security gate + verify + summary. Tier 1 single-mode runs are exempt per the Tier 1 exemption.
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## Guardrails
|
|
230
|
+
|
|
231
|
+
1. **One ASK gate.** Step 2 is the only user-facing checkpoint; after `accept`, the run proceeds through Step 5.
|
|
232
|
+
2. **No commit or push.** Generated auth code is left staged for human review; git operations are out of scope.
|
|
233
|
+
3. **No deprecated grants.** Never scaffold the implicit grant or ROPC — both are removed from OAuth 2.1; PKCE on the authorization-code flow is the only public-client path.
|
|
234
|
+
4. **No inlined secrets.** Client secrets, signing keys, and issuer URLs are referenced via `${env:VAR}` and emitted to `.env.example` with placeholders — never written into source.
|
|
235
|
+
5. **No plaintext long-lived tokens.** PATs are stored Argon2id/bcrypt-hashed and shown once at issue; a scaffold that persists a PAT in plaintext fails the Step 4 CQ3 gate.
|
|
236
|
+
6. **Security gate is mandatory.** The `hatch3r-security` CQ3 gate runs on every generated auth mode — a scaffold is never declared SUCCESS without a PASS verdict.
|
|
237
|
+
|
|
238
|
+
## Resumability (Decision 27/30)
|
|
239
|
+
|
|
240
|
+
auth-scaffold fans out one implementer per auth mode, so checkpoint at the per-mode boundary — an interrupted run re-enters at the first un-generated mode rather than regenerating completed OAuth/OIDC/PAT modules.
|
|
241
|
+
|
|
242
|
+
> Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Checkpoint Contract. Per-command slots: workspace `.auth-scaffold-workspace/`; step range the Step 1 → Step 5 progression; `wave` = the per-mode index in Step 3/4; snapshot/rollback paths every `src/auth/**` file a Step 3 implementer or a Step 4 regeneration touches. Write points: after the Step 1 spec parse, after the Step 2 accept gate, after each Step 3 implementer return (per mode), and after each Step 4 security gate.
|
|
243
|
+
|
|
244
|
+
## References
|
|
245
|
+
|
|
246
|
+
- [OAuth 2.1 Authorization Framework (`draft-ietf-oauth-v2-1-15`)](https://datatracker.ietf.org/doc/draft-ietf-oauth-v2-1/) (accessed 2026-06-02, IETF OAuth WG, official-docs) — mandates PKCE on every client, exact-string redirect-URI matching, removal of the implicit + ROPC grants, the bearer-token-in-query prohibition, and sender-constrained-or-one-time refresh tokens for public clients; source for the Step 3 OAuth contract and the deprecated-grant guardrail.
|
|
247
|
+
- [oauth.net — OAuth 2.1 specification index](https://oauth.net/2.1/) (accessed 2026-06-02, Aaron Parecki / OAuth.net, official-docs) — canonical clearinghouse summarizing the OAuth 2.1 normative changes (PKCE, exact redirect match, grant removals, refresh-token constraints); corroborating second source for the OAuth invariants.
|
|
248
|
+
- [OWASP ASVS v5.0 — V10 OAuth and OIDC](https://github.com/OWASP/ASVS/blob/master/5.0/en/0x19-V10-OAuth-and-OIDC.md) (accessed 2026-06-02, OWASP Foundation, official-docs; v5.0 released May 2025) — verification requirements for exact redirect-URI allowlisting, sender-constrained tokens (mTLS / DPoP), and ID-token `nonce` replay mitigation; the CQ3 floor the Step 4 gate checks against.
|
|
249
|
+
- [OpenID Connect Core 1.0 §3.1.3.7 — ID Token Validation](https://openid.net/specs/openid-connect-core-1_0.html#IDTokenValidation) (accessed 2026-06-02, OpenID Foundation, official-docs) — the `iss`/`aud`/`azp`/`exp`/`nonce`/signature checks required before session creation; source for the Step 3 OIDC validation contract.
|
|
250
|
+
- `agents/hatch3r-security.md` -> Audit checklist items 1-4, Verification commands (accessed 2026-06-02, in-repo canonical, official-docs) — the CQ3 auth-depth floor and the grep-based verification the Step 4 gate runs.
|
|
@@ -2,22 +2,24 @@
|
|
|
2
2
|
id: hatch3r-benchmark
|
|
3
3
|
type: command
|
|
4
4
|
orchestrator: true
|
|
5
|
-
agentPipeline: [hatch3r-researcher, hatch3r-
|
|
5
|
+
agentPipeline: [hatch3r-researcher, hatch3r-performance, hatch3r-docs-writer]
|
|
6
6
|
description: Run and analyze performance benchmarks. Compare results against baselines, identify regressions, and produce performance reports.
|
|
7
7
|
tags: [review, performance]
|
|
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: standard
|
|
12
13
|
triage_tiers: [1, 2, 3]
|
|
14
|
+
supports_resume: true
|
|
13
15
|
sub_agents_spawned:
|
|
14
16
|
count: 3
|
|
15
|
-
rationale: Three-stage pipeline per agentPipeline — researcher gathers prior baselines,
|
|
17
|
+
rationale: Three-stage pipeline per agentPipeline — researcher gathers prior baselines, performance (CQ7) executes the suite, docs-writer assembles the report; each receives the run cache and emits a structured slice. 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
|
|
|
@@ -25,9 +27,11 @@ Before any action, scan the user's request and provided context for unresolved q
|
|
|
25
27
|
|-------|----------|----------|----------|
|
|
26
28
|
| 1. Discovery | `hatch3r-researcher` (codebase-analysis mode) | No | Yes |
|
|
27
29
|
| 2. Execution | Orchestrator (inline, runs benchmarks) | No | Yes |
|
|
28
|
-
| 3. Analysis | `hatch3r-
|
|
30
|
+
| 3. Analysis | `hatch3r-performance` | No | Yes |
|
|
29
31
|
| 4. Reporting | `hatch3r-docs-writer` | No | If regressions found |
|
|
30
32
|
|
|
33
|
+
**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.
|
|
34
|
+
|
|
31
35
|
# Performance Benchmark — Run, Compare, and Report on Performance Metrics
|
|
32
36
|
|
|
33
37
|
Run performance benchmarks against a target (file, function, endpoint, or full suite), compare results against a baseline (previous run, git ref, or none), and produce a structured performance report. Discovers existing benchmark files or proposes new ones for critical paths. Executes with configurable iterations, performs statistical analysis on results, and flags regressions with root cause tracing. Persists results to `.benchmarks/results.json` for longitudinal tracking. AI proposes all actions; user confirms at every checkpoint.
|
|
@@ -45,6 +49,14 @@ Run performance benchmarks against a target (file, function, endpoint, or full s
|
|
|
45
49
|
3. **Structured output only.** All sub-agent prompts and benchmark results require structured markdown output — no prose dumps.
|
|
46
50
|
4. **Compress raw metrics.** Store full raw data in `.benchmarks/results.json` but present only summary statistics (mean, p50, p95, p99, stddev) in the report.
|
|
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: the Step 7 statistical-significance verdict (CV, t-test, reliability flag) and every Step 8 root-cause attribution MUST carry a high/medium/low confidence rating sourced from the hatch3r-performance sub-agent. A `noisy` classification (CV > 15%) maps to low confidence. Dropping the signal between stages is a gate failure.
|
|
59
|
+
|
|
48
60
|
---
|
|
49
61
|
|
|
50
62
|
## Workflow
|
|
@@ -55,12 +67,36 @@ Execute these steps in order. **Do not skip any step.** Ask the user at every ch
|
|
|
55
67
|
|
|
56
68
|
Classify the benchmark request before delegating:
|
|
57
69
|
|
|
58
|
-
- **Tier 1 (trivial)**: single benchmark with `none` baseline or quick re-run of an existing suite; inline execution, no `hatch3r-
|
|
70
|
+
- **Tier 1 (trivial)**: single benchmark with `none` baseline or quick re-run of an existing suite; inline execution, no `hatch3r-performance` fanout.
|
|
59
71
|
- **Tier 2 (standard)**: standard suite with `previous-run` or git-ref baseline; standard pipeline including statistical analysis and reporting.
|
|
60
72
|
- **Tier 3 (deep)**: full-suite cross-environment benchmark with regression triage and root-cause tracing; full pipeline with research and confirm scope with the user before saving results.
|
|
61
73
|
|
|
62
74
|
If Tier 1, complete inline and skip the analysis fanout. If Tier 2, run the standard pipeline below. If Tier 3, run the full pipeline with research and confirm scope with the user before saving results.
|
|
63
75
|
|
|
76
|
+
### Step 0.5: Emit Pre-Execution Cost Preview
|
|
77
|
+
|
|
78
|
+
Before the first sub-agent dispatch (Step 2 discovery researcher), surface the cost preview so a full-suite benchmark 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 inline ~0, Tier 2 ~2 (performance + docs-writer when regressions), Tier 3 up to 3>
|
|
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
|
+
The benchmark suite execution time (Step 5) is wall-clock measurement, not LLM cost — report it separately in `estimated_duration_min` so the cost delta is not skewed by iteration count. Post-execution actuals + delta land in the Step 9 report'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 quick re-run scored as Deep, or a full cross-environment suite 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
|
+
- The override does NOT lower the minimum-3-iterations statistical-validity floor (Guardrails) — measurement rigor is independent of effort tier.
|
|
98
|
+
- No override passed → the Step 0 auto-classification stands.
|
|
99
|
+
|
|
64
100
|
---
|
|
65
101
|
|
|
66
102
|
### Step 1: Gather Benchmark Context
|
|
@@ -220,7 +256,7 @@ Comparison:
|
|
|
220
256
|
|
|
221
257
|
### Step 7: Statistical Analysis
|
|
222
258
|
|
|
223
|
-
Delegate to `hatch3r-
|
|
259
|
+
Delegate to `hatch3r-performance` (CQ7) for analysis of the collected metrics.
|
|
224
260
|
|
|
225
261
|
1. Calculate statistical significance for each delta:
|
|
226
262
|
- Use coefficient of variation (CV) to assess measurement noise
|
|
@@ -399,6 +435,53 @@ The benchmark report follows this structure:
|
|
|
399
435
|
|
|
400
436
|
---
|
|
401
437
|
|
|
438
|
+
## Resumability (Decision 27/30)
|
|
439
|
+
|
|
440
|
+
benchmark is long-running — a Tier 3 full-suite run executes a multi-iteration benchmark sweep (Step 5), statistical analysis (Step 7), and regression root-cause delegation (Step 8) across the researcher → performance → docs-writer pipeline. 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 suite from scratch — benchmark iterations are expensive wall-clock and the statistical-validity floor mandates a minimum of 3 iterations per Guardrails.
|
|
441
|
+
|
|
442
|
+
> Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Checkpoint Contract. Per-command slots: workspace `.benchmark-workspace/`; step range the Step 0 → Step 10 progression; `wave` = suite/iteration batch index; snapshot/rollback paths `.benchmarks/results.json` and any report files under `docs/performance/`. Write points: after Step 1 context discovery, after Step 2 benchmark inventory locks, after Step 4 environment preparation is confirmed, after every Step 5 iteration batch completes (so partial measurements survive a crash and are not re-collected), after Step 6 baseline comparison, after Step 7 statistical analysis, after Step 8 root-cause delegation returns, after Step 9 report assembly, and after Step 10 results are persisted to `.benchmarks/results.json`.
|
|
443
|
+
|
|
444
|
+
---
|
|
445
|
+
|
|
446
|
+
## Per-Turn Pipeline-State Header (Bypass Protection)
|
|
447
|
+
|
|
448
|
+
> Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Per-Turn Pipeline-State Header. Phase mapping for benchmark: `1` = scope + tool selection, `2` = benchmark execution / sub-agent dispatch, `3` = result aggregation + regression detection, `4` = report + iteration-summary. Tier 1 runs are exempt per the Tier 1 exemption.
|
|
449
|
+
|
|
450
|
+
## End-of-Turn Delegation Attestation (Bypass Protection)
|
|
451
|
+
|
|
452
|
+
> Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → End-of-Turn Delegation Attestation. Per-command mutated-file slot: benchmark reports, baseline updates, dashboard refreshes.
|
|
453
|
+
|
|
454
|
+
## Iteration Summary (mandatory output)
|
|
455
|
+
|
|
456
|
+
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).
|
|
457
|
+
|
|
458
|
+
The 9 sections:
|
|
459
|
+
|
|
460
|
+
1. **Request** — verbatim restatement of the user's ask in one sentence.
|
|
461
|
+
2. **Fan-out + Cost** — `sub_agents_spawned: { count, rationale }` plus the `cost_estimate` / `cost_actuals` / `delta` blocks (see Cost Visibility below).
|
|
462
|
+
3. **Web Research** — every URL fetched with access date + trust tier per `agents/shared/rigor-contract.md` (0 acceptable when no research was needed).
|
|
463
|
+
4. **Files Mutated** — list with diff summary (lines added / removed / files created).
|
|
464
|
+
5. **Gates Passed / Failed** — explicit list per `.claude/rules/capability-lifecycle.md` Gate Checklist.
|
|
465
|
+
6. **Pillar Impact Attribution** — `progress_toward_pillar: <axis>.<pillar_id>+<delta>` per CONSTITUTION §6 Decision 17.
|
|
466
|
+
7. **Verification Commands** — exact commands run with exit codes plus key output lines (≤200 chars).
|
|
467
|
+
8. **Open Questions / Blockers** — explicit `None` if fully closed.
|
|
468
|
+
9. **Learnings Captured** — IDs of any learnings written to `.hatch3r/learnings/` this run per `rules/hatch3r-learning-system.md`.
|
|
469
|
+
|
|
470
|
+
### Cost Visibility (Decision 24)
|
|
471
|
+
|
|
472
|
+
> 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.
|
|
473
|
+
|
|
474
|
+
## Cost estimate (Decision 24)
|
|
475
|
+
|
|
476
|
+
This command emits cost transparency per `rules/hatch3r-cost-visibility.md` and CONSTITUTION §6 Decision 24/29:
|
|
477
|
+
|
|
478
|
+
- **Pre-execution `cost_estimate`** — emitted in Step 0.5 before the first researcher dispatch (Step 2 discovery).
|
|
479
|
+
- **Post-execution `cost_actuals` + `delta`** — appended to the Step 9 report's Fan-out + Cost section per `rules/hatch3r-iteration-summary.md` §2.
|
|
480
|
+
|
|
481
|
+
Per-tier `expected_sa_count` calibration (from frontmatter `sub_agents_spawned.count: 3` × tier heuristic in `rules/hatch3r-cost-visibility.md` Pre-Execution Estimate): Tier 1 ≈ 0 (inline discovery + execution, no fan-out); Tier 2 ≈ 2 (performance for analysis + docs-writer when regressions found); Tier 3 up to 3 (researcher + performance + docs-writer). Benchmark wall-clock execution is reported separately and not counted as LLM token cost. 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`.
|
|
482
|
+
|
|
483
|
+
---
|
|
484
|
+
|
|
402
485
|
## Error Handling
|
|
403
486
|
|
|
404
487
|
- **Benchmarks fail to run:** Capture the error output. Check for missing dependencies, syntax errors, or runner misconfiguration. Present the error and ASK: "Benchmark {name} failed to execute: {error}. Options: (a) skip and continue with remaining, (b) attempt to fix the benchmark file, (c) abort."
|
|
@@ -424,7 +507,7 @@ The benchmark report follows this structure:
|
|
|
424
507
|
|
|
425
508
|
## Related
|
|
426
509
|
|
|
427
|
-
- **Agent:** `hatch3r-
|
|
510
|
+
- **Agent:** `hatch3r-performance` (CQ7) — deep performance profiling and analysis
|
|
428
511
|
- **Check:** `checks/performance.md` — performance budget checks
|
|
429
512
|
- **Rule:** `hatch3r-performance-budgets` — performance budget thresholds and enforcement
|
|
430
513
|
- **Command:** `hatch3r-refactor-plan` — plan optimizations identified by benchmark regressions
|
|
@@ -2,22 +2,24 @@
|
|
|
2
2
|
id: hatch3r-board-fill
|
|
3
3
|
type: command
|
|
4
4
|
orchestrator: true
|
|
5
|
-
agentPipeline: [hatch3r-reviewer, hatch3r-fixer]
|
|
5
|
+
agentPipeline: [hatch3r-reviewer, hatch3r-fixer, hatch3r-ui, hatch3r-ux, hatch3r-security, hatch3r-reliability, hatch3r-testability, hatch3r-scalability, hatch3r-performance, hatch3r-maintainability, hatch3r-enhancability]
|
|
6
6
|
description: Create epics and issues/work items from todo.md, reorganize the board with dependency analysis, readiness assessment, and implementation ordering. Supports GitHub, Azure DevOps, and GitLab.
|
|
7
7
|
tags: [board, ctx:team-only]
|
|
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: standard
|
|
12
13
|
triage_tiers: [1, 2, 3]
|
|
14
|
+
supports_resume: true
|
|
13
15
|
sub_agents_spawned:
|
|
14
|
-
count:
|
|
15
|
-
rationale:
|
|
16
|
+
count: 11
|
|
17
|
+
rationale: Per-issue review cycle (reviewer + fixer) plus 9 CQ vector specialists (ui/ux/security/reliability/testability/scalability/performance/maintainability/enhancability) consulted on readiness assessment so that issue acceptance criteria encode the measurable floors the implementation must meet; batch mode scales reviewer count to N issues with serialization only on the per-issue reviewer→fixer hand-off. 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. Issue Creation | Orchestrator (inline, GitHub MCP) | No | Yes |
|
|
28
30
|
| 3. Board Sync | Orchestrator (Projects v2 sync) | No | Yes |
|
|
29
31
|
|
|
32
|
+
**Parallel-safety conditions** (per `rules/hatch3r-agent-orchestration.md` §Parallel Safety): every parallel fan-out (Step 1 explore sub-agents, the Step 7.9 per-issue reviewer/fixer loops where N issues = N parallel loops) holds all three — read-only or disjoint writes, deterministic aggregation, no shared mutable state.
|
|
33
|
+
|
|
30
34
|
All issue operations MUST follow the Board Sync Enforcement rules defined in `hatch3r-board-shared`.
|
|
31
35
|
|
|
32
36
|
# Board Fill -- Create Epics & Issues from todo.md + Board Reorganization
|
|
@@ -58,6 +62,14 @@ GitHub Agentic Workflows and hatch3r are complementary: use agentic workflows fo
|
|
|
58
62
|
|
|
59
63
|
Follow the **Token-Saving Directives** in `hatch3r-board-shared`.
|
|
60
64
|
|
|
65
|
+
## Confidence Propagation Contract
|
|
66
|
+
|
|
67
|
+
Every sub-agent delegation prompt in this command (the Step 7.9 reviewer/fixer loops and any Step 1 explore sub-agents) 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.
|
|
68
|
+
|
|
69
|
+
> 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
|
+
|
|
71
|
+
Downstream propagation: every readiness-assessment verdict (Step 5.6), every production-readiness reviewer verdict (Step 7.9b), and every flagged AI-inferred acceptance criterion MUST carry a high/medium/low confidence rating sourced from the upstream sub-agent. Dropping the signal between stages is a gate failure.
|
|
72
|
+
|
|
61
73
|
---
|
|
62
74
|
|
|
63
75
|
## Workflow
|
|
@@ -74,13 +86,36 @@ Classify the board-fill request before delegating:
|
|
|
74
86
|
|
|
75
87
|
If Tier 1, run only Steps 1–3, 5–6, and 7 (skip the heavy production-readiness review). If Tier 2, run the standard pipeline below. If Tier 3, run the full pipeline including Steps 5.5, 5.6, and 7.9, and confirm batch composition with the user before executing.
|
|
76
88
|
|
|
89
|
+
### Step 0.5: Emit Pre-Execution Cost Preview
|
|
90
|
+
|
|
91
|
+
Before the first sub-agent dispatch (Step 7.9 reviewer/fixer loops, or Step 1 explore sub-agents when application context is needed), surface the cost preview so a large board-fill batch 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 and the item count selected in Step 1:
|
|
92
|
+
|
|
93
|
+
```yaml
|
|
94
|
+
cost_estimate:
|
|
95
|
+
expected_sa_count: <triage tier → Tier 1 ~0 (no Step 7.9 review), Tier 2 ~2 per issue, Tier 3 up to 11 × issue count>
|
|
96
|
+
estimated_input_tokens_static_frame: <int>
|
|
97
|
+
estimated_web_research_queries: <int>
|
|
98
|
+
triage_tier: light | standard | deep
|
|
99
|
+
estimated_duration_min: <int>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
The Step 2.5 triage interview and the per-step ASK checkpoints are user-driven and excluded from the duration estimate. Post-execution actuals + delta land in the end-of-run iteration summary's Fan-out + Cost section per `rules/hatch3r-cost-visibility.md` Post-Execution Actuals. Token telemetry sources from `src/pipeline/observability.ts`.
|
|
103
|
+
|
|
104
|
+
### Effort Override (Decision 17)
|
|
105
|
+
|
|
106
|
+
Auto-tiering can misclassify — a 3-item todo scored as Tier 3, or a 20-item greenfield batch scored as Tier 1. The user override is the recovery path mandated by hatch3r's universal `--effort` override contract ("User overridable via `--effort` flag"):
|
|
107
|
+
|
|
108
|
+
- `--effort=light|standard|deep` forces the named tier, bypassing the Step 0 auto-classification (which gates whether Steps 5.5/5.6/7.9 run).
|
|
109
|
+
- 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.
|
|
110
|
+
- No override passed → the Step 0 auto-classification stands.
|
|
111
|
+
|
|
77
112
|
---
|
|
78
113
|
|
|
79
114
|
### Step 1: Read and Parse todo.md
|
|
80
115
|
|
|
81
116
|
1. Read `todo.md` at the project root.
|
|
82
|
-
2. Parse
|
|
83
|
-
3. Present the parsed list numbered.
|
|
117
|
+
2. Parse the file with the **Todo Grammar** in `hatch3r-board-shared` (the single source of truth the `hatch3r-roadmap` and `hatch3r-project-spec` producers emit). Apply its parse rules in order: skip `## P{N}` / `## Future Ideas` headers (recording each as the priority default for items beneath it — not a todo item), strip the leading `- `/`* ` list marker plus any `[ ]`/`[x]` checkbox token, extract the `**[BIZ|TECH|BOTH]**` scope tag out of the title (feed it to Step 3 classification), split the bold title from the description, and capture a trailing `Ref: {path}.` as a documentation reference. Lines that do not match the todo-item form are skipped with a one-line note so the user can fix malformed entries.
|
|
118
|
+
3. Present the parsed list numbered. Show each item's stripped title, its carried `priority:p{N}` default (from the enclosing header), and its `[BIZ|TECH|BOTH]` tag so the user can confirm the parse before processing.
|
|
84
119
|
|
|
85
120
|
**ASK:** "Here are the items I found in todo.md. Which items should I process? (all / specific numbers / exclude specific numbers)"
|
|
86
121
|
|
|
@@ -169,7 +204,7 @@ Before classifying items, extract the information needed to produce genuinely re
|
|
|
169
204
|
If a product vision was loaded in Step 1a, apply these modifications to the triage process:
|
|
170
205
|
|
|
171
206
|
1. **Derive context from the vision first.** For each triage dimension (Scope, Value, Unknowns, Size, Stakeholder), check whether the product vision document provides clear answers. Extract relevant goals, user segments, success metrics, and stated priorities from the vision.
|
|
172
|
-
2. **Reduce questioning.** Only ask triage questions for dimensions that the vision does not
|
|
207
|
+
2. **Reduce questioning.** Only ask triage questions for dimensions that the vision does not address with a stated answer. If the vision states the target user, value proposition, and scope boundaries for an item's domain, mark those dimensions as "Clear (from vision)" and skip the corresponding questions.
|
|
173
208
|
3. **Reference vision goals explicitly.** When classifying items or asking remaining triage questions, cite the specific vision goal or statement that informs the classification (e.g., "Per the product vision goal 'Zero-config onboarding', this item aligns with...").
|
|
174
209
|
4. **Greenfield streamlining.** For greenfield projects where the vision covers all major work areas, batch all items into a single triage pass. Present the vision-derived context for each item and ask the user to confirm or override in one prompt rather than per-item questioning.
|
|
175
210
|
5. **Tier-3 greenfield gate (P8 B2).** Vision-aware triage skips a readiness dimension ONLY when the product vision explicitly addresses it; otherwise mark the dimension `unresolved — needs user input` and ask via the platform-native question tool. If readiness gate (Step 5.6) reports unresolved external blockers, re-run triage per dimension.
|
|
@@ -255,7 +290,7 @@ If the user declines to answer a dimension ("skip", "not sure", "figure it out")
|
|
|
255
290
|
|
|
256
291
|
### Step 3: Issue Type & Executor Classification
|
|
257
292
|
|
|
258
|
-
For each remaining item, classify across all dimensions using the mapping tables below **combined with Triage Context from Step 2.5
|
|
293
|
+
For each remaining item, classify across all dimensions using the mapping tables below **combined with Triage Context from Step 2.5** and the `[BIZ|TECH|BOTH]` scope tag extracted in Step 1. Triage answers take precedence over keyword heuristics when they conflict. The scope tag is a soft signal: `TECH` leans `executor:agent`/`executor:hybrid` and a technical `area:*`; `BIZ` leans `executor:human`/`executor:hybrid` and surfaces stakeholder/value context; `BOTH` flags cross-cutting work for decomposition review in Step 5c. Triage answers and the keyword tables override the tag when they conflict.
|
|
259
294
|
|
|
260
295
|
**Type:**
|
|
261
296
|
|
|
@@ -322,7 +357,7 @@ If a product vision was loaded in Step 1a:
|
|
|
322
357
|
|
|
323
358
|
1. Include the product vision as **primary context** for issue scoping. Vision-stated goals, success metrics, target users, and scope boundaries take precedence over inferred context when drafting issue bodies and acceptance criteria.
|
|
324
359
|
2. Map each todo item to the specific vision goal(s) it supports. Include this mapping in the Context Summary output so that Steps 5 and 6 can reference it.
|
|
325
|
-
3. Flag any todo items that do not
|
|
360
|
+
3. Flag any todo items that do not map to a stated vision goal — these may represent scope creep or infrastructure work that supports the vision indirectly.
|
|
326
361
|
|
|
327
362
|
#### Output
|
|
328
363
|
|
|
@@ -360,7 +395,7 @@ Scan ALL existing standalone issues on the board (from the Step 1.5 board scan).
|
|
|
360
395
|
4. **Singleton promotion.** Apply the same singleton promotion rule as 5a.3 — propose a thematic epic for isolated standalones.
|
|
361
396
|
5. **Catch-all.** Remaining standalones go into the "General Improvements" epic per 5a.4.
|
|
362
397
|
|
|
363
|
-
Present regrouping proposals
|
|
398
|
+
Present regrouping proposals in a section separate from new-item grouping, so the user can confirm or reject existing issue regrouping independently.
|
|
364
399
|
|
|
365
400
|
#### 5c. Decomposition Check
|
|
366
401
|
|
|
@@ -706,7 +741,9 @@ For issues where the reviewer returned `REQUEST CHANGES`:
|
|
|
706
741
|
|
|
707
742
|
#### 7.9d. Loop Termination
|
|
708
743
|
|
|
709
|
-
Per-issue loop, max 4 iterations. Loop semantics mirror `src/pipeline/reviewLoop.ts
|
|
744
|
+
Per-issue loop, max 4 iterations (spec-class cap). Loop semantics mirror `src/pipeline/reviewLoop.ts`.
|
|
745
|
+
|
|
746
|
+
> **Iteration-cap rationale (D10-SA10.7-F10.7.7).** This spec-class loop caps at 4 (matching `DEFAULT_MAX_REVIEW_ITERATIONS` in `src/pipeline/reviewLoop.ts`) because issue-spec reviews converge more slowly and deterministically — they refine text against the production-readiness checklist with no runtime regressions feeding back. Code-class loops (`hatch3r-workflow` Phase 4a, `hatch3r-board-pickup` Step 7a review loop, `hatch3r-quick-change` Step 6a) cap at 3 because code reviews diverge faster (a fix can spawn a regression the next iteration must catch). Expected convergence is 1–2 iterations; the cap is the divergence backstop, not the target.
|
|
710
747
|
|
|
711
748
|
**Clean termination** (issue passes review):
|
|
712
749
|
- Reviewer returns `APPROVE`, AND
|
|
@@ -774,6 +811,55 @@ If yes, edit `todo.md` to remove lines for created issues. Preserve skipped/excl
|
|
|
774
811
|
|
|
775
812
|
---
|
|
776
813
|
|
|
814
|
+
## Per-Turn Pipeline-State Header (Bypass Protection)
|
|
815
|
+
|
|
816
|
+
> Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Per-Turn Pipeline-State Header. Phase mapping for board-fill: `1` = parse + board scan + triage (Steps 0–2.5), `2` = classification + context + grouping + dependency + readiness (Steps 3–5.6), `3` = create/update + production-readiness review (Steps 6–7.9, reviewer/fixer sub-agent loops), `4` = reconciliation + dashboard + cleanup + summary (Steps 7.8–8). Tier 1 runs are exempt per the Tier 1 exemption.
|
|
817
|
+
|
|
818
|
+
## End-of-Turn Delegation Attestation (Bypass Protection)
|
|
819
|
+
|
|
820
|
+
> Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → End-of-Turn Delegation Attestation. Per-command mutated-file slot: `todo.md` edits in Step 8. Issue-body mutations applied after a reviewer/fixer verdict (Step 7.9c) cite the spawning sub-agent invocation.
|
|
821
|
+
|
|
822
|
+
---
|
|
823
|
+
|
|
824
|
+
## Resumability (Decision 27/30)
|
|
825
|
+
|
|
826
|
+
board-fill is long-running — a Tier 3 batch can span 15+ items with per-issue reviewer/fixer loops (Step 7.9) and dozens of platform mutations (Step 7). Per hatch3r's workspace-checkpointed resumability contract, checkpoint progress so an interrupted run re-enters at the last completed phase rather than re-creating issues.
|
|
827
|
+
|
|
828
|
+
> Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Checkpoint Contract. Per-command slots: workspace `.board-fill-workspace/`; step range the command's step progression; `wave` = batch index when items are processed in dependency levels; snapshot/rollback paths the command's output paths. Write points: after each ASK checkpoint is confirmed and after each Step 7 mutation phase (epics created, sub-issues linked, board synced) so created-issue numbers and `link_results` survive a crash and are not re-created on resume.
|
|
829
|
+
|
|
830
|
+
---
|
|
831
|
+
|
|
832
|
+
## Iteration Summary (mandatory output)
|
|
833
|
+
|
|
834
|
+
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).
|
|
835
|
+
|
|
836
|
+
The 9 sections:
|
|
837
|
+
|
|
838
|
+
1. **Request** — verbatim restatement of the user's ask in one sentence.
|
|
839
|
+
2. **Fan-out + Cost** — `sub_agents_spawned: { count, rationale }` plus the `cost_estimate` / `cost_actuals` / `delta` blocks (see Cost Visibility below).
|
|
840
|
+
3. **Web Research** — every URL fetched with access date + trust tier per `agents/shared/rigor-contract.md` (0 acceptable when no research was needed).
|
|
841
|
+
4. **Files Mutated** — list with diff summary (lines added / removed / files created).
|
|
842
|
+
5. **Gates Passed / Failed** — explicit list per `.claude/rules/capability-lifecycle.md` Gate Checklist.
|
|
843
|
+
6. **Pillar Impact Attribution** — `progress_toward_pillar: <axis>.<pillar_id>+<delta>` per CONSTITUTION §6 Decision 17.
|
|
844
|
+
7. **Verification Commands** — exact commands run with exit codes plus key output lines (≤200 chars).
|
|
845
|
+
8. **Open Questions / Blockers** — explicit `None` if fully closed.
|
|
846
|
+
9. **Learnings Captured** — IDs of any learnings written to `.hatch3r/learnings/` this run per `rules/hatch3r-learning-system.md`.
|
|
847
|
+
|
|
848
|
+
### Cost Visibility (Decision 24)
|
|
849
|
+
|
|
850
|
+
> 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.
|
|
851
|
+
|
|
852
|
+
## Cost estimate (Decision 24)
|
|
853
|
+
|
|
854
|
+
This command emits cost transparency per `rules/hatch3r-cost-visibility.md` and CONSTITUTION §6 Decision 24/29:
|
|
855
|
+
|
|
856
|
+
- **Pre-execution `cost_estimate`** — emitted in Step 0.5 before the first sub-agent dispatch (Step 7.9 reviewer/fixer loops or Step 1 explore sub-agents).
|
|
857
|
+
- **Post-execution `cost_actuals` + `delta`** — appended to the end-of-run iteration summary's Fan-out + Cost section per `rules/hatch3r-iteration-summary.md` §2.
|
|
858
|
+
|
|
859
|
+
Per-tier `expected_sa_count` calibration (from frontmatter `sub_agents_spawned.count: 11` × tier heuristic in `rules/hatch3r-cost-visibility.md` Pre-Execution Estimate): Tier 1 ≈ 0 (Step 7.9 production-readiness review skipped); Tier 2 ≈ 2 per issue (reviewer + fixer); Tier 3 up to 11 per issue (reviewer/fixer plus the 9 CQ vector specialists consulted on readiness), scaling with issue count. 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`.
|
|
860
|
+
|
|
861
|
+
---
|
|
862
|
+
|
|
777
863
|
## Error Handling
|
|
778
864
|
|
|
779
865
|
- **Search failure** (GitHub `search_issues` / Azure DevOps `az boards query` / GitLab `glab issue list --search`): retry once, then warn and proceed without dedup.
|