@manhquy/flow-skill 0.7.0 → 0.7.2

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 (39) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +5 -5
  3. package/README_VN.md +5 -5
  4. package/package.json +1 -1
  5. package/skills/flow/SKILL.md +108 -219
  6. package/skills/flow/_templates/01-research.md +3 -2
  7. package/skills/flow/_templates/02-scope.md +2 -0
  8. package/skills/flow/_templates/03-prd.md +2 -1
  9. package/skills/flow/_templates/05-contract.md +1 -0
  10. package/skills/flow/_templates/card.md +5 -1
  11. package/skills/flow/law/CLAUDE.md +6 -5
  12. package/skills/flow/law/CODING.md +37 -0
  13. package/skills/flow/references/agent-detection.md +12 -9
  14. package/skills/flow/references/agent-stage-mapping.md +47 -12
  15. package/skills/flow/references/auto-run.md +38 -7
  16. package/skills/flow/references/clarify.md +7 -7
  17. package/skills/flow/references/command-dispatch.md +51 -51
  18. package/skills/flow/references/concierge.md +2 -2
  19. package/skills/flow/references/debt-and-halts.md +20 -5
  20. package/skills/flow/references/gate-00.md +10 -0
  21. package/skills/flow/references/gate-01.md +18 -0
  22. package/skills/flow/references/gate-02.md +16 -0
  23. package/skills/flow/references/gate-03.md +10 -0
  24. package/skills/flow/references/gate-04.md +12 -0
  25. package/skills/flow/references/gate-05.md +33 -0
  26. package/skills/flow/references/gate-assess.md +13 -0
  27. package/skills/flow/references/gate-card.md +25 -0
  28. package/skills/flow/references/gate-consistency.md +24 -0
  29. package/skills/flow/references/gate-constitution.md +19 -0
  30. package/skills/flow/references/gate-debt.md +5 -0
  31. package/skills/flow/references/gate-eval.md +54 -3
  32. package/skills/flow/references/gate-examples.md +78 -0
  33. package/skills/flow/references/gate-rules.md +40 -241
  34. package/skills/flow/references/gate-shared.md +37 -0
  35. package/skills/flow/references/ground-truth-gates.md +1 -1
  36. package/skills/flow/references/host-agnostic-parallel.md +54 -0
  37. package/skills/flow/references/mode-work.md +13 -10
  38. package/skills/flow/runner/flow.sh +334 -58
  39. package/skills-manifest.json +17 -2
@@ -0,0 +1,37 @@
1
+ # Shared gate rules — open decisions and material authority
2
+
3
+ Unique home for OD / material-authority. Stages 02 / 03 / 05 point here; do not copy.
4
+
5
+ ## Material authority
6
+
7
+ If materially different externally observable product choices remain open (quota,
8
+ identity key, tenancy model, response contract, enforcement owner, …), **stop** —
9
+ list the choice and consequences. Configurable defaults are not authority.
10
+
11
+ If the artifact invents policy (who can access what, retention, billing rules) with
12
+ no prior operator/ADR authority, stop and list Decision-required items.
13
+
14
+ Access/effects (public/token/admin, writes) that encode product policy without
15
+ operator authority → stop; do not invent tenancy/auth from convenience.
16
+
17
+ ## Assumption vs open decision
18
+
19
+ Read `## Assumptions`. A bullet that encodes product law (who can access what,
20
+ tenancy, retention, billing, enforcement owner) with no operator/ADR authority is
21
+ an **open decision or a stop**, not a silent default — move it under
22
+ `## Open decisions` (a line like `- [ ] which tenant key?`) or halt. Do not invent
23
+ auth/tenancy/retention/billing to clear `[FILL]`.
24
+
25
+ Contract has no `## Assumptions` section; do not invent one. Access/effects or
26
+ shared shapes that encode product law (tenancy, auth, retention, billing) with no
27
+ operator/ADR authority are an **open decision or a stop** — add a
28
+ `## Open decisions` bullet or halt.
29
+
30
+ ## Open decisions — mechanical
31
+
32
+ **More than 5 markdown bullets under `## Open decisions` fails `scan_gate`.**
33
+ Leftover `- [ ]` still fails boxes. Clarify (`references/clarify.md`) is opt-in,
34
+ never a `next` prereq.
35
+
36
+ If the section is a pile after that floor, assume or cut rather than interview
37
+ everything. Offer clarify when any open decision remains.
@@ -13,7 +13,7 @@ and used only to add color, never to pass a gate.
13
13
  | Card behavior works | the card's `## Verify` steps RUN for real (curl/click/command + expected output) | "the code should work" / "tests would pass" |
