@mhd-ghaith-abtah/flow 0.7.2-beta.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 (53) hide show
  1. package/CHANGELOG.md +87 -0
  2. package/LICENSE +21 -0
  3. package/README.md +162 -0
  4. package/adapters/e2e/_interface.md +42 -0
  5. package/adapters/e2e/none.md +15 -0
  6. package/adapters/e2e/playwright-mcp.md +86 -0
  7. package/adapters/issue-tracker/_interface.md +46 -0
  8. package/adapters/issue-tracker/github-issues.md +103 -0
  9. package/adapters/issue-tracker/linear.md +65 -0
  10. package/adapters/issue-tracker/none.md +26 -0
  11. package/adapters/pr/_interface.md +29 -0
  12. package/adapters/pr/github.md +61 -0
  13. package/adapters/pr/none.md +32 -0
  14. package/adapters/verify/_interface.md +26 -0
  15. package/adapters/verify/custom.md +27 -0
  16. package/adapters/verify/make.md +30 -0
  17. package/adapters/verify/pnpm.md +27 -0
  18. package/bin/flow.js +129 -0
  19. package/catalog.yaml +364 -0
  20. package/docs/adapters.md +99 -0
  21. package/docs/migrate-from-bmad.md +95 -0
  22. package/docs/profiles.md +81 -0
  23. package/docs/quickstart.md +82 -0
  24. package/lib/catalog.js +164 -0
  25. package/lib/commands/add.js +147 -0
  26. package/lib/commands/doctor.js +392 -0
  27. package/lib/commands/init.js +86 -0
  28. package/lib/commands/install.js +181 -0
  29. package/lib/commands/plan.js +108 -0
  30. package/lib/commands/remove.js +87 -0
  31. package/lib/commands/uninstall.js +157 -0
  32. package/lib/repo-root.js +53 -0
  33. package/package.json +62 -0
  34. package/schemas/catalog.schema.json +155 -0
  35. package/schemas/flow-config.schema.json +85 -0
  36. package/schemas/install-state.schema.json +79 -0
  37. package/skills/flow-doctor/SKILL.md +15 -0
  38. package/skills/flow-doctor/workflow.md +157 -0
  39. package/skills/flow-init/SKILL.md +10 -0
  40. package/skills/flow-init/workflow.md +420 -0
  41. package/skills/flow-sprint/SKILL.md +10 -0
  42. package/skills/flow-sprint/workflow.md +394 -0
  43. package/skills/flow-story/SKILL.md +12 -0
  44. package/skills/flow-story/workflow.md +531 -0
  45. package/templates/claude-md-section.md.tmpl +55 -0
  46. package/templates/flow-readme.md.tmpl +34 -0
  47. package/templates/flow.config.yaml.tmpl +94 -0
  48. package/templates/pr.md.tmpl +40 -0
  49. package/templates/retro.md.tmpl +58 -0
  50. package/templates/sprint.yaml.tmpl +18 -0
  51. package/templates/story.md.tmpl +35 -0
  52. package/tools/fix-caveman-shrink.sh +68 -0
  53. package/tools/lint-changelog.js +98 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,87 @@
