create-issflow 1.10.1 → 1.12.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 (44) hide show
  1. package/bin/cli.js +49 -22
  2. package/package.json +1 -1
  3. package/template/.issflow/README.md +8 -2
  4. package/template/.issflow/agents/planner.md +13 -3
  5. package/template/.issflow/agents/synthesizer.md +17 -8
  6. package/template/.issflow/commands/change-request.md +10 -2
  7. package/template/.issflow/commands/design.md +35 -20
  8. package/template/.issflow/commands/feature.md +33 -13
  9. package/template/.issflow/commands/goal.md +17 -8
  10. package/template/.issflow/commands/overview.md +46 -7
  11. package/template/.issflow/commands/phase.md +99 -32
  12. package/template/.issflow/commands/propose.md +25 -7
  13. package/template/.issflow/commands/quick.md +16 -4
  14. package/template/.issflow/commands/sprint.md +21 -12
  15. package/template/.issflow/commands/synthesize.md +10 -6
  16. package/template/.issflow/flow-config.json +11 -4
  17. package/template/.issflow/hooks/pre-compact.js +4 -0
  18. package/template/.issflow/hooks/session-start.js +84 -123
  19. package/template/.issflow/istartsoft-flow/METHODOLOGY.md +186 -46
  20. package/template/.issflow/models/MODEL-MATRIX.md +33 -0
  21. package/template/.issflow/routing/model-router.js +66 -0
  22. package/template/.issflow/routing/package.json +1 -0
  23. package/template/.issflow/routing/policy.json +69 -0
  24. package/template/.issflow/runtime/HOSTS.md +41 -0
  25. package/template/.issflow/runtime/README.md +150 -0
  26. package/template/.issflow/runtime/package.json +1 -0
  27. package/template/.issflow/runtime/workflow.js +187 -0
  28. package/template/.issflow/scripts/entry-notice.js +20 -0
  29. package/template/.issflow/scripts/package.json +1 -0
  30. package/template/.issflow/scripts/token-lint.js +58 -0
  31. package/template/.issflow/skills/ui-ux-pro-max/SKILL.md +7 -2
  32. package/template/.issflow/skills/ux-design/SKILL.md +4 -0
  33. package/template/.issflow/templates/ARCHITECTURE-template.md +7 -3
  34. package/template/.issflow/templates/PLAN-SCOPED.md +12 -0
  35. package/template/.issflow/templates/UX-PACK-template.md +19 -8
  36. package/template/.issflow/templates/design/DIRECTION.md +22 -0
  37. package/template/.issflow/templates/design/inventory.md +18 -0
  38. package/template/.issflow/templates/design/picker.html +165 -0
  39. package/template/.issflow/templates/design/platforms/line-oa.md +16 -0
  40. package/template/.issflow/templates/design/platforms/mobile-app.md +10 -0
  41. package/template/.issflow/templates/design/platforms/pwa.md +11 -0
  42. package/template/.issflow/templates/design/platforms/web-responsive.md +9 -0
  43. package/template/.issflow/templates/design/screens/SCREEN.md +19 -0
  44. package/template/.issflow/templates/design/tokens.css +47 -0
@@ -81,14 +81,30 @@ Store the round-1 answers as working context — do NOT write OVERVIEW.md yet.
81
81
  — the whole plan is built on these, so lock them first. Show a concise summary and
82
82
  STOP for sign-off (planning always asks, both modes):
83
83
  - **Tech stack** — language · framework · infra · auth · datastore · test + E2E runner
84
+ - **Auth checklist** (if any login/user): provider · session vs token · social/LINE link · roles — must be answered or explicit `n/a`
85
+ - **Surfaces** — default `web-responsive` if unset; also pwa / line-oa / mobile-app as needed
84
86
  - **Architecture** — the pattern (Feature-Based by default) + the folder layout
85
- - **UX direction** — design system / tokens + the wireframe baseline (the frame)
87
+ - **UX direction** — see STEP 5c Direction Picker when UI is in scope
86
88
  - **Data & integrations** — core data model + external services + their limits
87
- - **Conventions** — naming idiom (`code-standards`) + autonomy mode (AUTO / GUIDED)
89
+ - **Conventions** — naming idiom (`code-standards`) + autonomy mode (AUTO / GUIDED) — recommend AUTO for PM-mode builds
88
90
  - **Estimation config** — unit · rate card · currency · contingency (if quoting)
91
+ - **Timezone** — for delivery ETA dates (default `Asia/Bangkok` when project language is th)
89
92
  On any "change X" → revise OVERVIEW.md and re-confirm. Only a signed-off foundation
90
93
  proceeds to the planner. (This is the planning confirmation gate.)
91
94
 
95
+ ### Direction Picker (when UI is in scope)
96
+
97
+ 5c. If the product has UI (default yes unless OVERVIEW says none):
98
+ 1. Copy `.issflow/templates/design/picker.html` → `docs/design/picker.html`.
99
+ 2. Fill placeholders only (names, swatches, fonts, blurbs, anti-patterns). Prefer
100
+ `ui-ux-pro-max` `--design-system` output; if Python 3 is missing, use the three
101
+ fallback presets in the template footer (Calm SaaS / Bold Commerce / Trust Fintech).
102
+ **Do not freehand redesign the HTML/CSS chrome.**
103
+ 3. SHOW me the picker path and STOP for choice (A/B/C).
104
+ 4. On choice: write `docs/design/DIRECTION.md` + `docs/design/tokens.css` from templates;
105
+ set STATE `design-direction: locked <id> <date>`; HISTORY line.
106
+ 5. Internal skip: only if UI truly out of scope — set `design-direction: n/a`.
107
+
92
108
  ### Plan
