@manhquy/flow-skill 0.5.0 → 0.6.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 (29) hide show
  1. package/README.md +4 -4
  2. package/package.json +1 -1
  3. package/skills/flow/SKILL.md +12 -5
  4. package/skills/flow/_templates/02-scope.md +9 -0
  5. package/skills/flow/_templates/03-prd.md +11 -0
  6. package/skills/flow/_templates/05-contract.md +8 -0
  7. package/skills/flow/_templates/card.md +4 -0
  8. package/skills/flow/eval/fixtures/converge/conv-01/cards/C-001.md +21 -0
  9. package/skills/flow/eval/fixtures/converge/conv-01/flow/03-prd.md +7 -0
  10. package/skills/flow/eval/fixtures/converge/conv-01/src/app.py +3 -0
  11. package/skills/flow/eval/fixtures/converge/gap-01/cards/C-001.md +21 -0
  12. package/skills/flow/eval/fixtures/converge/gap-01/cards/C-002.md +21 -0
  13. package/skills/flow/eval/fixtures/converge/gap-01/flow/03-prd.md +8 -0
  14. package/skills/flow/eval/fixtures/converge/gap-01/flow/05-contract.md +7 -0
  15. package/skills/flow/eval/fixtures/converge/gap-01/src/app.py +11 -0
  16. package/skills/flow/eval/fixtures/converge/manifest.tsv +3 -0
  17. package/skills/flow/law/CLAUDE.md +7 -0
  18. package/skills/flow/references/artifact-lifecycle.md +58 -0
  19. package/skills/flow/references/clarify.md +191 -0
  20. package/skills/flow/references/command-dispatch.md +3 -1
  21. package/skills/flow/references/concierge.md +2 -0
  22. package/skills/flow/references/converge.md +109 -0
  23. package/skills/flow/references/flow-catalog.tsv +2 -0
  24. package/skills/flow/references/gate-rules.md +32 -0
  25. package/skills/flow/references/mode-work.md +11 -1
  26. package/skills/flow/references/stage-state-machine.md +9 -1
  27. package/skills/flow/runner/attestations.sh +249 -138
  28. package/skills/flow/runner/flow.sh +425 -5
  29. package/skills-manifest.json +14 -2
package/README.md CHANGED
@@ -5,7 +5,7 @@ Install the **flow** skill into coding agents with one command.
5
5
  | | |
6
6
  |---|---|
