@manhquy/flow-skill 0.7.2 → 0.7.3
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.
- package/CHANGELOG.md +12 -0
- package/README.md +5 -5
- package/README_VN.md +5 -5
- package/package.json +1 -1
- package/skills/flow/SKILL.md +3 -2
- package/skills/flow/references/command-dispatch.md +3 -3
- package/skills/flow/references/concierge.md +5 -3
- package/skills/flow/references/gate-eval.md +10 -10
- package/skills/flow/runner/flow.sh +82 -12
- package/skills-manifest.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@manhquy/flow-skill`. Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). Versioning: [SemVer](https://semver.org/).
|
|
4
4
|
|
|
5
|
+
|
|
6
|
+
## [0.7.3] — 2026-09-17 — ships skill v0.33.0 (stable / latest)
|
|
7
|
+
|
|
8
|
+
Skill-content release. Ships skill product **v0.33.0** (`status --json` /
|
|
9
|
+
`resume --json`, Stage 05 heading map — see root `CHANGELOG.md`
|
|
10
|
+
`## 0.33.0`). Installer CLI contract unchanged. Publishes to dist-tag
|
|
11
|
+
**`latest`**.
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
- Bundled skill tree re-synced from monorepo `skills/flow/`.
|
|
15
|
+
- Install: **`npx @manhquy/flow-skill@latest`**.
|
|
16
|
+
|
|
5
17
|
## [0.7.2] — 2026-09-11 — ships skill v0.32.0 (stable / latest)
|
|
6
18
|
|
|
7
19
|
Skill-content release. Ships skill product **v0.32.0** (mid-tier dispatcher,
|
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.7.
|
|
8
|
+
| **Current GA** | **0.7.3** — ships skill product **v0.33.0** |
|
|
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) |
|
|
@@ -35,7 +35,7 @@ npx @manhquy/flow-skill@latest
|
|
|
35
35
|
|
|
36
36
|
```bash
|
|
37
37
|
npx @manhquy/flow-skill@latest --help
|
|
38
|
-
# expect: flow-skill v0.7.x (ships skill v0.
|
|
38
|
+
# expect: flow-skill v0.7.x (ships skill v0.33.x)
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
### Common commands
|
|
@@ -90,7 +90,7 @@ npx @manhquy/flow-skill@latest --yes --all --dry-run --json
|
|
|
90
90
|
|----|--------|
|
|
91
91
|
| `npx @manhquy/flow-skill@latest` | Bare `npx @manhquy/flow-skill` (stale npx cache) |
|
|
92
92
|
| **Run** the CLI to copy the skill | `npm i` alone (package only; no skill files in agent homes) |
|
|
93
|
-
| Pin installer `@0.7.
|
|
93
|
+
| Pin installer `@0.7.3` if needed | Pin npm `@0.33.0` (skill version ≠ package version) |
|
|
94
94
|
| Prefer `@latest` | `@rc` (retired / behind) |
|
|
95
95
|
|
|
96
96
|
**Two version axes:** `package.json` version = installer; `SKILL.md` metadata = skill product. Both appear in `--help` and in the `plan` JSONL event (`version` + `skillVersion`).
|
|
@@ -138,7 +138,7 @@ rm -rf <project>/.claude/skills/flow
|
|
|
138
138
|
|---------|-----|
|
|
139
139
|
| Agent has no `/flow` after `npm i` | Run `npx @manhquy/flow-skill@latest` (install must **execute**) |
|
|
140
140
|
| Old skill after reinstall | Always use `@latest`; avoid bare package name |
|
|
141
|
-
| `No matching version found` for `@0.
|
|
141
|
+
| `No matching version found` for `@0.33.0` | That is the **skill** version. Use `@latest` or `@0.7.x` |
|
|
142
142
|
| Node too old | Install Node ≥ 22.14 (`nvm install 22`, etc.) |
|
|
143
143
|
| Windows `EBUSY` / `EPERM` | Close the agent holding files under the skill dir; re-run |
|
|
144
144
|
| Stale install lock | Delete `<parent>/.flow-skill.installing.lock` if reclaim fails |
|
|
@@ -148,7 +148,7 @@ rm -rf <project>/.claude/skills/flow
|
|
|
148
148
|
## JSONL (`--json`)
|
|
149
149
|
|
|
150
150
|
```jsonl
|
|
151
|
-
{"event":"plan","version":"0.7.
|
|
151
|
+
{"event":"plan","version":"0.7.3","skillVersion":"0.33.0","dryRun":false,"scope":"global","targets":["claude"]}
|
|
152
152
|
{"event":"install:start","target":"claude","dests":["~/.claude/skills/flow"]}
|
|
153
153
|
{"event":"install:done","target":"claude","dests":["~/.claude/skills/flow"],"result":"success","error":null,"warnings":[]}
|
|
154
154
|
{"event":"summary","success":true,"total":1,"attempted":1,"installed":1,"failed":0,"skipped":0,"aborted":false}
|
package/README_VN.md
CHANGED
|
@@ -5,7 +5,7 @@ Cài skill **flow** vào coding agent bằng một lệnh.
|
|
|
5
5
|
| | |
|
|
6
6
|
|---|---|
|
|
7
7
|
| **Package** | [`@manhquy/flow-skill`](https://www.npmjs.com/package/@manhquy/flow-skill) (installer CLI) |
|
|
8
|
-
| **GA hiện tại** | **0.7.
|
|
8
|
+
| **GA hiện tại** | **0.7.3** — ships skill product **v0.33.0** |
|
|
9
9
|
| **Nền tảng** | macOS · Linux · Windows (cùng code path Node) |
|
|
10
10
|
| **Yêu cầu** | Node.js **≥ 22.14** |
|
|
11
11
|
| **Source** | [github.com/manhquydev/flow-skill](https://github.com/manhquydev/flow-skill) |
|
|
@@ -35,7 +35,7 @@ npx @manhquy/flow-skill@latest
|
|
|
35
35
|
|
|
36
36
|
```bash
|
|
37
37
|
npx @manhquy/flow-skill@latest --help
|
|
38
|
-
# expect: flow-skill v0.7.x (ships skill v0.
|
|
38
|
+
# expect: flow-skill v0.7.x (ships skill v0.33.x)
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
### Lệnh hay dùng
|
|
@@ -90,7 +90,7 @@ npx @manhquy/flow-skill@latest --yes --all --dry-run --json
|
|
|
90
90
|
|-----|--------|
|
|
91
91
|
| `npx @manhquy/flow-skill@latest` | Bare `npx @manhquy/flow-skill` (cache npx có thể cũ) |
|
|
92
92
|
| **Chạy** CLI để copy skill | Chỉ `npm i` (chỉ thêm package; không cài skill vào agent home) |
|
|
93
|
-
| Pin installer `@0.7.
|
|
93
|
+
| Pin installer `@0.7.3` nếu cần cố định | Pin npm `@0.33.0` (version **skill** ≠ version package) |
|
|
94
94
|
| Ưu tiên `@latest` / `@0.7.x` | `@rc` (đã retire / tụt hậu) |
|
|
95
95
|
|
|
96
96
|
**Hai trục version:** `package.json` = installer CLI; `SKILL.md` metadata = skill product. Cả hai hiện trong `--help` và event JSONL `plan` (`version` + `skillVersion`).
|
|
@@ -138,7 +138,7 @@ rm -rf <project>/.claude/skills/flow
|
|
|
138
138
|
|------------|------------|
|
|
139
139
|
| Agent không có `/flow` sau `npm i` | Chạy `npx @manhquy/flow-skill@latest` (phải **execute** installer) |
|
|
140
140
|
| Skill cũ sau khi “cài lại” | Luôn dùng `@latest`; tránh bare package name |
|
|
141
|
-
| `No matching version found` với `@0.
|
|
141
|
+
| `No matching version found` với `@0.33.0` | Đó là version **skill**. Dùng `@latest` hoặc `@0.7.x` |
|
|
142
142
|
| Node quá cũ | Cài Node ≥ 22.14 (`nvm install 22`, v.v.) |
|
|
143
143
|
| Windows `EBUSY` / `EPERM` | Đóng agent đang giữ file trong skill dir; chạy lại |
|
|
144
144
|
| Stale install lock | Xóa `<parent>/.flow-skill.installing.lock` nếu reclaim thất bại |
|
|
@@ -148,7 +148,7 @@ rm -rf <project>/.claude/skills/flow
|
|
|
148
148
|
## JSONL (`--json`)
|
|
149
149
|
|
|
150
150
|
```jsonl
|
|
151
|
-
{"event":"plan","version":"0.7.
|
|
151
|
+
{"event":"plan","version":"0.7.3","skillVersion":"0.33.0","dryRun":false,"scope":"global","targets":["claude"]}
|
|
152
152
|
{"event":"install:start","target":"claude","dests":["~/.claude/skills/flow"]}
|
|
153
153
|
{"event":"install:done","target":"claude","dests":["~/.claude/skills/flow"],"result":"success","error":null,"warnings":[]}
|
|
154
154
|
{"event":"summary","success":true,"total":1,"attempted":1,"installed":1,"failed":0,"skipped":0,"aborted":false}
|
package/package.json
CHANGED
package/skills/flow/SKILL.md
CHANGED
|
@@ -8,7 +8,7 @@ keywords: [flow, buildflow, gate, build, ship, scope, prd, contract, card, deplo
|
|
|
8
8
|
license: MIT
|
|
9
9
|
metadata:
|
|
10
10
|
author: flow-skill
|
|
11
|
-
version: "0.
|
|
11
|
+
version: "0.33.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
|
|
|
@@ -51,7 +51,8 @@ needed. Typed verbs always win over chat.
|
|
|
51
51
|
- Security-class skip/debt → **HALT** until the operator accepts the exposure in `DEBT.md`.
|
|
52
52
|
- Never mark a card `done` without pasted world-state evidence.
|
|
53
53
|
- Never edit `_templates/` or `runner/flow.sh` during a project run.
|
|
54
|
-
- `NEXT_VERB=` is advisory; never auto-exec `
|
|
54
|
+
- `NEXT_VERB=` / JSON `next_verb` is advisory; never auto-exec `next`, `card`,
|
|
55
|
+
`card-start`, `check`, `fix-gate`, `auto`, or `skip`.
|
|
55
56
|
|
|
56
57
|
## Run `flow.sh` first
|
|
57
58
|
|
|
@@ -9,8 +9,8 @@ is no fragment loader (ADR-0001).
|
|
|
9
9
|
|
|
10
10
|
| User input | Runner call | Host duties after |
|
|
11
11
|
|---|---|---|
|
|
12
|
-
| `/flow` | `bash <skill>/runner/flow.sh status` | Relay `NEXT ->`, dwell, and (past 10 cards) the compact summary; nothing to author. |
|
|
13
|
-
| `/flow resume` | `bash <skill>/runner/flow.sh resume` | Read-only session-story; no lock. FAIL/PASS/Never: SKILL.md STOP + Dispatch. |
|
|
12
|
+
| `/flow` | `bash <skill>/runner/flow.sh status` | Relay prose `NEXT ->`, dwell, and (past 10 cards) the compact summary; nothing to author. Optional `status --json` prints one `flow_context/v1` object (`v,stage,gate,next_verb,card,dwell,load`) — **display-only**. Hosts MUST NOT dispatch `next_verb` (`next`/`card`/`card-start`/`check`/`fix-gate`/`auto`/`skip`). Default `/flow` stays prose status. |
|
|
13
|
+
| `/flow resume` | `bash <skill>/runner/flow.sh resume` | Read-only session-story; no lock. Optional `resume --json` same closed schema as status; display-only, never exec `next_verb`. FAIL/PASS/Never: SKILL.md STOP + Dispatch. |
|
|
14
14
|
| `/flow next` | `bash <skill>/runner/flow.sh next` | After PASS, compare to `gate-examples.md` (not a second always-on load). FAIL/Never: SKILL.md STOP + Dispatch. |
|
|
15
15
|
| `/flow assess` | `bash <skill>/runner/flow.sh assess` | Fill `flow/00-inspect.md` from EVIDENCE; Brownfield challenge in `gate-rules.md`. |
|
|
16
16
|
| `/flow card` | `bash <skill>/runner/flow.sh card` | Fill per `law/CLAUDE.md`; before coding, `law/CODING.md`. |
|
|
@@ -25,7 +25,7 @@ is no fragment loader (ADR-0001).
|
|
|
25
25
|
| `/flow constitution` | `bash <skill>/runner/flow.sh constitution` | Advisory constitution form + markers; then `gate-rules.md`. Not a `next` gate. |
|
|
26
26
|
| `/flow clarify` | `bash <skill>/runner/flow.sh clarify` | List leftover Open-decision boxes; write-back `references/clarify.md`. Not a `next` gate. |
|
|
27
27
|
| `/flow converge` | `bash <skill>/runner/flow.sh converge [--file <payload>]` | Assess vs plan per `references/converge.md`; present the findings table first. |
|
|
28
|
-
| `/flow eval [--stage 01\|02\|card] [--fixture <id>] [--n 3] [--timeout <s>]` | `bash <skill>/runner/flow.sh eval [...]` | Billable; live mode skips if `claude` absent. `--replay` does not inherit that SKIP. See `references/gate-eval.md`. |
|
|
28
|
+
| `/flow eval [--stage 01\|02\|05\|card] [--fixture <id>] [--n 3] [--timeout <s>]` | `bash <skill>/runner/flow.sh eval [...]` | Billable; live mode skips if `claude` absent. `--replay` does not inherit that SKIP. See `references/gate-eval.md`. |
|
|
29
29
|
| `/flow eval --report` | `bash <skill>/runner/flow.sh eval --report` | Offline; relay last complete batch + drift. See `references/gate-eval.md`. |
|
|
30
30
|
| `/flow eval --replay` | `bash <skill>/runner/flow.sh eval --replay` | Keyless replay; missing/stale fixtures exit 1. Verdicts never count toward the eval floor. |
|
|
31
31
|
| `/flow project-type <web\|cli\|library\|skill>` | `bash <skill>/runner/flow.sh project-type [t]` | Set/read type per `references/project-types.md`. Confirm before planning. |
|
|
@@ -10,9 +10,11 @@ ask routes through this loop before you consider typing a verb for the operator.
|
|
|
10
10
|
|
|
11
11
|
1. On any natural-language ask, run `flow.sh status` first (or `resume` when entering a
|
|
12
12
|
project cold mid-cycle — see SKILL.md dispatch rule 1). **Never guess state.**
|
|
13
|
-
`status`/`resume`
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
Default `status`/`resume` is human-readable prose. Optional `--json` is **display-only**:
|
|
14
|
+
`next_verb` is not executable. Hosts MUST NOT dispatch `next`, `card`, `card-start`,
|
|
15
|
+
`check`, `fix-gate`, `auto`, or `skip` from it. Concierge stays on prose (May-run);
|
|
16
|
+
do not switch the chat entry to `status --json`. Reliable on Claude; treat routing on
|
|
17
|
+
other engines (Codex, Antigravity/Gemini) as best-effort, not guaranteed.
|
|
16
18
|
2. Look up the closest `intent-class` row in `flow-catalog.tsv` for the parsed state.
|
|
17
19
|
3. Propose exactly **ONE** next action in plain language. Explain any gate concept in
|
|
18
20
|
one short sentence the first time it comes up (zero-jargon default — assume the user
|
|
@@ -27,8 +27,8 @@ rule text is enforceable by *a* judge," not "this build's self-review caught eve
|
|
|
27
27
|
|
|
28
28
|
Eleven shipped fixtures (`skills/flow/eval/fixtures/`, manifest `skills/flow/eval/manifest.tsv`):
|
|
29
29
|
sound/hollow pairs for Stage 01 (Research — fabricated quotes, vague "users"), Stage 02 (Scope —
|
|
30
|
-
grade laundering, a real C quietly graded B), Stage 05 (
|
|
31
|
-
|
|
30
|
+
grade laundering, a real C quietly graded B), Stage 05 (heading-mapped from `gate-05.md`; live
|
|
31
|
+
floor unmeasured until operator `--record`; do not cat `gate-shared.md` onto 05), and the card gate:
|
|
32
32
|
- **fcda** — sound multi-signal Evidence (mechanical PASS, semantic PASS)
|
|
33
33
|
- **fcdb** — process-only hollow (mechanical **FAIL** after hollow-done floor; still listed for
|
|
34
34
|
historical FLAG text / offline inspection)
|
|
@@ -69,9 +69,9 @@ pass**: `eval`, `eval --stage routing`, and `eval --stage converge` each print
|
|
|
69
69
|
(scorecard table above). Replay never counts toward the eval floor. When present, exactly one
|
|
70
70
|
minimal probe call is made to confirm the CLI runs headless before any real judging starts; a
|
|
71
71
|
probe failure means one billable call was made, then a clean skip. The artifact manifest is 11 rows; a full
|
|
72
|
-
default batch judges
|
|
73
|
-
+ the 1 probe =
|
|
74
|
-
|
|
72
|
+
default batch judges all 11 heading-mapped fixtures (01 / 02 / 05 / card) × N=3 = 33 judge calls
|
|
73
|
+
+ the 1 probe = 34 calls. Unfiltered batches are `--report`-complete (`n_written` == `n_expected`
|
|
74
|
+
== 11). Old 9-eval jsonl (05 FAIL-empty before increment) is not comparable.
|
|
75
75
|
|
|
76
76
|
**Measured real cost** (this machine, 2026-07-10, default/unforced model, no `--bare` available
|
|
77
77
|
under an OAuth/subscription session — see the build's spike notes): roughly **$0.30–0.37 per
|
|
@@ -158,11 +158,11 @@ What it can do: hard-fail when `_eval_gate_rules_sha` ≠ the recorded hash (`fi
|
|
|
158
158
|
re-record live per ADR re-baseline rule`). Replay verdicts **never count toward the eval floor**.
|
|
159
159
|
|
|
160
160
|
**Refresh protocol:** edit both sides of a rules change, run a live `--record` batch (11 × `--n 3`
|
|
161
|
-
= 33 judge calls + 1 probe;
|
|
161
|
+
= 33 judge calls + 1 probe; 11 heading-mapped) on a host with
|
|
162
162
|
real `timeout`/`gtimeout`, commit the stripped `eval/replay/` tree (verdict lines only — no
|
|
163
163
|
`session_id` / `cwd` envelopes) **in the same change** as the `gate-rules.md` edit. No
|
|
164
164
|
operator-recorded batch exists yet — the `eval-replay` CI job skip-with-notice until then;
|
|
165
|
-
the recorded-sha staleness check is unchanged.
|
|
165
|
+
the recorded-sha staleness check is unchanged. Do not invent replay `meta`.
|
|
166
166
|
|
|
167
167
|
**B1 escalation:** if hollow-done decoys that name no artifact/command recur in dogfood or
|
|
168
168
|
live eval after the B1-S addendum lands, escalate to full structured lineage evidence. Replay
|
|
@@ -238,7 +238,7 @@ yet (the same "measure, don't assume" discipline that gated this build in the fi
|
|
|
238
238
|
platform: a signal arriving while the runner is blocked on a foreground judge call was not
|
|
239
239
|
observed to preempt that call promptly. Cleanup between fixtures/calls fires reliably; a
|
|
240
240
|
normal (uninterrupted) run always cleans up its temp files immediately.
|
|
241
|
-
- **Small fixture corpus (eleven manifest rows,
|
|
241
|
+
- **Small fixture corpus (eleven manifest rows, eleven heading-mapped)**: enough to prove the
|
|
242
242
|
mechanism and give a real number, not enough for statistical confidence across every
|
|
243
243
|
stage/failure-mode combination. Widening the corpus is a natural v1.x follow-up, not a
|
|
244
244
|
v1 blocker.
|
|
@@ -267,8 +267,8 @@ window; the mechanism was never confirmed at the time (rate-limit vs hook conten
|
|
|
267
267
|
4. **Circuit breaker.** The FIRST evaluated fixture coming back UNRELIABLE (`invalid_count*3 > n`)
|
|
268
268
|
aborts the batch with a distinct nonzero exit code (2) and NO `done` trailer written — the
|
|
269
269
|
junk batch is invisible to `--report`/drift, so it cannot poison the baseline. `--keep-going`
|
|
270
|
-
forces the full batch; document worst case (≤ N_fixtures × n × 2 + 1 probe ≈
|
|
271
|
-
default
|
|
270
|
+
forces the full batch; document worst case (≤ N_fixtures × n × 2 + 1 probe ≈ 67 calls at
|
|
271
|
+
default 11 heading-mapped × 3).
|
|
272
272
|
|
|
273
273
|
### Rate-limit visibility (advisory, best-effort)
|
|
274
274
|
|
|
@@ -886,6 +886,14 @@ _stage_dwell() { # $1 = current stage name -> "Xm/Xh/Xd" from genuine entry, or
|
|
|
886
886
|
}
|
|
887
887
|
|
|
888
888
|
cmd_status() {
|
|
889
|
+
if [ "${1:-}" = "--json" ]; then
|
|
890
|
+
if [ -n "${2:-}" ]; then usage; exit 2; fi
|
|
891
|
+
_emit_context_json
|
|
892
|
+
return 0
|
|
893
|
+
elif [ -n "${1:-}" ]; then
|
|
894
|
+
usage
|
|
895
|
+
exit 2
|
|
896
|
+
fi
|
|
889
897
|
local idx; idx="$(current_stage_idx)"
|
|
890
898
|
echo "flow status"
|
|
891
899
|
echo " project: $ROOT"
|
|
@@ -990,6 +998,14 @@ _resume_valid_lines() {
|
|
|
990
998
|
}
|
|
991
999
|
|
|
992
1000
|
cmd_resume() {
|
|
1001
|
+
if [ "${1:-}" = "--json" ]; then
|
|
1002
|
+
if [ -n "${2:-}" ]; then usage; exit 2; fi
|
|
1003
|
+
_emit_context_json
|
|
1004
|
+
return 0
|
|
1005
|
+
elif [ -n "${1:-}" ]; then
|
|
1006
|
+
usage
|
|
1007
|
+
exit 2
|
|
1008
|
+
fi
|
|
993
1009
|
local idx; idx="$(current_stage_idx)"
|
|
994
1010
|
if [ "$idx" -lt 0 ]; then
|
|
995
1011
|
_na="$(_next_action)"
|
|
@@ -1317,7 +1333,8 @@ _next_action() {
|
|
|
1317
1333
|
echo "run '/flow check' then ship per stage 09"
|
|
1318
1334
|
}
|
|
1319
1335
|
|
|
1320
|
-
# Closed advisory enum from _next_action prose only. Hosts must not auto-exec
|
|
1336
|
+
# Closed advisory enum from _next_action prose only. Hosts must not auto-exec
|
|
1337
|
+
# next/card/card-start/check/fix-gate/auto/skip.
|
|
1321
1338
|
_next_verb_from() { # $1 = _next_action text
|
|
1322
1339
|
local a="$1"
|
|
1323
1340
|
case "$a" in
|
|
@@ -1338,6 +1355,54 @@ _emit_next() {
|
|
|
1338
1355
|
echo "NEXT_VERB=$(_next_verb_from "$a")"
|
|
1339
1356
|
}
|
|
1340
1357
|
|
|
1358
|
+
# PTC-aligned load hint for JSON status/resume. Display-only — never a capability token.
|
|
1359
|
+
# Matches SKILL.md load table: card/build -> law/CLAUDE.md; fix-gate/next/none stay empty
|
|
1360
|
+
# (mechanical FAIL is the blocked stage file; next PASS few-shots are after unlock).
|
|
1361
|
+
_json_load_for_verb() { # $1 = next_verb
|
|
1362
|
+
case "${1:-}" in
|
|
1363
|
+
card|card-start|check) echo "law/CLAUDE.md" ;;
|
|
1364
|
+
*) echo "" ;;
|
|
1365
|
+
esac
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1368
|
+
# Closed flow_context/v1 printer. Scalars through _json_str. scan_gate never piped.
|
|
1369
|
+
# Hosts MUST NOT dispatch next_verb (next/card/card-start/check/fix-gate/auto/skip).
|
|
1370
|
+
_emit_context_json() {
|
|
1371
|
+
local idx cur f stage="" gate="none" next_verb card="" dwell="" load na infl id ts
|
|
1372
|
+
idx="$(current_stage_idx)"
|
|
1373
|
+
if [ "$idx" -ge 0 ]; then
|
|
1374
|
+
cur="$(stage_name_at "$idx")"
|
|
1375
|
+
stage="$cur"
|
|
1376
|
+
f="$FLOW_DIR/$cur.md"
|
|
1377
|
+
if [ -f "$f" ]; then
|
|
1378
|
+
if scan_gate "$f" >/dev/null 2>&1; then
|
|
1379
|
+
gate="PASS"
|
|
1380
|
+
else
|
|
1381
|
+
gate="BLOCKED"
|
|
1382
|
+
fi
|
|
1383
|
+
fi
|
|
1384
|
+
dwell="$(_stage_dwell "$cur")"
|
|
1385
|
+
fi
|
|
1386
|
+
na="$(_next_action)"
|
|
1387
|
+
next_verb="$(_next_verb_from "$na")"
|
|
1388
|
+
load="$(_json_load_for_verb "$next_verb")"
|
|
1389
|
+
infl="$(_inflight_file)"
|
|
1390
|
+
if [ -f "$infl" ]; then
|
|
1391
|
+
while read -r id ts; do
|
|
1392
|
+
[ -n "$id" ] || continue
|
|
1393
|
+
f="$(resolve_card_file "$id" 2>/dev/null)"
|
|
1394
|
+
[ -n "$f" ] && [ -f "$f" ] || continue
|
|
1395
|
+
[ "$(card_status "$f")" = "todo" ] || continue
|
|
1396
|
+
card="$id"
|
|
1397
|
+
break
|
|
1398
|
+
done < "$infl"
|
|
1399
|
+
fi
|
|
1400
|
+
printf '{"v":"%s","stage":"%s","gate":"%s","next_verb":"%s","card":"%s","dwell":"%s","load":"%s"}\n' \
|
|
1401
|
+
"$(_json_str "flow_context/v1")" "$(_json_str "$stage")" "$(_json_str "$gate")" \
|
|
1402
|
+
"$(_json_str "$next_verb")" "$(_json_str "$card")" "$(_json_str "$dwell")" "$(_json_str "$load")"
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1405
|
+
|
|
1341
1406
|
_set_card_status() { # $1=file $2=value -> rewrite the ^status: line (portable substitute; temp+mv)
|
|
1342
1407
|
local f="$1" v="$2"
|
|
1343
1408
|
sed "s/^status:.*/status: $v/" "$f" > "$f.tmp" 2>/dev/null || { rm -f "$f.tmp"; return 1; }
|
|
@@ -3317,22 +3382,24 @@ _eval_heading_pattern() {
|
|
|
3317
3382
|
case "$1" in
|
|
3318
3383
|
01) echo '^## Stage 01' ;;
|
|
3319
3384
|
02) echo '^## Stage 02' ;;
|
|
3385
|
+
05) echo '^## Stage 05' ;;
|
|
3320
3386
|
card) echo '^## Card gate' ;;
|
|
3321
3387
|
*) return 1 ;;
|
|
3322
3388
|
esac
|
|
3323
3389
|
}
|
|
3324
3390
|
|
|
3325
3391
|
# Extract one stage's ritual text from the mapped file (01→gate-01.md, 02→gate-02.md,
|
|
3326
|
-
# card→gate-card.md): from its heading line up to (not including) the next
|
|
3327
|
-
# heading, or EOF. Prints nothing on a bad stage/missing file - caller MUST assert
|
|
3392
|
+
# 05→gate-05.md, card→gate-card.md): from its heading line up to (not including) the next
|
|
3393
|
+
# '## ' heading, or EOF. Prints nothing on a bad stage/missing file - caller MUST assert
|
|
3328
3394
|
# non-empty before any billable call (a silent empty extraction would judge against
|
|
3329
3395
|
# no rule at all).
|
|
3330
|
-
_eval_extract_section() { # $1 = stage (01|02|card)
|
|
3396
|
+
_eval_extract_section() { # $1 = stage (01|02|05|card)
|
|
3331
3397
|
local pat src
|
|
3332
3398
|
pat="$(_eval_heading_pattern "$1")" || return 1
|
|
3333
3399
|
case "$1" in
|
|
3334
3400
|
01) src="$SCRIPT_DIR/../references/gate-01.md" ;;
|
|
3335
3401
|
02) src="$SCRIPT_DIR/../references/gate-02.md" ;;
|
|
3402
|
+
05) src="$SCRIPT_DIR/../references/gate-05.md" ;;
|
|
3336
3403
|
card) src="$SCRIPT_DIR/../references/gate-card.md" ;;
|
|
3337
3404
|
*) return 1 ;;
|
|
3338
3405
|
esac
|
|
@@ -3402,8 +3469,9 @@ _eval_build_prompt() { # $1=outfile $2=stage $3=artifact-file $4=nonce
|
|
|
3402
3469
|
local outfile="$1" stage="$2" artifact="$3" nonce="$4" section shared
|
|
3403
3470
|
section="$(_eval_extract_section "$stage")" || return 1
|
|
3404
3471
|
[ -n "$section" ] || return 1
|
|
3405
|
-
# Shared OD/authority lives in 02/03/05 challenges. Extract maps 01/02/card
|
|
3406
|
-
#
|
|
3472
|
+
# Shared OD/authority lives in 02/03/05 challenges. Extract maps 01/02/05/card;
|
|
3473
|
+
# append shared onto 02 only. 05 extract may mention gate-shared.md; do not cat it
|
|
3474
|
+
# (shared OD on 05 false-FLAGs f05a — PASS fixture states bearer auth without an ADR).
|
|
3407
3475
|
if [ "$stage" = "02" ]; then
|
|
3408
3476
|
shared="$SCRIPT_DIR/../references/gate-shared.md"
|
|
3409
3477
|
[ -f "$shared" ] && section="$section
|
|
@@ -4641,7 +4709,7 @@ function cmd_eval {
|
|
|
4641
4709
|
[ -z "$fid" ] && continue
|
|
4642
4710
|
# manifest's stage column uses flow.sh's own full STAGES names ("01-research", "02-scope",
|
|
4643
4711
|
# "card") for consistency with the rest of the codebase; --stage/heading-map use the terse
|
|
4644
|
-
# 01|02|card form the plan's CLI spec documents - normalize by stripping to the leading
|
|
4712
|
+
# 01|02|05|card form the plan's CLI spec documents - normalize by stripping to the leading
|
|
4645
4713
|
# token before the first '-' (a bare "card" has none, so it passes through unchanged).
|
|
4646
4714
|
local fstage_short="${fstage%%-*}"
|
|
4647
4715
|
[ -n "$stage_filter" ] && [ "$fstage_short" != "$stage_filter" ] && continue
|
|
@@ -4667,7 +4735,7 @@ function cmd_eval {
|
|
|
4667
4735
|
local promptfile="$rundir/prompt.txt"
|
|
4668
4736
|
if ! _eval_build_prompt "$promptfile" "$fstage_short" "$artifact_path" "$nonce"; then
|
|
4669
4737
|
if [ "$replay_mode" -eq 1 ]; then
|
|
4670
|
-
echo " $fid: SKIP - no heading-mapped section (artifact-replay scope is 01|02|card)"
|
|
4738
|
+
echo " $fid: SKIP - no heading-mapped section (artifact-replay scope is 01|02|05|card)"
|
|
4671
4739
|
rm -rf "$rundir" 2>/dev/null
|
|
4672
4740
|
continue
|
|
4673
4741
|
fi
|
|
@@ -4898,10 +4966,12 @@ flow.sh - buildflow gate runner (mechanical layer)
|
|
|
4898
4966
|
|
|
4899
4967
|
usage: bash flow.sh <command> [args]
|
|
4900
4968
|
|
|
4901
|
-
status
|
|
4902
|
-
|
|
4969
|
+
status [--json] Where am I? What's blocking? (also: no command). --json prints
|
|
4970
|
+
one flow_context/v1 object (display-only; do not auto-exec next_verb).
|
|
4971
|
+
resume [--json] Session-story brief for a fresh agent entering mid-cycle: last session
|
|
4903
4972
|
(command names only, never raw args), in-flight card + dwell, gate state,
|
|
4904
4973
|
one NEXT-> line. Read-only, no lock. Run this FIRST when resuming a project.
|
|
4974
|
+
--json: same closed object as status --json.
|
|
4905
4975
|
next Check current gate; unlock next stage (or start at 00)
|
|
4906
4976
|
assess Brownfield: scaffold + gate a current-state assessment (flow/00-inspect.md) before planning
|
|
4907
4977
|
card Create the next build card (after planning complete)
|
|
@@ -5110,8 +5180,8 @@ fi
|
|
|
5110
5180
|
FLOW_LOG_START="$(_now)"
|
|
5111
5181
|
trap '_log_on_exit' EXIT
|
|
5112
5182
|
case "$cmd" in
|
|
5113
|
-
status|"") cmd_status ;;
|
|
5114
|
-
resume) cmd_resume ;;
|
|
5183
|
+
status|"") cmd_status "$@" ;;
|
|
5184
|
+
resume) cmd_resume "$@" ;;
|
|
5115
5185
|
next) cmd_next ;;
|
|
5116
5186
|
assess) cmd_assess ;;
|
|
5117
5187
|
card) cmd_card "$@" ;;
|