93
109
 
94
110
  6. Hand OVERVIEW.md + design-research findings to the `planner` subagent.
@@ -96,19 +112,33 @@ proceeds to the planner. (This is the planning confirmation gate.)
96
112
  - Start with Phase 0 (infra setup) only if infra is self-managed; with
97
113
  managed infra, Phase 0 is N/A and the plan starts at Phase 1.
98
114
  - End with a final code phase that contains the deploy task block.
115
+ - Tag each phase `size: S|M|L|XL` and `lane: lite|full` (lite only when no new
116
+ primary UI and not final/security-sensitive).
99
117
 
100
- 7. Create docs/STATE.md:
118
+ 7. Create docs/STATE.md (keep ≤ ~25 lines at top; include delivery board):
101
119
  ```
102
-
103
120
  # STATE
104
121
 
105
122
  phase: 0 (pending)
106
123
  plan: PENDING
124
+ design-direction: locked <id> <date> | PENDING | n/a
107
125
  design: PENDING
108
126
  architecture: PENDING
127
+ surfaces: web-responsive
128
+ timezone: Asia/Bangkok
129
+ delivery:
130
+ package: bootstrap
131
+ agent_eta: none
132
+ phase_etas: []
133
+ status: WAITING_ON_HUMAN
134
+ waiting_for: plan approve
135
+ waiting_since: <ISO-date>
136
+ stale_after: <ISO-date+24h>
137
+ eta_paused: true
138
+ next_human_action: approve PLAN.md
139
+ slip_reason: none
109
140
  completed: project bootstrapped — design research done, double grill done
110
141
  blocker: none
111
-
112
142
  ```
113
143
  (For internal non-quoted work you may set `design: n/a` and `architecture: n/a`
114
144
  instead of PENDING so rule 15 does not block `/phase`.)
@@ -130,10 +160,17 @@ instead of PENDING so rule 15 does not block `/phase`.)
130
160
  11. The plan is the contract the whole AUTO dev loop builds against, so it ends with a
131
161
  human sign-off — the planning twin of the `/propose` commercial gate.
132
162
 
133
- - SHOW me PLAN.md (and note any open risks the planner flagged). **STOP for approval.**
163
+ **Plan-Ready checklist** (must pass before you ask me to approve):
164
+ - Every phase has testable acceptance (no vague “make it good”)
165
+ - No TBD on auth / money / PII / primary surfaces
166
+ - If UI in scope: `design-direction` locked (or n/a) and screen IDs listed or stubbed
167
+ - Phase dependencies clear; size + lane tags present
168
+ - Open risks listed — material open questions block approve
169
+
170
+ - SHOW me PLAN.md + Plan-Ready result. **STOP for approval.**
134
171
  - On **approval**: record the sign-off in three places —
135
172
  1. stamp the PLAN.md header `> Approval: approved <YYYY-MM-DD> v1`;
136
- 2. set `plan: approved <YYYY-MM-DD>` in docs/STATE.md;
173
+ 2. set `plan: approved <YYYY-MM-DD>` in docs/STATE.md; clear waiting_for / set delivery status AGENT_ACTIVE when build starts;
137
174
  3. append `<YYYY-MM-DD> plan v1 approved` to docs/HISTORY.md (date-first, to
138
175
  match the other HISTORY lines).
139
176
  Only now may `/phase` / `/sprint` run.
@@ -144,7 +181,9 @@ instead of PENDING so rule 15 does not block `/phase`.)
144
181
 
145
182
  Optional next steps (client / quoted work):
146
183
  1. `/propose` — proposal + estimate (asks rate in chat; client docs stay totals-only).
184
+ Screen appendix MUST use locked `docs/design/tokens.css` + screen IDs.
147
185
  2. `/design` — UX pack + architecture approve gates (hard rule 15) before `/phase`.
186
+ Upgrade existing frames — do not re-roll direction if locked.
148
187
 
149
188
  Internal or personal projects may skip `/propose` and set `design: n/a` /
150
189
  `architecture: n/a` in STATE, then go to `/phase`.
@@ -1,15 +1,21 @@
1
1
  ---
2
- description: Run one phase end-to-end. TDD phases run SCAFFOLD -> RED -> GREEN; non-TDD phases run IMPLEMENT -> TEST. Both with the debug circuit breaker and the regression guard at CLOSE.
3
- argument-hint: [phase number · "dry-run" to preview what the phase would do]
2
+ description: Run one phase end-to-end. TDD phases run SCAFFOLD -> RED -> GREEN; non-TDD phases run IMPLEMENT -> TEST. Supports --lite. ETA + stuck/SLIP reporting required.
3
+ argument-hint: [phase number · "lite" · "dry-run"]
4
4
  ---
5
5
 
6
6
 
7
7
  Caveman ULTRA mode. You are the ORCHESTRATOR. Route work to subagents —
8
- you do NOT implement or debug yourself.
8
+ use native isolated workers when available; otherwise use sequential role passes
9
+ per METHODOLOGY → Host capabilities and continuity.
10
+ Speak to the human as **PM** (status / ETA / blockers).
9
11
 
10
12
  Note: subagents cannot talk to the user. Only YOU can.
11
13
 