7
7
  | **Package** | [`@manhquy/flow-skill`](https://www.npmjs.com/package/@manhquy/flow-skill) (installer CLI) |
8
- | **Current GA** | **0.5.0** — ships skill product **v0.28.0** |
8
+ | **Current GA** | **0.5.1** — ships skill product **v0.28.1** |
9
9
  | **Platforms** | macOS · Linux · Windows (same Node path) |
10
10
  | **Requirement** | Node.js **≥ 22.14** |
11
11
  | **Source** | [github.com/manhquydev/flow-skill](https://github.com/manhquydev/flow-skill) |
@@ -89,7 +89,7 @@ npx @manhquy/flow-skill@latest --yes --all --dry-run --json
89
89
  |----|--------|
90
90
  | `npx @manhquy/flow-skill@latest` | Bare `npx @manhquy/flow-skill` (stale npx cache) |
91
91
  | **Run** the CLI to copy the skill | `npm i` alone (package only; no skill files in agent homes) |
92
- | Pin installer `@0.5.0` if needed | Pin npm `@0.28.0` (skill version ≠ package version) |
92
+ | Pin installer `@0.5.1` if needed | Pin npm `@0.28.1` (skill version ≠ package version) |
93
93
  | Prefer `@latest` | `@rc` (retired / behind) |
94
94
 
95
95
  **Two version axes:** `package.json` version = installer; `SKILL.md` metadata = skill product. Both appear in `--help` and in the `plan` JSONL event (`version` + `skillVersion`).
@@ -137,7 +137,7 @@ rm -rf <project>/.claude/skills/flow
137
137
  |---------|-----|
138
138
  | Agent has no `/flow` after `npm i` | Run `npx @manhquy/flow-skill@latest` (install must **execute**) |
139
139
  | Old skill after reinstall | Always use `@latest`; avoid bare package name |
140
- | `No matching version found` for `@0.28.0` | That is the **skill** version. Use `@latest` or `@0.5.x` |
140
+ | `No matching version found` for `@0.28.1` | That is the **skill** version. Use `@latest` or `@0.5.x` |
141
141
  | Node too old | Install Node ≥ 22.14 (`nvm install 22`, etc.) |
142
142
  | Windows `EBUSY` / `EPERM` | Close the agent holding files under the skill dir; re-run |
143
143
  | Stale install lock | Delete `<parent>/.flow-skill.installing.lock` if reclaim fails |
@@ -147,7 +147,7 @@ rm -rf <project>/.claude/skills/flow
147
147
  ## JSONL (`--json`)
148
148
 
149
149
  ```jsonl
150
- {"event":"plan","version":"0.5.0","skillVersion":"0.28.0","dryRun":false,"scope":"global","targets":["claude"]}
150
+ {"event":"plan","version":"0.5.1","skillVersion":"0.28.1","dryRun":false,"scope":"global","targets":["claude"]}
151
151
  {"event":"install:start","target":"claude","dests":["~/.claude/skills/flow"]}
152
152
  {"event":"install:done","target":"claude","dests":["~/.claude/skills/flow"],"result":"success","error":null,"warnings":[]}
153
153
  {"event":"summary","success":true,"total":1,"attempted":1,"installed":1,"failed":0,"skipped":0,"aborted":false}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@manhquy/flow-skill",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Install the flow skill (buildflow gated build process) into your coding agent(s) via one npx command",
5
5
  "type": "module",
6
6
  "bin": {
@@ -3,12 +3,12 @@ name: flow
3
3
  description: Run the buildflow gated build process from idea to real done-evidence. Walk gated stages (Idea->Research->Scope->PRD->ADR->Contract->Cards->Build->Review->Deploy/Ship->Verify->Retro), each with a honest gate that must pass before advancing. Adapts to project type (web|cli|library|skill). Use when starting or driving a real product build, when the user types /flow, /flow next, /flow card, /flow check, or asks to scope/plan/ship a project through gates. Kill at any gate is a valid outcome.
4
4
  user-invocable: true
5
5
  when_to_use: "User wants to build a real product end-to-end with discipline (idea -> a deployed URL for web, or installs+runs for a CLI/library/skill), or types any /flow command, or asks for a gated build process, scope decision, contract-first plan, or card-based shipping."
6
- argument-hint: "[ resume | next | card | check C-NNN | project-type web|cli|library|skill | mode teach|work | skip <stage> | ready | workspace add|list|enter|remove|check|doctor | auto [stop] | attest semantic|live-verify|status|recover | doctor | retro | eval --stage 01|02|05|card|routing --fixture <id> --n 3 --keep-going --report | or just say what you want in plain language ]"
6
+ argument-hint: "[ resume | next | card | check C-NNN | project-type web|cli|library|skill | mode teach|work | skip <stage> | ready | workspace add|list|enter|remove|check|doctor | auto [stop] | attest semantic|live-verify|status|recover | doctor | retro | eval --stage 01|02|05|card|routing|converge --fixture <id> --n 3 --keep-going --report | clarify | converge | or just say what you want in plain language ]"
7
7
  keywords: [flow, buildflow, gate, build, ship, scope, prd, contract, card, deploy, vertical-slice, cli, library, skill, worktree, parallel-agents, workspace, multi-agent]
8
8
  license: MIT
9
9
  metadata:
10
10
  author: flow-skill
11
- version: "0.28.0"
11
+ version: "0.29.0"
12
12
  attribution: "Methodology from ai20k-build-phase/buildflow (Tony, arealisticdreamer.com); durable-layer ancestry and improve-ritual spirit from repository-harness (protocol v1 EOL — flow-owned fork); agent patterns from claudekit-engineer, BMAD-METHOD. v0.22 concierge from BMAD bmad-help; forge-idea from bmad-forge-idea (MIT, BMad Code LLC)."
13
13
  ---
14
14
 
@@ -29,9 +29,11 @@ Idea -> Research -> Scope -> PRD -> ADR -> Contract -> Cards -> Build -> Review
29
29
  `/flow` is **two layers working together**:
30
30
 
31
31
  1. **Mechanical layer — `runner/flow.sh`** (deterministic, exit 0/1). It manages the
32
- stage/card lifecycle and checks the *cheatable* things: unchecked gate boxes,
33
- leftover `[FILL]` placeholders, card status validity, empty done-evidence. Always run
34
- it first — its exit code is ground truth, never your own judgment.
32
+ stage/card lifecycle and checks the *cheatable* things: unchecked gate boxes
33
+ (including leftover `- [ ]` bullets under `## Open decisions` — same scanner), leftover
34
+ `[FILL]` placeholders, card status validity, empty done-evidence. Always run it first
35
+ — its exit code is ground truth, never your own judgment. `/flow clarify` is an
36
+ advisory printer of those open-decision bullets, not a second gate.
35
37
  2. **Semantic layer — YOU (Claude), via this skill** (quality gatekeeper). The script
36
38
  cannot tell a real competitor quote from a fabricated one, or a grade-laundered C
37
39
  feature from an honest B. **That is your job.** After the script passes, apply the
@@ -103,6 +105,8 @@ takes over a lock you're sure is dead; `/flow unlock` clears it.
103
105
  | `/flow coherence` | `flow.sh coherence` — flag version drift across declared version fields (doc-vs-code coherence; advisory) |
104
106
  | `/flow consistency` | `flow.sh consistency` — audit cross-artifact coverage: every PRD `FRn` is claimed by a card (`implements:`) and served by a contract interface; numeric success metric; no leftover placeholders (advisory; run after the contract gate, before cards) |
105
107
  | `/flow constitution` | `flow.sh constitution` — check operator-authored per-project invariants in `flow/constitution.md` (structure + optional grep-markers); **advisory and NOT a `next` gate** — run it at the scope/PRD/contract seam, then apply the semantic challenge in `gate-rules.md` |
108
+ | `/flow clarify` | `flow.sh clarify` — list leftover `- [ ]` bullets under `## Open decisions` on scope/PRD/contract (section-scoped, always exit 0); **advisory and NOT a `next` gate**. Write-back is the ritual in `references/clarify.md` (opt-in). |
109
+ | `/flow converge` | `flow.sh converge [--file <payload>]` — **append-only** remainder cards reconciling present code vs plan. Assess per `references/converge.md`, write a `flow-converge/v1` payload, then run: transactional (all cards or none), never edits an existing card, prints `CONVERGED` + writes nothing when there is no gap. Semantic proof: `flow.sh eval --stage converge`. |
106
110
  | `/flow eval [--stage 01\|02\|card] [--fixture <id>] [--n 3] [--timeout <s>] [--keep-going]` | `flow.sh eval` — **behavioral eval**: does the LLM semantic gate (`gate-rules.md`) actually flag a hollow-but-mechanically-clean fixture? Opt-in, **billable** (skips cleanly, zero calls, if `claude` CLI absent); prints a per-stage scorecard. v0.21: on a final-INVALID vote, raw stdout + stderr + rc are persisted to `.flow/eval-raw/<run_id>/` (git-ignored, envelope-stripped) so an INVALID storm is postmortemable; the first UNRELIABLE fixture aborts the batch (`--keep-going` forces full-batch, worst-case ~37 calls at `--n 3`); the retry backoff is env-injectable (`FLOW_EVAL_RETRY_BACKOFF`, default 5s, set 0 in tests). See `references/gate-eval.md` for scope/cost/limitations. |
107
111
  | `/flow eval --report` | `flow.sh eval --report` — **offline**, zero calls: last complete batch's scorecard + drift vs the prior complete batch |
108
112
  | `/flow promote <file>` | `flow.sh promote <file>` — copy a playbook into the cross-project KB (`~/.claude/flow/playbooks`); `recall` then surfaces it everywhere |
@@ -219,11 +223,14 @@ Hard stops (iteration/token/time caps) and ground-truth gates (`flow.sh` exit, r
219
223
  - `law/RETRO.md` — one honest line per run.
220
224
  - `references/gate-rules.md` — the per-stage semantic challenges (the heart of your gatekeeping).
221
225
  - `references/stage-state-machine.md` — stage order, unlock conditions, what each artifact must contain.
226
+ - `references/artifact-lifecycle.md` — named mutation models (living plan + append-only cards default; cycle-forward; flow-back). Converge is the flow-back closer. Prevents a `specs/` import. Not a `next` gate.
222
227
  - `references/project-types.md` — per-type (web|cli|library|skill) adaptations of the stages, gate lenses, and done-evidence.
223
228
  - `references/command-dispatch.md` — exact mapping of each `/flow` command to runner call + your duties.
224
229
  - `references/concierge.md` — the default conversational entry: routing loop, May-run/Must-ask default-deny classification, new-user consent script.
225
230
  - `references/flow-catalog.tsv` — the intent-class × state → action routing table the concierge reads (source of truth for automated checks).
226
231
  - `references/forge-idea.md` — the Idea/Scope persona-interrogation ritual (adapted from BMAD-METHOD's `bmad-forge-idea`, MIT, opt-in, never a gate condition).
232
+ - `references/clarify.md` — bounded sequential write-back for leftover `## Open decisions` bullets on Scope/PRD/Contract (opt-in, never a `next` prereq).
233
+ - `references/converge.md` — the flow-back closer: assess code vs plan, append remainder cards transactionally (`/flow converge`); gap taxonomy + `flow-converge/v1` payload schema. Semantic proof via `eval --stage converge`.
227
234
  - `references/agent-detection.md` — detect ck:/bmad agents + priority + fallback.
228
235
  - `references/agent-stage-mapping.md` — stage→agent map, scoped prompt template, durable hooks.
229
236
  - `references/claudekit-skills.md` — the **skill layer** on top of the agents: the curated per-stage ck-skill whitelist ("what to use when"), the 6 deep-wired high-ROI skills (ck-predict@ADR, ck-scenario@Contract, review-pr@Review/Ship, ck-security@security-cards, retro@Retro, ck-loop@Build/Verify), the binding rules (skill INFORMS / gate JUDGES; Claude-side detection + silent degrade; opt-in-with-prompt, off the hot path), and the loop-vs-two-strikes decision matrix (`flow.sh loop-prep`/`loop-log` plumbing, ck-loop as the untouched execution engine).
@@ -43,6 +43,7 @@ When a C feature is the real need, three honest paths:
43
43
  - [ ] The cut list is written (what I am NOT building in v1)
44
44
  - [ ] GO / KILL decision is written below
45
45
  - [ ] No FILL placeholders remain in this file
46
+ - [ ] No unresolved open decisions (resolve via /flow clarify, or assume/cut)
46
47
 
47
48
  ## Time budget
48
49
 
@@ -69,3 +70,11 @@ decision.
69
70
  ## Decision
70
71
 
71
72
  [FILL: GO or KILL — one sentence why]
73
+
74
+ ## Open decisions
75
+
76
+ Record unresolved product choices here (add a line like `- [ ] which tenant key?`). Do not invent auth, tenancy, retention, or billing to clear FILL. Resolve via /flow clarify, or assume/cut.
77
+
78
+ ## Assumptions
79
+
80
+ Informed defaults (industry-standard or already locked by the operator or an ADR). A bullet that encodes product law (who can access what, tenancy, retention, billing) with no operator/ADR authority is an open decision or a stop, not a silent default.
@@ -9,6 +9,9 @@
9
9
  - [ ] Pain & gain is a MAPPING TABLE: every pain cites evidence (a stage-01 quote or a named observation), and names the v1 feature that kills it; every v1 feature kills at least one pain
10
10
  - [ ] A stranger could build v1 from this without asking me anything
11
11
  - [ ] No FILL placeholders remain in this file
12
+ - [ ] No unresolved open decisions (resolve via /flow clarify, or assume/cut)
13
+ - [ ] No unquantified adjectives (fast / secure / intuitive / robust / prominent) in Features or NFRs — a number, a named constraint, or cut the word
14
+ - [ ] Every `FRn` names the failure or empty case (what the user sees when it fails or there is nothing), or an explicit `none`
12
15
 
13
16
  ## Context
14
17
 
@@ -55,3 +58,11 @@ interface in the contract (`FRn →`); `/flow consistency` checks this mechanica
55
58
  ## Success metric (numbers only)
56
59
 
57
60
  [FILL: e.g. "10 tickets filed by real residents in week 1; median first-response < 2h"]
61
+
62
+ ## Open decisions
63
+
64
+ Record unresolved product choices here (add a line like `- [ ] which tenant key?`). Do not invent auth, tenancy, retention, or billing to clear FILL. Resolve via /flow clarify, or assume/cut.
65
+
66
+ ## Assumptions
67
+
68
+ Informed defaults (industry-standard or already locked by the operator or an ADR). A bullet that encodes product law (who can access what, tenancy, retention, billing) with no operator/ADR authority is an open decision or a stop, not a silent default.
@@ -15,6 +15,10 @@ another, both look green. This file is the cheap fix.
15
15
  - [ ] Every interface has its INPUT and OUTPUT shapes written (web: request+response · cli: flags+output/exit code · library: args+return)
16
16
  - [ ] Access/effects column filled for every interface (web: public/token/admin · non-web: writes/side-effects, or "none")
17
17
  - [ ] No FILL placeholders remain in this file
18
+ - [ ] No unresolved open decisions (resolve via /flow clarify, or assume/cut)
19
+ - [ ] Every write interface names the failure shape (status or exit + body), not only the happy path
20
+ - [ ] Every interface that can return empty names the empty shape (empty list / 404 / exit 2), or an explicit `none`
21
+ - [ ] Access/effects is a concrete token (web: public/token/admin · non-web: writes/side-effects or "none") — not a vibe word (secure, authenticated, restricted)
18
22
 
19
23
  ## OpenAPI / Swagger rule (web only — N/A for cli/library/skill)
20
24
 
@@ -57,3 +61,7 @@ Reference each PRD feature by its `FRn` id so the mapping is machine-checkable
57
61
  (`/flow consistency` flags any `FRn` with no interface here).
58
62
 
59
63
  - [FILL: FR1 → interface(s) that serve it]
64
+
65
+ ## Open decisions
66
+
67
+ Record unresolved product choices here (add a line like `- [ ] which tenant key?`). Do not invent auth, tenancy, retention, or billing to clear FILL. Resolve via /flow clarify, or assume/cut.
@@ -11,6 +11,10 @@ risk-ack: none
11
11
 
12
12
  [FILL: exactly what this card builds. If it's two things, split it.]
13
13
 
14
+ ## Independent test
15
+
16
+ [FILL: one sentence — if only this card shipped, what can a user do? Or `infra` / `none` for scaffold/CI/contract-test/e2e plumbing. "Unit tests pass" is not an independent test.]
17
+
14
18
  ## Allowed files
15
19
 
16
20
  [FILL: which files/dirs this card may touch — keeps the diff reviewable]
@@ -0,0 +1,21 @@
1
+ # C-001 - greet
2
+ status: done
3
+ implements: FR1
4
+
5
+ ## Scope
6
+ greet(name) returns a greeting string.
7
+
8
+ ## Independent test
9
+ A caller runs greet("Ada") and reads back a greeting naming Ada.
10
+
11
+ ## Allowed files
12
+ src/app.py
13
+
14
+ ## Verify (run these before calling the card done)
15
+ - [x] greet("Ada") contains "Ada"
16
+
17
+ ## Done-evidence (world-state proof)
18
+ the shipped module returns the greeting
19
+
20
+ ## Evidence (paste the actual proof here when done)
21
+ verified by running the module
@@ -0,0 +1,7 @@
1
+ # PRD - greeting service
2
+
3
+ ## Features
4
+ - FR1: a caller gets a greeting for a name via greet(name) and reads it back.
5
+
6
+ ## Success metric
7
+ - greet returns in under 10ms for any name.
@@ -0,0 +1,3 @@
1
+ # Greeting service. Implements FR1: greet(name) returns a greeting naming the caller.
2
+ def greet(name):
3
+ return "Hello, " + name + "!"
@@ -0,0 +1,21 @@
1
+ # C-001 - task create + list
2
+ status: done
3
+ implements: FR1
4
+
5
+ ## Scope
6
+ POST /tasks and GET /tasks.
7
+
8
+ ## Independent test
9
+ A user creates a task at /tasks and sees it returned by the list.
10
+
11
+ ## Allowed files
12
+ src/app.py
13
+
14
+ ## Verify (run these before calling the card done)
15
+ - [x] POST /tasks returns 201
16
+
17
+ ## Done-evidence (world-state proof)
18
+ the deployed service returns the created task
19
+
20
+ ## Evidence (paste the actual proof here when done)
21
+ verified against the running service
@@ -0,0 +1,21 @@
1
+ # C-002 - mark task done
2
+ status: done
3
+ implements: FR2
4
+
5
+ ## Scope
6
+ POST /tasks/{id}/done flips a task to done.
7
+
8
+ ## Independent test
9
+ A user marks a task done and then reads it back as done.
10
+
11
+ ## Allowed files
12
+ src/app.py
13
+
14
+ ## Verify (run these before calling the card done)
15
+ - [x] POST /tasks/1/done returns 200
16
+
17
+ ## Done-evidence (world-state proof)
18
+ the deployed service reports the task as done
19
+
20
+ ## Evidence (paste the actual proof here when done)
21
+ verified against the running service
@@ -0,0 +1,8 @@
1
+ # PRD - task list service
2
+
3
+ ## Features
4
+ - FR1: a user creates a task via POST /tasks and sees it in GET /tasks.
5
+ - FR2: a user marks a task done via POST /tasks/{id}/done and it then reads as done.
6
+
7
+ ## Success metric
8
+ - 95% of task creates succeed in under 300ms.
@@ -0,0 +1,7 @@
1
+ # Contract
2
+
3
+ | FRn | interface | request | response | failure | access |
4
+ |-----|-----------|---------|----------|---------|--------|
5
+ | FR1 | POST /tasks | {title} | 201 {id,title,done:false} | 400 {error} | token |
6
+ | FR1 | GET /tasks | - | 200 [task] | - | token |
7
+ | FR2 | POST /tasks/{id}/done | - | 200 {id,done:true} | 404 {error} | token |
@@ -0,0 +1,11 @@
1
+ # Task service. Implements FR1 (create + list) only.
2
+ # FR2 (mark a task done) has no route here - the done endpoint was never written.
3
+ tasks = []
4
+
5
+ def create_task(title):
6
+ t = {"id": len(tasks) + 1, "title": title, "done": False}
7
+ tasks.append(t)
8
+ return t
9
+
10
+ def list_tasks():
11
+ return tasks
@@ -0,0 +1,3 @@
1
+ id stage repo-dir allow-list expected
2
+ gap-01 converge gap-01 src/app.py GAP
3
+ conv-01 converge conv-01 src/app.py CONVERGED
@@ -48,6 +48,12 @@ done-rules are identical in both modes.
48
48
 
49
49
  ## Standard card sequence
50
50
 
51
+ The first *value* card after the vertical slice must be independently demoable.
52
+ Do not emit a models-only (or services-only, or migrations-only) card: if it
53
+ cannot name a user-visible `## Independent test`, it is not a card — fold the
54
+ work into the slice that ships the value, or write `infra` / `none` only for
55
+ scaffold/CI/contract-test/e2e plumbing.
56
+
51
57
  1. **Scaffold + CI/CD** — repo, deploy pipeline, `/healthz` on a public URL. The scaffold
52
58
  picks the spec-serving mechanism (FastAPI: free at `/docs` + `/openapi.json`; other
53
59
  stacks: choose the generator in the ADR) — API docs are plumbing, not a later feature.
@@ -138,3 +144,4 @@ in parallel. The runner advises; the OPERATOR dispatches. Rules:
138
144
  marking them safe (planning all cards up front is fine).
139
145
  - Editing `_templates/` or `flow.sh` during a project run.
140
146
  - Frontend code before the UI mock card is approved.
147
+ - A models-only (or layer-only) card whose Independent test is empty or "unit tests pass".
@@ -0,0 +1,58 @@
1
+ # Artifact lifecycle — what moves after a change
2
+
3
+ Unlock order (`stage-state-machine.md`) says how a plan is *built the first time*.
4
+ This file says what happens to the artifacts *after* a requirement changes. It is
5
+ a naming convention, not a runner feature — there is no `flow.sh lifecycle`. Not a
6
+ `next` gate.
7
+
8
+ ## Default: living plan + append-only cards
9
+
10
+ Flow runs **one product cycle** in `flow/` + `cards/`:
11
+
12
+ - **Living plan.** `flow/00…05` are amended in place. A changed requirement edits
13
+ `03-prd.md` / `05-contract.md` where the requirement lives (plus a
14
+ `## Clarifications` note if it came from `/flow clarify`). You do not fork a new
15
+ planning tree.
16
+ - **Append-only cards.** Issued `cards/C-NNN.md` are **not** rewritten to chase a
17
+ plan change. New or changed work becomes **new** cards (`C-NNN+1`), with
18
+ `deps:` on the cards they build on. A "v2" is more cards + a plan amendment —
19
+ **not** a parallel `specs/002-…/` universe.
20
+
21
+ This keeps one source of truth for *planning* (PRD + contract) and one for *done*
22
+ (world-state evidence in card `## Evidence`). It is why the mechanical scanner can
23
+ stay simple: there is exactly one `flow/` and one `cards/` to gate.
24
+
25
+ ## The three models (name the one you are using)
26
+
27
+ | Model | What moves first | When |
28
+ |---|---|---|
29
+ | **living** (default) | the plan artifact is edited in place; new cards append | ordinary requirement change mid-cycle |
30
+ | **cycle-forward** | a fresh set of cards (and a PRD amendment) opens a new increment; old cards stay immutable as the shipped record | a v2 / next milestone on top of a shipped v1 |
31
+ | **flow-back** | code already drifted ahead of (or behind) the plan; you reconcile plan↔tree, then append remainder cards | after an out-of-band change, or to catch a hollow-complete plan |
32
+
33
+ All three keep the **append-only cards** rule. They differ only in what you touch
34
+ first. Pick one deliberately; do not silently rewrite issued cards to hide drift.
35
+
36
+ ## Flow-back closer = converge
37
+
38
+ The flow-back model needs a step that reads the present code against the plan
39
+ (PRD `FRn`, contract interfaces, cards, constitution `INV-n`) and **appends**
40
+ remainder cards for whatever is `missing` / `partial` / `contradicts` /
41
+ `unrequested` — without rewriting history. That closer is `/flow converge`.
42
+
43
+ The skill assesses code vs plan per `references/converge.md` and writes a
44
+ `flow-converge/v1` payload; `/flow converge` then **appends** the remainder cards
45
+ transactionally (all-or-nothing, never editing an existing card, byte-identical
46
+ `cards/` when nothing remains). The semantic gap-detection has its own eval
47
+ modality (`flow.sh eval --stage converge`) proving it flags a declared `FRn` the
48
+ code never built. The appended cards are `[FILL]` stubs — build them through the
49
+ normal `/flow ready` + `/flow check` path.
50
+
51
+ ## What not to do
52
+
53
+ - **Do not add a `specs/NNN-slug/` tree** (spec-kit style) or a `feature.json`.
54
+ Flow numbers work with card ids, not a second spec universe; a parallel tree is
55
+ how you get two sources of truth that drift.
56
+ - Do not rewrite or renumber an issued card to match a plan edit — append instead.
57
+ - Do not treat the plan as immutable and pile all change into cards — the plan is
58
+ living; keep PRD/contract honest so a stranger can still build v1 from them.
@@ -0,0 +1,191 @@
1
+ # Clarify ritual — resolve leftover open decisions (Scope / PRD / Contract)
2
+
3
+ Bounded, sequential write-back for open product decisions. Ported in *shape* from
4
+ Spec Kit's `/speckit.clarify` protocol; rewritten in Flow nouns. Open decisions
5
+ are unchecked `- [ ]` bullets under `## Open decisions` on `02-scope.md`,
6
+ `03-prd.md`, and `05-contract.md`. The existing line-anchored box scanner in
7
+ `scan_gate` already fails `next` / `gate` / `planning_complete` on those bullets.
8
+ This file is how you *clear* them.
9
+
10
+ **Not a planning stage. Not a `next` prerequisite command.** `flow.sh clarify`
11
+ only prints leftover bullets (section-scoped). The interview is this ritual.
12
+ Never auto-fired. Offer it (opt-in-with-prompt) when `scan_gate` lists unchecked
13
+ boxes under `## Open decisions`, the same way forge-idea is offered at Idea/Scope.
14
+
15
+ Does **not** replace:
16
+ - `forge-idea.md` — persona pressure-test of the *idea* (kill/harden), not write-back
17
+ - `mode-work.md` — one batch interview up front; leftover open decisions are the
18
+ *only* reason to ask more after that batch
19
+ - `native-rituals.md` §2 — edge-case *generation* for the contract
20
+ - `gate-rules.md` material-authority stop — detect invented policy; this ritual
21
+ *asks* then writes the answer
22
+
23
+ Informs, never judges: a finished clarify session does not pass the gate.
24
+ `flow.sh next` still has to see zero `[FILL]` / unchecked boxes, and you still
25
+ run the stage's semantic challenge.
26
+
27
+ ## When
28
+
29
+ - Stage 02, 03, or 05 has one or more unchecked `- [ ]` bullets under
30
+ `## Open decisions` (mechanical fail), **or**
31
+ - The operator asks to pin a Decision-required item before it gets invented into
32
+ the artifact.
33
+ - Skip at 00 / 01 / 04 — those stages have forge-idea / research / ADR rituals.
34
+
35
+ Cap: **at most 5 questions asked** in one session (retries on the same question
36
+ do not count). There is no mechanical cap on how many open-decision bullets a
37
+ file may carry (every leftover `- [ ]` already fails the gate). If the section
38
+ is a pile, that is a **semantic** "too many — assume or cut" judgment (see
39
+ `gate-rules.md`), not a runner count.
40
+
41
+ ## Token rules (authoring, before this ritual)
42
+
43
+ When drafting 02 / 03 / 05 (especially in `mode work`):
44
+
45
+ 1. **Write it** if the operator said it or the previous stage locked it.
46
+ 2. **Assume + record** if a reasonable industry default exists and the choice
47
+ does not change scope, security/privacy, or UX. On 02/03 record it under
48
+ `## Assumptions`. On **05 (contract) there is no `## Assumptions` section** —
49
+ do not invent one (`gate-rules.md` forbids it); assume by writing the
50
+ access/effects cell or shared shape, or cut.
51
+ Reasonable defaults (do **not** open-decide these): data retention for the
52
+ domain, ordinary error-message tone, session/OAuth2 for a standard web app
53
+ unless tenancy/SSO is the product, REST vs GraphQL when the stack is already
54
+ picked.
55
+ 3. **Add a line like `- [ ] which tenant key?` under `## Open decisions`** only
56
+ when: the choice changes scope, security/privacy, or UX; several
57
+ interpretations have different implications; **and** no honest default exists.
58
+ Priority: scope > security/privacy > UX > technical.
59
+ 4. Never invent auth, tenancy, retention, billing, or enforcement-owner to clear
60
+ `[FILL]`. That is the failure this section exists to stop.
61
+
62
+ ## Taxonomy (coverage scan — internal)
63
+
64
+ Walk the current artifact. Mark each category Clear / Partial / Missing. Do not
65
+ print the raw map unless you will ask zero questions (then print a one-line
66
+ "all Clear" summary).
67
+
68
+ | Category | Look for |
69
+ |---|---|
70
+ | Functional scope | who it is for, v1 vs cut list, GO/KILL still standing |
71
+ | Domain & data | entities, identity/uniqueness, lifecycle |
72
+ | Interaction / UX | critical journey, empty/error/loading |
73
+ | Non-functional | latency, scale, availability — only if v1-load-bearing |
74
+ | Integration | external services, failure modes |
75
+ | Edge / failure | negative path, conflict, throttle |
76
+ | Constraints / tradeoffs | stack already locked in ADR? rejected alternatives |
77
+ | Terminology | one canonical noun (`ticket` vs `issue`) |
78
+ | Completion | numeric success metric; observable result per FRn |
79
+ | Placeholders | leftover open-decision bullets, vague adjectives ("robust", "secure") |
80
+
81
+ Skip a candidate question if answering it would not change implementation,
82
+ validation, or the cut list — or if it belongs in ADR (stage 04), not here.
83
+
84
+ Queue at most 5, ranked Impact × Uncertainty. Prefer one high-impact security
85
+ or tenancy question over two low-impact wording questions.
86
+
87
+ ## Sequential loop
88
+
89
+ Present **exactly one** question at a time. Never reveal the rest of the queue.
90
+
91
+ **Question writing:**
92
+ - Lead with `**Question:**` and a full interrogative that ends in `?`.
93
+ - Optional suffix after the `?`: `(FR3)` or `(scope)`. Never use a label as the
94
+ question (`Acceptance device matrix` is invalid).
95
+ - Next line: one plain "Why it matters" sentence (the stake for shipping).
96
+ - Everyday wording. A reader who does not know Flow must be able to answer
97
+ from the Question line alone.
98
+
99
+ **Multiple choice (preferred):**
100
+ - Pick a **Recommended** option first (best default given project type, risk
101
+ reduction, anything already locked in scope/ADR). One or two sentences why.
102
+ - Then a table:
103
+
104
+ | Option | Description |
105
+ |--------|-------------|
106
+ | A | … |
107
+ | B | … |
108
+ | C | … (D/E if needed, max 5) |
109
+ | Short | different answer, ≤5 words |
110
+
111
+ - After the table: `Reply with the letter, "yes"/"recommended" to accept, or a short answer.`
112
+
113
+ **Short answer (no honest discrete options):**
114
+ - `**Suggested:** <≤5 words> — <one-line why>`
115
+ - `Format: ≤5 words. Reply "yes"/"suggested" to accept, or your own answer.`
116
+
117
+ After the operator answers:
118
+ - "yes" / "recommended" / "suggested" → use your stated recommendation.
119
+ - Otherwise map to one option or accept a ≤5-word phrase.
120
+ - Ambiguous → re-ask (does not consume a new slot).
121
+ - Then write back (next section) **before** asking the next question.
122
+
123
+ **Stop when:**
124
+ - remaining queued items are no longer necessary, or
125
+ - the operator says done / good / no more / stop / proceed, or
126
+ - you have asked 5 questions, or
127
+ - no valid question existed at the start.
128
+
129
+ If the quota is hit with high-impact leftovers, list them under **Deferred**
130
+ with a one-line rationale (better as an Assumption, a cut-list item, or a later
131
+ ADR). Do not leave them as unchecked open-decision bullets if you can honestly
132
+ assume or cut.
133
+
134
+ ## Write-back (after EACH accepted answer)
135
+
136
+ Target file = the stage you are clarifying (`flow/02-scope.md` / `03-prd.md` /
137
+ `05-contract.md`). Teach mode: the operator writes; you propose the exact
138
+ patch. Work mode: you write, then self-challenge.
139
+
140
+ 1. Ensure a `## Clarifications` section exists. Create it **just above**
141
+ `## Assumptions` (or at the end if Assumptions is missing). Under it, a
142
+ `### Session YYYY-MM-DD` subheading for today.
143
+ 2. Append `- Q: <question> → A: <final answer>`.
144
+ 3. Patch the *real* section — do not leave the answer only in the log:
145
+ - scope / cut / GO-KILL → Features in v1, Cut list, or Decision
146
+ - actor / journey → Target users or Features (`FRn:`)
147
+ - data / entity → Shared shapes (contract) or Features
148
+ - NFR / metric → Success metric or Non-functional requirements (must stay
149
+ numeric / observable)
150
+ - edge / failure → a named bullet, or a contract failure shape
151
+ - term → one canonical noun everywhere you just touched
152
+ 4. **Remove the `- [ ]` bullet** this answer resolved (or tick it only if you
153
+ keep a resolved record in-place — prefer delete so the section stays empty
154
+ when work is done). Leave no contradictory earlier sentence.
155
+ 5. Save after each answer (overwrite the file). Do not reorder unrelated
156
+ headings. Keep each insertion short and testable.
157
+
158
+ Allowed new headings: `## Clarifications`, `### Session YYYY-MM-DD` only.
159
+
160
+ ## Assumptions challenge (after the loop, and after a mechanical PASS)
161
+
162
+ Read `## Assumptions` on the artifact you just touched. For each bullet:
163
+
164
+ - Is this a real default (industry-standard, or already locked by the operator
165
+ / ADR), or is it **product law** (who can access what, tenancy, retention,
166
+ billing, enforcement owner) wearing an assumption hat?
167
+ - If it is product law with no operator/ADR authority → treat it as
168
+ Decision-required: either add an open-decision bullet (and ask it) or
169
+ **stop** and list it the same way `gate-rules.md` material-authority stop
170
+ does. Do not silently keep it.
171
+
172
+ A clean mechanical gate with a sneaky assumption is the exact hollow-pass this
173
+ ritual exists to catch.
174
+
175
+ ## Completion report (to the operator)
176
+
177
+ - Questions asked & answered (count).
178
+ - File(s) patched.
179
+ - Sections touched.
180
+ - Open-decision bullets remaining (should be zero on the file you cleared;
181
+ say so if not).
182
+ - Coverage one-liner per taxonomy row: Resolved / Deferred / Clear / Outstanding.
183
+ - Suggested next: `/flow next` if open decisions are gone; otherwise another
184
+ clarify pass or an honest cut/assume.
185
+
186
+ ## Done when
187
+
188
+ Every accepted answer is in `## Clarifications` *and* in the real section.
189
+ Resolved open-decision bullets are gone from the file. Assumptions were
190
+ challenged for silent policy invention. No `cmd_next` / `cmd_clarify` coupling
191
+ was implied — the operator (or you, after they agree) runs `next` themselves.
@@ -10,7 +10,7 @@ install dir; run from the project root so `flow/` and `cards/` resolve.
10
10
  | `/flow resume` | `bash <skill>/runner/flow.sh resume` | Read-only, no lock. Relay all four sections verbatim (last session, in-flight + dwell, gate state, NEXT ->). Run this FIRST when entering a project mid-cycle with no prior context this session. Never expand on or guess at raw args it didn't print — it deliberately shows command names only. |
11
11
  | `/flow next` | `bash <skill>/runner/flow.sh next` | If FAIL: relay the exact violations + line numbers; offer help, don't author/tick in teach mode. If PASS: run the stage's challenge in `gate-rules.md`; flag hollow content, let operator decide. |
12
12
  | `/flow assess` | `bash <skill>/runner/flow.sh assess` | Brownfield only: fill `flow/00-inspect.md` from EVIDENCE (read the code) — functionality/UI/UX vs product, risks, test baseline, **Evidence ledger** claim tags. After mechanical PASS, apply gate-rules **Brownfield assess** challenge (no Observed→product-law promotion). Reuse `scout`/`researcher`. Gate is operator-reviewed; then proceed to `/flow next`. |
13
- | `/flow card` | `bash <skill>/runner/flow.sh card` | Confirm the new card id; remind: fill Scope (one thing) / Allowed files / Verify / Done-evidence per `law/CLAUDE.md`. |
13
+ | `/flow card` | `bash <skill>/runner/flow.sh card` | Confirm the new card id; remind: fill Scope (one thing) / Independent test / Allowed files / Verify / Done-evidence per `law/CLAUDE.md`. |
14
14
  | `/flow card start C-NNN` | `bash <skill>/runner/flow.sh card start C-NNN` | Optional: mark the card in flight (operator-visible in-progress, shown in `/flow status`). Portable `cards/.inflight` registry; does NOT touch the gated `status:` field. Coexists with hand-edit. |
15
15
  | `/flow card done C-NNN` | `bash <skill>/runner/flow.sh card done C-NNN` | Optional convenience: CLI-owned flip to `done`, gated by the SAME done-rules as `check` (reverts on fail — never a hollow done). Then still apply the semantic card review (diff-vs-scope, contract shapes, real evidence) as with `check`. |
16
16
  | `/flow check C-NNN` | `bash <skill>/runner/flow.sh check C-NNN` | If PASS mechanically: review diff-vs-scope, allowed-files drift, contract-shape match, DESIGN.md for UI, evidence = real world-state. |
@@ -20,6 +20,8 @@ install dir; run from the project root so `flow/` and `cards/` resolve.
20
20
  | `/flow coherence` | `bash <skill>/runner/flow.sh coherence` | Flags version drift across declared version fields (package.json / pyproject / src app_version). The cheap doc-vs-code slice; semantic contradictions stay a human gate-challenge. |
21
21
  | `/flow consistency` | `bash <skill>/runner/flow.sh consistency` | After the contract gate, before cards: every PRD `FRn` is claimed by a card (`implements:`) and served by a contract interface; numeric success metric; no leftover placeholders. Then apply the semantic cross-artifact passes in `gate-rules.md` (hollow coverage, conflicting requirements, terminology drift). Advisory. |
22
22
  | `/flow constitution` | `bash <skill>/runner/flow.sh constitution` | At the scope/PRD/contract seam: checks `flow/constitution.md` is well-formed (no placeholder, every invariant has an ID) + scans declared grep-markers. **Advisory, NOT a `next` gate** — then apply the semantic challenge in `gate-rules.md`. |
23
+ | `/flow clarify` | `bash <skill>/runner/flow.sh clarify` | List leftover `- [ ]` bullets under `## Open decisions` on 02/03/05 (section-scoped). **Advisory, NOT a `next` gate** — write-back is `references/clarify.md` (opt-in). Never invent auth/tenancy/retention/billing to clear FILL. |
24
+ | `/flow converge` | `bash <skill>/runner/flow.sh converge [--file <payload>]` | Flow-back closer: assess present code vs plan per `references/converge.md`, write a `flow-converge/v1` payload to `.flow/converge-pending.md`, then run to **append** remainder cards. Transactional (all or none), append-only (never edits an existing card), prints `CONVERGED` + writes nothing when there is no gap. Present the findings table to the operator first. |
23
25
  | `/flow eval [--stage 01\|02\|card] [--fixture <id>] [--n 3] [--timeout <s>]` | `bash <skill>/runner/flow.sh eval [...]` | **Billable** (skips cleanly, zero calls, if `claude` CLI absent). Relay the scorecard verbatim. See `references/gate-eval.md` before running: what it measures (a fresh-judge lower bound, not the work-mode self-challenge), cost, and thresholds. Never wired into `next`/`check` gating — informative only. |
24
26
  | `/flow eval --report` | `bash <skill>/runner/flow.sh eval --report` | Offline, zero calls. Relay the last complete batch's scorecard + drift vs the prior complete batch. |
25
27
  | `/flow project-type <web\|cli\|library\|skill>` | `bash <skill>/runner/flow.sh project-type [t]` | Set/read the project type that selects the per-type gate lens + done-evidence definition (`references/project-types.md`). Confirm the type matches reality before planning. |
@@ -45,6 +45,7 @@ SKILL.md's Forbidden list). When a brand-new user's ask requires you to draft so
45
45
  - contract
46
46
  - tokens
47
47
  - constitution
48
+ - clarify
48
49
  - design
49
50
  - doctor
50
51
  - ready
@@ -68,6 +69,7 @@ operator-authority-only):
68
69
  - unlock
69
70
  - retro
70
71
  - eval
72
+ - converge
71
73
 
72
74
  **Default-deny:** any verb not explicitly listed under May-run above is must-ask — this
73
75
  includes any verb added to flow after this file was written. When in doubt, ask.