14
14
  | Story proof | `flow.sh harness story verify <id>` -> `verify_command` exit 0 | "I wrote tests" |
15
15
  | Build merged-safe | review green (adversarial) + `flow.sh check` pass | "the diff is small" |
16
- | Card DONE | deploy ran + **live URL verified as a user** (world-state evidence pasted) | "merged" / "deploy succeeded" / "tests pass" |
16
+ | Card DONE | per-type world-state evidence pasted (deployed URL for web; install+run for cli/library/skill) | "merged" / "deploy succeeded" / "tests pass" |
17
17
  | Card DONE (mechanical floor) | `flow.sh check` / `card done`: `## Evidence` multi-signal score ≥2 (URL + curl/command/test-log/path/DB/skill categories; denylist example.com etc.) | process-only prose (PR approvals, CI green, release notes alone); empty/placeholder |
18
18
  | Dep ready / parallel | `ready` + graph deps-met: dep `status=done` **and** same Evidence multi-signal floor | hand-edit `status: done` with hollow Evidence |
19
19
  | Auto activation | risk set valid + current Stage 05 `semantic_gate` receipt (`attestations.md`) | prose “planning looks done” |
@@ -0,0 +1,54 @@
1
+ # Host-agnostic parallel occupancy
2
+
3
+ Flow requires **no named multiplexer**. Parallel cards are a ready-gate +
4
+ worktrees + host-owned placement + world-state fan-in. Absence of Herdr, tmux,
5
+ in-process `Task`, or any other host **never fails a gate** and never changes
6
+ `flow.sh` exit.
7
+
8
+ Herdr and tmux appear below only as **examples, never as a dependency** or a
9
+ first-class adapter.
10
+
11
+ ## Degrade ladder
12
+
13
+ | Rung | Primitive already in the process | Who binds occupants | Who waits |
14
+ |---|---|---|---|
15
+ | **0** | In-process subagents / `Task` | Hosting agent; cwd = the card's worktree | Host `Task` join |
16
+ | **1** | Operator extra terminals / tabs | Human pastes the print-enter block | Human |
17
+ | **2** | Process is **already inside** a mux (`HERDR_ENV=1` / `TMUX` set) | That mux's **own** skill/CLI; flow does not wrap or detect it | That mux's own wait |
18
+ | **3** | None of the above, or `/flow ready` overlap | Serial: one card | Hosting agent, one at a time |
19
+
20
+ Rung 2 is opt-in by the mux's own environment injection, never by `PATH`.
21
+ Inside-mux probe is the mux's own env (`HERDR_ENV=1`, `TMUX`), never
22
+ `command -v herdr` from outside (a CLI can talk to a same-uid socket without
23
+ `HERDR_ENV`). Absence of rungs 0–2 is the default path, not a degrade footnote.
24
+
25
+ ## Gate parity
26
+
27
+ Host `idle` / `done` / `blocked` is **not a card pass**. `flow.sh check` still
28
+ judges, and it must run **in the card's worktree** (parent-tree check of main
29
+ is a false fail/pass). Screen output is not evidence.
30
+
31
+ Keep the four "blocked" senses distinct:
32
+
33
+ | Sense | Meaning | Home |
34
+ |---|---|---|
35
+ | **host-blocked** | mux/pane approval chrome or occupant stuck | the host |
36
+ | **subagent-BLOCKED** | scoped subagent status protocol | `agent-detection.md` |
37
+ | **ready-blocked** | deps unmet or allowed-files overlap | `flow.sh ready` |
38
+ | **Tier-C security halt** | security-class exposure; operator DEBT | `auto-run.md` |
39
+
40
+ Mixing them auto-answers a payments card or auto-halts a yes/no prompt.
41
+
42
+ ## File-is-the-wait
43
+
44
+ The **HOST waits** (Task join / human / the mux's own wait). `flow.sh` **never waits on or polls** another agent. Fan-in is world-state: re-invoke `check` in
45
+ the card worktree after the host's wait returns.
46
+
47
+ ## Forbidden (ADR-0001; not a nit)
48
+
49
+ `flow.sh` must not exec host control CLIs (`herdr agent start`, `herdr agent wait`, `herdr agent prompt`, `herdr server stop`, `tmux send-keys`, and equivalents).
50
+ Forbidden by name: `mux-up`, `mux-run-wave`, `mux-proxy`. No screen output as
51
+ evidence. No hook install into `~/.claude` or `~/.omp`. No long-lived socket subscribe (`events.subscribe`). `flow.sh` never spawns agents; placement is print-enter or the host's own Task/mux.
52
+
53
+ Own-runtime / own-PTY / own-wait is a successor ADR plus a separate product,
54
+ not a card in this skill.
@@ -2,17 +2,20 @@
2
2
 
3
3
  `MODE` file at project root (default `teach`). Set with `/flow mode work`.
4
4
 
5
- - **teach** — the operator writes every artifact; you only gatekeep. Default.
6
- - **work** — you interview the operator ONCE, draft stages 00-05 yourself, pause only for
5
+ - **teach** — the operator writes every artifact; the host only gatekeeps. Default.
6
+ - **work** — interview the operator ONCE, draft stages 00-05, pause only for
7
7
  scope sign-off, deliver the card set as one summary. **Gates and done-rules are identical
8
- to teach** — you still pass every gate, you just also author.
8
+ to teach** — every gate still passes; the host also authors.
9
9
 
10
10
  ## The work-mode shape (interview once -> draft -> one pause -> summary)
11
11
 
12
- 1. **Interview once.** Ask a single tight batch (use `AskUserQuestion`): the idea in one
13
- line, who has the pain (a real named person/group), the rough budget/time, the stack if
14
- they have a preference, and the one channel for the first users. Don't drip questions
15
- across stages.
12
+ 1. **Interview once.** One tight batch — numbered questions, not a drip across stages:
13
+ 1. Idea in one line?
14
+ 2. Who has the pain (a real named person/group)?
15
+ 3. Rough budget/time?
16
+ 4. Stack preference, if any?
17
+ 5. One channel for the first users?
18
+ Host-neutral: use whatever ask/prompt surface the host has.
16
19
  2. **Draft 00 -> 01 -> 02.** Fill idea, do real research (delegate to `researcher` per
17
20
  `agent-stage-mapping.md` — actually open competitors, quote real complaints with links),
18
21
  and produce the scope table with honest Impact + Grade. Run each gate with `flow.sh next`.
@@ -33,8 +36,8 @@
33
36
 
34
37
  ## Rules that still hold in work mode
35
38
  - Every gate must pass mechanically (`flow.sh`) AND semantically (`gate-rules.md`). Drafting
36
- does not lower the bar — self-challenge before presenting (you are now the author AND under
37
- review, so apply the adversarial lens to your own draft).
39
+ does not lower the bar — self-challenge the draft before presenting. Self-challenge is
40
+ color, not a verdict: it never substitutes for `flow.sh` + `gate-rules.md`.
38
41
  - Research must be real (opened competitors, quoted complaints with links) — no fabrication.
39
42
  This is the highest-risk stage for an AI author; verify every quote has a source.
40
43
  - Scope honesty: do not grade-launder your own C features to B. Call C a C, justify the path.
@@ -43,5 +46,5 @@
43
46
  can still halt or add a bullet (a policy-encoding `## Assumptions` line with no operator/ADR
44
47
  authority is an open decision, not a silent default). Never invent auth / tenancy / retention
45
48
  / billing to clear FILL.
46
- - Done is still world-state evidence; you cannot mark a card done without real proof.
49
+ - Done is still world-state evidence; a card cannot be marked done without real proof.
47
50
  - Write durable records (intake/decision/story) as you go, same as teach mode.