12
- Target phase: $ARGUMENTS (default: the phase marked pending in docs/PLAN.md)
14
+ Target phase: $ARGUMENTS (default: next ready phase in the approved plan,
15
+ reconciled with execution state; do not rely on stale status in a hashed plan).
16
+ LANE: if args contain `lite` OR PLAN phase has `lane: lite` → LITE mode.
17
+ LITE forbidden when: final phase · new primary UI flow · auth/money/PII surface.
18
+ LITE still requires ETA + DoD + (if any UI touch) task check happy path.
13
19
 
14
20
  ---
15
21
 
@@ -24,7 +30,9 @@ run, commit, deploy nothing. (METHODOLOGY → Dry-run.)
24
30
 
25
31
  ## 0. PRE-FLIGHT
26
32
 
27
- a. PLAN-APPROVAL CHECK (hard rule 13): Read the docs/PLAN.md `> Approval:` header.
33
+ a. PLAN-APPROVAL CHECK: apply METHODOLOGY → Plan-scoped approvals first: verify
34
+ ACTIVE-PLAN, exact revision/digest and allowed paths when present. A legacy
35
+ docs/PLAN.md `> Approval:` header is fallback only, never an override.
28
36
  Still `PENDING` (or no header) -> STOP. The plan is not signed off; no phase may
29
37
  start. Route me to the `/overview` PLAN-APPROVAL gate (or `/replan` then re-approve).
30
38
  Approved -> continue.
