hatch3r 2.1.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/README.md +3 -3
  2. package/dist/cli/index.js +77 -19
  3. package/dist/content/agents/hatch3r-brownfield-spec.md +1 -1
  4. package/dist/content/agents/hatch3r-fixer.md +21 -8
  5. package/dist/content/agents/hatch3r-handoff-loader.md +7 -2
  6. package/dist/content/agents/hatch3r-handoff-preparer.md +5 -16
  7. package/dist/content/agents/hatch3r-implementer.md +29 -3
  8. package/dist/content/agents/hatch3r-maintainability.md +2 -0
  9. package/dist/content/agents/hatch3r-researcher.md +1 -1
  10. package/dist/content/agents/hatch3r-reviewer.md +21 -13
  11. package/dist/content/agents/hatch3r-ui.md +1 -1
  12. package/dist/content/agents/hatch3r-ux.md +1 -1
  13. package/dist/content/agents/shared/cq-specialist-roster.md +2 -2
  14. package/dist/content/agents/shared/efficiency-patterns.md +1 -1
  15. package/dist/content/agents/shared/quality-charter.md +6 -5
  16. package/dist/content/agents/shared/quality-specialist-frame.md +1 -1
  17. package/dist/content/agents/shared/severity-mapping.md +1 -1
  18. package/dist/content/agents/shared/triage-vocabulary.md +1 -1
  19. package/dist/content/agents/shared/user-content-templates.md +1 -1
  20. package/dist/content/agents/shared/user-question-protocol.md +4 -3
  21. package/dist/content/checks/code-quality.md +11 -0
  22. package/dist/content/checks/security.md +5 -0
  23. package/dist/content/checks/testing.md +2 -0
  24. package/dist/content/commands/board/pickup-delegation-multi.md +18 -8
  25. package/dist/content/commands/board/pickup-delegation.md +5 -4
  26. package/dist/content/commands/hatch3r-api-spec.md +5 -17
  27. package/dist/content/commands/hatch3r-auth-scaffold.md +7 -20
  28. package/dist/content/commands/hatch3r-benchmark.md +5 -17
  29. package/dist/content/commands/hatch3r-board-fill.md +6 -18
  30. package/dist/content/commands/hatch3r-board-pickup.md +8 -19
  31. package/dist/content/commands/hatch3r-bug-pipeline.md +4 -16
  32. package/dist/content/commands/hatch3r-bug-plan.md +5 -17
  33. package/dist/content/commands/hatch3r-codebase-map.md +5 -17
  34. package/dist/content/commands/hatch3r-create.md +5 -17
  35. package/dist/content/commands/hatch3r-debug.md +5 -17
  36. package/dist/content/commands/hatch3r-design-system-create.md +254 -0
  37. package/dist/content/commands/hatch3r-diagnose.md +10 -18
  38. package/dist/content/commands/hatch3r-feature-plan.md +5 -17
  39. package/dist/content/commands/hatch3r-handoff.md +5 -17
  40. package/dist/content/commands/hatch3r-healthcheck.md +5 -17
  41. package/dist/content/commands/hatch3r-incident-response.md +3 -15
  42. package/dist/content/commands/hatch3r-migration-plan.md +5 -17
  43. package/dist/content/commands/hatch3r-onboard.md +6 -18
  44. package/dist/content/commands/hatch3r-pack-install.md +6 -29
  45. package/dist/content/commands/hatch3r-pr-resolve.md +77 -79
  46. package/dist/content/commands/hatch3r-project-spec.md +5 -17
  47. package/dist/content/commands/hatch3r-quick-change.md +5 -17
  48. package/dist/content/commands/hatch3r-refactor-plan.md +5 -17
  49. package/dist/content/commands/hatch3r-release.md +6 -16
  50. package/dist/content/commands/hatch3r-revision.md +11 -23
  51. package/dist/content/commands/hatch3r-roadmap.md +5 -17
  52. package/dist/content/commands/hatch3r-security-audit.md +5 -17
  53. package/dist/content/commands/hatch3r-slo-scaffold.md +8 -20
  54. package/dist/content/commands/hatch3r-spec.md +11 -16
  55. package/dist/content/commands/hatch3r-test-plan.md +5 -17
  56. package/dist/content/commands/hatch3r-workflow.md +16 -26
  57. package/dist/content/commands/revision/revision-quality.md +6 -5
  58. package/dist/content/commands/shared/orchestration-frame.md +2 -2
  59. package/dist/content/rules/hatch3r-agent-orchestration-detail.md +2 -2
  60. package/dist/content/rules/hatch3r-agent-orchestration-detail.mdc +2 -2
  61. package/dist/content/rules/hatch3r-agent-orchestration.md +15 -15
  62. package/dist/content/rules/hatch3r-agent-orchestration.mdc +15 -15
  63. package/dist/content/rules/hatch3r-anti-duplication.md +15 -4
  64. package/dist/content/rules/hatch3r-anti-duplication.mdc +15 -4
  65. package/dist/content/rules/hatch3r-clarification-default.md +8 -7
  66. package/dist/content/rules/hatch3r-clarification-default.mdc +8 -7
  67. package/dist/content/rules/hatch3r-code-standards.md +1 -1
  68. package/dist/content/rules/hatch3r-code-standards.mdc +1 -1
  69. package/dist/content/rules/hatch3r-contract-census.md +160 -0
  70. package/dist/content/rules/hatch3r-contract-census.mdc +160 -0
  71. package/dist/content/rules/hatch3r-cost-visibility.md +11 -4
  72. package/dist/content/rules/hatch3r-cost-visibility.mdc +11 -4
  73. package/dist/content/rules/hatch3r-deep-context.md +1 -0
  74. package/dist/content/rules/hatch3r-deep-context.mdc +1 -0
  75. package/dist/content/rules/hatch3r-dynamic-stack-verification.md +114 -0
  76. package/dist/content/rules/hatch3r-dynamic-stack-verification.mdc +109 -0
  77. package/dist/content/rules/hatch3r-enhancability.md +1 -1
  78. package/dist/content/rules/hatch3r-enhancability.mdc +1 -1
  79. package/dist/content/rules/hatch3r-findings-ledger.md +129 -0
  80. package/dist/content/rules/hatch3r-findings-ledger.mdc +129 -0
  81. package/dist/content/rules/hatch3r-handoff-readiness.md +1 -1
  82. package/dist/content/rules/hatch3r-handoff-readiness.mdc +1 -1
  83. package/dist/content/rules/hatch3r-i18n.md +4 -0
  84. package/dist/content/rules/hatch3r-i18n.mdc +4 -0
  85. package/dist/content/rules/hatch3r-iteration-summary.md +47 -49
  86. package/dist/content/rules/hatch3r-iteration-summary.mdc +47 -49
  87. package/dist/content/rules/hatch3r-learning-system.md +6 -6
  88. package/dist/content/rules/hatch3r-learning-system.mdc +6 -6
  89. package/dist/content/rules/hatch3r-migrations.md +1 -1
  90. package/dist/content/rules/hatch3r-migrations.mdc +1 -1
  91. package/dist/content/rules/hatch3r-reviewer-calibration.md +2 -2
  92. package/dist/content/rules/hatch3r-reviewer-calibration.mdc +2 -2
  93. package/dist/content/rules/hatch3r-security-patterns.md +4 -0
  94. package/dist/content/rules/hatch3r-security-patterns.mdc +4 -0
  95. package/dist/content/rules/hatch3r-testing.md +14 -0
  96. package/dist/content/rules/hatch3r-testing.mdc +14 -0
  97. package/dist/content/rules/hatch3r-tool-currency.md +1 -1
  98. package/dist/content/rules/hatch3r-tool-currency.mdc +1 -1
  99. package/dist/content/skills/hatch3r-adhoc-orchestrate/SKILL.md +1 -1
  100. package/dist/content/skills/hatch3r-design-system-detect/SKILL.md +2 -0
  101. package/dist/content/skills/hatch3r-handoff-prepare/SKILL.md +4 -4
  102. package/dist/content/skills/hatch3r-report/SKILL.md +1 -1
  103. package/package.json +2 -2
