@manhquy/flow-skill 0.1.0-rc.1 → 0.1.0-rc.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 +134 -1
- package/README.md +29 -33
- package/README_VN.md +20 -30
- package/SECURITY.md +1 -1
- package/bin/cli.mjs +31 -5
- package/package.json +3 -2
- package/skills/flow/SKILL.md +248 -234
- package/skills/flow/_templates/00-idea.md +16 -16
- package/skills/flow/_templates/00-inspect.md +42 -42
- package/skills/flow/_templates/01-research.md +59 -59
- package/skills/flow/_templates/02-scope.md +71 -71
- package/skills/flow/_templates/03-prd.md +57 -57
- package/skills/flow/_templates/04-adr.md +21 -21
- package/skills/flow/_templates/05-contract.md +59 -59
- package/skills/flow/_templates/card.md +26 -26
- package/skills/flow/eval/fixtures/routing/manifest.tsv +16 -0
- package/skills/flow/eval/fixtures/routing/states/state-any-midproject.txt +4 -0
- package/skills/flow/eval/fixtures/routing/states/state-cards-todo.txt +4 -0
- package/skills/flow/eval/fixtures/routing/states/state-empty.txt +4 -0
- package/skills/flow/eval/fixtures/routing/states/state-idea-stage.txt +4 -0
- package/skills/flow/eval/fixtures/routing/states/state-review-passed.txt +5 -0
- package/skills/flow/eval/fixtures/routing/states/state-review-pending.txt +4 -0
- package/skills/flow/eval/fixtures/routing/states/state-scope-stage.txt +4 -0
- package/skills/flow/harness/README.md +117 -117
- package/skills/flow/harness/flow_harness.py +1 -1
- package/skills/flow/harness/schema/001-init.sql +129 -129
- package/skills/flow/harness/schema/002-story-verify.sql +9 -9
- package/skills/flow/harness/schema/003-tool-registry.sql +15 -15
- package/skills/flow/harness/schema/004-intervention.sql +15 -15
- package/skills/flow/harness/schema/005-tool-extensions.sql +20 -20
- package/skills/flow/harness/schema/009-accessed-count.sql +11 -11
- package/skills/flow/harness/schema/010-usage-event.sql +42 -42
- package/skills/flow/harness/schema/011-usage-gate-reason.sql +8 -8
- package/skills/flow/harness/schema/012-usage-ephemeral.sql +10 -10
- package/skills/flow/law/CLAUDE.md +140 -140
- package/skills/flow/law/DESIGN.md +141 -141
- package/skills/flow/law/RETRO.md +18 -13
- package/skills/flow/playbooks/README.md +28 -28
- package/skills/flow/playbooks/cloudflare-ai-gateway-qwen.md +346 -346
- package/skills/flow/playbooks/docker-deploy-stale-cache.md +32 -32
- package/skills/flow/playbooks/rag-lite-postgres-cloudflare.md +192 -192
- package/skills/flow/references/adversarial-review.md +202 -197
- package/skills/flow/references/agent-detection.md +88 -88
- package/skills/flow/references/agent-stage-mapping.md +114 -114
- package/skills/flow/references/auto-run.md +81 -81
- package/skills/flow/references/claudekit-skills.md +11 -0
- package/skills/flow/references/command-dispatch.md +54 -54
- package/skills/flow/references/concierge.md +113 -0
- package/skills/flow/references/flow-catalog.tsv +18 -0
- package/skills/flow/references/forge-idea.md +88 -0
- package/skills/flow/references/gate-rules.md +185 -171
- package/skills/flow/references/native-rituals.md +133 -0
- package/skills/flow/references/project-types.md +42 -42
- package/skills/flow/runner/flow.sh +362 -3
- package/skills-manifest.json +15 -3
- package/src/constants.mjs +36 -4
- package/src/help.mjs +13 -5
- package/src/prompt.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,9 +2,142 @@
|
|
|
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
|
+
## [0.1.0-rc.3] — 2026-07-18
|
|
6
|
+
|
|
7
|
+
Ships the same skill product **v0.22.0** as rc.2, plus pipeline/UX fixes found after the first
|
|
8
|
+
OIDC publish + independent verification.
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- **Nightly registry health false-red:** `scripts/smoke.mjs` ran `npx` from inside
|
|
12
|
+
`npm-wrapper/`, so npx resolved the **local workspace package** instead of the registry
|
|
13
|
+
(`flow-skill: not found`) even when the published package was healthy. Smoke now uses an
|
|
14
|
+
empty temp cwd + `npx --package=… flow-skill`; nightly runs from `$RUNNER_TEMP`.
|
|
15
|
+
- **CI bash-suite Windows cancelled at 15m:** full 33-suite run needs ~20–25m on Windows Git
|
|
16
|
+
Bash (measured run `29630992330` — mid-`test_flow_eval` when cut). `timeout-minutes` is now
|
|
17
|
+
**30 on windows-latest**, 15 elsewhere. `tests/run_all.sh` prints per-suite `wall_s`.
|
|
18
|
+
- **`promote_to`:** early-exit before install/test (no full job burn); input description states
|
|
19
|
+
it is **manual-only** (OIDC cannot `npm dist-tag add` — E401 on run `29556075144`).
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
- Dual-version UX: `--help` shows `flow-skill v<pkg> (ships skill v<skill>)`; JSONL `plan`
|
|
23
|
+
event gains additive `skillVersion`. Unit tests pin values from `package.json` + `SKILL.md`.
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
- `bin/cli.mjs` git mode `100755` (executable bit in tarball).
|
|
27
|
+
|
|
28
|
+
## [0.1.0-rc.2] — 2026-07-17 — LIVE (published 2026-07-17, `latest` + `rc` both point here)
|
|
29
|
+
|
|
30
|
+
Ships `skills/flow` v0.22.0 (concierge front-door + standalone native rituals — see the root
|
|
31
|
+
repo's CHANGELOG.md `## 0.22.0` entry for the full skill-content changelog). This wrapper
|
|
32
|
+
release fixes the actual reported installer bug, adds a 5th install target (Cursor), and fixes
|
|
33
|
+
two hardening items found while verifying it all.
|
|
34
|
+
|
|
35
|
+
### Fixed — the reported symptom (A0)
|
|
36
|
+
- **Antigravity users installing via `npx` got no guidance and saw a silent `/flow`-not-found.**
|
|
37
|
+
A freshly-installed skill isn't discovered by an agent until it reloads; the post-install
|
|
38
|
+
summary line only ever told Claude + Codex users what to do. Every installed target now gets
|
|
39
|
+
its own restart/reload hint (`bin/cli.mjs`'s `doneLine()`, `install.sh`, `install.ps1` — all
|
|
40
|
+
three entry points, built from the actual installed-targets list, not a static string).
|
|
41
|
+
|
|
42
|
+
### Fixed — hardening found during verification
|
|
43
|
+
- `scripts/sync.mjs` baked an **absolute local filesystem path** (e.g. `D:\project\flow\...`)
|
|
44
|
+
into `skills-manifest.json`'s `source` field, and that file ships inside the published
|
|
45
|
+
tarball (`package.json` `files:`) — leaking local machine layout and being non-reproducible
|
|
46
|
+
across dev machines/CI. Now emits a repo-relative `"../skills/flow"` (or a literal
|
|
47
|
+
`"$FLOW_SKILL_SRC (override)"` marker when the env override is used).
|
|
48
|
+
- `pretest: node scripts/sync.mjs` — the bundled `skills/flow/` tree is gitignored
|
|
49
|
+
(regenerated by `npm run sync`/`prepack`); a fresh checkout now gets it automatically before
|
|
50
|
+
`npm test` instead of failing with a missing/stale bundle.
|
|
51
|
+
- `--test-concurrency=1` pinned on the `test` script — the two new real (non-dry-run) CLI
|
|
52
|
+
install tests below, run in parallel with `lock-atomicity.test.mjs`'s own child-process
|
|
53
|
+
spawns, intermittently starved on Windows (spurious non-zero exit unrelated to any of the
|
|
54
|
+
three files' own logic, confirmed by serialized re-runs going 38/38 green repeatedly vs an
|
|
55
|
+
occasional false-red in parallel). Total suite time impact: negligible (~1-2s).
|
|
56
|
+
|
|
57
|
+
### Added — 5th install target: Cursor
|
|
58
|
+
- New `cursor` target → `~/.cursor/skills/flow`. **Marker is `.cursor/skills`, never bare
|
|
59
|
+
`.cursor`** — the bare dir holds unrelated editor config (settings, caches, `argv.json`) that
|
|
60
|
+
exists for every Cursor user, and a bare marker would have silently auto-installed flow under
|
|
61
|
+
`--yes` for anyone with Cursor installed at all (the exact false-positive class the existing
|
|
62
|
+
Antigravity `~/.gemini` guard already dodges).
|
|
63
|
+
- **Path confirmed by a live probe on the dev machine, not documentation/web research**: found a
|
|
64
|
+
real pre-existing symlink `~/.cursor/skills/find-skills -> ~/.agents/skills/find-skills`,
|
|
65
|
+
empirically proving Cursor's actual skill-read location and that it already consumes content
|
|
66
|
+
from the universal Agent-Skills home (see below).
|
|
67
|
+
- `agents` target relabeled "Agents home — universal Agent-Skills home" — it's the shared
|
|
68
|
+
directory the open Agent Skills standard ([agentskills.io](https://agentskills.io), Anthropic,
|
|
69
|
+
now stewarded by the Agentic AI Foundation) defines, which spec-compliant tools beyond this
|
|
70
|
+
installer's named targets (Cursor confirmed; ~30 others per the standard's adoption) can read.
|
|
71
|
+
- **Honesty limit, not overclaim**: Cursor has no discoverable headless CLI (`cursor agent --help`
|
|
72
|
+
falls through to generic IDE flags, no `-p`/`exec` print-mode). Unlike Antigravity (`agy -p`)
|
|
73
|
+
and Codex (`codex exec`), the installed skill's *runner execution* inside Cursor is not
|
|
74
|
+
independently live-verified here — install correctness is (real scratch-`$HOME` test, content
|
|
75
|
+
lands at the confirmed path). README/CHANGELOG say "install verified, runner not yet
|
|
76
|
+
independently confirmed" rather than claiming parity with the other two targets.
|
|
77
|
+
- `--all` now installs 5 targets; every "4 target(s)" mention across `--help`, both root READMEs,
|
|
78
|
+
and both npm-wrapper READMEs updated to 5 (the count in `--help` is now derived from
|
|
79
|
+
`TARGETS.length` so it cannot drift again).
|
|
80
|
+
|
|
81
|
+
### Added — tests
|
|
82
|
+
- `test/detect.test.mjs`: 2 new cases — bare `.cursor` does NOT trigger detection (the
|
|
83
|
+
false-positive regression guard), `.cursor/skills` present → detected at the confirmed dest.
|
|
84
|
+
- `test/cli.test.mjs`: three REAL (non-dry-run, scratch-`$HOME`) installs asserting the Done-line
|
|
85
|
+
restart hint — `antigravity` alone, `cursor` alone (this one caught a real bug: the Done-line
|
|
86
|
+
printed empty for a cursor-only install because Cursor wasn't yet in `RESTART_HINTS` when it
|
|
87
|
+
was written — fixed same-session), and `claude,codex` (proving the old Codex hint survives and
|
|
88
|
+
no unrelated agent line leaks in).
|
|
89
|
+
- `test/sync-manifest.test.mjs`: asserts `skills-manifest.json.source` is never an absolute path.
|
|
90
|
+
- `tests/test_flow_antigravity_integration.sh` (root repo bash suite): 4 new assertions —
|
|
91
|
+
both `install.sh` and `install.ps1` carry the Antigravity restart/reload hint, and the old
|
|
92
|
+
hardcoded Claude+Codex-only Done line is gone from both.
|
|
93
|
+
|
|
94
|
+
### Fixed — CI publish guard (found on the actual first real run of this workflow)
|
|
95
|
+
- `publish-npm-wrapper.yml`'s `Guard — assert no NODE_AUTH_TOKEN present (OIDC only)` step
|
|
96
|
+
**hard-failed every run, including this release's first attempt** (run `29554226397`,
|
|
97
|
+
2026-07-17). Root-caused via a temporary diagnostic step (added, run 3×, removed same
|
|
98
|
+
session): `NODE_AUTH_TOKEN` is unset right after `actions/checkout@v4` but becomes a real
|
|
99
|
+
short-lived OIDC-exchanged value the instant `actions/setup-node@v4` runs with
|
|
100
|
+
`registry-url` set — that's the current `actions/setup-node@v4` (a moving tag) doing its own
|
|
101
|
+
native npm OIDC handling, not a leaked static secret. The guard's 2026-07-12 design assumed
|
|
102
|
+
the older model where `npm publish` alone performed the OIDC exchange with nothing set
|
|
103
|
+
beforehand; it never matched real `actions/setup-node@v4` behavior and had a 0% pass rate
|
|
104
|
+
since the day it was written. **Removed** — see the workflow file's inline comment for the
|
|
105
|
+
full evidence chain.
|
|
106
|
+
- **npm Trusted Publisher was never actually bound** on npmjs.com for this package (confirmed:
|
|
107
|
+
first real publish attempt after the guard fix still 404'd — `PUT
|
|
108
|
+
.../@manhquy%2fflow-skill — Not found`). The 2026-07-12 runbook flagged this config as `TBD`
|
|
109
|
+
and it was never closed out. Configured now: `owner=manhquydev`, `repo=flow-skill`,
|
|
110
|
+
`workflow=publish-npm-wrapper.yml`, `environment=npm-publish`. `npm publish --provenance`
|
|
111
|
+
now succeeds via pure OIDC — confirmed live, SLSA attestation present.
|
|
112
|
+
- **`npm dist-tag add` does NOT work via OIDC** (confirmed live: `E401 Unable to authenticate`
|
|
113
|
+
even immediately after a successful OIDC-authenticated publish in the same job). npm has not
|
|
114
|
+
extended Trusted Publishing to this endpoint yet (matches
|
|
115
|
+
`plans/reports/researcher-260712-1006-npm-trusted-publisher-first-publish-edge-cases-report.md`
|
|
116
|
+
item #12, "OIDC support in development", no ship date). Promoting `0.1.0-rc.2` to `latest`
|
|
117
|
+
required the same manual Granular-Access-Token-with-Bypass-2FA flow used for the rc.1
|
|
118
|
+
bootstrap publish — see `RELEASE_CHECKLIST.md` for the exact steps and why this account
|
|
119
|
+
(created 2026-07-11, after npm's Sept-2025 TOTP-enrollment cutoff) has no other CLI-auth path
|
|
120
|
+
for write operations.
|
|
121
|
+
|
|
122
|
+
### Release command (already run for this release)
|
|
123
|
+
```
|
|
124
|
+
cd npm-wrapper && npm test # confirmed green first
|
|
125
|
+
git tag npm@0.1.0-rc.2 && git push origin npm@0.1.0-rc.2 # triggered the workflow (after the guard fix + TP config above)
|
|
126
|
+
```
|
|
127
|
+
|
|
5
128
|
## [0.1.0-rc.1] — 2026-07-12
|
|
6
129
|
|
|
7
|
-
|
|
130
|
+
**LIVE on npm**: https://www.npmjs.com/package/@manhquy/flow-skill
|
|
131
|
+
|
|
132
|
+
Initial release candidate. Published manually to bootstrap npm Trusted Publisher (which requires the package to exist first). rc.2+ will be published from CI with OIDC + SLSA L2 provenance.
|
|
133
|
+
|
|
134
|
+
Publish details (for the record):
|
|
135
|
+
- Method: Granular Access Token with `Bypass 2FA` (created + used + revoked within 60s from the maintainer's local machine).
|
|
136
|
+
- No provenance on this bootstrap version (`npm publish --provenance` requires a supported CI environment; laptop publish is not).
|
|
137
|
+
- Dist-tags at publish: `{rc: 0.1.0-rc.1, latest: 0.1.0-rc.1}` — npm auto-populated `latest` on first publish. Docs advise pinning `@rc` or `@0.1.0-rc.1` explicitly.
|
|
138
|
+
- Tarball: 76 files, 203 KB gzipped, 566 KB unpacked.
|
|
139
|
+
|
|
140
|
+
Ships to the `rc` npm dist-tag.
|
|
8
141
|
|
|
9
142
|
### Post-implementation audit fixes (before first publish)
|
|
10
143
|
- **installer:** `acquireLock` was TOCTOU-racy — switched to atomic `writeFileSync(..., { flag: 'wx' })` so two `npx` runs cannot both acquire.
|
package/README.md
CHANGED
|
@@ -5,41 +5,26 @@ One-command installer that copies the [flow](https://github.com/manhquydev/flow-
|
|
|
5
5
|
- Pure Node — works on macOS, Linux, and Windows (cmd, PowerShell 5.1/7, Git Bash) with the same code path.
|
|
6
6
|
- Interactive multi-select or non-interactive CI mode.
|
|
7
7
|
- Preserves any user-added files in the destination outside the 6 subdirs the skill owns.
|
|
8
|
-
- Ships with [npm provenance](https://docs.npmjs.com/generating-provenance-statements) via GitHub Actions trusted publishing
|
|
9
|
-
|
|
10
|
-
## Status — 2026-07-12
|
|
11
|
-
|
|
12
|
-
- ✅ Code complete, 35/35 tests green, CI matrix green (ubuntu/macos/windows × Node 22/24).
|
|
13
|
-
- ⏳ Not yet on npm registry. Repo public + renamed; transfer to `manhquy` account pending accept; first publish (`v0.1.0-rc.1`, manual, no provenance) queued.
|
|
14
|
-
- ➡️ Once published, this section will disappear and `npx @manhquy/flow-skill@rc` becomes the canonical install path.
|
|
8
|
+
- Ships with [npm provenance](https://docs.npmjs.com/generating-provenance-statements) via GitHub Actions trusted publishing **starting with rc.2** — rc.1 was a manual bootstrap because npm Trusted Publisher cannot bind to a package that does not yet exist.
|
|
15
9
|
|
|
16
10
|
## Install
|
|
17
11
|
|
|
18
|
-
**A. From the git repo (works today, no npm registry needed)**
|
|
19
|
-
|
|
20
|
-
```bash
|
|
21
|
-
git clone https://github.com/manhquydev/flow-skill.git
|
|
22
|
-
cd flow-skill/npm-wrapper
|
|
23
|
-
npm install
|
|
24
|
-
npm run sync # materializes skills/flow from ../skills/flow
|
|
25
|
-
npm link # exposes `flow-skill` as a global command
|
|
26
|
-
|
|
27
|
-
flow-skill --yes --all --dry-run --json # smoke check
|
|
28
|
-
flow-skill # interactive install
|
|
29
12
|
```
|
|
30
|
-
|
|
31
|
-
To remove: `npm unlink -g @manhquy/flow-skill`.
|
|
32
|
-
|
|
33
|
-
**B. Via npx (once published)**
|
|
34
|
-
|
|
35
|
-
```
|
|
36
|
-
# Pre-release channel (RC candidate — will exist after first publish)
|
|
13
|
+
# Pre-release channel (current — v0.1.0-rc.3, ships skill v0.22.0)
|
|
37
14
|
npx @manhquy/flow-skill@rc
|
|
38
15
|
```
|
|
39
16
|
|
|
40
17
|
An interactive prompt asks which agents to install to. Pick one or more, confirm, done.
|
|
41
18
|
|
|
42
|
-
> **RC phase**: pin `@rc` (dist-tag) or a specific version like `@0.1.0-rc.
|
|
19
|
+
> **RC phase**: pin `@rc` (dist-tag) or a specific version like `@0.1.0-rc.3`. `npx @manhquy/flow-skill@0.1.x` will start working after stable `0.1.0` is published — semver ranges do **not** match pre-release tuples by default. See [SECURITY.md](./SECURITY.md).
|
|
20
|
+
>
|
|
21
|
+
> **`npm i` alone is not enough.** `npm install @manhquy/flow-skill` only adds the installer
|
|
22
|
+
> package to `node_modules`. You must **run** it (`npx @manhquy/flow-skill@rc` or
|
|
23
|
+
> `npx flow-skill` after install) to copy the skill into agent homes.
|
|
24
|
+
>
|
|
25
|
+
> **Two version axes:** package `version` in this folder is the **installer** (e.g. `0.1.0-rc.3`).
|
|
26
|
+
> Skill product version lives in `skills/flow/SKILL.md` (`metadata.version`, e.g. `0.22.0`).
|
|
27
|
+
> `--help` and the JSONL `plan` event expose both (`version` + `skillVersion`).
|
|
43
28
|
|
|
44
29
|
## Non-interactive
|
|
45
30
|
|
|
@@ -51,7 +36,7 @@ npx @manhquy/flow-skill@rc --yes
|
|
|
51
36
|
npx @manhquy/flow-skill@rc --yes -t claude -t codex
|
|
52
37
|
npx @manhquy/flow-skill@rc --yes -t claude,codex # comma form OK
|
|
53
38
|
|
|
54
|
-
# Force all
|
|
39
|
+
# Force all five targets even if not detected
|
|
55
40
|
npx @manhquy/flow-skill@rc --yes --all
|
|
56
41
|
|
|
57
42
|
# Project scope (Claude only — see below)
|
|
@@ -67,16 +52,25 @@ npx @manhquy/flow-skill@rc --yes --all --dry-run --json
|
|
|
67
52
|
|---|---|---|---|
|
|
68
53
|
| `claude` | Claude Code | `~/.claude/skills/flow` | any presence of `~/.claude` (Claude is always pre-checked) |
|
|
69
54
|
| `codex` | Codex CLI | `~/.codex/skills/flow` | `~/.codex/skills` |
|
|
70
|
-
| `agents` | Agents home | `~/.agents/skills/flow` | `~/.agents/skills` |
|
|
55
|
+
| `agents` | Agents home — also the universal [Agent-Skills](https://agentskills.io) home other spec-compliant tools read | `~/.agents/skills/flow` | `~/.agents/skills` |
|
|
71
56
|
| `antigravity` | Antigravity (CLI + IDE) | `~/.gemini/antigravity-cli/skills/flow` **and** `~/.gemini/config/skills/flow` | `~/.gemini/antigravity-cli` **or** `~/.gemini/config/skills` |
|
|
57
|
+
| `cursor` | Cursor | `~/.cursor/skills/flow` | `~/.cursor/skills` (never the bare `~/.cursor` config dir every Cursor user has) |
|
|
72
58
|
|
|
73
59
|
`--project` scope writes to `<dir>/.claude/skills/flow` and supports only the `claude` target. Combining `--project` with a non-Claude target exits with code `2`.
|
|
74
60
|
|
|
75
61
|
## After install
|
|
76
62
|
|
|
63
|
+
A freshly-installed skill isn't discovered by an agent until it reloads — the installer's final
|
|
64
|
+
line tells you exactly what to do for whichever targets you installed:
|
|
65
|
+
|
|
77
66
|
- Claude Code: type `/flow`.
|
|
78
|
-
- Codex CLI: type `$flow` (restart Codex once to load).
|
|
79
|
-
- Antigravity:
|
|
67
|
+
- Codex CLI: type `$flow` (restart Codex once to load a new skill).
|
|
68
|
+
- Antigravity: restart/reload the IDE (or restart `agy`) to load the new skill, then type `/flow`.
|
|
69
|
+
- Agents home (`~/.agents/skills/`): restart/reload your tool if it does not auto-detect new skills.
|
|
70
|
+
- Cursor: **install verified, live runner execution not yet independently confirmed** — Cursor
|
|
71
|
+
has no headless CLI probe available for automated verification (unlike Antigravity's `agy -p`
|
|
72
|
+
or Codex's `codex exec`); restart/reload Cursor after install and check the Agent panel for
|
|
73
|
+
the `flow` skill.
|
|
80
74
|
- Diagnostics: run `/flow doctor` from your agent.
|
|
81
75
|
|
|
82
76
|
## Uninstall
|
|
@@ -100,14 +94,16 @@ rm -rf <project>/.claude/skills/flow
|
|
|
100
94
|
- **Windows `EBUSY` / `EPERM` mid-install**: an agent (Claude Code, Codex, Antigravity IDE) is holding a file inside the destination. Close the agent and re-run. The installer already retries with 100/300/900 ms backoff before surfacing the error.
|
|
101
95
|
- **Stale advisory lock**: a prior run crashed. The next run detects the dead PID and reclaims the lock automatically. If it does not (very rare — the recorded PID was recycled by another live process), delete `<parent-of-dest>/.flow-skill.installing.lock`.
|
|
102
96
|
- **`No matching version found` on `@0.1.x`**: you are trying to install a pre-release version through a stable range. Use `@rc` (dist-tag) or an explicit `@0.1.0-rc.N` until stable `0.1.0` ships.
|
|
103
|
-
-
|
|
97
|
+
- **`No matching version found` on `@0.22.0`**: that is the **skill product** version, not the npm package version. Use `@rc` / `@0.1.0-rc.N` (installer) — skill content version is printed by `--help` as `ships skill v…`.
|
|
98
|
+
- **Installed package but agent has no `/flow`**: `npm i` does not run the installer. Run `npx @manhquy/flow-skill@rc` (or `npx flow-skill` if already installed) and restart the agent.
|
|
99
|
+
- **Node too old** (`requires Node.js >=22.14.0`): upgrade with your preferred version manager (`nvm install 22`, `fnm install 22`, or Node's official installer). Node 20 reached end-of-life April 2026; npm OIDC Trusted Publishing needs npm >=11.5.1 which bundles with Node 22.14+.
|
|
104
100
|
|
|
105
101
|
## JSONL contract
|
|
106
102
|
|
|
107
103
|
`--json` streams one JSON object per line:
|
|
108
104
|
|
|
109
105
|
```jsonl
|
|
110
|
-
{"event":"plan","version":"0.1.0-rc.
|
|
106
|
+
{"event":"plan","version":"0.1.0-rc.3","skillVersion":"0.22.0","dryRun":false,"scope":"global","targets":["claude","codex"]}
|
|
111
107
|
{"event":"install:start","target":"claude","dests":["~/.claude/skills/flow"]}
|
|
112
108
|
{"event":"install:done","target":"claude","dests":["~/.claude/skills/flow"],"result":"success","error":null,"warnings":[]}
|
|
113
109
|
{"event":"summary","success":true,"total":2,"attempted":2,"installed":2,"failed":0,"skipped":0,"aborted":false}
|
|
@@ -119,7 +115,7 @@ rm -rf <project>/.claude/skills/flow
|
|
|
119
115
|
|
|
120
116
|
| Event | Required fields | Notes |
|
|
121
117
|
|---|---|---|
|
|
122
|
-
| `plan` | `version` (string), `dryRun` (bool), `scope` (`global`\|`project`), `targets` (string[]) | Always the first event. |
|
|
118
|
+
| `plan` | `version` (string), `dryRun` (bool), `scope` (`global`\|`project`), `targets` (string[]), optional `skillVersion` (string\|null) | Always the first event. `version` = npm package; `skillVersion` = bundled `SKILL.md` product version. |
|
|
123
119
|
| `install:start` | `target` (string), `dests` (string[]) | One per selected target. |
|
|
124
120
|
| `install:done` | `target`, `dests`, `result` (`success`\|`failed`), `error` (string\|null), `warnings` (string[]) | Fired after each target. `error` is `null` on success. |
|
|
125
121
|
| `summary` | `success` (bool), `total`, `attempted`, `installed`, `failed`, `skipped`, `aborted` (bool) | Always the last event. Counts sum: `attempted = installed + failed`; `skipped = total - attempted`. |
|
package/README_VN.md
CHANGED
|
@@ -7,39 +7,16 @@ Trình cài đặt một-lệnh sao chép skill [flow](https://github.com/manhqu
|
|
|
7
7
|
- Bảo toàn file người dùng đã thêm ngoài 6 subdir mà skill sở hữu.
|
|
8
8
|
- Ship kèm [npm provenance](https://docs.npmjs.com/generating-provenance-statements) qua GitHub Actions trusted publishing (từ rc.2+).
|
|
9
9
|
|
|
10
|
-
## Tình trạng — 2026-07-12
|
|
11
|
-
|
|
12
|
-
- ✅ Code hoàn thiện, 35/35 test xanh, CI matrix xanh (ubuntu/macos/windows × Node 22/24).
|
|
13
|
-
- ⏳ Chưa lên npm registry. Repo đã public + đã rename; transfer sang `manhquy` account đang chờ accept; first publish (`v0.1.0-rc.1`, thủ công, không có provenance) đang queued.
|
|
14
|
-
- ➡️ Sau khi publish, section này sẽ biến mất và `npx @manhquy/flow-skill@rc` thành lệnh cài chính thức.
|
|
15
|
-
|
|
16
10
|
## Cài đặt
|
|
17
11
|
|
|
18
|
-
**A. Từ git repo (chạy được ngay, không cần npm registry)**
|
|
19
|
-
|
|
20
|
-
```bash
|
|
21
|
-
git clone https://github.com/manhquydev/flow-skill.git
|
|
22
|
-
cd flow-skill/npm-wrapper
|
|
23
|
-
npm install
|
|
24
|
-
npm run sync # materialize skills/flow từ ../skills/flow
|
|
25
|
-
npm link # expose `flow-skill` như global command
|
|
26
|
-
|
|
27
|
-
flow-skill --yes --all --dry-run --json # smoke check
|
|
28
|
-
flow-skill # cài tương tác
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
Gỡ: `npm unlink -g @manhquy/flow-skill`.
|
|
32
|
-
|
|
33
|
-
**B. Qua npx (sau khi publish)**
|
|
34
|
-
|
|
35
12
|
```
|
|
36
|
-
# Kênh pre-release (
|
|
13
|
+
# Kênh pre-release (hiện tại — v0.1.0-rc.2)
|
|
37
14
|
npx @manhquy/flow-skill@rc
|
|
38
15
|
```
|
|
39
16
|
|
|
40
17
|
Prompt tương tác hỏi cài vào agent nào. Chọn một hoặc nhiều, xác nhận, xong.
|
|
41
18
|
|
|
42
|
-
> **Giai đoạn RC**: pin `@rc` (dist-tag) hoặc phiên bản cụ thể `@0.1.0-rc.
|
|
19
|
+
> **Giai đoạn RC**: pin `@rc` (dist-tag) hoặc phiên bản cụ thể `@0.1.0-rc.2`. `npx @manhquy/flow-skill@0.1.x` chỉ dùng được sau khi stable `0.1.0` publish — semver range **không** match pre-release theo mặc định. Xem [SECURITY.md](./SECURITY.md).
|
|
43
20
|
|
|
44
21
|
## Non-interactive
|
|
45
22
|
|
|
@@ -51,7 +28,7 @@ npx @manhquy/flow-skill@rc --yes
|
|
|
51
28
|
npx @manhquy/flow-skill@rc --yes -t claude -t codex
|
|
52
29
|
npx @manhquy/flow-skill@rc --yes -t claude,codex # Dạng comma OK
|
|
53
30
|
|
|
54
|
-
# Ép cài cả
|
|
31
|
+
# Ép cài cả 5 target dù không detect
|
|
55
32
|
npx @manhquy/flow-skill@rc --yes --all
|
|
56
33
|
|
|
57
34
|
# Project scope (chỉ Claude — xem bên dưới)
|
|
@@ -67,16 +44,24 @@ npx @manhquy/flow-skill@rc --yes --all --dry-run --json
|
|
|
67
44
|
|---|---|---|---|
|
|
68
45
|
| `claude` | Claude Code | `~/.claude/skills/flow` | bất kỳ presence của `~/.claude` (Claude luôn pre-check) |
|
|
69
46
|
| `codex` | Codex CLI | `~/.codex/skills/flow` | `~/.codex/skills` |
|
|
70
|
-
| `agents` | Agents home | `~/.agents/skills/flow` | `~/.agents/skills` |
|
|
47
|
+
| `agents` | Agents home — cũng là thư mục [Agent-Skills](https://agentskills.io) chung mà các tool tuân chuẩn khác đọc | `~/.agents/skills/flow` | `~/.agents/skills` |
|
|
71
48
|
| `antigravity` | Antigravity (CLI + IDE) | `~/.gemini/antigravity-cli/skills/flow` **và** `~/.gemini/config/skills/flow` | `~/.gemini/antigravity-cli` **hoặc** `~/.gemini/config/skills` |
|
|
49
|
+
| `cursor` | Cursor | `~/.cursor/skills/flow` | `~/.cursor/skills` (không bao giờ dùng thư mục config `~/.cursor` trần — ai dùng Cursor cũng có) |
|
|
72
50
|
|
|
73
51
|
Scope `--project` ghi vào `<dir>/.claude/skills/flow` và chỉ hỗ trợ target `claude`. Kết hợp `--project` với target khác → exit code `2`.
|
|
74
52
|
|
|
75
53
|
## Sau khi cài
|
|
76
54
|
|
|
55
|
+
Skill vừa cài xong sẽ không được agent nhận ra cho tới khi agent reload — dòng cuối cùng của
|
|
56
|
+
installer nói rõ việc cần làm cho đúng target đã cài:
|
|
57
|
+
|
|
77
58
|
- Claude Code: gõ `/flow`.
|
|
78
|
-
- Codex CLI: gõ `$flow` (restart Codex 1 lần để load).
|
|
79
|
-
- Antigravity:
|
|
59
|
+
- Codex CLI: gõ `$flow` (restart Codex 1 lần để load skill mới).
|
|
60
|
+
- Antigravity: restart/reload IDE (hoặc restart `agy`) để load skill mới, rồi gõ `/flow`.
|
|
61
|
+
- Agents home: restart/reload tool nếu nó không tự nhận skill mới.
|
|
62
|
+
- Cursor: **đã xác nhận cài đúng chỗ, chưa xác nhận runner chạy độc lập** — Cursor không có
|
|
63
|
+
CLI headless để tự động kiểm (khác `agy -p` của Antigravity hay `codex exec` của Codex);
|
|
64
|
+
restart/reload Cursor sau khi cài rồi kiểm tra panel Agent xem có skill `flow` không.
|
|
80
65
|
- Chẩn đoán: chạy `/flow doctor` từ agent.
|
|
81
66
|
|
|
82
67
|
## Gỡ cài đặt
|
|
@@ -111,7 +96,7 @@ Hợp đồng additive trong `0.1.x` — field mới có thể thêm, field cũ
|
|
|
111
96
|
- **`EBUSY`/`EPERM` giữa install trên Windows**: một agent đang giữ handle vào file trong destination. Đóng agent + re-run. Installer đã retry 100/300/900 ms trước khi báo error.
|
|
112
97
|
- **Advisory lock cũ**: run trước crash. Run mới tự phát hiện PID dead → reclaim. Trường hợp hiếm (PID được recycle bởi process khác đang chạy): xóa `<parent-of-dest>/.flow-skill.installing.lock`.
|
|
113
98
|
- **`No matching version found` với `@0.1.x`**: cài pre-release qua stable range. Dùng `@rc` hoặc `@0.1.0-rc.N` cho tới khi stable `0.1.0` ship.
|
|
114
|
-
- **Node quá cũ** (`requires Node.js >=
|
|
99
|
+
- **Node quá cũ** (`requires Node.js >=22.14.0`): update bằng `nvm install 22`, `fnm install 22`, hoặc installer chính thức của Node. Node 20 hết vòng đời từ 4/2026; npm OIDC Trusted Publishing cần npm >=11.5.1 (bundle theo Node 22.14+).
|
|
115
100
|
|
|
116
101
|
## Yêu cầu
|
|
117
102
|
|
|
@@ -125,6 +110,11 @@ Mỗi phiên bản publish có [npm provenance](https://docs.npmjs.com/generatin
|
|
|
125
110
|
npm view @manhquy/flow-skill@<version> dist.attestations.provenance
|
|
126
111
|
```
|
|
127
112
|
|
|
113
|
+
> **Ngoại lệ RC-window**: `v0.1.0-rc.1` được publish thủ công từ máy developer để bootstrap npm
|
|
114
|
+
> Trusted Publisher (TP không thể bind tới package chưa tồn tại) — bản này không có provenance.
|
|
115
|
+
> Từ `v0.1.0-rc.2` trở đi, mọi bản publish đều qua CI workflow với OIDC và có attestation
|
|
116
|
+
> SLSA Build Level 2 đầy đủ.
|
|
117
|
+
|
|
128
118
|
## Bảo mật
|
|
129
119
|
|
|
130
120
|
Threat model + WILL/WON'T list + kênh report — xem [SECURITY.md](./SECURITY.md). Tóm tắt: pure Node, không network call, không spawn shell/PowerShell, không postinstall hook, không chạm settings/hooks/MCP config.
|
package/SECURITY.md
CHANGED
|
@@ -55,7 +55,7 @@ These match the behavior of the upstream `install.sh`; they are documented rathe
|
|
|
55
55
|
```
|
|
56
56
|
npm view @manhquy/flow-skill@<version> dist.attestations.provenance
|
|
57
57
|
```
|
|
58
|
-
**`v0.1.0-rc.1` exception**: this bootstrap version was published manually (Trusted Publisher requires the package to already exist before it can bind) and carries no attestation.
|
|
58
|
+
**`v0.1.0-rc.1` exception**: this bootstrap version was published manually (Trusted Publisher requires the package to already exist before it can bind) and carries no attestation. `v0.1.0-rc.2` (2026-07-17) is the first version published from CI via OIDC — confirmed live with an SLSA Build Level 2 attestation. All versions from rc.2 onward are attested; if provenance is a hard requirement, pin `@0.1.0-rc.2` or later.
|
|
59
59
|
- **Publisher account.** npm 2FA `auth-and-writes` is enabled as defense-in-depth for the git + npm identity behind the workflow.
|
|
60
60
|
- **Pin your version.** During the RC window use `@rc` (dist-tag) or an explicit `@0.1.0-rc.N`. After stable ships, pin `@0.1.x` (or a specific version). `@latest` invites blind updates on a package that writes to your agent home.
|
|
61
61
|
- **Completeness signal (not tamper detection).** The tarball ships `skills-manifest.json` recording the synced skill's file count + list. The publish workflow re-counts the checked-out tree against this manifest to catch an incomplete sync. It is **not** a supply-chain integrity proof — that role belongs to npm provenance above. `.integrity` SHA-256 sidecar was intentionally not adopted because it would have been generated from the same source it hashed (circular trust).
|
package/bin/cli.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
4
4
|
import { join, resolve } from 'node:path';
|
|
5
5
|
import { existsSync } from 'node:fs';
|
|
6
6
|
|
|
7
|
-
import { TARGETS, TARGET_NAMES, PKG_VERSION } from '../src/constants.mjs';
|
|
7
|
+
import { TARGETS, TARGET_NAMES, PKG_VERSION, SKILL_VERSION } from '../src/constants.mjs';
|
|
8
8
|
import { defaultSelection, detectAll } from '../src/detect.mjs';
|
|
9
9
|
import { renderHelp } from '../src/help.mjs';
|
|
10
10
|
import { install, installAntigravity } from '../src/installer.mjs';
|
|
@@ -147,6 +147,29 @@ function humanResult(target, result) {
|
|
|
147
147
|
return `${status} ${target} -> ${dests}${err}`;
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
+
// v0.23 A0 fix — the reported symptom: a user installs to a non-Claude agent, opens it, types
|
|
151
|
+
// /flow, and sees nothing, because a freshly-installed skill isn't discovered until the agent
|
|
152
|
+
// reloads. The old static message only told Claude+Codex users what to do; every installed
|
|
153
|
+
// target now gets its own line so nobody is left guessing why /flow doesn't show up.
|
|
154
|
+
const RESTART_HINTS = {
|
|
155
|
+
claude: 'Claude Code: type /flow',
|
|
156
|
+
codex: 'Codex CLI: type $flow (restart Codex once to load a new skill)',
|
|
157
|
+
antigravity:
|
|
158
|
+
'Antigravity: restart/reload the IDE (or restart `agy`) to load the new skill, then type /flow',
|
|
159
|
+
agents:
|
|
160
|
+
'Agents home (~/.agents/skills/): restart/reload your tool if it does not auto-detect new skills',
|
|
161
|
+
// Cursor has no headless CLI probe (unlike Antigravity's `agy -p` or Codex's `codex exec`) to
|
|
162
|
+
// independently verify the runner loads post-install — restart/reload guidance is still the
|
|
163
|
+
// correct advice (same discovery-on-reload mechanism), just without our own live confirmation
|
|
164
|
+
// that the Agent panel picks it up. See README's "After install" section for the caveat.
|
|
165
|
+
cursor: 'Cursor: restart/reload Cursor to load the new skill, then check the Agent panel for flow',
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
function doneLine(targets) {
|
|
169
|
+
const hints = targets.map((t) => RESTART_HINTS[t]).filter(Boolean);
|
|
170
|
+
return `Done. ${hints.join(' | ')}`;
|
|
171
|
+
}
|
|
172
|
+
|
|
150
173
|
async function main() {
|
|
151
174
|
const rawArgs = process.argv.slice(2);
|
|
152
175
|
let opts;
|
|
@@ -265,6 +288,9 @@ async function main() {
|
|
|
265
288
|
{
|
|
266
289
|
event: 'plan',
|
|
267
290
|
version: PKG_VERSION,
|
|
291
|
+
// Additive: skill product version (SKILL.md). `version` stays the npm package version
|
|
292
|
+
// for back-compat with existing JSONL consumers.
|
|
293
|
+
skillVersion: SKILL_VERSION,
|
|
268
294
|
dryRun: opts.dryRun,
|
|
269
295
|
scope,
|
|
270
296
|
targets: plan.map((p) => p.target),
|
|
@@ -346,10 +372,7 @@ async function main() {
|
|
|
346
372
|
);
|
|
347
373
|
|
|
348
374
|
if (!opts.json && success) {
|
|
349
|
-
log(
|
|
350
|
-
'\nDone. Claude Code: type /flow | Codex CLI: type $flow (restart Codex once).',
|
|
351
|
-
false
|
|
352
|
-
);
|
|
375
|
+
log(`\n${doneLine(plan.map((p) => p.target))}`, false);
|
|
353
376
|
}
|
|
354
377
|
|
|
355
378
|
// If aborted mid-loop, exit 130 (matches shell convention) instead of the generic failure.
|
|
@@ -360,6 +383,9 @@ async function main() {
|
|
|
360
383
|
main().catch((err) => {
|
|
361
384
|
// F2 — a crash inside main() must not truncate JSONL: emit a machine-parseable summary
|
|
362
385
|
// before exit so CI consumers can distinguish "crashed" from "hung".
|
|
386
|
+
// Argv fallback: `--json` is a boolean flag with no alias in parseArgs config, so a raw
|
|
387
|
+
// string match on process.argv is safe today; if the flag ever gets an alias or
|
|
388
|
+
// `--json=true` form, hoist `jsonMode` to module scope from parseCliArgs instead.
|
|
363
389
|
const isJson = process.argv.includes('--json');
|
|
364
390
|
const message = err?.message ?? String(err);
|
|
365
391
|
if (isJson) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manhquy/flow-skill",
|
|
3
|
-
"version": "0.1.0-rc.
|
|
3
|
+
"version": "0.1.0-rc.3",
|
|
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": {
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
"scripts": {
|
|
24
24
|
"sync": "node scripts/sync.mjs",
|
|
25
25
|
"prepack": "node scripts/sync.mjs",
|
|
26
|
-
"
|
|
26
|
+
"pretest": "node scripts/sync.mjs",
|
|
27
|
+
"test": "node --test --test-concurrency=1 test/installer.test.mjs test/detect.test.mjs test/cli.test.mjs test/lock-atomicity.test.mjs test/sync-manifest.test.mjs",
|
|
27
28
|
"smoke": "node scripts/smoke.mjs"
|
|
28
29
|
},
|
|
29
30
|
"dependencies": {
|