@@ -42,27 +50,57 @@ a2. DESIGN + ARCHITECTURE GATES (hard rule 15): Read `docs/STATE.md` for `design
42
50
  b. INFRA CHECK (phases > 0): Read the declared infra in docs/OVERVIEW.md.
43
51
  - Managed infra -> confirm it is reachable; no provisioning step is needed.
44
52
  - Self-managed infra -> confirm Phase 0 (infra) ran and is healthy.
45
- Surface infra + auth status before any work. Blocked infra -> STOP.
53
+ Surface infra + auth status before any work. After bounded readiness retries,
54
+ blocked infra parks this phase; return control to a goal/sprint driver for
55
+ independent approved work. Never treat an unavailable service as tested.
46
56
 
47
57
  c. PHASE STATE CHECK: Read docs/STATE.md and docs/PLAN.md.
48
58
  - No phase in progress, requested is next pending -> START at step 1.
49
- - Same phase in-progress -> RESUME from STATE.md "next action".
50
- - Different phase in-progress -> STOP. Tell me which phase is open.
59
+ - Same phase in-progress -> reconcile worktree, approval, and checkpoint
60
+ evidence before resuming STATE.md "next action"; retain retry counters.
61
+ - Different phase in-progress -> finish it first unless parked and the driver
62
+ selected this independently approved phase; preserve both checkpoints.
51
63
  - Out of dependency order -> AUTO: ignore the request and run the next pending
52
64
  phase in PLAN order. GUIDED: STOP, warn, proceed only if I confirm.
53
65
  - Phase not in PLAN.md -> STOP. Suggest /overview or /replan.
54
66
 
55
- d. FINAL PHASE CHECK: Read docs/PLAN.md. Is this the last phase (no further
56
- pending phases after this one)? Record this as IS_FINAL_PHASE=true/false.
67
+ d. FINAL PHASE CHECK: Reconcile the approved plan with execution state. Is this
68
+ the last planned phase? Record IS_FINAL_PHASE=true/false; earlier parked units
69
+ still block package completion even when this is the final phase.
70
+
71
+ e. DELIVERY / ETA BOARD (required before RESEARCH):
72
+ Update `docs/STATE.md` `delivery:` block:
73
+ - First inspect any existing wait: while its gate remains unresolved, retain
74
+ WAITING_ON_HUMAN (or WAITING_STALE after `stale_after`), surface the next
75
+ human action, and park this unit. Resume AGENT_ACTIVE only when the gate is
76
+ resolved and execution actually starts; then clear resolved waiting fields.
77
+ - Set `agent_eta` and `phase_etas` using `flow-config.json` → `delivery.phaseHours`
78
+ by phase size (S/M/L/XL) and project timezone. Preserve the previous ETA
79
+ before recalculating so an overdue estimate is reported as SLIP, not hidden.
80
+ - Stage line: `stage: RESEARCH | next: … | blocker: none`
81
+ - Assumption budget: max `assumptionBudgetPerPhase` (default 3). Exceed → park
82
+ this unit for `/replan` or human; independent approved driver work may continue.
83
+ - If status was WAITING_ON_HUMAN and `stale_after` passed → set `WAITING_STALE`,
84
+ tell the human `next_human_action`, do not pretend AI is still building.
85
+ - If wall-clock past `agent_eta` while AGENT_ACTIVE → **SLIP**: report reason +
86
+ new ETA or BLOCKED. Never silently continue past ETA.
87
+
88
+ f. LITE shortcuts (when LITE): skip dedicated researcher if unknowns are none;
89
+ skip browser E2E if no UI. Keep every applicable CLOSE gate, including regression,
90
+ endpoint coverage, lint, secrets, and UI task checks. LITE never waives approval,
91
+ evidence, retry, or security requirements. Full path otherwise.
57
92
 
58
93
 
59
94
  ---
60
95
 
61
96
  ## 1. RESEARCH + TDD APPLICABILITY
62
97
 
63
- Dispatch `researcher` in IMPL mode scoped to this phase.
98
+ If LITE and no open unknowns: skip researcher; note "lite: research skipped" in STATE.
99
+ Else dispatch `researcher` in IMPL mode scoped to this phase.
64
100
  Returns terse summary + path. Read the file only if needed.
65
- Unknowns block the phase -> re-dispatch narrowed. No guessing.
101
+ Unknowns block the phase -> re-dispatch narrowed within the methodology retry
102
+ budget, then park if unresolved. No guessing or unbounded research.
103
+ After each major stage change, rewrite STATE `stage:` + one-line progress.
66
104
 
67
105
  SECURE SDLC (design): if this phase touches a TRUST BOUNDARY (auth, untrusted input,
68
106
  data store, money, PII), threat-model it now (`security` skill) and fold the abuse
@@ -114,13 +152,13 @@ NOT edit them). Fill to green. Budget 3, WARN@2, STUCK@3.
114
152
 
115
153
  ## 3c. TEST (e2e) — FRONTEND phases only
116
154
 
117
- If this phase ships UI: dispatch `e2e-runner` (BLIND) to write + run browser E2E
118
- for the slice using the declared E2E runner (it brings the test stack up/down
119
- itself). Then run the `ux-design` cookbook + wireframe check on the new UI
120
- (hard rule 9): the UI must match the wireframe frame and pass the cookbook
121
- (tokens, a11y/WCAG AA, states, breakpoints). A `ux-design` BLOCK is a GATE FAIL.
122
- Do not re-run `ui-ux-pro-max` `--design-system` here — the look is locked in the
123
- approved UX pack.
155
+ If this phase ships UI:
156
+ - FULL: dispatch `e2e-runner` (BLIND) for browser E2E of the slice.
157
+ - LITE with UI touch: skip full E2E only if a **task check** still proves the
158
+ primary user job (scripted or manual-recorded happy path) — never skip both.
159
+ - Always run the `ux-design` cookbook + wireframe check (hard rule 9). Tokens must
160
+ come from `docs/design/tokens.css` — raw hex/spacing in components = BLOCK.
161
+ Do not re-run `ui-ux-pro-max` `--design-system` here — look is locked.
124
162
  Non-frontend phase -> skip §3c.
125
163
 
126
164
  PHASE GATE (rule 5) -> go to §4/§5/§6 (see GATE below).
@@ -133,8 +171,9 @@ PHASE GATE (rule 5) -> go to §4/§5/§6 (see GATE below).
133
171
 
134
172
  Dispatch `implementer` (legacy mode) with phase spec + research summary.
135
173
  Returns STUCK -> go to ESCALATE.
136
- If IS_FINAL_PHASE: phase spec includes the deploy task; confirm the return
137
- includes "deployed URL" before proceeding.
174
+ If IS_FINAL_PHASE: prepare the deploy task, but do not deploy without explicit
175
+ release authorization. Record deployment as pending approval when not authorized;
176
+ never require a fabricated deployed URL to advance local verification.
138
177
 
139
178
  ## 3N. TEST (blind)
140
179
 
@@ -145,7 +184,8 @@ spec — never reads the logic. (e2e-runner only if frontend.)
145
184
 
146
185
  ## GATE (both paths)
147
186
 
148
- PHASE GATE = current-phase REAL API suite passes AND (if frontend) E2E passes AND
187
+ PHASE GATE = current-phase REAL API suite passes AND (if frontend: E2E passes
188
+ OR the permitted LITE task check has recorded passing evidence) AND
149
189
  (if frontend) the `ux-design` cookbook + wireframe check passes AND the
150
190
  accumulated mock regression corpus stays green AND every docs/ENDPOINTS.md
151
191
  entry has a regression test (checked at CLOSE).
@@ -170,10 +210,11 @@ Dispatch `debugger` (isolated context) on the specific failure.
170
210
  (it is token-expensive); re-dispatch `debugger` with the findings, budget 3.
171
211
  STILL STUCK (or already spent this phase's unstuck): log the issue (root cause +
172
212
  every failed hypothesis) to ISSUES.md,
173
- mark the slice `BLOCKED` in PLAN, and move to the next INDEPENDENT slice/phase.
174
- Add it to the batched end-of-run report. HARD-STOP (pause for me) ONLY if no
175
- independent work remains, or the blocker is on the hard-stop list
176
- (security / irreversible / contradictory spec).
213
+ mark the slice `BLOCKED` in execution state without rewriting the approved plan,
214
+ then return to the goal/sprint driver for the next INDEPENDENT approved unit.
215
+ A standalone phase reports the blocker rather than starting unrelated work.
216
+ Hard stops park affected work and dependents; do not bypass them or halt safe
217
+ independent driver work. Retain attempt counts across resume.
177
218
 
178
219
  **GUIDED:**
179
220
  FIRST STUCK: STOP. Present the problem, 3 failed hypotheses, the debugger's
@@ -193,6 +234,13 @@ REGRESSION GATE (before closing — Feature 3):
193
234
  - IF IS_FINAL_PHASE: additionally run `scripts/regression.sh --real` (full real
194
235
  corpus). A failure blocks close.
195
236
 
237
+ UI TASK CHECK (if this phase touched UI — required even in LITE):
238
+ - Happy path: primary user can complete the phase's user-visible job without guessing.
239
+ - Viewport: primary breakpoint (≥MD) + <SM if mobile is primary.
240
+ - Tokens: run `node .issflow/scripts/token-lint.js` to check unlisted hex/RGB colors.
241
+ Review semantic token usage and spacing separately; the script does not verify those.
242
+ - Fail → FIX; do not close.
243
+
196
244
  CODE-STANDARDS GATE (rule 12): the formatter + linter are clean (the language's
197
245
  standard tool); names follow the language's own idiom; the code conforms to the
198
246
  declared architecture (Feature-Based by default). Lint/format errors or idiom
@@ -206,7 +254,13 @@ SECURITY GATE (rule 11 — Secure SDLC build stage):
206
254
  - Open HIGH/CRITICAL findings BLOCK the close -> route to FIX. Deploying to prod
207
255
  with open high/critical findings is a hard-stop (human sign-off).
208
256
 
209
- Mark phase `done` in docs/PLAN.md.
257
+ Record phase `done` in execution state only if all required gates passed. Do not
258
+ edit approval-hashed plan content for progress; pending deployment remains pending
259
+ and prevents declaring a deployment-inclusive phase complete.
260
+ DELIVERY UPDATE: only after all required gates pass, set this phase's
261
+ `phase_etas` entry done; refresh the next ready phase's `agent_eta`. Set
262
+ `delivery.status: DONE` only if the package is complete. Otherwise preserve
263
+ WAITING/BLOCKED and its next action; clear only resolved waiting fields.
210
264
 
211
265
  SPRINT STANDUP (if a sprint is active — STATE.md shows `sprint: <n> (active)`):
212
266
  fire the `/sprint standup` tick — append the one-line standup to
@@ -239,27 +293,40 @@ IF IS_FINAL_PHASE — FINAL CLOSE sequence:
239
293
  - Full endpoint catalogue: docs/ENDPOINTS.md
240
294
  - Project history: docs/HISTORY.md
241
295
  ```
