create-issflow 1.10.1 → 1.11.1

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 (34) hide show
  1. package/bin/cli.js +37 -12
  2. package/package.json +1 -1
  3. package/template/.issflow/README.md +4 -1
  4. package/template/.issflow/agents/planner.md +6 -1
  5. package/template/.issflow/agents/synthesizer.md +6 -4
  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 +6 -1
  9. package/template/.issflow/commands/overview.md +46 -7
  10. package/template/.issflow/commands/phase.md +50 -13
  11. package/template/.issflow/commands/propose.md +25 -7
  12. package/template/.issflow/commands/quick.md +2 -0
  13. package/template/.issflow/flow-config.json +11 -4
  14. package/template/.issflow/hooks/session-start.js +64 -128
  15. package/template/.issflow/istartsoft-flow/METHODOLOGY.md +57 -17
  16. package/template/.issflow/models/MODEL-MATRIX.md +33 -0
  17. package/template/.issflow/routing/model-router.js +66 -0
  18. package/template/.issflow/routing/policy.json +69 -0
  19. package/template/.issflow/scripts/entry-notice.js +20 -0
  20. package/template/.issflow/scripts/token-lint.js +58 -0
  21. package/template/.issflow/skills/ui-ux-pro-max/SKILL.md +7 -2
  22. package/template/.issflow/skills/ux-design/SKILL.md +3 -0
  23. package/template/.issflow/templates/ARCHITECTURE-template.md +7 -3
  24. package/template/.issflow/templates/PLAN-SCOPED.md +12 -0
  25. package/template/.issflow/templates/UX-PACK-template.md +19 -8
  26. package/template/.issflow/templates/design/DIRECTION.md +22 -0
  27. package/template/.issflow/templates/design/inventory.md +18 -0
  28. package/template/.issflow/templates/design/picker.html +165 -0
  29. package/template/.issflow/templates/design/platforms/line-oa.md +16 -0
  30. package/template/.issflow/templates/design/platforms/mobile-app.md +10 -0
  31. package/template/.issflow/templates/design/platforms/pwa.md +11 -0
  32. package/template/.issflow/templates/design/platforms/web-responsive.md +9 -0
  33. package/template/.issflow/templates/design/screens/SCREEN.md +19 -0
  34. package/template/.issflow/templates/design/tokens.css +47 -0
package/bin/cli.js CHANGED
@@ -156,6 +156,19 @@ function adapterCursor() {
156
156
  '(mirror of `.issflow/commands/`). Caveman ULTRA mode; apply the `karpathy-guidelines`',
157
157
  'and `ux-design` skills. See `AGENTS.md` for the role/command/skill map.', '',
158
158
  ].join('\n'));
159
+ writeFile('.cursor/rules/issflow-gates.mdc', [
160
+ '---', 'description: iStartSoftFlow gates — STATE delivery + plan lock', 'alwaysApply: true', '---', '',
161
+ 'Before any source Edit/Write:',
162
+ '1. Read `docs/STATE.md` — respect `delivery:` (ETA · WAITING · SLIP · DONE).',
163
+ '2. If PLAN approval is PENDING → do not edit source (rule 13).',
164
+ '3. Past `agent_eta` while AGENT_ACTIVE → report SLIP; do not silent-continue.',
165
+ '4. WAITING_ON_HUMAN / WAITING_STALE → do not pretend the agent is still building.',
166
+ '5. UI work: locked `design-direction` / `docs/design/tokens.css` — no freehand palette.',
167
+ '6. Near context gate → `/synthesize` (keep delivery:) + `/clear`, prefer over compact.',
168
+ '',
169
+ 'Talk to the human as PM/SA. Subagents never address the user.',
170
+ '',
171
+ ].join('\n'));
159
172
  copyTemplateCommands('.cursor/commands');
160
173
  writeFile('.cursor/hooks.json', JSON.stringify({
161
174
  version: 1,
@@ -164,7 +177,7 @@ function adapterCursor() {
164
177
  subagentStop: [{ command: 'node .issflow/hooks/subagent-stop.js' }],
165
178
  },
166
179
  }, null, 2) + '\n');