1
+ # Changelog
2
+
3
+ All notable changes to Flow are documented in this file.
4
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
5
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.7.2-beta.0] — 2026-05-19
10
+
11
+ ### Changed
12
+ - `package.json` `files` block tightened for first npm publish: exclude `*.test.js` (internal unit tests, not user examples) and `docs/flow/` (Flow's internal dogfood backlog — sprint.yaml, scope-reviews, deferred ledger). Tarball drops from 61 → 53 files, 91.2 kB → 80.8 kB packed. User-runnable utilities (`tools/lint-changelog.js`, `tools/fix-caveman-shrink.sh`) added to the allowlist.
13
+
14
+ ## [0.7.1] — 2026-05-19
15
+
16
+ ### Added
17
+ - `/flow-init` now drops a `.caveman-enable` zero-byte marker in the project root. Pairs with the upstream Caveman PR ([JuliusBrussee/caveman#407](https://github.com/JuliusBrussee/caveman/pull/407)) that adds project-scope gating via `.caveman-enable` / `.caveman-disable` markers + env var + config allow/deny lists. Flow's own repo carries the marker so contributors keep Caveman active here even with global default flipped to off. Fully closes #9 + #25 once the upstream PR merges.
18
+ - `docs/flow/scope-reviews/2026-05-19.md` — first scope-review dogfood run on Flow's own backlog. Spawned background general-purpose agent against `docs/flow/sprint.yaml` + reference docs + git log. Output: 3 merges + 3 drops + 3 splits + 7 adds + 3 epic-reconsiderations proposed; all 3 merges / drops / splits and all 7 adds applied; light epic change (E5 renamed CLI + release-hardening; full re-cut deferred to v0.8). `sprint.yaml` grew 32 → 46 stories with retroactive attribution for hidden CHANGELOG work. Honest postmortem flagged E5 as scope creep and E3-007 docs story as too coarse. Closes #14.
19
+
20
+ ### Fixed
21
+ - Upstream Caveman PR #407 hot-fix: project-scope check now precedes the global `off` branch so `.caveman-enable` actually activates caveman when the user has flipped global default to `off` (allowlist mode). Original logic order silently broke the canonical workflow. Pushed as commit `5602309` to the PR branch with 2 new test cases. Local install also patched. `~/.config/caveman/config.json` now set to `{"defaultMode":"off"}` so non-Flow projects stay silent; Flow projects activate via `.caveman-enable` marker that `/flow-init` drops.
22
+ - E5-009 — stripped the false `/flow-sprint scope-review --apply-from <path>` promise from the workflow. Text now points at same-day re-run for resumed interactive apply.
23
+
24
+ ### Added
25
+ - `flow doctor --repair-upstream <bmad|ecc|caveman>` — prints the exact commands to reinstall an upstream at its pinned version after drift. Does NOT auto-run (upstream installers touch user-scope state and curl-pipe-bash should never be implicit). Closes E5-005.
26
+ - `tools/lint-changelog.js` + `changelog-format` CI job — enforces CONTRIBUTING.md's "one-line entries" rule. Flags wrapped CHANGELOG entries with line numbers. Honors fenced code blocks and indented continuation. Closes E5-006.
27
+ - `lib/commands/doctor.test.js`, `install.test.js`, `add.test.js`, `remove.test.js`, `tools/lint-changelog.test.js` — coverage for the previously-untested CLI command modules plus the new linter. Suite now 51/51 (was 18 before this batch).
28
+
29
+ ### Changed
30
+ - README refreshed for v0.7.0: install status block now states the truth (clone + dev-link works; npm publish pending as E1-002), "three skills" → four (flow-doctor added), install bullets mention Caveman installer + SHA-256 inspection + `.caveman-enable` marker + BMad migration backup. The Caveman scope FAQ entry now links to [JuliusBrussee/caveman#407](https://github.com/JuliusBrussee/caveman/pull/407) and documents the `{"defaultMode": "off"}` + allowlist mode you can apply today.
31
+ - E5-007 — stripped the team-profile `features` block (`multi_repo: true`, `multi_llm_review: true`, `audit_log: true`) from catalog.yaml. All three had zero implementation; `multi_llm_review` was a renamed duplicate of `review.use_separate_model` which is real. README + `docs/profiles.md` team-profile descriptions rewritten to ship-as-stated. Read-only multi-repo awareness tracked as deferred E5-010 (build on real demand, not speculatively).
32
+ - `flow.config.yaml` + `docs/flow/sprint.yaml` + `docs/flow/deferred.md` — Flow now dogfoods Flow. Sprint state maps the 28-issue v0.6.1 review backlog to 5 epics. `/flow-sprint scope-review` can now be run on Flow's own backlog (closes prep for #14).
33
+ - `lib/commands/doctor.js` — `flow doctor` headless health check. Probes catalog parse + schema, install-state at each scope, flow.config.yaml shape, adapter file presence + symlink kind (mixed-state warning), required CLIs in $PATH, upstream pin status. Exit code 0/1/2 for ok/warn/fail. JSON output via `--json`. LLM-dependent probes (MCP responsiveness, severity-label scan) remain in `/flow-doctor` skill.
34
+ - `lib/commands/install.js` — `flow install` headless install path. Runs catalog operations (copy components, ensure dirs, touch state) but intentionally does NOT invoke BMad/ECC/Caveman/MCP installers (those need interactive auth + curl-pipe-bash confirmations). Surfaces clear "next steps" hand-off to `/flow-init` for the remainder.
35
+ - `lib/commands/add.js` + `lib/commands/remove.js` — single-adapter swap via CLI. `flow add adapter:e2e-playwright-mcp --yes` copies adapter files AND updates `flow.config.yaml.adapters.<family>`. `flow remove` flips the family back to its `none` variant (Flow expects SOME adapter per family) without deleting adapter files from disk.
36
+ - `lib/commands/plan.test.js` + `lib/commands/uninstall.test.js` — coverage for the CLI command modules. Suite now 18 tests, all green.
37
+
38
+ ## [0.7.0] — 2026-05-19
39
+
40
+ ### Added
41
+ - `flow-doctor` skill — health check for catalog / state / adapters / MCPs / CLIs / upstreams + probes for known bugs (caveman-shrink standalone vs wrapper, stripped severity labels, loose `## Plan` markers, upstream version drift, Caveman global scope, adapter symlink drift). Supports `--fix` for safe auto-repairs. Closes #7.
42
+ - `lib/catalog.js` + `lib/repo-root.js` + `lib/commands/plan.js` + `lib/commands/init.js` + `lib/commands/uninstall.js` — first real implementation of the `flow` CLI commands (replaces stub dispatch). `flow plan` resolves profiles with `extends:` inheritance and adapter family-override; `--json` emits machine-readable plan. `flow uninstall` defaults to `--scope project` (safe), dry-runs by default, requires `--execute --yes` to actually remove. Does NOT touch BMad / ECC / Caveman. Closes #1 (code path), #8.
43
+ - `lib/catalog.test.js` — first test file. 7 tests pass under `npm test` (`node --test`). Closes second half of #3.
44
+ - `.github/workflows/ci.yml` — GitHub Actions CI on push + PR. Matrix Node 20 + 22. Runs `npm test`, smoke-tests all four profiles, shellchecks `tools/`, enforces the CHANGELOG-touched rule from CONTRIBUTING.md. Closes second half of #3.
45
+ - `.github/PULL_REQUEST_TEMPLATE.md` — PR checklist matching CONTRIBUTING.md.
46
+ - `schemas/catalog.schema.json`, `schemas/install-state.schema.json`, `schemas/flow-config.schema.json` — JSON Schema (draft-07) for the three hand-editable surfaces. `loadCatalog` runs ajv validation when the schema is present; throws with grouped error messages on violation. New test asserts the shipped `catalog.yaml` passes its own schema. Closes #11.
47
+ - `tools/fix-caveman-shrink.sh` — print-only repair for the caveman-shrink standalone-vs-wrapper MCP registration bug. Does NOT auto-run `claude mcp` (modifying MCP registration affects every session). Closes #5.
48
+ - `tools/release.sh` — release-cutting script. Sanity-checks (clean tree, on main, up to date), runs tests + smoke, moves `[Unreleased]` to dated heading, bumps `package.json`, commits + tags + pushes. Supports `patch | minor | major | <explicit-version>` + `--dry-run` + `--no-push`. Closes #22.
49
+ - `CONTRIBUTING.md` — setup, branch conventions, CHANGELOG-on-every-PR rule, versioning + release flow, PR checklist. Closes #23.
50
+ - `docs/quickstart.md`, `docs/profiles.md`, `docs/adapters.md`, `docs/migrate-from-bmad.md` — first real documentation pass. Covers 10-min path to first shipped story, profile selection rationale, adapter contract + inventory, BMad → Flow migration including rollback. Closes #17.
51
+ - README FAQ section (8 questions: BMad/ECC/Flow split, profile selection, Caveman, GitHub-free workflows, upgrade, uninstall, config-commit safety, bug reports) + "When to use which command" precedence table (BMad / Flow / ECC mapping per lifecycle phase). Closes #20 + #27.
52
+ - Curl-pipe-bash inspection (when `FLOW_INSPECT_INSTALL_SCRIPTS=1`) now prints the downloaded script's SHA-256 alongside path + line count. Closes #21.
53
+
54
+ ### Changed
55
+ - README: stripped premature `npx @mhd-ghaith-abtah/flow-init` claim; documented current state as slash-command only until v0.7 npm publish lands.
56
+ - `flow.config.yaml` is now explicitly committed (team-share); per-developer overrides go in `flow.config.local.yaml` (gitignored). `flow-story` deep-merges local on top of base. Template comment + `flow-init` gitignore additions cover the new convention.
57
+ - `caveman-commit` now receives raw inputs (story.id, title, tags, changed_files, severity counts, verify command, e2e status) instead of the caveman-compressed `## Review Notes` block — eliminates double-compression that was degrading commit-message quality.
58
+ - `--auto-merge` no longer polls 30s × 15min (≈30 `gh pr view` calls eating main-context). Single 90s wait, then either continue to merge-done (fast-CI case) or end turn with a handoff. Next `/flow-story` invocation re-checks. Configurable via `config.pr.auto_merge_wait_seconds`.
59
+ - `flow-story` review barrier: 15-min wall-clock timeout (configurable via `config.review.barrier_timeout_seconds`). Timed-out reviewers no longer deadlock the commit phase — they halt with explicit options instead of waiting forever.
60
+ - `flow-story` severity gate: hardened against caveman-review label stripping. Raw severity counts (from un-compressed reviewer output) are now the single source of truth; compressed `## Review Notes` get a `Findings: X critical · Y high · …` header prepended if all severity tokens are stripped.
61
+
62
+ ### Fixed
63
+ - Cycle-detection in profile inheritance (`resolveProfile` throws on cycles instead of stack-overflowing).
64
+ - `flow-story` plan phase decision tree restructured. Six lettered paths (A–F) collapsed into four numbered branches, ordered from most-specific (flag-driven) to default. Comments now explicitly state when each branch fires (e.g., "Caveman not installed AND --auto"). Resolves the "unreachable paths E + F when Caveman installed" confusion. Closes #15.
65
+ - `/flow-init --migrate-bmad` now stages backups (`*.flow-backup-<timestamp>`) of `sprint-status.yaml`, `deferred-work.md`, and any pre-existing `docs/flow/sprint.yaml` BEFORE any migration write. Validates produced `sprint.yaml` after write; if parse fails or story count drops to zero, restores from backups and halts with the parse error. Backup paths recorded in `install-state.json.migrations.bmad.backups`. Documented in `docs/migrate-from-bmad.md` was previously aspirational — now implemented. Closes #19.
66
+ - `/flow-init` now records the installed version of every upstream (BMad / ECC / Caveman) at install time in `install-state.json.upstreams.<name>.version`. `flow-doctor` adds a version-drift probe that warns when the currently-installed version differs from the pinned version — catches silent BMad/ECC/Caveman interface changes. Closes #12.
67
+ - `/flow-sprint add` story-id detection now supports `tracker-style` (e.g. `PLA-42`, `ENG-100`), `kebab` (e.g. `setup-auth`), and `custom` formats alongside `bmad` and `flow-native`. Free-form formats prompt for the next id instead of HALTing on "unrecognized format". Closes #26.
68
+ - `/flow-doctor` adapter probe now distinguishes `symlink → <target>`, `regular_file` (mixed-state drift warning), and `missing` for each adapter file. Resolves the previously-undefined behavior when a project mixes real adapter files with Flow's symlinks. Closes #28.
69
+ - Anchored `## Plan` / `## Review Notes` / `## Verified` / `## E2E` marker detection in `flow-story` phase decision. Previous loose match (`grep -c '^## Plan'`) false-matched `## Plan B` or `## Planning`. Now requires exact heading.
70
+ - `flow-doctor` caveman-shrink probe corrected: caveman-shrink is an MCP proxy (not a skill). Probe now reads `claude mcp get caveman-shrink` and flags standalone registrations that cause `-32000` errors. `tools/fix-caveman-shrink.sh` prints the exact remove + re-add commands (does NOT auto-run — MCP registration affects every Claude Code session).
71
+
72
+
73
+ ## [0.0.1] — 2026-05-18
74
+
75
+ ### Added
76
+ - Initial scaffold: `flow-init`, `flow-sprint`, `flow-story` skills
77
+ - Catalog (`catalog.yaml`) with profiles `mini`, `standard`, `team`
78
+ - Adapter interfaces for `issue-tracker`, `pr`, `e2e`, `verify`
79
+ - v0.1 adapters: `linear`, `github-issues`, `none` (issue-tracker);
80
+ `github`, `none` (pr); `playwright-mcp`, `none` (e2e); `make`, `pnpm`, `custom` (verify)
81
+ - BMad delegation: invokes `npx bmad-method install --modules <curated>`
82
+ - ECC delegation: invokes `./install.sh --profile <curated> --with --without`
83
+ - MCP integration: `context7`, `playwright`, `linear`, `github-mcp` (optional)
84
+ - Node CLI binary (`bin/flow.js`) with subcommands `install`, `plan`, `status`, `doctor`, `add`, `remove`, `uninstall`
85
+ - Slash command parity inside Claude Code
86
+ - Migration from BMad `sprint-status.yaml`
87
+ - State store at `~/.claude/flow/install-state.json` and `<project>/.claude/flow/install-state.json`
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Mhd Ghaith Al Abtah
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,162 @@
1
+ # Flow
2
+
3
+ > Token-light per-story workflow for Claude Code. Delegates to BMad + ECC + Caveman instead of duplicating them.
4
+
5
+ Flow is a thin orchestration layer. It owns three things:
6
+ - Per-story state (`sprint.yaml` + tiny story files)
7
+ - Pluggable adapters (issue tracker, PR platform, E2E, verify)
8
+ - An installer that **invokes BMad, ECC, and Caveman's own installers** so you choose exactly which upstream pieces land in your project
9
+
10
+ Everything else is delegated:
11
+ - `/plan`, `/prp-implement`, `/code-review`, `/update-docs` etc. come from [ECC](https://github.com/affaan-m/everything-claude-code)
12
+ - PRD + architecture + epics + retros come from [BMad](https://github.com/bmad-code-org/BMAD-METHOD) when you want them
13
+ - Response-token compression comes from [Caveman](https://github.com/JuliusBrussee/caveman) (default `full` mode, ~46% input / ~75% output savings, auto-installed by `/flow-init`)
14
+
15
+ Flow stitches them together.
16
+
17
+ ## Why
18
+
19
+ Existing per-story workflows are token-heavy. BMad's create-story re-reads epics + architecture + UX + previous story + git log every iteration. GSD spawns parallel 200k-context subagents. spec-kit ships 8 artifact files per feature. A ~30-line story stub plus delegation to ECC's existing primitives lands at **~20k tokens per story in mini mode** vs **~95k in BMad full**.
20
+
21
+ ## Install
22
+
23
+ > **Status (v0.7.0):** the `npx` install path is not yet published to npm. The headless CLI (`node bin/flow.js plan / install / doctor / add / remove / uninstall`) is fully working from a clone. Slash commands are the recommended primary path. `npx @mhd-ghaith-abtah/flow init` lands once the package is published; tracked as E1-002 in `docs/flow/sprint.yaml`.
24
+
25
+ ```bash
26
+ # Inside Claude Code (recommended)
27
+ /flow-init
28
+
29
+ # Headless (works today against a clone — npm publish pending)
30
+ git clone https://github.com/mhd-ghaith-abtah/flow.git
31
+ cd flow && npm install && tools/dev-link.sh
32
+ flow plan --profile standard
33
+ ```
34
+
35
+ The slash-command path runs the same interactive installer. It detects your project shape, asks ~8 questions, then:
36
+ - Installs Flow's four skills (`flow-init`, `flow-sprint`, `flow-story`, `flow-doctor`)
37
+ - Optionally invokes `npx bmad-method install` with a curated module list
38
+ - Optionally invokes ECC's `install.sh` with a curated profile
39
+ - Optionally invokes Caveman's installer (curl-pipe-bash, with SHA-256 inspection support via `FLOW_INSPECT_INSTALL_SCRIPTS=1`)
40
+ - Sets up MCP servers needed by your selected adapters (`context7`, `playwright`, `linear`, …)
41
+ - Writes `flow.config.yaml` + scaffolds `docs/flow/`
42
+ - Drops a `.caveman-enable` marker so Caveman activates here even if the user's global default is `off` (see Caveman FAQ entry below)
43
+ - Optionally migrates an existing BMad `sprint-status.yaml` (with backup + rollback)
44
+
45
+ ## Quickstart
46
+
47
+ ```bash
48
+ $ /flow-init # one time per project
49
+ $ /flow-sprint add "First story" --epic E1 --tags ui # add a story
50
+ $ /flow-sprint next # start work
51
+ $ /flow-story # implement → review → verify → commit → PR
52
+ $ /flow-sprint done E1-001 # close out
53
+ ```
54
+
55
+ ## Profiles
56
+
57
+ | Profile | When | Tokens/story |
58
+ |---|---|---|
59
+ | `mini` | Solo, single repo, light review | ~20k |
60
+ | `standard` | Solo or small team, formal review, PRs | ~40k |
61
+ | `team` | Small team, Linear sprints, separate-model review | ~60k |
62
+
63
+ All three are mode flags on the same skills, not different code paths.
64
+
65
+ ## Adapters
66
+
67
+ Pick one per category in `flow.config.yaml`:
68
+
69
+ | Category | v0.1 adapters |
70
+ |---|---|
71
+ | Issue tracker | `linear`, `github-issues`, `none` |
72
+ | PR platform | `github`, `none` |
73
+ | E2E | `playwright-mcp`, `none` |
74
+ | Verify | `make`, `pnpm`, `custom` |
75
+
76
+ More coming in v0.2: `jira`, `notion`, `plain`, `gitlab`, `bitbucket`, `cypress`, `slack`, `discord`.
77
+
78
+ ## Architecture
79
+
80
+ ```
81
+ flow install
82
+ ├── Phase A: detect (BMad? ECC? which MCPs? which CLIs?)
83
+ ├── Phase B: install Flow's own skills + adapters + templates
84
+ ├── Phase C: delegate to upstream installers
85
+ │ ├── npx bmad-method install --modules <curated subset>
86
+ │ └── ECC ./install.sh --profile <curated subset>
87
+ ├── Phase D: install MCP servers (context7, playwright, linear, …)
88
+ ├── Phase E: scaffold flow.config.yaml + docs/flow/
89
+ └── Phase F: smoke test (flow doctor)
90
+ ```
91
+
92
+ Flow does not re-implement BMad or ECC. It calls them with the right flags and records what it did in `~/.claude/flow/install-state.json`.
93
+
94
+ ## When to use which command
95
+
96
+ After `/flow-init` you'll have slash commands from all three projects active. Use this table when you're not sure which to invoke:
97
+
98
+ | Goal | Command | Owner |
99
+ |---|---|---|
100
+ | Write a PRD, architecture doc, or epic list | `/bmad-create-prd`, `/bmad-create-architecture`, `/bmad-create-epic` | BMad |
101
+ | Generate a fresh story from a BMad epic | `/bmad-create-story` (then `/flow-sprint import-bmad`) | BMad → Flow |
102
+ | Add a story to the current sprint | `/flow-sprint add "<title>" --epic E1` | Flow |
103
+ | Pick the next story to work on | `/flow-sprint next` | Flow |
104
+ | **Implement → review → verify → commit → PR** | `/flow-story` | Flow (orchestrates ECC) |
105
+ | Just write code with a plan gate | `/plan` then `/prp-implement` | ECC |
106
+ | Just run a code review | `/code-review` | ECC |
107
+ | Just run the documentation updater | `/update-docs` | ECC |
108
+ | Health-check the whole install | `/flow-doctor` | Flow |
109
+ | End-of-sprint retro | `/flow-sprint retro` | Flow |
110
+
111
+ **Rule of thumb:** if you're moving a story through its lifecycle (plan → code → review → ship), use `/flow-story` — it dispatches to the right ECC primitive at the right phase. If you want to invoke an ECC primitive directly (e.g., to re-review uncommitted code without advancing the story), call it by name; Flow won't get in the way.
112
+
113
+ **Don't mix:** `/bmad-create-story` and `/flow-sprint add` both create story files. Pick one per project — Flow's import-bmad subcommand bridges the two if you start with BMad and want Flow to take over.
114
+
115
+ ## FAQ
116
+
117
+ **Why not just use BMad on its own?**
118
+ BMad re-reads epics + architecture + UX + previous story + git log every iteration. That lands at ~95k tokens per story in full mode. Flow keeps the planning artifacts but skips the re-reads on every cycle — a story stub plus delegation to ECC's `/prp-implement` lands at ~20k in mini mode.
119
+
120
+ **Why not just use ECC?**
121
+ ECC owns the per-story primitives (`/plan`, `/prp-implement`, `/code-review`, `/update-docs`). What it doesn't own is the *between-stories* state: which story is next, which is in review, which is deferred, which adapter handles PRs in this repo. Flow's `sprint.yaml` + `flow-story` skill is that thin layer.
122
+
123
+ **Do I need Caveman?**
124
+ Yes for now — Flow expects it. Caveman compresses Claude's responses ~75% in `full` mode, which is what makes mini-profile's 20k-tokens-per-story claim realistic. `/flow-init` installs it automatically with the right registration (see `tools/fix-caveman-shrink.sh` if the MCP proxy gets mis-registered).
125
+
126
+ **Caveman is now active in every Claude Code session, even my non-Flow projects. Can I scope it?**
127
+ Caveman's `SessionStart` hook activates globally by default. Native project-scope gating is shipping upstream via [JuliusBrussee/caveman#407](https://github.com/JuliusBrussee/caveman/pull/407) (filed and reviewed by Flow's maintainer; awaiting upstream merge). The PR adds `.caveman-enable` / `.caveman-disable` marker files, a `CAVEMAN_PROJECT_SCOPE` env var, and config-driven `projectScope.allow[]` / `deny[]` lists. To opt into allowlist mode today, set `~/.config/caveman/config.json` to `{"defaultMode": "off"}` — Caveman stays silent everywhere except projects with `.caveman-enable` in their root. Flow's `/flow-init` drops that marker automatically, so Flow-managed projects keep working. `/flow-doctor` surfaces a probe for "Caveman active outside a Flow project" until the PR merges.
128
+
129
+ **Which profile should I pick?**
130
+ - `mini` — solo, single repo, light review, no formal PR process → ~20k/story
131
+ - `standard` — solo or small team, formal review, GitHub PRs, Playwright E2E → ~40k/story
132
+ - `team` — small team, issue tracker (Linear default), separate-model code review (spawns one reviewer with a different model for fresh perspective) → ~60k/story
133
+
134
+ You can swap profiles with `/flow-init --update --profile <name>` — it's just a different bundle, not a different codepath.
135
+
136
+ **What if I don't use GitHub?**
137
+ Pick `adapter:pr-none` during `/flow-init` and configure `verify` + `e2e` to whatever you do use. GitLab + Bitbucket adapters are planned for v0.2.
138
+
139
+ **How do I upgrade Flow?**
140
+ `/flow-init --update` is idempotent. It re-detects project shape, diffs against `install-state.json`, and applies only the deltas. Upstream installers (BMad / ECC / Caveman) are re-invoked only when their pinned subset changes.
141
+
142
+ **What happens if I uninstall?**
143
+ `/flow uninstall` removes Flow's own skills and adapters. It does NOT remove BMad, ECC, or Caveman — those were installed by their own installers and Flow recorded that, not owned it. Your `sprint.yaml` + stories stay on disk.
144
+
145
+ **Is my `flow.config.yaml` safe to commit?**
146
+ Yes — it's intentionally team-shared (adapter choices, review policy, verify command). Secrets live in `~/.claude/.env.flow` (chmod 600, never committed). Per-developer overrides go in `flow.config.local.yaml` (gitignored) which Flow merges over the base config.
147
+
148
+ **Where do I report bugs?**
149
+ [github.com/mhd-ghaith-abtah/flow/issues](https://github.com/mhd-ghaith-abtah/flow/issues). Run `/flow-doctor` first — it surfaces known-bug patterns automatically.
150
+
151
+ ## Credits
152
+
153
+ Flow stands on:
154
+ - **[BMad-Method](https://github.com/bmad-code-org/BMAD-METHOD)** by bmad-code-org — planning workflow (PRD, architecture, epics)
155
+ - **[Everything Claude Code (ECC)](https://github.com/affaan-m/everything-claude-code)** by affaan-m — per-story primitives (`/plan`, `/prp-*`, `/code-review`, `/update-docs`)
156
+ - **[Get Shit Done (GSD)](https://github.com/gsd-build/get-shit-done)** by TÂCHES — concept inspiration
157
+ - **[spec-kit](https://github.com/github/spec-kit)** by GitHub — spec-driven development pattern
158
+ - **[AI Dev Tasks](https://github.com/snarktank/ai-dev-tasks)** by snarktank — lean PRD + tasks pattern
159
+
160
+ ## License
161
+
162
+ MIT
@@ -0,0 +1,42 @@
1
+ # E2E Adapter Interface
2
+
3
+ E2E adapters run the user-journey block from a story file against a live app.
4
+
5
+ ## Required operations
6
+
7
+ ### `run_journey(story_file, base_url) → { passed, failed, artifacts }`
8
+
9
+ 1. Parse the `## E2E Journey` block from the story file.
10
+ 2. Execute each step in order.
11
+ 3. Collect artifacts (screenshots, traces, logs) at `docs/flow/artifacts/<story_id>/`.
12
+ 4. Return:
13
+ - `passed` — array of step names that passed
14
+ - `failed` — array of `{ step, error, artifact_path }` for failures
15
+ - `artifacts` — list of generated file paths
16
+
17
+ ### `smoke_test(base_url) → ok | { error, artifact_path }`
18
+
19
+ Quick sanity check: load base_url, verify no console errors, no 5xx. Returns `ok` if reachable.
20
+
21
+ ## Optional operations
22
+
23
+ ### `screenshot_diff(baseline_path, current_path) → { diff_pct, diff_image_path }`
24
+
25
+ Visual regression — optional but recommended for UI-heavy stories.
26
+
27
+ ## Journey block format
28
+
29
+ ```markdown
30
+ ## E2E Journey
31
+
32
+ - navigate /
33
+ - assert visible "Welcome"
34
+ - click "Get started"
35
+ - assert url ends with /signup
36
+ - fill input[name=email] = "test@example.com"
37
+ - click "Continue"
38
+ - assert visible "Check your inbox"
39
+ - screenshot success
40
+ ```
41
+
42
+ Each line is one step. Verbs supported per adapter — see each adapter's docstring. Indentation tolerant. Comments start with `#`.
@@ -0,0 +1,15 @@
1
+ # No E2E adapter
2
+
3
+ E2E phase is skipped entirely. Stories may still have `## E2E Journey` blocks for documentation, but Flow does not execute them.
4
+
5
+ ## run_journey(story_file, base_url)
6
+
7
+ Returns `{ passed: [], failed: [], artifacts: [], skipped: true }`.
8
+
9
+ ## smoke_test(base_url)
10
+
11
+ Returns `ok`.
12
+
13
+ ## screenshot_diff(baseline_path, current_path)
14
+
15
+ Returns `{ skipped: true }`.
@@ -0,0 +1,86 @@
1
+ # Playwright MCP adapter
2
+
3
+ Uses the Playwright MCP server. Runs an interactive browser session, executes journey steps, captures artifacts.
4
+
5
+ **MCP namespace:** `mcp__playwright__*` (exact prefix depends on how the MCP is registered — `mcp__plugin_playwright__*` if installed as a plugin).
6
+
7
+ **Dependencies:**
8
+ - Playwright MCP server installed (`claude mcp list | grep playwright`)
9
+ - `@playwright/test` runtime in the project (`pnpm add -D @playwright/test`)
10
+ - A browser binary installed (`npx playwright install chromium`)
11
+
12
+ **Config keys** (`flow.config.yaml > integrations.e2e`):
13
+ - `base_url` — required, e.g. `http://localhost:4321`
14
+ - `journeys_dir` — default `docs/flow/journeys` (for reusable journeys outside stories)
15
+ - `viewport` — optional `{ width, height }`, defaults `{ 1280, 720 }`
16
+ - `start_server_cmd` — optional, e.g. `pnpm dev`. If set, Flow starts the server before journey and stops after.
17
+
18
+ ---
19
+
20
+ ## run_journey(story_file, base_url)
21
+
22
+ 1. **Pre-flight:**
23
+ - If `start_server_cmd` is set, spawn it in background, wait for `base_url` to respond 200, max 30s.
24
+ - Parse `## E2E Journey` block from `story_file` into ordered step list.
25
+
26
+ 2. **Browser setup:**
27
+ - `mcp__playwright__browser_navigate({ url: base_url })`
28
+ - `mcp__playwright__browser_resize({ width, height })` if viewport configured.
29
+
30
+ 3. **Step execution** — for each step:
31
+
32
+ | Step verb | MCP tool |
33
+ |---|---|
34
+ | `navigate <path>` | `browser_navigate({ url: base_url + path })` |
35
+ | `assert visible "<text>"` | `browser_snapshot()` then check accessibility tree for text |
36
+ | `assert url ends with <path>` | `browser_evaluate({ function: "() => location.pathname" })` |
37
+ | `click "<text>"` or `click <selector>` | `browser_click({ ref })` (resolve ref from snapshot first) |
38
+ | `fill <selector> = "<value>"` | `browser_type({ ref, text })` |
39
+ | `wait <selector>` | `browser_wait_for({ ref })` |
40
+ | `screenshot <name>` | `browser_take_screenshot({ filename: "<story_id>/<name>.png" })` |
41
+ | `assert no console errors` | `browser_console_messages()` → filter level=error → assert empty |
42
+ | `# <comment>` | no-op (just a step label) |
43
+
44
+ 4. **On failure:**
45
+ - Capture a screenshot of the failure state: `browser_take_screenshot({ filename: "<story_id>/FAIL-<step_name>.png" })`
46
+ - Record `{ step, error, artifact_path }` in `failed[]`.
47
+ - Continue running remaining steps unless `--stop-on-failure` flag was set.
48
+
49
+ 5. **Cleanup:**
50
+ - If `start_server_cmd` was used, kill the spawned process.
51
+ - `browser_close()`.
52
+
53
+ 6. **Save artifacts:**
54
+ - All screenshots already saved by MCP under the path passed.
55
+ - Write a summary at `docs/flow/artifacts/<story_id>/journey-result.json`:
56
+ ```json
57
+ {
58
+ "story_id": "...",
59
+ "ran_at": "...",
60
+ "base_url": "...",
61
+ "passed": [...],
62
+ "failed": [...],
63
+ "duration_ms": ...
64
+ }
65
+ ```
66
+
67
+ 7. **Return** `{ passed, failed, artifacts }`.
68
+
69
+ ## smoke_test(base_url)
70
+
71
+ 1. `browser_navigate({ url: base_url })`
72
+ 2. `browser_console_messages()` → assert no `level: error`
73
+ 3. `browser_snapshot()` → assert any visible content (page is not blank)
74
+ 4. `browser_close()`
75
+ 5. Return `ok` or `{ error, artifact_path }`.
76
+
77
+ ## screenshot_diff(baseline_path, current_path)
78
+
79
+ Optional — v0.1 returns `{ diff_pct: null, note: "not implemented" }`. v0.2 will use `pixelmatch` or `odiff`.
80
+
81
+ ## Failure handling
82
+
83
+ - MCP unreachable: halt with `claude mcp list` output and "Run `/flow-init --repair` or `claude mcp add playwright ...`".
84
+ - Server start fails: halt with the start command output.
85
+ - Journey block missing: prompt user to add it, or fall back to `smoke_test`.
86
+ - Step verb unrecognized: halt with the offending line and the supported verbs list above.
@@ -0,0 +1,46 @@
1
+ # Issue Tracker Adapter Interface
2
+
3
+ Every issue-tracker adapter MUST implement these operations. flow-story and flow-sprint invoke them by name.
4
+
5
+ ## Required operations
6
+
7
+ ### `create_issue(title, body, labels) → { issue_id, url } | { skipped: true }`
8
+
9
+ Called by `/flow-sprint add` when a new story is created. Return:
10
+ - `issue_id` — string used as `story.issue` in sprint.yaml
11
+ - `url` — string for user reference
12
+
13
+ If the adapter is `none`, return `{ skipped: true }` and Flow uses an internal id (`local-001`).
14
+
15
+ ### `transition_to_doing(issue_id) → ok | { error }`
16
+
17
+ Called by `/flow-sprint next`. Mark the external issue as "in progress" / "started" / whichever the platform calls it.
18
+
19
+ ### `transition_to_review(issue_id, pr_url) → ok | { error }`
20
+
21
+ Called by `/flow-story` after `/prp-pr` opens a PR. Link the PR to the issue and move to "in review".
22
+
23
+ ### `transition_to_done(issue_id) → ok | { error }`
24
+
25
+ Called by `/flow-sprint done`. Close the issue.
26
+
27
+ ### `get_state(issue_id) → state_string`
28
+
29
+ Read-only. Used by `flow doctor` and parity checks. Returns the external platform's state name.
30
+
31
+ ## Optional operations
32
+
33
+ ### `verify_merged(issue_id) → boolean`
34
+
35
+ Called before `transition_to_done`. Confirm the linked PR is actually merged so we don't close prematurely.
36
+
37
+ ## Config keys
38
+
39
+ Adapters declare the keys they need in `flow.config.yaml > integrations.issue_tracker.*`. The Flow installer prompts for these at first install or when the adapter is swapped in via `flow adapter swap`.
40
+
41
+ ## Failure handling
42
+
43
+ If any operation fails:
44
+ - Log the error to `docs/flow/audit-log.md` (if `mode: team`) or to stderr.
45
+ - Do NOT silently swallow — Flow halts and surfaces the error so the user can decide.
46
+ - The adapter SHOULD be retryable: re-running the same op should be idempotent.
@@ -0,0 +1,103 @@
1
+ # GitHub Issues adapter
2
+
3
+ Uses the `gh` CLI (already authenticated via `gh auth login`). No MCP required.
4
+
5
+ **Config keys** (from `flow.config.yaml > integrations.issue_tracker`):
6
+ - `repo` — `owner/name` (auto-detected by `gh repo view --json nameWithOwner -q .nameWithOwner`)
7
+ - `label_prefix` — optional, defaults to `flow`
8
+ - `default_labels` — optional list, defaults to `["flow"]`
9
+
10
+ **Dependencies:**
11
+ - `gh` CLI authenticated (`gh auth status` must pass)
12
+ - `git remote get-url origin` resolves to a GitHub repo
13
+
14
+ ---
15
+
16
+ ## create_issue(title, body, labels)
17
+
18
+ 1. Compose label list: `{{config.default_labels}} + labels + ["flow:backlog"]`.
19
+ 2. Run:
20
+ ```bash
21
+ gh issue create \
22
+ --repo {{config.repo}} \
23
+ --title "{{title}}" \
24
+ --body "{{body}}" \
25
+ {{ for each label: --label "<label>" }}
26
+ ```
27
+ 3. Parse stdout — last line is the issue URL: `https://github.com/{{repo}}/issues/<N>`.
28
+ 4. Extract `N` from the URL → `issue_id` = `#<N>`.
29
+ 5. Return `{ issue_id, url }`.
30
+
31
+ ## transition_to_doing(issue_id)
32
+
33
+ ```bash
34
+ gh issue edit {{issue_id_number}} \
35
+ --repo {{config.repo}} \
36
+ --remove-label "flow:backlog" \
37
+ --add-label "flow:in-progress"
38
+ ```
39
+
40
+ ## transition_to_review(issue_id, pr_url)
41
+
42
+ 1. Update labels:
43
+ ```bash
44
+ gh issue edit {{issue_id_number}} \
45
+ --remove-label "flow:in-progress" \
46
+ --add-label "flow:in-review"
47
+ ```
48
+ 2. Post a linking comment:
49
+ ```bash
50
+ gh issue comment {{issue_id_number}} \
51
+ --body "PR opened: {{pr_url}}"
52
+ ```
53
+ 3. Note: GitHub auto-links issues mentioned in PR bodies via `Fixes #N` or `Closes #N`. The PR template in Flow ensures this is included.
54
+
55
+ ## transition_to_done(issue_id)
56
+
57
+ ```bash
58
+ gh issue close {{issue_id_number}} \
59
+ --repo {{config.repo}} \
60
+ --reason completed
61
+ ```
62
+
63
+ ## verify_merged(issue_id)
64
+
65
+ 1. Find PR linked to this issue:
66
+ ```bash
67
+ gh pr list \
68
+ --search "linked:issue:{{issue_id_number}} is:merged" \
69
+ --json number,mergedAt \
70
+ --jq '.[0]'
71
+ ```
72
+ 2. Return truthy if `mergedAt` is not null.
73
+
74
+ ## get_state(issue_id)
75
+
76
+ ```bash
77
+ gh issue view {{issue_id_number}} \
78
+ --json state,labels \
79
+ --jq '{state: .state, labels: [.labels[].name]}'
80
+ ```
81
+
82
+ Map labels → Flow state:
83
+ - `flow:backlog` → `backlog`
84
+ - `flow:in-progress` → `doing`
85
+ - `flow:in-review` → `review`
86
+ - `state: CLOSED` → `done` (if `flow` label present)
87
+
88
+ ## Failure handling
89
+
90
+ - If `gh` is unauthenticated, halt with: "Run `gh auth login` and retry."
91
+ - If repo not detected, prompt user for `repo` config key.
92
+ - `gh issue` operations are idempotent — re-running is safe.
93
+ - Network failures: retry once, then halt.
94
+
95
+ ## Label setup (one-time)
96
+
97
+ On first use in a repo, Flow creates the label set:
98
+ ```bash
99
+ gh label create "flow" --color "0E8A16" || true
100
+ gh label create "flow:backlog" --color "BFD4F2" || true
101
+ gh label create "flow:in-progress" --color "FBCA04" || true
102
+ gh label create "flow:in-review" --color "5319E7" || true
103
+ ```
@@ -0,0 +1,65 @@
1
+ # Linear adapter
2
+
3
+ Uses the Linear MCP server (`@tacticlaunch/mcp-linear`). Requires OAuth auth (browser flow).
4
+
5
+ **Config keys:**
6
+ - `team_key` — Linear team prefix, e.g. `PLA` (issues become `PLA-42`)
7
+ - `state_map` — optional override for state name → Flow status mapping (defaults below)
8
+
9
+ **Dependencies:**
10
+ - Linear MCP server installed (`claude mcp list | grep linear`)
11
+ - OAuth completed (`mcp__plugin_linear_linear__list_teams` returns successfully)
12
+
13
+ ---
14
+
15
+ ## create_issue(title, body, labels)
16
+
17
+ 1. Resolve team id:
18
+ - `mcp__plugin_linear_linear__list_teams` → find team where `key == config.team_key`
19
+ 2. Create:
20
+ - `mcp__plugin_linear_linear__create_issue` with `{ teamId, title, description: body }`
21
+ 3. Apply labels:
22
+ - For each label string, `mcp__plugin_linear_linear__list_issue_labels` and find matching name. If missing, create it. Then add to issue.
23
+ 4. Return `{ issue_id: response.identifier, url: response.url }`.
24
+
25
+ ## transition_to_doing(issue_id)
26
+
27
+ 1. `mcp__plugin_linear_linear__list_issue_statuses` for the team
28
+ 2. Find state where `type == "started"` AND `name in ["In Progress", "Doing", "Started"]`
29
+ 3. `mcp__plugin_linear_linear__update_issue` with `{ id: issue_id, stateId }`
30
+
31
+ ## transition_to_review(issue_id, pr_url)
32
+
33
+ 1. Find state where `name in ["In Review", "Review", "Code Review"]`
34
+ 2. `update_issue` with `stateId`
35
+ 3. Add comment: `mcp__plugin_linear_linear__create_comment` with `{ issueId, body: "PR opened: " + pr_url }`
36
+
37
+ ## transition_to_done(issue_id)
38
+
39
+ 1. Find state where `type == "completed"` AND `name in ["Done", "Completed", "Closed"]`
40
+ 2. `update_issue` with `stateId`
41
+
42
+ ## verify_merged(issue_id)
43
+
44
+ 1. Read issue: `mcp__plugin_linear_linear__get_issue({ id: issue_id })`
45
+ 2. Look for attached PR (Linear auto-detects PRs linked via `Fixes` keywords or branch naming `<team_key>-<n>-...`).
46
+ 3. Check the PR's merged state via gh CLI: `gh pr view <number> --json mergedAt -q .mergedAt`.
47
+ 4. Return truthy if non-null.
48
+
49
+ ## get_state(issue_id)
50
+
51
+ `mcp__plugin_linear_linear__get_issue` → `.state.name` and `.state.type`.
52
+
53
+ Map:
54
+ - type `backlog` or `unstarted` → `backlog`
55
+ - type `started` → `doing`
56
+ - type `started` AND name matches "review" → `review`
57
+ - type `completed` → `done`
58
+ - type `canceled` → `cancelled`
59
+
60
+ ## Failure handling
61
+
62
+ - If MCP unavailable, halt with: "Linear MCP not reachable — run `claude mcp list` to debug, or `/flow-init --repair`."
63
+ - If auth not completed, halt with: "Linear OAuth not done — open Claude Code Settings → MCP → linear → Authenticate."
64
+ - Rate limit: Linear MCP returns 429 — retry with exponential backoff up to 3 times.
65
+ - If team_key not found, halt with the list of available team keys.