242
- Tell me the project is complete and ready to use.
296
+ Use the PROJECT COMPLETE / READY TO USE wording only if every required unit,
297
+ check, and authorized deployment is actually complete. Otherwise report local
298
+ implementation verified, pending release/approval, blocked, or not run, with
299
+ evidence. Include only observed URLs and never include secret auth values.
243
300
 
244
301
  ELSE (not final phase):
245
302
 
246
303
  Run `/synthesize`.
247
- Tell me phase done + the next phase. Recommend `/clear` then `/phase` next.
304
+ Report phase result + next approved phase. Under `/goal run` or `/sprint run`,
305
+ checkpoint and return to the driver to continue without routine confirmation.
306
+ A standalone `/phase` ends here; use a context reset only if the host supports it.
248
307
 
249
308
  ---
250
309
 
251
310
  ## STATE CHECKPOINTING
252
311
 
253
- After each step, update docs/STATE.md:
312
+ After each step, checkpoint per METHODOLOGY → Execution contract (including
313
+ approval digest, branch/base, evidence, attempts and remaining budget). Update
314
+ docs/STATE.md without losing other lanes:
254
315
  ```
255
316
 
256
317
  phase: <n> (in progress)
257
318
  plan: approved <date> ← carry forward; never drop the rule-13 sign-off record
258
319
  tdd: <true|false>
320
+ stage: <RESEARCH|SCAFFOLD|RED|GREEN|TEST|FIX|CLOSE>
259
321
  completed: <steps done so far>
260
322
  next: <exact next step>
261
323
  blocker: <none or open issue>
324
+ delivery: ← preserve + update; never drop
325
+ agent_eta: <date>
326
+ status: AGENT_ACTIVE | WAITING_ON_HUMAN | WAITING_STALE | BLOCKED | SLIP | DONE
327
+ …
262
328
 
263
329
  ```
264
- Keep STATE.md small — overwrite, do not append. Preserve the `plan:` line on every
265
- overwrite (the PLAN-APPROVAL record, hard rule 13); do not blank it.
330
+ Keep STATE.md small — overwrite, do not append. Preserve `plan:` and `delivery:`
331
+ on every overwrite. When entering WAITING_ON_HUMAN: set waiting_for, waiting_since,
332
+ stale_after (configured `delivery.staleAfterHours`, default 24h), eta_paused: true, next_human_action (one sentence).
@@ -24,6 +24,11 @@ and its `> Approval:` header still reads `PENDING` (or is missing), STOP and rou
24
24
  to the `/overview` PLAN-APPROVAL gate before quoting — pricing an unapproved plan
25
25
  re-prices on every revision.
26
26
 
27
+ DIRECTION CHECK (UI in scope): STATE `design-direction:` must be `locked …` (or
28
+ explicit `n/a` if no UI). Still PENDING → STOP and run overview STEP 5c Direction
29
+ Picker first. Screen appendix must use `docs/design/tokens.css` colors — never invent
30
+ a parallel palette.
31
+
27
32
  ## STEP 1 — SCOPE
28
33
  List the deliverables (features / epics) from OVERVIEW / PRD. Mark each
29
34
  **in-scope** or **out-of-scope** explicitly — naming out-of-scope items now is what
@@ -32,9 +37,15 @@ prevents silent scope creep (and grounds change-order re-pricing later).
32
37
  ## STEP 2 — PHASE BREAKDOWN (internal)
33
38
  Derive the vertical-slice phases (or read `docs/PLAN.md` if it exists). Size each:
34
39
  - complexity: **S | M | L | XL**