167
- warnings.push('cursor: PreCompact has no Cursor equivalent (snapshot ritual degrades to model-run); verify hooks.json against cursor.com/docs/hooks — the schema evolves.');
180
+ warnings.push('cursor: PreCompact has no Cursor equivalent (snapshot ritual degrades to model-run); plan-gate/context-guard are Claude-strongest — Cursor relies on issflow-gates.mdc + Tier A sessionStart. Verify hooks.json against cursor.com/docs/hooks.');
168
181
  }
169
182
 
170
183
  function adapterGemini() {
@@ -243,6 +256,15 @@ function agentsMd() {
243
256
  'Declare your stack (language, framework, infra, auth, test + E2E runner,',
244
257
  'planning source) once in `docs/OVERVIEW.md`. Every rule references *your declared',
245
258
  'stack* and hardcodes none.', '',
259
+ '## Host capability (enforcement)', '',
260
+ '| Host | Hooks | Notes |',
261
+ '|------|-------|-------|',
262
+ '| Claude Code | Full (SessionStart · PreToolUse · PreCompact · Stop) | Strongest plan-gate + context-guard |',
263
+ '| Cursor | sessionStart + subagentStop + `.cursor/rules` | Partial — model-run gates via `issflow-gates.mdc` |',
264
+ '| Codex / Gemini / Aider | model-run rituals | Run SESSION-OPEN Tier A by hand |',
265
+ '',
266
+ 'You talk as **PM/SA**. Subagents never chat with you. Delivery ETA lives in',
267
+ '`docs/STATE.md` (`delivery:`). See `.issflow/models/MODEL-MATRIX.md` for model tips.', '',
246
268
  ].join('\n');
247
269
  }
248
270
 
