buildflow-dev 1.0.6 → 4.0.1
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/README.md +273 -25
- package/package.json +4 -2
- package/src/commands/init.js +19 -0
- package/src/commands/install.js +3 -2
- package/templates/CLAUDE.md +49 -29
- package/templates/commands/build.md +89 -34
- package/templates/commands/check.md +59 -24
- package/templates/commands/debug.md +68 -0
- package/templates/commands/deploy.md +80 -0
- package/templates/commands/hotfix.md +94 -0
- package/templates/commands/plan.md +64 -22
- package/templates/commands/ship.md +109 -47
- package/templates/commands/spec.md +147 -0
- package/templates/commands/start.md +38 -8
- package/templates/commands/test.md +82 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# BuildFlow
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> Spec-driven, multi-agent development orchestration with automatic token pruning — for Claude Code, Gemini CLI, Codex CLI, Cursor, Cline, and Continue.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/buildflow-dev)
|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
|
@@ -15,11 +15,13 @@
|
|
|
15
15
|
- [Supported AI Tools](#supported-ai-tools)
|
|
16
16
|
- [AI Slash Commands](#ai-slash-commands)
|
|
17
17
|
- [CLI Commands](#cli-commands)
|
|
18
|
+
- [Example: Full Greenfield Flow](#example-full-greenfield-flow-phases--waves)
|
|
18
19
|
- [How It Works](#how-it-works)
|
|
19
20
|
- [Package Source Structure](#package-source-structure)
|
|
20
21
|
- [The .buildflow/ Scaffold](#the-buildflow-scaffold)
|
|
21
22
|
- [Template System](#template-system)
|
|
22
23
|
- [9 Specialized Agents](#9-specialized-agents)
|
|
24
|
+
- [v4.0: Spec-Driven + Token Pruning](#v40-what-changed)
|
|
23
25
|
- [Examples](#examples)
|
|
24
26
|
- [Token Economics](#token-economics)
|
|
25
27
|
- [Contributing](#contributing)
|
|
@@ -30,14 +32,18 @@
|
|
|
30
32
|
|
|
31
33
|
## What is BuildFlow?
|
|
32
34
|
|
|
33
|
-
BuildFlow is a **CLI tool** that installs a
|
|
35
|
+
BuildFlow is a **CLI tool** that installs a spec-driven, multi-agent AI workflow into any project. It does two things:
|
|
34
36
|
|
|
35
|
-
1. **Scaffolds `.buildflow/`** —
|
|
36
|
-
2. **Installs slash commands** — writes `/buildflow-*` command files into whichever AI tools you use (Claude Code, Cursor, etc.)
|
|
37
|
+
1. **Scaffolds `.buildflow/`** — markdown files that act as persistent memory, formal specs, project state, and agent instructions
|
|
38
|
+
2. **Installs slash commands** — writes `/buildflow-*` command files into whichever AI tools you use (Claude Code, Cursor, Gemini CLI, etc.)
|
|
37
39
|
|
|
38
|
-
Once installed, you work entirely inside your AI tool using `/buildflow-*` commands.
|
|
40
|
+
Once installed, you work entirely inside your AI tool using `/buildflow-*` commands.
|
|
39
41
|
|
|
40
|
-
**
|
|
42
|
+
**Three core ideas that separate BuildFlow from other tools:**
|
|
43
|
+
|
|
44
|
+
- **Spec-first:** Every phase starts with a formal PRD + Technical Design + Acceptance Criteria. Plans trace to ACs. Ship is blocked if any AC is unsatisfied.
|
|
45
|
+
- **Context isolation:** Each agent receives a minimal context packet — only what it needs. No context rot, no wasted tokens.
|
|
46
|
+
- **Auto-prune:** `light.md` is automatically compressed at session start and after each ship. Long sessions stay lean.
|
|
41
47
|
|
|
42
48
|
---
|
|
43
49
|
|
|
@@ -88,21 +94,53 @@ These are installed into your AI tool and triggered by typing `/` (or `@` / `$`
|
|
|
88
94
|
|
|
89
95
|
| Command | Agent | Purpose | Token Cost |
|
|
90
96
|
|---------|-------|---------|-----------|
|
|
91
|
-
| `/buildflow-start` | Strategist | Begin project:
|
|
97
|
+
| `/buildflow-start` | Strategist | Begin project: vision questions, pruning of stale context, saves to `core/vision.md` | ~8K |
|
|
92
98
|
| `/buildflow-think [topic]` | Researcher × 3 + Synthesizer | Parallel web research on a topic, synthesized into a recommendation | ~30K |
|
|
93
|
-
| `/buildflow-
|
|
94
|
-
| `/buildflow-
|
|
95
|
-
| `/buildflow-
|
|
96
|
-
| `/buildflow-
|
|
99
|
+
| `/buildflow-spec` | Strategist | **NEW** — Generate formal PRD + Technical Design + Acceptance Criteria. Required before planning | ~18K |
|
|
100
|
+
| `/buildflow-plan [phase]` | Architect | Reads specs, maps tasks to ACs, groups into dependency waves, checks full AC coverage | ~20K |
|
|
101
|
+
| `/buildflow-build [wave]` | Builder × N + Reviewer | Execute waves with context-isolated Builders — each wave auto-tests, auto-fixes, only advances when green | ~50K/wave |
|
|
102
|
+
| `/buildflow-test [wave]` | Reviewer | Standalone test + fix loop — re-verify a wave or test a manual change | ~25K |
|
|
103
|
+
| `/buildflow-check` | Reviewer × 4 | Spec compliance + correctness + quality + security in parallel | ~22K |
|
|
104
|
+
| `/buildflow-ship` | Strategist + Security Auditor | Spec gate + security gate + context pruning + git tag | ~22K |
|
|
97
105
|
|
|
98
106
|
### Workflow — Existing Codebases
|
|
99
107
|
|
|
100
108
|
| Command | Agent | Purpose | Token Cost |
|
|
101
109
|
|---------|-------|---------|-----------|
|
|
102
110
|
| `/buildflow-onboard` | Cartographer | One-time analysis: writes `MAP.md`, `PATTERNS.md`, `DEPENDENCIES.md`, `HOTSPOTS.md` | ~35K |
|
|
103
|
-
| `/buildflow-modify "description"` | Surgeon | Surgical change with blast-radius analysis and restore point | ~30K |
|
|
111
|
+
| `/buildflow-modify "description"` | Surgeon | Surgical change with blast-radius analysis and restore point — use for features **and bugfixes** | ~30K |
|
|
104
112
|
| `/buildflow-refactor [scope]` | Surgeon + Reviewer | Improve code quality without changing behavior | ~40K |
|
|
105
113
|
|
|
114
|
+
**`/buildflow-modify` works for both features and bugs.** Pass a plain-English description either way:
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
# Feature
|
|
118
|
+
/buildflow-modify "Add pagination to the GET /users endpoint"
|
|
119
|
+
|
|
120
|
+
# Bugfix
|
|
121
|
+
/buildflow-modify "Fix null pointer crash when user has no profile photo"
|
|
122
|
+
/buildflow-modify "Fix login redirect loop when session expires"
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
The Surgeon always runs a blast-radius analysis first (what files are affected, what calls them) and creates a git restore point before touching anything — making it especially safe for bugfixes where a wrong change can cause regressions.
|
|
126
|
+
|
|
127
|
+
If you're not sure where the bug is yet, use `/buildflow-help` first — it's a diagnostic mode that helps you locate the problem before you try to fix it.
|
|
128
|
+
|
|
129
|
+
| Situation | Command |
|
|
130
|
+
|-----------|---------|
|
|
131
|
+
| Know what needs to change | `/buildflow-modify "fix description"` |
|
|
132
|
+
| Don't know where the bug is | `/buildflow-help` first, then `/buildflow-modify` |
|
|
133
|
+
| Tests failing after a change | `/buildflow-debug` |
|
|
134
|
+
| Production incident / tiny patch | `/buildflow-hotfix "description"` — no planning, no waves |
|
|
135
|
+
|
|
136
|
+
### Debugging & Deployment
|
|
137
|
+
|
|
138
|
+
| Command | Agent | Purpose | Token Cost |
|
|
139
|
+
|---------|-------|---------|-----------|
|
|
140
|
+
| `/buildflow-hotfix "description"` | Surgeon | **NEW** — Fast-path: no spec, no plan, no waves. Restore point → fix → test → commit. For incidents and small patches | ~10K |
|
|
141
|
+
| `/buildflow-debug ["error"]` | Surgeon | Root-cause analysis for failing tests — traces error to source, applies minimal fix | ~20K |
|
|
142
|
+
| `/buildflow-deploy [env]` | Strategist | Pre-flight checks then deploy to staging or production | ~15K |
|
|
143
|
+
|
|
106
144
|
### Security
|
|
107
145
|
|
|
108
146
|
| Command | Agent | Purpose | Token Cost |
|
|
@@ -149,6 +187,155 @@ buildflow update --check # Check current version without updating
|
|
|
149
187
|
|
|
150
188
|
---
|
|
151
189
|
|
|
190
|
+
## Example: Full Greenfield Flow (Phases & Waves)
|
|
191
|
+
|
|
192
|
+
Here's what a complete new project looks like end-to-end, showing how phases and waves are **auto-generated** by BuildFlow — you never define them manually.
|
|
193
|
+
|
|
194
|
+
### 1. Init and start
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
mkdir my-app && cd my-app
|
|
198
|
+
npx buildflow-dev init
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
```
|
|
202
|
+
/buildflow-start
|
|
203
|
+
```
|
|
204
|
+
> Strategist asks 4–5 questions. Writes answers to `.buildflow/core/vision.md`.
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
### 2. Research (optional)
|
|
209
|
+
|
|
210
|
+
```
|
|
211
|
+
/buildflow-think auth-strategy
|
|
212
|
+
```
|
|
213
|
+
> 3 Researcher agents run in parallel. Synthesizer combines results.
|
|
214
|
+
> Output → `.buildflow/research/auth-strategy.md`
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
### 3. Spec — formal artifacts before any planning
|
|
219
|
+
|
|
220
|
+
```
|
|
221
|
+
/buildflow-spec
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
Strategist asks a few clarifying questions, then generates three locked files:
|
|
225
|
+
|
|
226
|
+
```
|
|
227
|
+
.buildflow/specs/
|
|
228
|
+
├── PRD.md ← What, for whom, success criteria, out of scope
|
|
229
|
+
├── TDD.md ← Architecture, API contracts, component breakdown
|
|
230
|
+
└── acceptance.md ← Testable pass/fail criteria
|
|
231
|
+
|
|
232
|
+
AC-001: Given unauthenticated user, when POST /login with valid credentials,
|
|
233
|
+
then return 200 with session token
|
|
234
|
+
AC-002: Given invalid password, when POST /login, then return 401
|
|
235
|
+
AC-003: Given expired token, when any authenticated request, then return 401
|
|
236
|
+
...
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
User reviews and approves. Specs are locked. `/buildflow-plan` will not run without them.
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
### 4. Plan — Architect maps tasks to Acceptance Criteria
|
|
244
|
+
|
|
245
|
+
```
|
|
246
|
+
/buildflow-plan
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
The Architect reads `specs/acceptance.md` and produces `.buildflow/phases/01/PLAN.md` with every task traced to an AC:
|
|
250
|
+
|
|
251
|
+
```
|
|
252
|
+
Phase 1 — Foundation
|
|
253
|
+
|
|
254
|
+
Wave 1 (parallel — no dependencies):
|
|
255
|
+
• Create database schema [AC-001, AC-002]
|
|
256
|
+
• Create project config files [AC-NF-001]
|
|
257
|
+
|
|
258
|
+
Wave 2 (depends on Wave 1):
|
|
259
|
+
• Create auth middleware [AC-001, AC-002, AC-003]
|
|
260
|
+
• Create data models [AC-001]
|
|
261
|
+
|
|
262
|
+
Wave 3 (depends on Wave 2):
|
|
263
|
+
• Create login API route [AC-001, AC-002]
|
|
264
|
+
• Create token refresh route [AC-003]
|
|
265
|
+
|
|
266
|
+
Wave 4 (depends on Wave 3):
|
|
267
|
+
• Create login UI form [AC-001, AC-002]
|
|
268
|
+
• Write integration tests [all ACs]
|
|
269
|
+
|
|
270
|
+
AC Coverage check: AC-001 ✓ AC-002 ✓ AC-003 ✓ AC-NF-001 ✓
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
Every AC is covered. The Architect won't write the plan if any AC is orphaned.
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
### 4. Build — testing is automatic inside every wave
|
|
278
|
+
|
|
279
|
+
```
|
|
280
|
+
/buildflow-build
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
Testing is **built into every wave** — you don't run `/buildflow-test` manually. For each wave, the cycle is:
|
|
284
|
+
|
|
285
|
+
```
|
|
286
|
+
Build wave tasks (parallel Builders)
|
|
287
|
+
↓
|
|
288
|
+
Review output (Reviewer)
|
|
289
|
+
↓
|
|
290
|
+
Run tests automatically
|
|
291
|
+
↓
|
|
292
|
+
┌─ Tests pass? ──────────────────────── Move to next wave
|
|
293
|
+
└─ Tests fail? → Fix → Re-test → loop until green (max 5 attempts)
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
So `Wave 1` is fully green before `Wave 2` starts. `Wave 2` is fully green before `Wave 3` starts. And so on.
|
|
297
|
+
|
|
298
|
+
If a wave can't be fixed within 5 attempts, the build stops and reports exactly what failed — then you can use `/buildflow-debug` for deeper investigation.
|
|
299
|
+
|
|
300
|
+
```
|
|
301
|
+
/buildflow-debug "auth middleware not rejecting expired tokens"
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
**`/buildflow-test` standalone** is available if you want to re-verify a wave you already built, or test after a manual code change outside of `/buildflow-build`.
|
|
305
|
+
|
|
306
|
+
---
|
|
307
|
+
|
|
308
|
+
### 6. Check, ship, and deploy
|
|
309
|
+
|
|
310
|
+
```
|
|
311
|
+
/buildflow-check
|
|
312
|
+
```
|
|
313
|
+
> 4 Reviewers in parallel: spec compliance (all ACs?) / correctness / quality / security
|
|
314
|
+
|
|
315
|
+
```
|
|
316
|
+
/buildflow-ship
|
|
317
|
+
```
|
|
318
|
+
> Gate 0: all ACs satisfied — blocks if any are ✗
|
|
319
|
+
> Gate 1: security scan — blocks on critical issues
|
|
320
|
+
> Gate 2: all tests passing
|
|
321
|
+
> Then: retrospective → context pruning (`light.md` compressed) → git tag
|
|
322
|
+
|
|
323
|
+
```
|
|
324
|
+
/buildflow-deploy staging
|
|
325
|
+
```
|
|
326
|
+
> Pre-flight checks → deploy to staging → smoke test
|
|
327
|
+
|
|
328
|
+
```
|
|
329
|
+
/buildflow-deploy production
|
|
330
|
+
```
|
|
331
|
+
> Stricter gate (all tests + audit must pass) → deploy to production
|
|
332
|
+
|
|
333
|
+
---
|
|
334
|
+
|
|
335
|
+
**Key point:** `[phase]` and `[wave]` arguments are optional escape hatches for resuming or re-running specific parts. In a normal flow you just type `/buildflow-plan` and `/buildflow-build` with no arguments.
|
|
336
|
+
|
|
337
|
+
---
|
|
338
|
+
|
|
152
339
|
## How It Works
|
|
153
340
|
|
|
154
341
|
### The install flow
|
|
@@ -266,22 +453,27 @@ buildflow-dev/
|
|
|
266
453
|
│ │ all available /buildflow-* commands.
|
|
267
454
|
│ │ {{APP_NAME}} is replaced with the detected project name.
|
|
268
455
|
│ │
|
|
269
|
-
│ └── commands/
|
|
456
|
+
│ └── commands/ 19 markdown files — one per slash command.
|
|
270
457
|
│ │ Each file is the full instruction set for that command.
|
|
271
458
|
│ │ The AI reads and executes these when you trigger the command.
|
|
272
459
|
│ │ Format: YAML frontmatter (name, description, agent, tools)
|
|
273
460
|
│ │ followed by numbered steps the agent follows.
|
|
274
461
|
│ │
|
|
275
|
-
│ ├── start.md Vision gathering, mode detection
|
|
462
|
+
│ ├── start.md Vision gathering, mode detection, light.md pruning on session start
|
|
276
463
|
│ ├── think.md Parallel research with up to 3 Researcher agents
|
|
277
|
-
│ ├──
|
|
464
|
+
│ ├── spec.md Generate PRD + TDD + Acceptance Criteria (required before plan)
|
|
465
|
+
│ ├── plan.md AC-traced dependency mapping → wave-based execution plan
|
|
278
466
|
│ ├── build.md Wave-by-wave parallel Builder execution
|
|
467
|
+
│ ├── test.md Run tests + UI verification after each wave
|
|
279
468
|
│ ├── check.md 3-reviewer parallel quality check
|
|
280
|
-
│ ├── ship.md
|
|
469
|
+
│ ├── ship.md Spec gate + security gate + context pruning → retro → git tag
|
|
470
|
+
│ ├── hotfix.md Fast-path fix — no spec, no plan, restore point → fix → test → commit
|
|
281
471
|
│ ├── onboard.md One-time codebase analysis → MAP/PATTERNS/DEPENDENCIES/HOTSPOTS
|
|
282
472
|
│ ├── modify.md Surgical code change with blast-radius analysis
|
|
283
473
|
│ ├── refactor.md Quality improvement without behavior change
|
|
284
474
|
│ ├── audit.md OWASP Top 10 AI-powered scan
|
|
475
|
+
│ ├── debug.md Root-cause analysis for failing tests or broken behavior
|
|
476
|
+
│ ├── deploy.md Pre-flight checks → deploy to staging or production
|
|
285
477
|
│ ├── status.md Current phase and recommended next action
|
|
286
478
|
│ ├── explain.md Plain-language explanation of code, concepts, errors
|
|
287
479
|
│ ├── back.md Undo to git restore point, update state
|
|
@@ -319,12 +511,17 @@ their-project/
|
|
|
319
511
|
│ settings, parallelization limits. The AI adapts its
|
|
320
512
|
│ explanation depth based on the experience: field.
|
|
321
513
|
│
|
|
514
|
+
├── specs/ Generated by /buildflow-spec. Required before /buildflow-plan.
|
|
515
|
+
│ ├── PRD.md Product Requirements: what, for whom, success criteria, out of scope.
|
|
516
|
+
│ ├── TDD.md Technical Design: architecture, API contracts, component breakdown.
|
|
517
|
+
│ └── acceptance.md Acceptance Criteria (AC-001, AC-002...). Every plan task traces
|
|
518
|
+
│ to an AC. /buildflow-check verifies each. /buildflow-ship blocks
|
|
519
|
+
│ if any AC is unsatisfied.
|
|
520
|
+
│
|
|
322
521
|
├── memory/
|
|
323
|
-
│ └── light.md
|
|
324
|
-
│
|
|
325
|
-
│
|
|
326
|
-
│ Kept under 5K tokens deliberately — costs less to load than
|
|
327
|
-
│ it saves in re-detection work.
|
|
522
|
+
│ └── light.md Persistent context across sessions. Auto-pruned to ≤3K tokens
|
|
523
|
+
│ at session start and after each /buildflow-ship. Archived phase
|
|
524
|
+
│ data moves to phases/N/retro.md — not deleted, just unloaded.
|
|
328
525
|
│
|
|
329
526
|
├── learnings/
|
|
330
527
|
│ ├── glossary.md Project-specific jargon and BuildFlow concepts. Grows as
|
|
@@ -346,7 +543,8 @@ their-project/
|
|
|
346
543
|
│
|
|
347
544
|
├── phases/ One subfolder per phase (01/, 02/, etc.)
|
|
348
545
|
│ └── 01/
|
|
349
|
-
│ ├── PLAN.md Task breakdown with dependency waves
|
|
546
|
+
│ ├── PLAN.md Task breakdown with AC references and dependency waves.
|
|
547
|
+
│ │ Archived context from light.md lands here after /buildflow-ship.
|
|
350
548
|
│ └── retro.md Written during /buildflow-ship: what worked, what didn't
|
|
351
549
|
│
|
|
352
550
|
└── security/
|
|
@@ -485,6 +683,36 @@ buildflow fix
|
|
|
485
683
|
|
|
486
684
|
---
|
|
487
685
|
|
|
686
|
+
## v4.0: What Changed
|
|
687
|
+
|
|
688
|
+
### Spec-Driven Layer
|
|
689
|
+
Every phase now has a formal spec before any code is planned or written.
|
|
690
|
+
|
|
691
|
+
| Old flow | New flow |
|
|
692
|
+
|----------|----------|
|
|
693
|
+
| vision → plan → build | vision → **spec** → plan → build |
|
|
694
|
+
| Plan tasks were freeform | Plan tasks trace to Acceptance Criteria |
|
|
695
|
+
| Check was code review only | Check verifies every AC is satisfied |
|
|
696
|
+
| Ship had security gate | Ship has **spec gate** + security gate |
|
|
697
|
+
|
|
698
|
+
### Context Isolation (Token Pruning)
|
|
699
|
+
Agents now receive minimal context packets instead of full project state.
|
|
700
|
+
|
|
701
|
+
| What changed | Effect |
|
|
702
|
+
|-------------|--------|
|
|
703
|
+
| Each Builder gets max 5 relevant files | −10–30K tokens per wave |
|
|
704
|
+
| `light.md` auto-pruned to ≤3K at session start | Prevents bloat across long projects |
|
|
705
|
+
| `light.md` pruned after every `/buildflow-ship` | Stale phase data archived, not re-loaded |
|
|
706
|
+
| Reviewers receive diff + ACs only (not full codebase) | Faster, more focused reviews |
|
|
707
|
+
|
|
708
|
+
### New Commands
|
|
709
|
+
| Command | Purpose |
|
|
710
|
+
|---------|---------|
|
|
711
|
+
| `/buildflow-spec` | Generate PRD + TDD + Acceptance Criteria |
|
|
712
|
+
| `/buildflow-hotfix` | Fast-path for incidents — no planning overhead |
|
|
713
|
+
|
|
714
|
+
---
|
|
715
|
+
|
|
488
716
|
## Token Economics
|
|
489
717
|
|
|
490
718
|
| Scenario | Tokens | Notes |
|
|
@@ -492,10 +720,18 @@ buildflow fix
|
|
|
492
720
|
| Greenfield full workflow | 130–160K | All phases, one session |
|
|
493
721
|
| Onboarding existing project | +35K | One-time, never again |
|
|
494
722
|
| Existing project after onboard | 130–160K | Same as greenfield |
|
|
723
|
+
| `/buildflow-spec` | ~18K | One-time per phase — produces PRD + TDD + ACs |
|
|
495
724
|
| Security gate (per ship) | +10K | Always runs with `/buildflow-ship` |
|
|
496
|
-
| Light memory load (per session) | ~
|
|
725
|
+
| Light memory load (per session) | ~1.5K | Pruned to ≤3K — **saves** ~10K in re-detection |
|
|
726
|
+
| Context pruning savings | −5–15K | Old phase data archived, not reloaded each session |
|
|
727
|
+
| Hotfix (vs full build) | ~10K vs ~50K | 5× cheaper for small patches |
|
|
728
|
+
| Per-agent context packets | −10–30K | Builders get minimal context, not full codebase |
|
|
497
729
|
|
|
498
|
-
|
|
730
|
+
**Token efficiency strategy:**
|
|
731
|
+
- `light.md` stays under 3K (auto-pruned after each ship and at session start)
|
|
732
|
+
- Each agent gets a context packet: only task spec + relevant files + style rules
|
|
733
|
+
- Builders never receive full codebase — they get max 5 relevant files
|
|
734
|
+
- Old phase data lives in `phases/N/retro.md`, not loaded unless needed
|
|
499
735
|
|
|
500
736
|
---
|
|
501
737
|
|
|
@@ -576,11 +812,23 @@ Everything else (`.claude/`, `node_modules/`, `.gitignore`, etc.) is excluded.
|
|
|
576
812
|
|
|
577
813
|
## Roadmap
|
|
578
814
|
|
|
815
|
+
### New AI Tools
|
|
579
816
|
- [ ] `buildflow install --tool windsurf` — Windsurf IDE support
|
|
580
817
|
- [ ] `buildflow install --tool aider` — Aider CLI support
|
|
581
818
|
- [ ] `buildflow install --tool zed` — Zed editor support
|
|
582
|
-
|
|
819
|
+
|
|
820
|
+
### New Slash Commands
|
|
821
|
+
- [ ] `/buildflow-perf` — performance profiling: detect slow queries, bundle size issues, render bottlenecks
|
|
822
|
+
- [ ] `/buildflow-docs` — auto-generate or update README, API docs, and inline comments from code
|
|
823
|
+
- [ ] `/buildflow-migrate` — guided database migration: generate migration files, verify rollback safety
|
|
824
|
+
- [ ] `/buildflow-seed` — generate realistic test data for the current schema
|
|
825
|
+
|
|
826
|
+
### CLI Improvements
|
|
827
|
+
- [ ] `buildflow audit` in GitHub Actions — CI-friendly exit codes already work, needs workflow template
|
|
583
828
|
- [ ] `buildflow fix --auto` — non-interactive mode for CI
|
|
829
|
+
- [ ] `buildflow test` — terminal wrapper that runs the project's test suite with BuildFlow context
|
|
830
|
+
|
|
831
|
+
### Platform
|
|
584
832
|
- [ ] Web dashboard for project status visualization
|
|
585
833
|
- [ ] Custom agent creation: `buildflow agent create`
|
|
586
834
|
- [ ] Team sync: shared `.buildflow/` across teammates
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "buildflow-dev",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "4.0.1",
|
|
4
|
+
"description": "Spec-driven, multi-agent AI development orchestration with automatic token pruning. Works with Claude Code, Gemini CLI, Codex CLI, Cursor, and more.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
7
7
|
"claude",
|
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
"developer-tools",
|
|
12
12
|
"cli",
|
|
13
13
|
"workflow",
|
|
14
|
+
"spec-driven-development",
|
|
15
|
+
"multi-agent",
|
|
14
16
|
"scaffolding",
|
|
15
17
|
"security-audit",
|
|
16
18
|
"code-generation"
|
package/src/commands/init.js
CHANGED
|
@@ -80,6 +80,7 @@ function scaffoldBuildflow(appName, projectInfo) {
|
|
|
80
80
|
const dirs = [
|
|
81
81
|
'core', 'you', 'memory', 'phases',
|
|
82
82
|
'learnings', 'research', 'codebase',
|
|
83
|
+
'specs',
|
|
83
84
|
'security/reports', 'security/rules',
|
|
84
85
|
'security/suppressions',
|
|
85
86
|
]
|
|
@@ -451,6 +452,24 @@ Phase 0 — Initial setup complete. Run \`/buildflow-start\` to begin.
|
|
|
451
452
|
---
|
|
452
453
|
|
|
453
454
|
*New decisions are appended below by \`/buildflow-think\` and \`/buildflow-plan\`.*
|
|
455
|
+
`)
|
|
456
|
+
|
|
457
|
+
// ── specs/ ──────────────────────────────────────────────────────────────────
|
|
458
|
+
writeFileSync(join(base, 'specs', 'README.md'),
|
|
459
|
+
`# Specs
|
|
460
|
+
|
|
461
|
+
> Generated by \`/buildflow-spec\`. Run it after \`/buildflow-start\`.
|
|
462
|
+
|
|
463
|
+
| File | Purpose |
|
|
464
|
+
|------|---------|
|
|
465
|
+
| \`PRD.md\` | Product Requirements — what, for whom, success criteria |
|
|
466
|
+
| \`TDD.md\` | Technical Design — architecture, API contracts, decisions |
|
|
467
|
+
| \`acceptance.md\` | Acceptance Criteria — testable pass/fail conditions per feature |
|
|
468
|
+
|
|
469
|
+
These files are the source of truth for planning and verification.
|
|
470
|
+
\`/buildflow-plan\` traces every task to an AC.
|
|
471
|
+
\`/buildflow-check\` verifies every AC is satisfied.
|
|
472
|
+
\`/buildflow-ship\` blocks if any AC is unmet.
|
|
454
473
|
`)
|
|
455
474
|
|
|
456
475
|
// ── security/DEBT.md ────────────────────────────────────────────────────────
|
package/src/commands/install.js
CHANGED
|
@@ -620,8 +620,9 @@ function loadCommandTemplates() {
|
|
|
620
620
|
const templatesDir = join(__dirname, '../../templates/commands')
|
|
621
621
|
const commands = {}
|
|
622
622
|
const commandNames = [
|
|
623
|
-
'start', 'think', 'plan', 'build', 'check', 'ship',
|
|
624
|
-
'onboard', 'modify', 'refactor', 'audit',
|
|
623
|
+
'start', 'think', 'spec', 'plan', 'build', 'test', 'check', 'ship',
|
|
624
|
+
'onboard', 'modify', 'refactor', 'hotfix', 'audit',
|
|
625
|
+
'debug', 'deploy',
|
|
625
626
|
'status', 'explain', 'back', 'help',
|
|
626
627
|
]
|
|
627
628
|
for (const name of commandNames) {
|
package/templates/CLAUDE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# {{APP_NAME}} — Claude Code Configuration
|
|
2
2
|
|
|
3
|
-
This project uses **BuildFlow
|
|
3
|
+
This project uses **BuildFlow v4.0** for spec-driven, multi-agent development orchestration.
|
|
4
4
|
|
|
5
5
|
## Session Start Checklist (Run Every Time)
|
|
6
6
|
|
|
@@ -15,41 +15,57 @@ Before doing anything else at the start of every session:
|
|
|
15
15
|
Then display the contents of UPDATE.md.
|
|
16
16
|
- If the file does not exist, proceed silently.
|
|
17
17
|
|
|
18
|
-
2. **
|
|
18
|
+
2. **Prune memory** — read `.buildflow/memory/light.md`. If over 3K tokens, prune it:
|
|
19
|
+
- Archive phase task lists and build timestamps to `phases/[last phase]/retro.md`
|
|
20
|
+
- Keep: app_name, framework, language, current_phase, spec_status, style_fingerprint, last 2 decisions
|
|
21
|
+
- Report: "Context pruned: light.md [X] → [Y] tokens"
|
|
22
|
+
|
|
19
23
|
3. **Load state** — read `.buildflow/core/state.md` for current phase and status
|
|
20
24
|
|
|
21
25
|
---
|
|
22
26
|
|
|
23
|
-
##
|
|
24
|
-
|
|
25
|
-
Type `/` in Claude Code to see available commands:
|
|
26
|
-
|
|
27
|
-
- `/buildflow-start` — begin or continue the project
|
|
28
|
-
- `/buildflow-onboard` — analyze existing codebase (run once for existing projects)
|
|
29
|
-
- `/buildflow-think` — research and discuss
|
|
30
|
-
- `/buildflow-plan` — create execution plan
|
|
31
|
-
- `/buildflow-build` — implement the plan
|
|
32
|
-
- `/buildflow-check` — verify quality
|
|
33
|
-
- `/buildflow-ship` — finalize with security gate
|
|
34
|
-
- `/buildflow-audit` — run security scan
|
|
35
|
-
- `/buildflow-status` — see where you are
|
|
36
|
-
- `/buildflow-help` — get help or recover from issues
|
|
27
|
+
## BuildFlow v4.0 Workflow
|
|
37
28
|
|
|
38
|
-
|
|
29
|
+
```
|
|
30
|
+
/buildflow-start → capture vision
|
|
31
|
+
/buildflow-think → research (optional)
|
|
32
|
+
/buildflow-spec → generate PRD + TDD + Acceptance Criteria ← NEW
|
|
33
|
+
/buildflow-plan → map tasks to ACs, group into waves
|
|
34
|
+
/buildflow-build → execute waves with auto-test + auto-fix
|
|
35
|
+
/buildflow-check → verify all ACs satisfied
|
|
36
|
+
/buildflow-ship → spec gate + security gate + context pruning
|
|
37
|
+
/buildflow-deploy → pre-flight + deploy to staging/production
|
|
38
|
+
```
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
## Quick Reference
|
|
41
|
+
|
|
42
|
+
| Command | When to use |
|
|
43
|
+
|---------|-------------|
|
|
44
|
+
| `/buildflow-start` | Begin or continue the project |
|
|
45
|
+
| `/buildflow-spec` | Define PRD, TDD, Acceptance Criteria before planning |
|
|
46
|
+
| `/buildflow-plan` | Create spec-traced wave plan |
|
|
47
|
+
| `/buildflow-build` | Execute plan — auto-tests and auto-fixes each wave |
|
|
48
|
+
| `/buildflow-test` | Re-verify a wave or test a manual change |
|
|
49
|
+
| `/buildflow-check` | Verify all ACs satisfied + code quality |
|
|
50
|
+
| `/buildflow-ship` | Spec gate + security gate + context prune + git tag |
|
|
51
|
+
| `/buildflow-deploy` | Pre-flight checks + deploy staging/production |
|
|
52
|
+
| `/buildflow-hotfix` | Fast-path fix — no planning, no waves |
|
|
53
|
+
| `/buildflow-debug` | Root-cause analysis when tests fail |
|
|
54
|
+
| `/buildflow-onboard` | One-time analysis of existing codebase |
|
|
55
|
+
| `/buildflow-modify` | Surgical change or bugfix to existing code |
|
|
56
|
+
| `/buildflow-audit` | OWASP Top 10 security scan |
|
|
57
|
+
| `/buildflow-status` | See current phase and progress |
|
|
58
|
+
| `/buildflow-help` | Diagnostic mode + recovery |
|
|
43
59
|
|
|
44
60
|
## Core Rules
|
|
45
61
|
|
|
62
|
+
- Each agent receives a **minimal context packet** — only what it needs, nothing else
|
|
63
|
+
- `light.md` must stay under 3K tokens — prune at session start if over
|
|
46
64
|
- Ask confidence (1-5) before locking major decisions
|
|
47
|
-
-
|
|
48
|
-
-
|
|
65
|
+
- Run `/buildflow-spec` before `/buildflow-plan` — no spec, no plan
|
|
66
|
+
- `/buildflow-ship` blocks if any Acceptance Criterion is unsatisfied
|
|
49
67
|
- Create git restore points before destructive operations
|
|
50
68
|
- Run `/buildflow-audit` before every `/buildflow-ship`
|
|
51
|
-
- Cite research sources with trust scores (1-5)
|
|
52
|
-
- Keep `.buildflow/memory/light.md` under 5K tokens
|
|
53
69
|
|
|
54
70
|
## Agents
|
|
55
71
|
|
|
@@ -58,14 +74,14 @@ Type `/` in Claude Code to see available commands:
|
|
|
58
74
|
| Strategist | Vision, decisions, direction |
|
|
59
75
|
| Researcher | Parallel web research with sources |
|
|
60
76
|
| Synthesizer | Combines research findings |
|
|
61
|
-
| Architect |
|
|
62
|
-
| Builder | Code matching project style |
|
|
63
|
-
| Reviewer |
|
|
77
|
+
| Architect | Spec-traced dependency planning |
|
|
78
|
+
| Builder | Code matching project style, AC-referenced |
|
|
79
|
+
| Reviewer | Spec compliance + quality checks |
|
|
64
80
|
| Cartographer | Maps existing codebases |
|
|
65
81
|
| Surgeon | Precise modifications to existing code |
|
|
66
82
|
| Security Auditor | OWASP Top 10 scanning |
|
|
67
83
|
|
|
68
|
-
Each agent gets a **fresh context window** — no context rot.
|
|
84
|
+
Each agent gets a **fresh context window** with a **minimal context packet** — no context rot, no wasted tokens.
|
|
69
85
|
|
|
70
86
|
## Project Structure
|
|
71
87
|
|
|
@@ -74,10 +90,14 @@ Each agent gets a **fresh context window** — no context rot.
|
|
|
74
90
|
├── core/
|
|
75
91
|
│ ├── vision.md ← What we're building
|
|
76
92
|
│ └── state.md ← Current phase and status
|
|
93
|
+
├── specs/ ← Generated by /buildflow-spec ← NEW
|
|
94
|
+
│ ├── PRD.md ← Product Requirements
|
|
95
|
+
│ ├── TDD.md ← Technical Design
|
|
96
|
+
│ └── acceptance.md ← Acceptance Criteria (AC-001, AC-002...)
|
|
77
97
|
├── you/
|
|
78
98
|
│ └── preferences.md ← Experience level, style prefs
|
|
79
99
|
├── memory/
|
|
80
|
-
│ └── light.md ← Persistent context (≤
|
|
100
|
+
│ └── light.md ← Persistent context (≤3K tokens, auto-pruned)
|
|
81
101
|
├── codebase/ ← Generated by /buildflow-onboard
|
|
82
102
|
│ ├── MAP.md
|
|
83
103
|
│ ├── PATTERNS.md
|