35
- - effort: an ideal-days RANGE (e.g. 2–3d), + story points if your team uses them
40
+ - **scope_effort** (axis A): ideal-days RANGE for commercial value (human-equivalent)
41
+ - **agent_delivery** (axis B): agent-active hours/days from `flow-config.json` →
42
+ `delivery.phaseHours` (S/M/L/XL) — wall-clock when AI may work, **excluding**
43
+ waiting-on-human gates
36
44
  - risk / unknowns: what could move the estimate
37
45
 
46
+ Show **both axes in chat to the human** every time. Client price uses **A only**.
47
+ Client timeline may show B as “AI-assisted delivery (if approvals are timely)”.
48
+
38
49
  Keep this sizing for the **chat math**. Do **not** dump every PLAN phase onto the
39
50
  client table — collapse into packages in STEP 5.
40
51
 
@@ -109,9 +120,12 @@ production is up within the scope on this quote. **Never** construction wording
109
120
  ## Scope — in-scope: … | out-of-scope: …
110
121
  ## Packages — table: package | cost
111
122
  — or package | estimated | billed | cost (only if hours columns requested)
112
- ## Total — <low>–<high> ← totals only; no “incl. X% contingency”
113
- ## Timeline — <estimate>, dependency order
114
- ## Assumptions — …
123
+ ## Delivery clocks (internal + chat; client page may show demo dates only)
124
+ — per package: scope_effort (A · pricing) | agent_delivery (B · agent-active)
125
+ | demo_by (calendar, assuming human gates ≤ staleAfterHours)
126
+ ## Total — <low>–<high> ← totals only from A; no “incl. X% contingency”
127
+ ## Timeline — demo_by per package + dependency order (B pauses while waiting on humans)
128
+ ## Assumptions — … (if human gates slower than SLA, demo_by slips — not an agent hang)
115
129
  ## Exclusions — … (hosting/database: client pays provider, if that was the answer)
116
130
  ## Payment — software delivery events + the asked split (if any)
117
131
  ## Screens — docs/proposal.html pages 2–N (or “none — no UI in scope”)
@@ -149,14 +163,18 @@ production is up within the scope on this quote. **Never** construction wording
149
163
  **Screen appendix (required when UI is in scope)** — same `docs/proposal.html`,
150
164
  not a second signable file. After page 1's page-break, emit `.sheet.screens`
151
165
  into `{{SCREEN_SHEETS}}`:
152
- - Build frames from **PLAN + OVERVIEW** modules/capabilities (empty chrome is
153
- fine). Do **not** wait for UX-PACK (that gate is after sign-off).
166
+ - Build frames from **PLAN + OVERVIEW** with stable **screen IDs** (`S-01`…).
167
+ - Apply locked **token colors** from `docs/design/tokens.css` into the template
168
+ CSS variables / inline token slots — same direction the build will use.
154
169
  - Cover **every** in-scope module and capability — not a 4–8 frame sampler.
155
170
  - Group sheets by package; module bar on each sheet; numbered short captions
156
171
  under frames.
157
- - Label: not pixel-binding. Sign on page 1 only. **No emoji as icons.**
172
+ - Label: structure-binding via screen IDs; visuals follow locked direction (still
173
+ not pixel-perfect). Sign on page 1 only. **No emoji as icons.**
158
174
  - Use the template's desk/phone/sidebar/card/table CSS. Do not invent a
159
175
  parallel stylesheet.
176
+ - Per package row (internal + chat): `scope_effort` · `agent_delivery` ·
177
+ `demo_by` (calendar date assuming human gates answer within staleAfterHours).
160
178
 
161
179
  Print-ready (Ctrl/Cmd-P → A4 → Save as PDF). Keep PROPOSAL.md and proposal.html
162
180
  in sync.
@@ -25,15 +25,27 @@ Steps:
25
25
  understand it · file(s) you'll touch · blast radius — and WAIT for my confirm.
26
26
  One cheap turn beats redoing a misunderstood edit. (Already confirmed in this
27
27
  conversation? say so and proceed — don't re-ask the same understanding.)
28
- 1. grep docs/ISSUES.md for anything related.
28
+ 1. Verify applicable plan revision/digest and allowed paths per METHODOLOGY →
29
+ Plan-scoped approvals; intake confirmation alone cannot override that gate.
30
+ grep docs/ISSUES.md for anything related.
31
+ 1b. If the change touches UI: read `docs/design/tokens.css` + inventory when present.
32
+ Use semantic tokens only — no raw hex/spacing literals in components.
29
33
  2. Make the change. Smallest diff that works.
30
34
  3. Run it — lint/typecheck/smoke. Show me result.
31
35
  4. REGRESSION GUARD: run `scripts/regression.sh` (mock corpus). No corpus in this
32
36
  repo? run the project's own test suite instead (or the touched area's tests).
33
- A break BLOCKS the `/quick` — surface it to me and stop. No agent chain is added.
34
- 5. Error you cannot fix in 2 tries -> STOP. Recommend `/phase`.
37
+ A break blocks completion, not the first repair attempt: fix within the approved
38
+ scope and rerun the failed check plus regression, using the two-try budget below.
39
+ No agent chain is added.
40
+ 5. Error you cannot fix in 2 tries -> park this unit with failed hypotheses,
41
+ evidence, and the next action. Recommend `/phase`; do not expand scope or
42
+ reset the budget automatically. Under an approved goal, return the blocker
43
+ to its driver so independent units can continue.
35
44
  6. Change revealed a bug -> `/log-issue`.
36
45
  7. ARCHITECTURE SELF-CHECK: touched an agent, hook, command, or workflow rule?