@@ -0,0 +1,254 @@
1
+ ---
2
+ id: hatch3r-design-system-create
3
+ type: command
4
+ orchestrator: true
5
+ agentPipeline: [hatch3r-researcher, hatch3r-implementer, hatch3r-ui, hatch3r-ux]
6
+ description: "Create a project design system from brand assets or an elicitation dialog — DTCG 2025.10 token emission, 3-tier taxonomy (primitive → semantic → component), OKLCH ramps, dual output design.md + design-tokens.json, gated on WCAG 2.2 AA contrast, 100% theme parity, and 0 dangling aliases."
7
+ argument-hint: "[brand-asset-path]"
8
+ tags: [implementation, ui, design-system, floor:ui-ux]
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: 4
17
+ rationale: One hatch3r-researcher extracts palette + convention seeds from brand assets (Tier 2/3 only); one hatch3r-implementer writes design-tokens.json + docs/design.md + emission targets (all file mutation flows through the implementer per the Mandatory Delegation Directive); hatch3r-ui and hatch3r-ux run in parallel as the two mandatory validation gates — read-only over the same generated files with disjoint checklist rows. Research → implement → gate are the only serialization edges; every alias resolves into one token graph, so generation stays single-implementer by shared-state dependency, never by token cost. Cost-dominance per CONSTITUTION §2 P8.
18
+ ---
19
+
20
+ ## §0 Detect Ambiguity (P8 B1)
21
+
22
+ > Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → §0 Detect Ambiguity. Per-command triggers: (a) neither a brand-asset path nor an explicit request for the elicitation dialog is present; (b) the Step 1 detect verdict is `reuse` — an existing system is in scope and overwriting it is irreversible; (c) theme set undeclared (light + dark pair vs + high-contrast third set per `rules/hatch3r-theming.md`); (d) emission target undeclared (DTCG JSON only vs + Tailwind v4 `@theme` vs + CSS custom properties); (e) brand hue count ambiguous (one primary vs primary + secondary + accent — each hue gets its own ramp). Proceed without asking ONLY when the asset-vs-dialog path, theme set, and emission target are all explicit. B1 directive: `rules/hatch3r-clarification-default.md`.
23
+
24
+ ## Agent Pipeline
25
+
26
+ | Stage | Agent(s) | Parallel | Required |
27
+ |-------|----------|----------|----------|
28
+ | 1. Detect existing design system | Orchestrator (inline; runs `hatch3r-design-system-detect` skill, read-only) | No | Yes |
29
+ | 2. Intake / elicitation + ASK gate | Orchestrator (inline) | No | Yes |
30
+ | 3. Brand/asset research | `hatch3r-researcher` | Per asset class | Tier 2/3 only |
31
+ | 4. Generate tokens + docs | `hatch3r-implementer` | No — single token graph | Yes |
32
+ | 5. Validate CQ1 + CQ2 gates | `hatch3r-ui` + `hatch3r-ux` | Yes | Yes |
33
+ | 6. Docs check + Iteration Summary | Orchestrator (inline) | No | Yes |
34
+
35
+ **Parallel-safety conditions** (per `rules/hatch3r-agent-orchestration.md` §Parallel Safety): Stage 5 runs `hatch3r-ui` and `hatch3r-ux` concurrently — both are read-only over the same generated files, their gate rows are disjoint (contrast/alias/parity vs focus-indicator/target-size), and aggregation is deterministic (union of findings). Stage 3 fans out one researcher per asset class (palette + logo vs screenshot corpus vs Figma/tokens-studio export) when Tier 3 supplies more than one. Stage 4 stays single-implementer: every alias resolves into one token graph — shared mutable state, so the no-parallel-writers condition binds; a dependency edge, not a token-cost serialization.
36
+
37
+ ---
38
+
39
+ # Design System Create -- Brand Assets or Elicitation Dialog → DTCG Tokens + design.md
40
+
41
+ Creates a project- or workspace-wide design system from brand assets (logo, brand-color list, screenshots, Figma export, tokens-studio JSON) or, when no assets exist, from a structured elicitation dialog. Dual output: `design-tokens.json` (DTCG Format Module 2025.10 — `$type`/`$value`, `{group.token}` aliases) and `docs/design.md` (principles, palette + OKLCH ramps, taxonomy diagram, theme table, usage examples, embedded Accessibility Report). A run passes only when every blocking row of the Step 5 gate table holds: WCAG 2.2 AA contrast on 100% of semantic fg/bg pairs in every theme, 100% theme parity, 0 dangling aliases, 0 component→primitive direct references.
42
+
43
+ Use `/hatch3r-design-system-create` when the detect verdict is `create` or `extend`. Use the `hatch3r-design-system-detect` skill alone to inventory an existing system without generating; use the `hatch3r-ui-ux-verify` skill to audit built UI against a system that already exists.
44
+
45
+ ---
46
+
47
+ ## Argument Parsing
48
+
49
+ Optional positional argument: `<brand-asset-path>` — a file or directory of brand assets.
50
+
51
+ - If supplied: Step 2 reads assets from that path; the elicitation dialog covers only the intake fields the assets leave unanswered.
52
+ - If omitted: Step 2 runs the full elicitation dialog (primary hue, neutral temperature, density, radius scale, motion preference, theme set).
53
+
54
+ ---
55
+
56
+ ## Step 0: Triage
57
+
58
+ Classify before delegating, using the Light / Standard / Deep vocabulary in `agents/shared/triage-vocabulary.md` (`triage_tiers: [1, 2, 3]` maps 1 = Light, 2 = Standard, 3 = Deep).
59
+
60
+ - **Tier 1 (Light)** — complete assets (brand hues + neutral readable without research), a single light + dark pair, detect verdict `create`. No researcher: one `hatch3r-implementer` + the two parallel gates.
61
+ - **Tier 2 (Standard)** — the elicitation dialog is needed (no assets, or assets answer only part of the Step 2 intake table) OR the detect verdict is `extend`. One `hatch3r-researcher` pass over whatever assets exist + implementer + gates.
62
+ - **Tier 3 (Deep)** — Figma/tokens-studio import, multi-brand palette, monorepo (workspace-wide token package), or a third theme (high-contrast). One researcher per asset class in parallel + implementer + gates.
63
+
64
+ An undeclared theme set or emission target fires the §0 gate before tiering. Classify upward on uncertainty (highest-tier rule, `agents/shared/triage-vocabulary.md`).
65
+
66
+ ### Step 0.5: Emit Pre-Execution Cost Preview
67
+
68
+ Before the Step 2 ASK gate, emit the cost preview per `rules/hatch3r-cost-visibility.md`:
69
+
70
+ ```yaml
71
+ cost_estimate:
72
+ expected_sa_count: <0-2 researchers by tier + 1 implementer + 2 validation gates>
73
+ estimated_input_tokens_static_frame: <int>
74
+ estimated_web_research_queries: <int> # 0-2 — only for Figma/tokens-studio field-mapping checks
75
+ triage_tier: light | standard | deep
76
+ estimated_duration_min: <int>
77
+ ```
78
+
79
+ Post-execution actuals + delta land in the Step 6 Iteration Summary recap per `rules/hatch3r-cost-visibility.md`.
80
+
81
+ > Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Effort Override. Per-command slot: a complete-assets single-pair run misread as Deep because a stray tokens-studio JSON sits in the repo — force `--effort=light`.
82
+
83
+ ---
84
+
85
+ ## Step 1: Detect First (mandatory, read-only)
86
+
87
+ Invoke the `hatch3r-design-system-detect` skill inline and consume its Design System Inventory (`.audit-workspace/design-system-inventory.md`). This command never re-implements detection — it reads the inventory's token source, color space, component library, and responsive strategy verbatim and treats them as ground truth for Steps 3–4.
88
+
89
+ Verdict routing (the inventory's `Verdict:` line):
90
+
91
+ | Verdict | Route |
92
+ |---------|-------|
93
+ | `reuse` | HALT with an actionable pointer: print the existing token source + component library and exit — this command never overwrites a working design system. To audit it instead, run the `hatch3r-ui-ux-verify` skill. |
94
+ | `extend` | Scope generation to the inventory's gaps only (e.g. missing dark theme, missing component tier, hex → OKLCH migration). Existing token names are read-only inputs; the inventory's canonical token-source location overrides the greenfield default. |
95
+ | `create` | Full pipeline, Steps 2–6. |
96
+
97
+ If the inventory flags multiple token sources, the run is BLOCKED until the maintainer names the canonical one (the detect skill's reconciliation rule) — writing a new source beside them would break the DTCG single-source-of-truth mandate.
98
+
99
+ ---
100
+
101
+ ## Step 2: Intake / Elicitation + ASK Checkpoint (only mutation gate)
102
+
103
+ Fill the intake table from `<brand-asset-path>` where the assets answer a field; run the structured dialog for the rest. Cache for the Step 4 implementer prompt.
104
+
105
+ | Input | Default if unspecified | Notes |
106
+ |-------|------------------------|-------|
107
+ | Brand assets | none → full dialog | logo, brand-color list, screenshots, Figma export, tokens-studio JSON |
108
+ | Brand hue(s) | (required — assets or dialog) | 1–3 hues; each hue gets its own OKLCH ramp |
109
+ | Neutral temperature | pure gray | warm / cool / pure — hue bias of the neutral ramp |
110
+ | Density | comfortable | compact / comfortable / spacious — base of the spacing scale |
111
+ | Radius scale | 4px base | none / 4px / 8px / full-round tiers |
112
+ | Motion | 200ms ease + reduced-motion variant | per `rules/hatch3r-theming.md` |
113
+ | Theme set | light + dark | + high-contrast (≥7:1 text, ≥3:1 non-text) per `rules/hatch3r-theming.md` |
114
+ | Emission target | DTCG JSON | + Tailwind v4 `@theme` / + CSS custom properties, per the detect inventory |
115
+ | Token-source location | `tokens/design-tokens.json` (greenfield) | the inventory's canonical location wins on `extend` |
116
+
117
+ Present ONE consolidated ASK confirming the intake summary — the only mutation gate:
118
+
119
+ ```
120
+ hatch3r-design-system-create — Tier {1|2|3}, verdict: {create|extend}
121
+
122
+ Intake summary:
123
+ brand hues: {n} ({oklch values or dialog answers})
124
+ neutral: {warm|cool|pure} · density: {…} · radius: {…} · motion: {…}
125
+ themes: light + dark {+ high-contrast}
126
+ emission: DTCG JSON {+ @theme} {+ CSS vars}
127
+ taxonomy: primitive → semantic → component
128
+ output: {token-source location} + docs/design.md
129
+ ```
130
+
131
+ ASK per `agents/shared/user-question-protocol.md`: `accept` — generate and gate; `edit` — change an intake field first; `skip` — cancel, write nothing. After `accept`, the run is autonomous through Step 6.
132
+
133
+ ---
134
+
135
+ ## Step 3: Token Architecture (+ Tier 2/3 asset research)
136
+
137
+ **Tier 2/3 research (sub-agent delegation).** Delegate asset analysis to `hatch3r-researcher` via the Task tool — one researcher per asset class, in parallel (read-only per that agent's contract). Brief: extract candidate brand hues as OKLCH, spacing/radius conventions visible in screenshots, and a tokens-studio → DTCG field mapping when an export is present. Findings feed the Step 4 implementer prompt. Tier 1 skips this stage — the assets already answer the intake table.
138
+
139
+ **Taxonomy (all tiers).** Three tiers, aligned with `rules/hatch3r-theming.md` token layering and `rules/hatch3r-component-conventions.md`:
140
+
141
+ 1. **Primitive** — raw scales, no theme awareness: OKLCH ramps (`gray.100`…`gray.900`, `brand.100`…), spacing, radius, type scale.
142
+ 2. **Semantic** — role tokens (`color.surface`, `color.text-primary`, `color.border`, `color.brand`, `color.error/success/warning`) aliasing primitives; the theme-switching layer.
143
+ 3. **Component** — `btn.text`, `input.border`, … aliasing semantic tokens only.
144
+
145
+ **Hard rule:** a component token never references a primitive token directly — every component alias resolves through the semantic tier (blocking row, Step 5). This constraint is what makes theme switching a semantic-tier-only override.
146
+
147
+ ---
148
+
149
+ ## Step 4: Generate (sub-agent delegation)
150
+
151
+ Delegate to `hatch3r-implementer` via the Task tool. ALL file writes flow through the implementer per the Mandatory Delegation Directive — the orchestrator writes nothing inline.
152
+
153
+ The implementer prompt MUST include the detect inventory, the confirmed intake, the Step 3 research findings, and this contract:
154
+
155
+ **OKLCH ramps (per brand hue + neutral):** a lightness ramp per hue (10 steps, L ≈ 0.98 → 0.15); for text-role steps hold L fixed and adjust C/H toward the Step 5 contrast thresholds (the apcach pattern — in OKLCH, contrast tracks ΔL, so L placement is the contrast control). Reduce chroma 10–20% on dark-theme surface ramps per `rules/hatch3r-theming.md`.
156
+
157
+ **DTCG emission (the token-source file):** Format Module 2025.10 — every token carries `$type` + `$value`; aliases use `{group.token}` syntax; groups mirror the 3-tier taxonomy; default location `tokens/design-tokens.json` on greenfield, the inventory's canonical location on `extend`.
158
+
159
+ **Themes:** light + dark (+ high-contrast when confirmed) as semantic-tier override sets with IDENTICAL semantic key sets — a key present in one theme and absent in another is a blocking Step 5 failure.
160
+
161
+ **Adapter emission (per detect inventory):** Tailwind v4 `@theme` block and/or `:root` CSS custom properties are generated FROM the DTCG file (Style Dictionary-compatible naming) — derived outputs, never a second authored source.
162
+
163
+ **Docs:** `docs/design.md` per the Step 6 contract.
164
+
165
+ Also include: all `scope: always` rule directives; the confidence expression requirement (verbatim, high/medium/low per `agents/shared/quality-charter.md` §1); the boundary "do NOT create branches, commits, or PRs". Await the structured result; capture `Files changed` and the `Delegation proof ID` per file.
166
+
167
+ ---
168
+
169
+ ## Step 5: Validate (parallel sub-agent gates)
170
+
171
+ After the implementer returns, delegate `hatch3r-ui` and `hatch3r-ux` via the Task tool in parallel. `hatch3r-ui` owns the contrast, alias, parity, reference, and APCA rows (CQ1 acceptance bar: `agents/hatch3r-ui.md` audit checklist); `hatch3r-ux` owns the focus-indicator and touch-target rows (interaction affordances, CQ2). Each prompt carries the generated file paths + its gate rows:
172
+
173
+ | Gate | Threshold | Blocking |
174
+ |---|---|---|
175
+ | WCAG 2.2 AA contrast (4.5:1 text / 3:1 large + non-text) | 100% of semantic fg/bg pairs, every theme | Yes |
176
+ | Focus-indicator contrast ≥3:1 | 100% of interactive component tokens | Yes |
177
+ | Touch-target sizing tokens ≥44px | 100% | Yes |
178
+ | Dangling aliases | 0 | Yes |
179
+ | Theme parity (identical semantic key set per theme) | 100% | Yes |
180
+ | Component→primitive direct references | 0 | Yes |
181
+ | APCA (Lc ≥60 body / ≥45 large) | advisory | No — recorded in a11y report |
182
+
183
+ The 44px sizing-token row sits above the WCAG 2.2 AA SC 2.5.8 floor (24×24 CSS px) — size tokens are authored to the platform-HIG bar so consuming components inherit it. A blocking-row failure routes back through `hatch3r-implementer` (max 1 regeneration pass), then re-gates the failed rows only. A persistent blocking failure ends the run at `PARTIAL` with the system flagged not-merge-ready. APCA readings below Lc 60/45 land in the design.md Accessibility Report — advisory, never a halt.
184
+
185
+ ---
186
+
187
+ ## Step 6: Docs + Iteration Summary
188
+
189
+ Verify `docs/design.md` (written by the Step 4 implementer) carries: principles (the confirmed intake decisions restated as statements), palette + per-hue OKLCH ramp tables, the 3-tier taxonomy diagram, a theme table (semantic keys × themes), usage examples per emission target, and an embedded Accessibility Report (WCAG pass matrix per theme + the APCA advisory readings). Emit the runtime `sub_agents_spawned: {count, rationale}` block with the actual spawn count per `rules/hatch3r-fan-out-discipline.md`.
190
+
191
+ ### End-of-Turn Delegation Attestation (Bypass Protection)
192
+
193
+ > Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → End-of-Turn Delegation Attestation. Per-command mutated-file slot: `{token-source location}`, `docs/design.md`, emission-target files — all `via hatch3r-implementer`.
194
+
195
+ ### Iteration Summary (mandatory output)
196
+
197
+ Close the run with the recap-contract Iteration Summary per `rules/hatch3r-iteration-summary.md`: a 1–2 line recap (status, outcome, files · sub-agents · gates · cost delta) plus every exception line whose firing condition holds — silence asserts the default.
198
+
199
+ ```markdown
200
+ ## Iteration Summary
201
+
202
+ **SUCCESS** — Created 2-theme OKLCH design system (1 brand hue + neutral, 3-tier DTCG tokens); ui + ux gates PASS 6/6 blocking rows.
203
+ files 3 (+486/−0) · sa 4/4 · gates 6/6 · cost Δ−8% tok / Δ+3% min · tier 2
204
+ Not done: APCA Lc 58 on `color.text-secondary` (dark) — advisory, recorded in the design.md Accessibility Report
205
+ Next: import the token file into the build (Tailwind `@theme` / Style Dictionary) and point component authors at docs/design.md.
206
+ ```
207
+
208
+ Status decision rules:
209
+ - **SUCCESS** — tokens + docs written, all blocking gate rows PASS, verdict-scoped outputs complete.
210
+ - **PARTIAL** — generated, but a blocking row failed after the single regeneration pass, or a verification command failed.
211
+ - **FAILED** — the implementer returned BLOCKED; nothing written.
212
+ - **BLOCKED** — detect verdict `reuse`, multiple token sources unreconciled, or an intake contradiction the maintainer must rule on.
213
+
214
+ ---
215
+
216
+ ## Per-Turn Pipeline-State Header (Bypass Protection)
217
+
218
+ > Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Per-Turn Pipeline-State Header. Phase mapping: `1` = detect + intake + confirm, `2` = research + implementer generation, `3` = parallel gates + docs + summary. Tier 1 complete-asset runs are exempt per the Tier 1 exemption.
219
+
220
+ ---
221
+
222
+ ## Error Handling
223
+
224
+ - **Asset unreadable or unsupported format** — name the supported classes (logo image, brand-color list, screenshots, Figma export, tokens-studio JSON) and fall back to the elicitation dialog for the missing fields; never infer a brand hue from a filename.
225
+ - **Multiple token sources in the detect inventory** — BLOCKED until the maintainer names the canonical source (Step 1).
226
+ - **Researcher returns low-confidence hue extraction** — re-open the ASK with the OKLCH candidates as numbered options (residual-ambiguity re-ask per the frame §0); never silently pick one.
227
+ - **Persistent blocking-gate failure after the regeneration pass** — end at PARTIAL, not-merge-ready flag, gate findings quoted verbatim in the Iteration Summary.
228
+
229
+ ## Guardrails
230
+
231
+ 1. **One ASK gate.** Step 2 is the only user-facing checkpoint; after `accept`, the run proceeds through Step 6 (residual-ambiguity re-asks per frame §0 excepted).
232
+ 2. **No commit or push.** Generated files are left staged for human review; git operations are out of scope.
233
+ 3. **Detect before create.** Step 1 is never skipped; a `reuse` verdict halts the run — this command never overwrites an existing design system.
234
+ 4. **Single authored source.** The DTCG file is the only hand-authored token source; `@theme` / CSS-vars outputs are derived from it and regenerated, never edited in place.
235
+ 5. **No raw color values outside the primitive tier.** Semantic and component tokens are aliases only (`rules/hatch3r-theming.md` token layering).
236
+ 6. **Both gates are mandatory.** A run is never declared SUCCESS without `hatch3r-ui` AND `hatch3r-ux` PASS on every blocking row they own.
237
+
238
+ ## Resumability (Decision 27/30)
239
+
240
+ design-system-create serializes on the research → generate → gate edges, so checkpoint at the stage boundary — an interrupted run re-enters at the first incomplete stage rather than regenerating the token file it already wrote.
241
+
242
+ > Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Checkpoint Contract. Per-command slots: workspace `.design-system-workspace/`; step range the Step 1 → Step 6 progression; `wave` = the researcher-batch index in Step 3, then the regeneration-pass index in Step 5; snapshot/rollback paths the token-source file, `docs/design.md`, and every emission-target file the Step 4 implementer touches. Write points: after the Step 1 inventory read, after the Step 2 accept gate, after each Step 3 researcher return, after the Step 4 implementer return, and after each Step 5 gate verdict.
243
+
244
+ ## References
245
+
246
+ - [W3C Design Tokens Format Module 2025.10](https://www.designtokens.org/tr/drafts/format/) (accessed 2026-07-08, W3C Design Tokens Community Group, official-docs) — `$type`/`$value` token shape, `{group.token}` alias syntax, group nesting, and the single-source mandate; source for the Step 4 emission contract.
247
+ - [Design Tokens specification reaches first stable version](https://www.w3.org/community/design-tokens/2025/10/28/design-tokens-specification-reaches-first-stable-version/) (accessed 2026-07-08, W3C Design Tokens CG, official-docs) — confirms 2025.10 as the first stable release; the version the emission contract pins.
248
+ - [WCAG 2.2](https://www.w3.org/TR/WCAG22/) (accessed 2026-07-08, W3C, official-docs) — SC 1.4.3 contrast minimums (4.5:1 / 3:1 large), SC 1.4.11 non-text contrast 3:1, SC 2.5.8 target size 24×24; the Step 5 blocking thresholds and the floor the 44px token row exceeds.
249
+ - [apcach](https://github.com/antiflasher/apcach) (accessed 2026-07-08, named-maintainer library, established-library) — composing OKLCH colors to a target contrast by holding L and adjusting C/H; pattern source for the Step 4 ramp recipe and the APCA advisory row (Lc 60 body / 45 large).
250
+ - [Style Dictionary — DTCG support](https://styledictionary.com/info/dtcg/) (accessed 2026-07-08, Style Dictionary maintainers, established-library) — DTCG-input transform surface and derived multi-platform outputs; basis for the derived-emission (never second-source) guardrail.
251
+ - [uxKero/anydesign](https://github.com/uxKero/anydesign) (accessed 2026-07-08, named maintainer, independent-analysis) — prior art: elicitation-dialog → design-system generation; structural source for the Step 2 dialog field set.
252
+ - [arvindrk/extract-design-system](https://github.com/arvindrk/extract-design-system) (accessed 2026-07-08, named maintainer, independent-analysis) — prior art: palette/spacing extraction from existing assets and screenshots; structural source for the Step 3 researcher brief.
253
+
254
+ Cross-references: `skills/hatch3r-design-system-detect/SKILL.md` (mandatory Step 1 inventory producer) · `rules/hatch3r-theming.md` (token layering, theme sets, dark-theme chroma reduction) · `rules/hatch3r-component-conventions.md` (how downstream components consume the tokens) · `rules/hatch3r-accessibility-standards.md` (WCAG 2.2 AA criteria behind the Step 5 rows) · `agents/hatch3r-ui.md` (CQ1 acceptance bar).
@@ -100,7 +100,7 @@ cost_estimate:
100
100
  estimated_duration_min: <int>
101
101
  ```
102
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`.
103
+ Post-execution actuals + delta land in the Step 6 Iteration Summary recap (cost facet; full blocks on the `Cost:` exception line beyond ±25%) per `rules/hatch3r-cost-visibility.md` Post-Execution Actuals. Token telemetry sources from `src/pipeline/observability.ts`.
104
104
 
105
105
  ### Effort Override (Decision 17)
106
106
 
@@ -166,7 +166,7 @@ Each fixer prompt MUST include:
166
166
  4. The confidence expression requirement (verbatim).
167
167
  5. Explicit: do NOT create branches, commits, or PRs — the fixer's standing boundary; this command stops before commit for human review.
168
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.
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` on the `Next:` line of the Step 6 recap rather than auto-spawning a reviewer.
170
170
 
171
171
  ---
172
172
 
@@ -180,26 +180,18 @@ Re-run the relevant Step 1 probe(s) to confirm the fix cleared the symptom: re-r
180
180
 
181
181
  ### Iteration Summary (mandatory output)
182
182
 
183
- Emit the canonical iteration summary per `rules/hatch3r-iteration-summary.md`:
183
+ Close the run with the recap-contract Iteration Summary per `rules/hatch3r-iteration-summary.md`: a 1–2 line recap (status, outcome, files · sub-agents · gates · cost delta) plus every exception line whose firing condition holds — silence asserts the default. Omitting the recap fails that rule's Validation Gate (CONSTITUTION §6 Decision 23, superseded in place 2026-07-06).
184
+
185
+ Worked example for this domain:
184
186
 
185
187
  ```markdown
186
188
  ## Iteration Summary
187
189
 
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."}
190
+ **PARTIAL** Diagnosed manifest schema drift; migrated .hatch3r/hatch.json to schemaVersion 3; primary symptom resolved (hatch3r status re-run clean); second symptom not yet reproduced.
191
+ files 1 (+3/−1) · sa 3/3 · gates 2/2 · cost Δ−8% tok / Δ+5% min · tier 3
192
+ Blockers: second symptom (intermittent sync stall) not reproduced against the captured state bundle — needs a failing transcript
193
+ Confidence: medium — primary fix verified by re-run probe; residual symptom unreproduced.
194
+ Next: commit the manifest migration; re-run /hatch3r-diagnose if the stall recurs.
203
195
  ```
204
196
 
205
197
  Status decision rules:
@@ -29,7 +29,7 @@ sub_agents_spawned:
29
29
  | 2. Document Generation | `hatch3r-docs-writer` (spec, ADRs) | Yes | Yes |
30
30
  | 3. Todo Generation | Orchestrator (inline) | No | Yes |
31
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.
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 (file- and contract-level), deterministic aggregation, no shared mutable state.
33
33
 
34
34
  # Feature Plan — Single Feature Specification from Idea to Board-Ready Epic
35
35
 
@@ -86,7 +86,7 @@ cost_estimate:
86
86
  estimated_duration_min: <int>
87
87
  ```
88
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`.
89
+ Post-execution, the delta figure lands in the Iteration Summary recap (cost facet); full blocks surface on the `Cost:` exception line beyond ±25%, per `rules/hatch3r-cost-visibility.md`. Token telemetry sources from `src/pipeline/observability.ts`.
90
90
 
91
91
  ### Effort Override (Decision 17)
92
92
 
@@ -527,30 +527,18 @@ feature-plan is long-running — a Tier 3 cross-cutting feature fans out four pa
527
527
 
528
528
  ## Iteration Summary (mandatory output)
529
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`.
530
+ Close the run with the recap-contract Iteration Summary per `rules/hatch3r-iteration-summary.md`: a 1–2 line recap (status, outcome, files · sub-agents · gates · cost delta) plus every exception line whose firing condition holds — silence asserts the default. Omitting the recap fails that rule's Validation Gate (CONSTITUTION §6 Decision 23, superseded in place 2026-07-06).
543
531
 
544
532
  ### Cost Visibility (Decision 24)
545
533
 
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.
534
+ > 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; the delta figure lands in the Iteration Summary recap (cost facet); full blocks surface on the `Cost:` exception line beyond ±25%, per `rules/hatch3r-cost-visibility.md`.
547
535
 
548
536
  ## Cost estimate (Decision 24)
549
537
 
550
538
  This command emits cost transparency per `rules/hatch3r-cost-visibility.md` and CONSTITUTION §6 Decision 24/29:
551
539
 
552
540
  - **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.
541
+ - **Post-execution `cost_actuals` + `delta`** — the delta figure lands in the Iteration Summary recap (cost facet); full blocks surface on the `Cost:` exception line beyond ±25%, per `rules/hatch3r-cost-visibility.md`.
554
542
 
555
543
  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
544
 
@@ -25,7 +25,7 @@ sub_agents_spawned:
25
25
 
26
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.
27
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.
28
+ **Parallel-safety conditions** (per `rules/hatch3r-agent-orchestration.md` §Parallel Safety): any parallel fan-out holds all three — read-only or disjoint writes (file- and contract-level), deterministic aggregation, no shared mutable state.
29
29
 
30
30
  ## Learnings Consultation
31
31
 
@@ -59,7 +59,7 @@ cost_estimate:
59
59
  estimated_duration_min: <int>
60
60
  ```
61
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`.
62
+ Post-execution, the delta figure lands in the Iteration Summary recap (cost facet); full blocks surface on the `Cost:` exception line beyond ±25%, per `rules/hatch3r-cost-visibility.md`. Token telemetry sources from `src/pipeline/observability.ts`.
63
63
 
64
64
  ### Effort Override (Decision 17)
65
65
 
@@ -162,30 +162,18 @@ ID STATUS BRANCH
162
162
 
163
163
  ## Iteration Summary (mandatory output)
164
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`.
165
+ Close the run with the recap-contract Iteration Summary per `rules/hatch3r-iteration-summary.md`: a 1–2 line recap (status, outcome, files · sub-agents · gates · cost delta) plus every exception line whose firing condition holds — silence asserts the default. Omitting the recap fails that rule's Validation Gate (CONSTITUTION §6 Decision 23, superseded in place 2026-07-06).
178
166
 
179
167
  ### Cost Visibility (Decision 24)
180
168
 
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.
169
+ > 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; the delta figure lands in the Iteration Summary recap (cost facet); full blocks surface on the `Cost:` exception line beyond ±25%, per `rules/hatch3r-cost-visibility.md`.
182
170
 
183
171
  ## Cost estimate (Decision 24)
184
172
 
185
173
  This command emits cost transparency per `rules/hatch3r-cost-visibility.md` and CONSTITUTION §6 Decision 24/29:
186
174
 
187
175
  - **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.
176
+ - **Post-execution `cost_actuals` + `delta`** — the delta figure lands in the Iteration Summary recap (cost facet); full blocks surface on the `Cost:` exception line beyond ±25%, per `rules/hatch3r-cost-visibility.md`.
189
177
 
190
178
  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
179
 
@@ -33,7 +33,7 @@ This command discovers the module taxonomy via static analysis, then delegates i
33
33
  | 4. Issue Creation | Orchestrator (GitHub MCP) | No | Yes |
34
34
  | 5. Board Sync | Orchestrator (Projects v2 sync) | No | Yes |
35
35
 
36
- **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.
36
+ **Parallel-safety conditions** (per `rules/hatch3r-agent-orchestration.md` §Parallel Safety): every parallel fan-out above holds all three — read-only or disjoint writes (file- and contract-level), deterministic aggregation, no shared mutable state.
37
37
 
38
38
  All issue operations MUST follow the Projects v2 Enforcement rules defined in `hatch3r-board-shared`.
39
39
 
@@ -61,7 +61,7 @@ cost_estimate:
61
61
  estimated_duration_min: <int>
62
62
  ```
63
63
 
64
- Post-execution actuals + delta land in the Step 6 finalization summary's Fan-out + Cost section per `rules/hatch3r-cost-visibility.md` Post-Execution Actuals. Token telemetry sources from `src/pipeline/observability.ts`.
64
+ Post-execution, the delta figure lands in the Iteration Summary recap (cost facet); full blocks surface on the `Cost:` exception line beyond ±25%, per `rules/hatch3r-cost-visibility.md`. Token telemetry sources from `src/pipeline/observability.ts`.
65
65
 
66
66
  ### Effort Override (Decision 17)
67
67
 
@@ -384,30 +384,18 @@ healthcheck is long-running — module discovery (Step 2) seeds a per-module hat
384
384
 
385
385
  ## Iteration Summary (mandatory output)
386
386
 
387
- 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).
388
-
389
- The 9 sections:
390
-
391
- 1. **Request** — verbatim restatement of the user's ask in one sentence.
392
- 2. **Fan-out + Cost** — `sub_agents_spawned: { count, rationale }` plus the `cost_estimate` / `cost_actuals` / `delta` blocks (see Cost Visibility below).
393
- 3. **Web Research** — every URL fetched with access date + trust tier per `agents/shared/rigor-contract.md` (0 acceptable when no research was needed).
394
- 4. **Files Mutated** — list with diff summary (lines added / removed / files created).
395
- 5. **Gates Passed / Failed** — explicit list per `.claude/rules/capability-lifecycle.md` Gate Checklist.
396
- 6. **Pillar Impact Attribution** — `progress_toward_pillar: <axis>.<pillar_id>+<delta>` per CONSTITUTION §6 Decision 17.
397
- 7. **Verification Commands** — exact commands run with exit codes plus key output lines (≤200 chars).
398
- 8. **Open Questions / Blockers** — explicit `None` if fully closed.
399
- 9. **Learnings Captured** — IDs of any learnings written to `.hatch3r/learnings/` this run per `rules/hatch3r-learning-system.md`.
387
+ Close the run with the recap-contract Iteration Summary per `rules/hatch3r-iteration-summary.md`: a 1–2 line recap (status, outcome, files · sub-agents · gates · cost delta) plus every exception line whose firing condition holds — silence asserts the default. Omitting the recap fails that rule's Validation Gate (CONSTITUTION §6 Decision 23, superseded in place 2026-07-06).
400
388
 
401
389
  ### Cost Visibility (Decision 24)
402
390
 
403
- > 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.
391
+ > 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; the delta figure lands in the Iteration Summary recap (cost facet); full blocks surface on the `Cost:` exception line beyond ±25%, per `rules/hatch3r-cost-visibility.md`.
404
392
 
405
393
  ## Cost estimate (Decision 24)
406
394
 
407
395
  This command emits cost transparency per `rules/hatch3r-cost-visibility.md` and CONSTITUTION §6 Decision 24/29:
408
396
 
409
397
  - **Pre-execution `cost_estimate`** — emitted in the Pre-Execution Cost Preview above before the first module audit-authoring dispatch (Step 4).
410
- - **Post-execution `cost_actuals` + `delta`** — appended to the Step 6 finalization summary's Fan-out + Cost section per `rules/hatch3r-iteration-summary.md` §2.
398
+ - **Post-execution `cost_actuals` + `delta`** — the delta figure lands in the Iteration Summary recap (cost facet); full blocks surface on the `Cost:` exception line beyond ±25%, per `rules/hatch3r-cost-visibility.md`.
411
399
 
412
400
  Per-tier `expected_sa_count` calibration (from frontmatter `sub_agents_spawned.count: 3`, which is the static floor; actual fan-out scales with discovered module count per `rules/fan-out-discipline.md` P8 B2): one `hatch3r-implementer` Task per module sub-issue body + `hatch3r-ui` (CQ1) + `hatch3r-security` (CQ3 supply-chain slice) for the two cross-cutting axes. Tier 2 (module count ≤8) and Tier 3 (module count >8) both bound the parallel module batch by `max_phase4_parallel`. 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`.
413
401
 
@@ -91,7 +91,7 @@ cost_estimate:
91
91
  estimated_duration_min: <int>
92
92
  ```
93
93
 
94
- 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`; estimation primitives from `src/pipeline/costEstimator.ts`.
94
+ Post-execution, the delta figure lands in the Iteration Summary recap (cost facet); full blocks surface on the `Cost:` exception line beyond ±25%, per `rules/hatch3r-cost-visibility.md`. Token telemetry sources from `src/pipeline/observability.ts`; estimation primitives from `src/pipeline/costEstimator.ts`.
95
95
 
96
96
  ### Effort Override (Decision 17)
97
97
 
@@ -171,23 +171,11 @@ Commit message format: `docs: post-mortem for {incident-slug}` (post-mortem + ru
171
171
 
172
172
  ## Iteration Summary (mandatory output)
173
173
 
174
- 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).
175
-
176
- The 9 sections:
177
-
178
- 1. **Request** — verbatim restatement of the user's ask in one sentence.
179
- 2. **Fan-out + Cost** — `sub_agents_spawned: { count, rationale }` plus the `cost_estimate` / `cost_actuals` / `delta` blocks (see Cost Visibility below).
180
- 3. **Web Research** — every URL fetched with access date + trust tier per `agents/shared/rigor-contract.md` (0 acceptable when no research was needed).
181
- 4. **Files Mutated** — list with diff summary (lines added / removed / files created).
182
- 5. **Gates Passed / Failed** — explicit list per `.claude/rules/capability-lifecycle.md` Gate Checklist.
183
- 6. **Pillar Impact Attribution** — `progress_toward_pillar: <axis>.<pillar_id>+<delta>` per CONSTITUTION §6 Decision 17.
184
- 7. **Verification Commands** — exact commands run with exit codes plus key output lines (≤200 chars).
185
- 8. **Open Questions / Blockers** — explicit `None` if fully closed.
186
- 9. **Learnings Captured** — IDs of any learnings written to `.hatch3r/learnings/` this run per `rules/hatch3r-learning-system.md`.
174
+ Close the run with the recap-contract Iteration Summary per `rules/hatch3r-iteration-summary.md`: a 1–2 line recap (status, outcome, files · sub-agents · gates · cost delta) plus every exception line whose firing condition holds — silence asserts the default. Omitting the recap fails that rule's Validation Gate (CONSTITUTION §6 Decision 23, superseded in place 2026-07-06).
187
175
 
188
176
  ### Cost Visibility (Decision 24)
189
177
 
190
- > 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.
178
+ > 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; the delta figure lands in the Iteration Summary recap (cost facet); full blocks surface on the `Cost:` exception line beyond ±25%, per `rules/hatch3r-cost-visibility.md`.
191
179
 
192
180
  ---
193
181
 
@@ -29,7 +29,7 @@ sub_agents_spawned:
29
29
  | 2. Impact Analysis | `hatch3r-architect` | No | Yes |
30
30
  | 3. Plan Generation | `hatch3r-docs-writer` | No | Yes |
31
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.
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 (file- and contract-level), deterministic aggregation, no shared mutable state.
33
33
 
34
34
  # Migration Plan — Dependency or Framework Upgrade from Assessment to Phased Execution
35
35
 
@@ -83,7 +83,7 @@ cost_estimate:
83
83
  estimated_duration_min: <int>
84
84
  ```
85
85
 
86
- 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`.
86
+ Post-execution actuals + delta land in the Iteration Summary recap (cost facet; full blocks on the `Cost:` exception line beyond ±25%) per `rules/hatch3r-cost-visibility.md` Post-Execution Actuals. Token telemetry sources from `src/pipeline/observability.ts`.
87
87
 
88
88
  ### Effort Override (Decision 17)
89
89
 
@@ -390,30 +390,18 @@ migration-plan is long-running — a Tier 3 multi-major-version or framework mig
390
390
 
391
391
  ## Iteration Summary (mandatory output)
392
392
 
393
- 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).
394
-
395
- The 9 sections:
396
-
397
- 1. **Request** — verbatim restatement of the user's ask in one sentence.
398
- 2. **Fan-out + Cost** — `sub_agents_spawned: { count, rationale }` plus the `cost_estimate` / `cost_actuals` / `delta` blocks (see Cost Visibility below).
399
- 3. **Web Research** — every URL fetched with access date + trust tier per `agents/shared/rigor-contract.md` (0 acceptable when no research was needed).
400
- 4. **Files Mutated** — list with diff summary (lines added / removed / files created).
401
- 5. **Gates Passed / Failed** — explicit list per `.claude/rules/capability-lifecycle.md` Gate Checklist.
402
- 6. **Pillar Impact Attribution** — `progress_toward_pillar: <axis>.<pillar_id>+<delta>` per CONSTITUTION §6 Decision 17.
403
- 7. **Verification Commands** — exact commands run with exit codes plus key output lines (≤200 chars).
404
- 8. **Open Questions / Blockers** — explicit `None` if fully closed.
405
- 9. **Learnings Captured** — IDs of any learnings written to `.hatch3r/learnings/` this run per `rules/hatch3r-learning-system.md`.
393
+ Close the run with the recap-contract Iteration Summary per `rules/hatch3r-iteration-summary.md`: a 1–2 line recap (status, outcome, files · sub-agents · gates · cost delta) plus every exception line whose firing condition holds — silence asserts the default. Omitting the recap fails that rule's Validation Gate (CONSTITUTION §6 Decision 23, superseded in place 2026-07-06).
406
394
 
407
395
  ### Cost Visibility (Decision 24)
408
396
 
409
- > 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.
397
+ > 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 the Iteration Summary recap (cost facet; full blocks on the `Cost:` exception line beyond ±25%) per `rules/hatch3r-cost-visibility.md`.
410
398
 
411
399
  ## Cost estimate (Decision 24)
412
400
 
413
401
  This command emits cost transparency per `rules/hatch3r-cost-visibility.md` and CONSTITUTION §6 Decision 24/29:
414
402
 
415
403
  - **Pre-execution `cost_estimate`** — emitted in Step 0.5 before the first researcher dispatch.
416
- - **Post-execution `cost_actuals` + `delta`** — appended to the iteration summary's Fan-out + Cost section per `rules/hatch3r-iteration-summary.md` §2.
404
+ - **Post-execution `cost_actuals` + `delta`** — appended to the Iteration Summary recap (cost facet; full blocks on the `Cost:` exception line beyond ±25%) per `rules/hatch3r-cost-visibility.md`.
417
405
 
418
406
  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 ≈ 1 (two researchers, architect skipped when no breaking changes); Tier 2 ≈ 3 (two parallel researchers + architect, docs-writer); Tier 3 up to 3 (same fan-out, deeper changelog + incremental-vs-direct analysis). 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`.
419
407