@@ -265,22 +287,25 @@ function flowConfig() {
265
287
  return JSON.stringify({
266
288
  context: {
267
289
  window: 0,
268
- warnPct: 60,
269
- gatePct: 78,
290
+ warnPct: 55,
291
+ gatePct: 70,
292
+ injectMaxLines: 25,
270
293
  _note: 'Context-budget watchdog (.issflow/hooks/context-guard.js, PreToolUse hook). '
271
294
  + 'window 0 = auto-detect from the model id (200000 for standard models). '
272
- + 'Some 1M-context models report their id WITHOUT a [1m] tag, so auto-detect '
273
- + 'assumes 200000 and may false-gate around 156k — if you run a 1M model, set '
274
- + 'window:1000000 here by hand. warnPct = soft non-blocking nudge; gatePct = hard '
275
- + 'block on NEW build work (Edit/Write to SOURCE files). Checkpoint paths '
276
- + '(docs/**, STATE/ISSUES/snapshots) and all Bash are never blocked; Task '
277
- + 'delegation is never gated (a subagent isolates noise and shrinks context).',
295
+ + 'warnPct soft nudge; gatePct hard block on NEW source Edit/Write. Prefer '
296
+ + '/synthesize + /clear (keep delivery:) over compact near gate. Checkpoint '
297
+ + 'docs/** never gated.',
298
+ },
299
+ delivery: {
300
+ staleAfterHours: 24,
301
+ phaseHours: { S: 2, M: 4, L: 8, XL: 16 },
302
+ assumptionBudgetPerPhase: 3,
303
+ _note: 'Agent-active ETA uses phaseHours by size. Waiting-on-human pauses ETA; '
304
+ + 'after staleAfterHours → WAITING_STALE.',
278
305
  },
279
306
  sprint: {
280
307
  defaultCapacity: 8,
281
- _note: 'Sprint layer (/sprint). defaultCapacity = points committed to the FIRST '
282
- + 'sprint before any velocity history exists; later sprints size to the rolling '
283
- + 'completed-velocity average. Optional — /sprint falls back to 8 if absent.',
308
+ _note: 'Sprint layer (/sprint). defaultCapacity = points for first sprint.',
284
309
  },
285
310
  }, null, 2) + '\n';
286
311
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-issflow",
3
- "version": "1.10.1",
3
+ "version": "1.11.1",
4
4
  "description": "Scaffold the iStartSoftFlow AI-coding workflow into a project. Stack-agnostic, tool-agnostic (Claude Code, Codex, Cursor, Gemini, Aider), non-destructive.",
5
5
  "bin": {
6
6
  "create-issflow": "bin/cli.js"
@@ -17,7 +17,10 @@ This directory is the **portable workflow kit** (tool-agnostic). Every
17
17
  | `skills/` | On-demand cookbooks (ux-design, ui-ux-pro-max, security, support-triage, …) |
18
18
  | `hooks/` | Lifecycle enforcement scripts |
19
19
  | `istartsoft-flow/` | METHODOLOGY.md — every hard rule lives here once |
20
- | `templates/` | Proposal / UX pack / architecture / CR / FEATURE / automation |
20
+ | `templates/` | Proposal / UX pack / architecture / CR / FEATURE / design picker · platforms |
21
+ | `models/` | MODEL-MATRIX.md — cross-host model guidance (aliases stay haiku/sonnet/opus) |
22
+ | `routing/` | Advisory model router (fail-closed) |
23
+ | `scripts/` | Portable helpers (e.g. token-lint.js) |
21
24
 
22
25
  ## Claude Code only
23
26
 
@@ -79,7 +79,7 @@ token unambiguously. Do not put prose containing the word `approved` after a
79
79
 
80
80
  ## Sprint 1: <name> [goal: <one-line user-visible increment>] ← sprint headers optional; group a few phases
81
81
 
82
- ## Phase 1: <name> [5 pts] [status: pending]
82
+ ## Phase 1: <name> [5 pts] [size: S|M|L|XL] [lane: lite|full] [status: pending]
83
83
 
84
84
  - slice: <what works end-to-end after this phase>
85
85
  - rationale: <why this slice, why now — the user / business value (from the PRD)>
@@ -88,11 +88,16 @@ token unambiguously. Do not put prose containing the word `approved` after a
88
88
  - acceptance (sharp, testable):
89
89
  - GIVEN <state> WHEN <action with concrete input> THEN <exact observable output>
90
90
  - edge/negative: <input> -> <expected handling>
91
+ - (UI) task check: primary user completes the job without guessing
91
92
  - impl notes: <constraints, gotchas, patterns to follow — so the implementer needs no extra digging>
92
93
  - qa focus: <what the tests must especially probe — abuse / edge cases>
93
94
  - external: <service name, or “none”>
94
95
  …
95
96
 
97
+ Plan-Ready (orchestrator checks before human approve): every phase has testable
98
+ acceptance · no TBD on auth/money/PII/primary surfaces · size+lane set · UI phases
99
+ reference screen IDs or locked direction · dependencies clear.
100
+
96
101
  ## Phase N: <name — final code phase> [status: pending]
97
102
 
98
103
  - slice: <what works + app is deployed and reachable>
@@ -17,14 +17,16 @@ Do NOT touch docs/ENDPOINTS.md — owned by implementer.
17
17
  ## Standard tasks (every phase — do all, in order)
18
18
 
19
19
  1. STATE.md — rewrite, do not append. Keep ONLY:
20
- - current phase + status
20
+ - current phase + status + stage
21
21
  - what was just completed (1-3 bullets)
22
22
  - the immediate next action
23
23
  - any open blocker
24
24
  PRESERVE verbatim (never blank on rewrite): the `plan:` line (the PLAN-APPROVAL
25
- sign-off record, hard rule 13) and the `sprint:` line (active-sprint marker) if
26
- present — load-bearing gate/standup state, not transient progress.
27
- Target: under 25 lines.
25
+ sign-off record, hard rule 13), the `sprint:` line if present, **and the entire
26
+ `delivery:` block** (agent_eta / status / waiting_* / slip) — load-bearing for
27
+ finish-date honesty. Also preserve `design-direction:`, `design:`, `architecture:`,
28
+ `surfaces:`, `timezone:` when present.
29
+ Target: under ~30 lines including delivery.
28
30
 
29
31
  2. ISSUES.md — dedup + compress:
30
32
  - merge duplicate / near-duplicate issues.
@@ -38,12 +38,18 @@ Also classify commercial lane:
38
38
  `/support` or `/quick` — not a billable CR unless the client expands scope.
39
39
  - **Billable CR** → continue below.
40
40
 
41
+ **No full grill-me.** If the change hits surfaces / auth / UX / architecture:
42
+ ask **1–3 mini questions** (brief-back with recommended answers), then continue.
43
+ Deep design re-lock happens later via `/design` if rule 15 reopens.
44
+
41
45
  ## STEP 2 — IMPACT ANALYSIS
42
46
  Determine:
43
47
  - phases affected — **done phases are frozen** (their cost is already spent and
44
48
  counts); new / changed phases; cut phases (credit back the un-started effort).
45
49
  - knock-on effects — architecture, **UX pack**, **security (re-threat-model?)**,
46
- tests, timeline. If UX or arch artifacts change, those gates re-open (rule 15).
50
+ tests, timeline, **design-direction / tokens**. If UX or arch artifacts change,
51
+ those gates re-open (rule 15). If direction must change, reset
52
+ `design-direction:` to PENDING (re-picker).
47
53
  - dispatch `researcher` (DESIGN or IMPL) if the change needs grounding in facts.
48
54
 
49
55
  ## STEP 3 — RE-ESTIMATE (the DELTA only)
@@ -52,10 +58,12 @@ Determine:
52
58
  estimate memo or chat-recorded answers.
53
59
  - If rate / contingency is missing → **ASK once** (same rule as `/propose`). Never
54
60
  invent a kit default rate; never commit personal rates into public kit files.
61
+ - Report **two deltas** in chat: scope_effort Δ (axis A, drives money) and
62
+ agent_delivery Δ (axis B, calendar when AI may work). Price uses A only.
55
63
  - added effort × rate = added cost; cut effort = credit.
56
64
  - **net cost Δ** + **new total** vs the approved baseline — as a range.
57
65
  - Show rate math **in chat to the human only**.
58
- - **timeline Δ**. State what stays the SAME so the client sees the price is fair.
66
+ - **timeline Δ** (B agent_delivery + human-gate buffer + new `demo_by`). Refresh STATE `delivery:` if mid-build. State what stays the SAME so the client sees the price is fair.
59
67
 
60
68
  ### CLIENT-DOC RULE
61
69
  Anything the client sees (CR summary, updated PROPOSAL.md / proposal.html) shows
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Post-proposal DESIGN + ARCHITECTURE gates — produce UX pack and architecture note, stop for human approve before /phase (hard rule 15).
2
+ description: Post-proposal DESIGN + ARCHITECTURE gates — upgrade locked direction into UX pack + architecture, stop for human approve before /phase (hard rule 15).
3
3
  argument-hint: [optional: "ux" | "arch" | "both" · "dry-run"]
4
4
  ---
5
5
 
@@ -14,44 +14,59 @@ DRY-RUN: if `$ARGUMENTS` contains `dry-run`/`--dry-run`, outline what you'd writ
14
14
  and STOP. Write nothing.
15
15
 
16
16
  ## PRE-FLIGHT
17
- - Read `docs/OVERVIEW.md`, `docs/PLAN.md`, `docs/PROPOSAL.md` (if any), `docs/STATE.md`.
17
+ - Read `docs/OVERVIEW.md`, `docs/PLAN.md`, `docs/PROPOSAL.md` (if any), `docs/STATE.md`,
18
+ `docs/design/DIRECTION.md`, `docs/design/tokens.css`.
18
19
  - PLAN must be approved (rule 13). If a proposal exists for quoted work, it should
19
20
  be signed off first (`/propose`) — otherwise warn and confirm they want design
20
21
  gates without a commercial proposal (internal projects may skip `/propose` and
21
22
  still run `/design`, or skip rule 15 entirely when STATE has `design: n/a` and
22
23
  `architecture: n/a` set deliberately for non-quoted work).
24
+ - **Direction:** if UI in scope and `design-direction` is not locked → STOP; run
25
+ overview Direction Picker first. If locked → **do not** re-run `ui-ux-pro-max`
26
+ restyle unless the human explicitly asks to change look (then re-approve).
23
27
 
24
28
  Target: `$ARGUMENTS` → `ux` | `arch` | `both` (default **both**).
25
29
 
30
+ ## Design scale (pick one; say it out loud)
31
+
32
+ | Scale | When | Artifact depth |
33
+ |-------|------|----------------|
34
+ | Spike | Feasibility only | Short answer — no UX-PACK |
35
+ | Bounded | Small change to existing UI | Short design in chat or thin UX-PACK + approve |
36
+ | Architectural | New product / subsystem / auth boundary / multi-surface | Full UX-PACK(s) + ARCHITECTURE |
37
+
26
38
  ## STEP 1 — UX PACK (if ux|both)
27
- 1. Apply `ui-ux-pro-max` (visual direction): run the kit engine
28
- `.issflow/skills/ui-ux-pro-max/scripts/search.py --design-system` from
29
- OVERVIEW product + industry. Fold into UX-PACK tokens — do not create a
30
- parallel `design-system/` SoT. If Python 3 is missing, ask me to install it
31
- (do not install tools yourself).
32
- 2. Apply `ux-design` skill (authoring mode): wireframe baseline + cookbook direction.
33
- Catalogue output must still pass the cookbook (tokens, a11y, no emoji icons).
34
- 3. Scaffold or update `docs/UX-PACK.md` from `.issflow/templates/UX-PACK-template.md`.
35
- 4. Fill flows, screen inventory, tokens/frame, a11y notes from OVERVIEW + PLAN.
36
- 5. SHOW me UX-PACK.md. **STOP for approval.**
37
- 6. On approve: stamp `> Approval: approved <date> v<n>`; set `design: approved <date>`
39
+ 1. Scaffold or update `docs/UX-PACK.md` from `.issflow/templates/UX-PACK-template.md`.
40
+ 2. Fold **locked** DIRECTION + tokens — do not invent a second palette.
41
+ 3. Apply `ux-design` skill (authoring): wireframe baseline + cookbook. Screen inventory
42
+ must use stable IDs from propose appendix when present.
43
+ 4. Per primary screen: goal, primary CTA, empty/loading/error, <SM and ≥MD notes.
44
+ 5. If `surfaces` includes more than web: add `docs/design/<surface>/` notes (PWA /
45
+ line-oa / mobile packs — see templates under `.issflow/templates/design/platforms/`).
46
+ 6. Update `docs/design/inventory.md` — reuse only listed components.
47
+ 7. SHOW me UX-PACK.md. **STOP for approval.**
48
+ 8. On approve: stamp `> Approval: approved <date> v<n>`; set `design: approved <date>`
38
49
  in STATE.md; HISTORY line `design v<n> approved`.
39
- 7. On change request: revise and re-show; header stays PENDING.
50
+ 9. On change request: revise and re-show; header stays PENDING.
51
+ 10. Quoted + UI: after approve, **regenerate** `docs/proposal.html` screen sheets from
52
+ the same screen IDs + tokens so the PDF matches what will be built.
40
53
 
41
54
  ## STEP 2 — ARCHITECTURE (if arch|both)
42
55
  1. Dispatch `researcher` (DESIGN) only if open unknowns remain; else use OVERVIEW.
43
56
  2. Scaffold or update `docs/ARCHITECTURE.md` from
44
57
  `.issflow/templates/ARCHITECTURE-template.md`.
45
- 3. Apply `code-standards` architecture guidance; security trust boundaries via
58
+ 3. Include **Auth decision record** when users/login exist (provider, session model,
59
+ identity linking, roles) — grill briefly if still open.
60
+ 4. Apply `code-standards` architecture guidance; security trust boundaries via
46
61
  `security` skill when relevant.
47
- 4. SHOW me ARCHITECTURE.md. **STOP for approval.**
48
- 5. On approve: stamp header; set `architecture: approved <date>` in STATE.md;
62
+ 5. SHOW me ARCHITECTURE.md. **STOP for approval.**
63
+ 6. On approve: stamp header; set `architecture: approved <date>` in STATE.md;
49
64
  HISTORY line `architecture v<n> approved`. Optionally `/log-decision` for
50
65
  material pattern choices.
51
- 6. On change request: revise and re-show.
66
+ 7. On change request: revise and re-show.
52
67
 
53
68
  ## STEP 3 — HANDOFF
54
69
  When both required gates are approved (or N/A for internal skip):
55
70
  - Tell me `/phase` is unblocked for rule 15.
56
- - Reminder: frontend phases still run the `ux-design` CLOSE check (rule 9);
57
- architecture drift still needs `/log-decision` (rule 8).
71
+ - Reminder: frontend phases still run the `ux-design` CLOSE check (rule 9) + task
72
+ check; architecture drift still needs `/log-decision` (rule 8).
@@ -4,7 +4,12 @@ argument-hint: [path to Feature doc, e.g. docs/features/<slug>/FEATURE.md · "dr
4
4
  ---
5
5
 
6
6
  Caveman ULTRA mode. You are the ORCHESTRATOR. Route work to subagents —
7
- you do NOT implement or debug yourself. Subagents cannot talk to the user; only YOU can.
7
+ you do NOT implement or debug yourself. Speak PM-style (ETA / stage / WAITING /
8
+ DONE). Subagents cannot talk to the user; only YOU can.
9
+
10
+ Before build slices: set STATE `delivery:` agent_eta from phase sizes; heartbeat
11
+ stage lines; on human gates set WAITING_ON_HUMAN + waiting_since + stale_after.
12
+ UI work must respect `docs/design/tokens.css` + inventory when present.
8
13
 
9
14
  Target doc: $ARGUMENTS (default: the single `docs/features/*/FEATURE.md` whose
10
15
  `> Status:` reads `approved, pending` — zero or multiple candidates -> STOP and list them.)
@@ -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,19 @@
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
+ you do NOT implement or debug yourself. Speak to the human as **PM** (status /
9
+ ETA / blockers) — not as a pair-programming developer.
9
10
 
10
11
  Note: subagents cannot talk to the user. Only YOU can.
11
12
 
12
13
  Target phase: $ARGUMENTS (default: the phase marked pending in docs/PLAN.md)
14
+ LANE: if args contain `lite` OR PLAN phase has `lane: lite` → LITE mode.
15
+ LITE forbidden when: final phase · new primary UI flow · auth/money/PII surface.
16
+ LITE still requires ETA + DoD + (if any UI touch) task check happy path.
13
17
 
14
18
  ---
15
19
 
@@ -55,14 +59,33 @@ c. PHASE STATE CHECK: Read docs/STATE.md and docs/PLAN.md.
55
59
  d. FINAL PHASE CHECK: Read docs/PLAN.md. Is this the last phase (no further
56
60
  pending phases after this one)? Record this as IS_FINAL_PHASE=true/false.
57
61
 
62
+ e. DELIVERY / ETA BOARD (required before RESEARCH):
63
+ Update `docs/STATE.md` `delivery:` block:
64
+ - Set `status: AGENT_ACTIVE`, `eta_paused: false`, clear waiting_for if resuming.
65
+ - Set `agent_eta` and `phase_etas` using `flow-config.json` → `delivery.phaseHours`
66
+ by phase size (S/M/L/XL) and project timezone.
67
+ - Stage line: `stage: RESEARCH | next: … | blocker: none`
68
+ - Assumption budget: max `assumptionBudgetPerPhase` (default 3). Exceed → STOP
69
+ for `/replan` or human — do not keep guessing.
70
+ - If status was WAITING_ON_HUMAN and `stale_after` passed → set `WAITING_STALE`,
71
+ tell the human `next_human_action`, do not pretend AI is still building.
72
+ - If wall-clock past `agent_eta` while AGENT_ACTIVE → **SLIP**: report reason +
73
+ new ETA or BLOCKED. Never silently continue past ETA.
74
+
75
+ f. LITE shortcuts (when LITE): skip dedicated researcher if unknowns are none;
76
+ skip browser E2E if no UI; CLOSE = regression + lint + secrets (and UI task
77
+ check if UI touched). Full path otherwise.
78
+
58
79
 
59
80
  ---
60
81
 
61
82
  ## 1. RESEARCH + TDD APPLICABILITY
62
83
 
63
- Dispatch `researcher` in IMPL mode scoped to this phase.
84
+ If LITE and no open unknowns: skip researcher; note "lite: research skipped" in STATE.
85
+ Else dispatch `researcher` in IMPL mode scoped to this phase.
64
86
  Returns terse summary + path. Read the file only if needed.
65
87
  Unknowns block the phase -> re-dispatch narrowed. No guessing.
88
+ After each major stage change, rewrite STATE `stage:` + one-line progress (heartbeat).
66
89
 
67
90
  SECURE SDLC (design): if this phase touches a TRUST BOUNDARY (auth, untrusted input,
68
91
  data store, money, PII), threat-model it now (`security` skill) and fold the abuse
@@ -114,13 +137,13 @@ NOT edit them). Fill to green. Budget 3, WARN@2, STUCK@3.
114
137
 
115
138
  ## 3c. TEST (e2e) — FRONTEND phases only
116
139
 
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.
140
+ If this phase ships UI:
141
+ - FULL: dispatch `e2e-runner` (BLIND) for browser E2E of the slice.
142
+ - LITE with UI touch: skip full E2E only if a **task check** still proves the
143
+ primary user job (scripted or manual-recorded happy path) — never skip both.
144
+ - Always run the `ux-design` cookbook + wireframe check (hard rule 9). Tokens must
145
+ come from `docs/design/tokens.css` — raw hex/spacing in components = BLOCK.
146
+ Do not re-run `ui-ux-pro-max` `--design-system` here — look is locked.
124
147
  Non-frontend phase -> skip §3c.
125
148
 
126
149
  PHASE GATE (rule 5) -> go to §4/§5/§6 (see GATE below).
@@ -193,6 +216,12 @@ REGRESSION GATE (before closing — Feature 3):
193
216
  - IF IS_FINAL_PHASE: additionally run `scripts/regression.sh --real` (full real
194
217
  corpus). A failure blocks close.
195
218
 
219
+ UI TASK CHECK (if this phase touched UI — required even in LITE):
220
+ - Happy path: primary user can complete the phase's user-visible job without guessing.
221
+ - Viewport: primary breakpoint (≥MD) + <SM if mobile is primary.
222
+ - Tokens: no raw hex / off-grid spacing — prefer `node scripts/token-lint.js` when present.
223
+ - Fail → FIX; do not close.
224
+
196
225
  CODE-STANDARDS GATE (rule 12): the formatter + linter are clean (the language's
197
226
  standard tool); names follow the language's own idiom; the code conforms to the
198
227
  declared architecture (Feature-Based by default). Lint/format errors or idiom
@@ -206,6 +235,8 @@ SECURITY GATE (rule 11 — Secure SDLC build stage):
206
235
  - Open HIGH/CRITICAL findings BLOCK the close -> route to FIX. Deploying to prod
207
236
  with open high/critical findings is a hard-stop (human sign-off).
208
237
 
238
+ DELIVERY UPDATE: set this phase's `phase_etas` entry done; refresh next phase
239
+ `agent_eta` or set `delivery.status: DONE` if package complete. Clear waiting_*.
209
240
  Mark phase `done` in docs/PLAN.md.
210
241
 
211
242
  SPRINT STANDUP (if a sprint is active — STATE.md shows `sprint: <n> (active)`):
@@ -256,10 +287,16 @@ After each step, update docs/STATE.md:
256
287
  phase: <n> (in progress)
257
288
  plan: approved <date> ← carry forward; never drop the rule-13 sign-off record
258
289
  tdd: <true|false>
290
+ stage: <RESEARCH|SCAFFOLD|RED|GREEN|TEST|FIX|CLOSE>
259
291
  completed: <steps done so far>
260
292
  next: <exact next step>
261
293
  blocker: <none or open issue>
294
+ delivery: ← preserve + update; never drop
295
+ agent_eta: <date>
296
+ status: AGENT_ACTIVE | WAITING_ON_HUMAN | WAITING_STALE | BLOCKED | SLIP | DONE
297
+ …
262
298
 
263
299
  ```
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.
300
+ Keep STATE.md small — overwrite, do not append. Preserve `plan:` and `delivery:`
301
+ on every overwrite. When entering WAITING_ON_HUMAN: set waiting_for, waiting_since,
302
+ stale_after (+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.
@@ -26,6 +26,8 @@ Steps:
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
28
  1. grep docs/ISSUES.md for anything related.
29
+ 1b. If the change touches UI: read `docs/design/tokens.css` + inventory when present.
30
+ Use semantic tokens only — no raw hex/spacing literals in components.
29
31
  2. Make the change. Smallest diff that works.
30
32
  3. Run it — lint/typecheck/smoke. Show me result.
31
33
  4. REGRESSION GUARD: run `scripts/regression.sh` (mock corpus). No corpus in this
@@ -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
  }