37
46
  YES -> `/log-decision`.
38
47
 
39
- No STATE.md rewrite, no synthesize, no /clear needed.
48
+ No full STATE.md rewrite, synthesize, or /clear needed. If interrupted or blocked,
49
+ leave a minimal checkpoint (scope, diff, tests, attempts, next action) per the
50
+ methodology Execution contract; preserve existing state. Report done only after
51
+ required checks pass, otherwise blocked/not run with evidence.
@@ -50,7 +50,9 @@ velocity table). Create `docs/sprints/` if absent. STATE.md carries the active s
50
50
  =====================================================================
51
51
  ## §1 — SPRINT PLANNING (ceremony)
52
52
 
53
- Pre: `docs/PLAN.md` exists AND its `> Approval:` header reads `approved …` (the
53
+ Pre: verify the active plan revision/digest and allowed paths per METHODOLOGY →
54
+ Plan-scoped approvals. For legacy plans only, `docs/PLAN.md` exists AND its
55
+ `> Approval:` header reads `approved …` (the
54
56
  PLAN-APPROVAL gate, hard rule 13). Still `PENDING` / missing → STOP, route to the
55
57
  `/overview` plan-approval gate. A sprint only SLICES an already-signed-off plan.
56
58
 
@@ -58,7 +60,7 @@ a. **Estimate (one-time, lazy).** Every pending PLAN phase needs a points estima
58
60
  (Fibonacci `1 2 3 5 8`, relative effort from the phase `slice` + `acceptance`
59
61
  size; a phase that feels `>8` is too big — note it for `/replan` to split). If the
60
62
  planner already wrote `[N pts]` tags, reuse them; otherwise assign now and write
61
- them back into PLAN.md next to each phase header.
63
+ them into the sprint artifact, leaving the approved plan unchanged.
62
64
 
63
65
  b. **Capacity.** Read `docs/sprints/VELOCITY.md`.
64
66
  - Have history → capacity = rolling-average completed velocity (last ≤3 sprints).
@@ -73,7 +75,8 @@ c. **Commit.** Walk the PLAN in dependency order, pull pending phases into this
73
75
 
74
76
  d. **Write** `docs/sprints/sprint-<n>.md` from the template below; set
75
77
  `status: active`; seed the burndown tick 0 = total committed points. Group the
76
- committed phases under a `## Sprint <n>` header in PLAN.md if not already grouped.
78
+ committed phases in the sprint artifact, referencing the immutable approved
79
+ plan revision. Do not add sprint headers to approval-hashed PLAN content.
77
80
  Update STATE.md: `sprint: <n> (active)`.
78
81
 
79
82
  AUTO: auto-commit the computed backlog, log the goal + points + capacity, continue.
@@ -136,7 +139,8 @@ Inspect-and-adapt on the PROCESS, not the product. Write the `## Retro` block:
136
139
  - **estimate accuracy** — committed vs completed points; note phases that blew their
137
140
  estimate so the next sprint's poker is calibrated.
138
141
 
139
- AUTO: auto-apply the routed actions (log/replan) and continue. GUIDED: list actions,
142
+ AUTO: auto-apply in-scope logging/process actions and continue. A replan is a
143
+ proposal requiring the plan gate, not permission to change approved scope. GUIDED: list actions,
140
144
  confirm before applying.
141
145
 
142
146
  =====================================================================
@@ -156,11 +160,13 @@ d. Update STATE.md: clear the active sprint (or set the next one if `/sprint run
156
160
  =====================================================================
157
161
  ## §RUN — AUTO END-TO-END DRIVER (the headline: "do all the process automatically")
158
162
 
159
- `/sprint run [n]` drives one full sprint — or, if you keep going, every remaining
160
- sprint until the PLAN is exhausted — with NO human stop except a hard-stop:
163
+ `/sprint run [n]` drives the requested approved sprint scope. Continue across
164
+ sprints only when that scope was authorized. Establish finite unit/retry budgets
165
+ before execution using the methodology Execution contract; preserve them on resume.
166
+ Routine phase and ceremony boundaries need no new confirmation:
161
167
 
162
168
  ```
163
- loop while pending phases remain in PLAN.md:
169
+ loop while approved, dependency-ready units remain and run budget permits:
164
170
  1. §1 PLANNING → commit the next sprint from PLAN + velocity
165
171
  2. for each committed phase, in dependency order:
166
172
  run /phase <p> → the full build loop (its own gates + circuit breaker)
@@ -170,11 +176,14 @@ loop while pending phases remain in PLAN.md:
170
176
  3. §3 REVIEW → demo + boundary audits (fix blockers, re-audit)
171
177
  4. §4 RETRO → routed actions, applied
172
178
  5. §5 CLOSE → velocity + carry-forward + HISTORY
173
- 6. /synthesize → suggest /clear (token reset at the sprint boundary, like a phase)
174
- AUTO: start the next sprint automatically. GUIDED: stop, report, wait.
175
- HARD-STOP at any point: deploy/irreversible/outbound action, security-sensitive
176
- change, contradictory spec, or debug budget spent with no independent slice left →
177
- pause, surface the consolidated report, hand to the human.
179
+ 6. /synthesize → checkpoint evidence, attempts, remaining budget and next action
180
+ (reset context only with a supported host mechanism; preserve resume state)
181
+ AUTO: start the next sprint only within the authorized run scope and budget.
182
+ GUIDED: stop, report, wait.
183
+ HARD-STOP: park the affected action and its dependents; continue only safe,
184
+ independently approved work. Stop the run for exhausted budget, a run-wide blocker,
185
+ or no actionable units. Never recycle a blocked phase into the next sprint without
186
+ new evidence or a resolved prerequisite. Report partial completion truthfully.
178
187
  ```
179
188
 
180
189
  When the last PLAN phase is `accepted`, the build is sprint-complete → recommend
@@ -6,21 +6,25 @@ Caveman ULTRA mode.
6
6
 
7
7
  Trigger: end of a phase, or any time STATE.md / ISSUES.md feel bloated.
8
8
 
9
- Dispatch the `synthesizer` subagent.
9
+ Dispatch the `synthesizer` subagent when supported; otherwise run its checklist
10
+ sequentially per METHODOLOGY → Host capabilities and continuity. Preserve every
11
+ active/parked lane checkpoint, evidence record, approval digest, and retry budget.
10
12
 
11
13
  For a normal phase: it rewrites STATE.md, dedups ISSUES.md, prunes snapshots,
12
14
  appends to HISTORY.md.
13
15
 
14
16
  For the FINAL phase (no further pending phases): also pass the signal
15
17
  "FINAL PHASE" so the synthesizer runs the extended pass — updating OVERVIEW.md
16
- and README.md to reflect the completed project state.
18
+ and README.md to reflect the verified project state, including any pending
19
+ deployment or blocked work. Last phase does not imply completed project.
17
20
 
18
- To determine if this is the final phase: read docs/PLAN.md. If no phases remain
19
- with status "pending" after the current one, it is the final phase.
21
+ To determine if this is the final phase, reconcile the approved plan with execution
22
+ state. Do not edit approval-hashed plan content to track completion.
20
23
 
21
- When synthesizer returns "safe to /clear: yes", tell me:
24
+ When synthesizer confirms durable checkpoints are safe for a context reset, report:
22
25
  - before/after line counts
23
26
  - whether the final-pass ran
24
- - that I can now run /clear (or proceed to the endpoint summary if final phase)
27
+ - next action; under a goal/sprint driver, return control and continue approved work
28
+ - reset only if the host supports it and it is needed; otherwise use the checkpoint
25
29
 
26
30
  If it returns anything unsafe, show me what and stop.
@@ -1,12 +1,19 @@
1
1
  {
2
2
  "context": {
3
3
  "window": 1000000,
4
- "warnPct": 60,
5
- "gatePct": 78,
6
- "_note": "window = this session's real context window. THIS repo runs Opus 4.8 [1m] but the transcript records model id as 'claude-opus-4-8' (no [1m] tag), so auto-detect (window:0) would wrongly assume 200000 and false-gate around 156k. Set it explicitly here. Kit template default stays 200000 — override per your model. warnPct = soft non-blocking nudge. gatePct = hard PreToolUse block on NEW build work (Edit/Write to SOURCE files). Checkpoint paths (docs/**, STATE/ISSUES/snapshots) and all Bash (git) are never blocked; Task delegation is never gated (a subagent isolates noise and shrinks orchestrator context)."
4
+ "warnPct": 55,
5
+ "gatePct": 70,
6
+ "injectMaxLines": 25,
7
+ "_note": "window = session context. Template default for new installs should be 200000 unless overridden. warnPct soft nudge; gatePct hard block on NEW source Edit/Write. Prefer /synthesize + /clear (handoff) over compact near gate. Checkpoint docs/** never gated."
8
+ },
9
+ "delivery": {
10
+ "staleAfterHours": 24,
11
+ "phaseHours": { "S": 2, "M": 4, "L": 8, "XL": 16 },
12
+ "assumptionBudgetPerPhase": 3,
13
+ "_note": "Agent-active ETA uses phaseHours by size tag. Waiting-on-human pauses ETA; after staleAfterHours status becomes WAITING_STALE."
7
14
  },
8
15
  "sprint": {
9
16
  "defaultCapacity": 8,
10
- "_note": "Sprint layer (/sprint). defaultCapacity = points committed to the FIRST sprint before any velocity history exists; later sprints size to the rolling completed-velocity average. Optional — /sprint falls back to 8 if this block is absent."
17
+ "_note": "Sprint layer (/sprint). defaultCapacity = points for first sprint before velocity exists."
11
18
  }
12
19
  }
@@ -18,12 +18,16 @@ const stamp = `${d.getFullYear()}${p2(d.getMonth() + 1)}${p2(d.getDate())}-${p2(
18
18
  const snap = path.join('docs/.snapshots', `precompact-${stamp}.md`);
19
19
 
20
20
  const state = read('docs/STATE.md');
21
+ const workflow = read('docs/WORKFLOW.json');
21
22
  const body = [
22
23
  `# Pre-compact snapshot ${stamp}`, '',
23
24
  '## Git',
24
25
  sh('git status --short').replace(/\n+$/, ''),
25
26
  sh('git diff --stat').replace(/\n+$/, ''),
26
27
  '',
28
+ '## Durable workflow checkpoint',
29
+ workflow === null ? '(no docs/WORKFLOW.json)' : 'Resume from docs/WORKFLOW.json; reconcile running tasks before retrying. This snapshot is not an approval or a replacement checkpoint.',
30
+ '',
27
31
  '## STATE.md at compact time',
28
32
  state !== null ? state.replace(/\n$/, '') : '(no STATE.md)',
29
33
  '',