buildflow-dev 1.0.7 → 4.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +138 -51
- package/package.json +4 -2
- package/src/commands/init.js +19 -0
- package/src/commands/install.js +2 -2
- package/templates/CLAUDE.md +49 -33
- package/templates/commands/build.md +237 -66
- package/templates/commands/check.md +59 -24
- package/templates/commands/hotfix.md +119 -0
- package/templates/commands/modify.md +212 -38
- package/templates/commands/onboard.md +246 -52
- package/templates/commands/plan.md +204 -36
- package/templates/commands/ship.md +109 -47
- package/templates/commands/spec.md +251 -0
- package/templates/commands/start.md +38 -8
- package/templates/commands/think.md +186 -38
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)
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
- [The .buildflow/ Scaffold](#the-buildflow-scaffold)
|
|
22
22
|
- [Template System](#template-system)
|
|
23
23
|
- [9 Specialized Agents](#9-specialized-agents)
|
|
24
|
+
- [v4.0: Spec-Driven + Token Pruning](#v40-what-changed)
|
|
24
25
|
- [Examples](#examples)
|
|
25
26
|
- [Token Economics](#token-economics)
|
|
26
27
|
- [Contributing](#contributing)
|
|
@@ -31,14 +32,18 @@
|
|
|
31
32
|
|
|
32
33
|
## What is BuildFlow?
|
|
33
34
|
|
|
34
|
-
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:
|
|
35
36
|
|
|
36
|
-
1. **Scaffolds `.buildflow/`** —
|
|
37
|
-
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.)
|
|
38
39
|
|
|
39
|
-
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.
|
|
40
41
|
|
|
41
|
-
**
|
|
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.
|
|
42
47
|
|
|
43
48
|
---
|
|
44
49
|
|
|
@@ -89,20 +94,21 @@ These are installed into your AI tool and triggered by typing `/` (or `@` / `$`
|
|
|
89
94
|
|
|
90
95
|
| Command | Agent | Purpose | Token Cost |
|
|
91
96
|
|---------|-------|---------|-----------|
|
|
92
|
-
| `/buildflow-start` | Strategist | Begin project:
|
|
93
|
-
| `/buildflow-think [topic]` | Researcher × 3 + Synthesizer |
|
|
94
|
-
| `/buildflow-
|
|
95
|
-
| `/buildflow-
|
|
96
|
-
| `/buildflow-
|
|
97
|
-
| `/buildflow-
|
|
98
|
-
| `/buildflow-
|
|
97
|
+
| `/buildflow-start` | Strategist | Begin project: vision questions, pruning of stale context, saves to `core/vision.md` | ~8K |
|
|
98
|
+
| `/buildflow-think [topic]` | Researcher × 3 + Synthesizer | Research + `--arch` (architecture review) + `--build-vs-buy` + `--debt` + `--complexity` modes | ~30K |
|
|
99
|
+
| `/buildflow-spec` | Strategist | Generate user-story-backed PRD + TDD + ACs with Spec Critic self-review pass. Required before planning | ~20K |
|
|
100
|
+
| `/buildflow-plan [phase]` | Architect | AC-traced tasks, HARD/SOFT/EXTERNAL dependency reasoning, effort estimates, risk sequencing, Engineering Review | ~22K |
|
|
101
|
+
| `/buildflow-build [wave]` | Builder × N + Reviewer | Context packets with closest-example + before/after contracts. Auto-test, auto-fix, PR-ready commits per wave | ~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 |
|
|
99
105
|
|
|
100
106
|
### Workflow — Existing Codebases
|
|
101
107
|
|
|
102
108
|
| Command | Agent | Purpose | Token Cost |
|
|
103
109
|
|---------|-------|---------|-----------|
|
|
104
|
-
| `/buildflow-onboard` | Cartographer |
|
|
105
|
-
| `/buildflow-modify "description"` | Surgeon |
|
|
110
|
+
| `/buildflow-onboard` | Cartographer | Deep analysis: import graph, module boundaries, load-bearing files, risk scores → MAP/GRAPH/PATTERNS/DEPENDENCIES/HOTSPOTS | ~40K |
|
|
111
|
+
| `/buildflow-modify "description"` | Surgeon | Full transitive impact chain + risk scores + test coverage map + API contract check + surgical change | ~30K |
|
|
106
112
|
| `/buildflow-refactor [scope]` | Surgeon + Reviewer | Improve code quality without changing behavior | ~40K |
|
|
107
113
|
|
|
108
114
|
**`/buildflow-modify` works for both features and bugs.** Pass a plain-English description either way:
|
|
@@ -125,12 +131,14 @@ If you're not sure where the bug is yet, use `/buildflow-help` first — it's a
|
|
|
125
131
|
| Know what needs to change | `/buildflow-modify "fix description"` |
|
|
126
132
|
| Don't know where the bug is | `/buildflow-help` first, then `/buildflow-modify` |
|
|
127
133
|
| Tests failing after a change | `/buildflow-debug` |
|
|
134
|
+
| Production incident / tiny patch | `/buildflow-hotfix "description"` — no planning, no waves |
|
|
128
135
|
|
|
129
136
|
### Debugging & Deployment
|
|
130
137
|
|
|
131
138
|
| Command | Agent | Purpose | Token Cost |
|
|
132
139
|
|---------|-------|---------|-----------|
|
|
133
|
-
| `/buildflow-
|
|
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 |
|
|
134
142
|
| `/buildflow-deploy [env]` | Strategist | Pre-flight checks then deploy to staging or production | ~15K |
|
|
135
143
|
|
|
136
144
|
### Security
|
|
@@ -207,36 +215,62 @@ npx buildflow-dev init
|
|
|
207
215
|
|
|
208
216
|
---
|
|
209
217
|
|
|
210
|
-
### 3.
|
|
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
|
|
211
244
|
|
|
212
245
|
```
|
|
213
246
|
/buildflow-plan
|
|
214
247
|
```
|
|
215
248
|
|
|
216
|
-
The Architect reads `
|
|
249
|
+
The Architect reads `specs/acceptance.md` and produces `.buildflow/phases/01/PLAN.md` with every task traced to an AC:
|
|
217
250
|
|
|
218
251
|
```
|
|
219
252
|
Phase 1 — Foundation
|
|
220
253
|
|
|
221
254
|
Wave 1 (parallel — no dependencies):
|
|
222
|
-
• Create database schema
|
|
223
|
-
• Create project config files
|
|
224
|
-
• Set up folder structure
|
|
255
|
+
• Create database schema [AC-001, AC-002]
|
|
256
|
+
• Create project config files [AC-NF-001]
|
|
225
257
|
|
|
226
258
|
Wave 2 (depends on Wave 1):
|
|
227
|
-
• Create
|
|
228
|
-
• Create
|
|
259
|
+
• Create auth middleware [AC-001, AC-002, AC-003]
|
|
260
|
+
• Create data models [AC-001]
|
|
229
261
|
|
|
230
262
|
Wave 3 (depends on Wave 2):
|
|
231
|
-
• Create API
|
|
232
|
-
• Create
|
|
263
|
+
• Create login API route [AC-001, AC-002]
|
|
264
|
+
• Create token refresh route [AC-003]
|
|
233
265
|
|
|
234
266
|
Wave 4 (depends on Wave 3):
|
|
235
|
-
• Create UI
|
|
236
|
-
• Write integration tests
|
|
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 ✓
|
|
237
271
|
```
|
|
238
272
|
|
|
239
|
-
|
|
273
|
+
Every AC is covered. The Architect won't write the plan if any AC is orphaned.
|
|
240
274
|
|
|
241
275
|
---
|
|
242
276
|
|
|
@@ -271,17 +305,20 @@ If a wave can't be fixed within 5 attempts, the build stops and reports exactly
|
|
|
271
305
|
|
|
272
306
|
---
|
|
273
307
|
|
|
274
|
-
###
|
|
308
|
+
### 6. Check, ship, and deploy
|
|
275
309
|
|
|
276
310
|
```
|
|
277
311
|
/buildflow-check
|
|
278
312
|
```
|
|
279
|
-
>
|
|
313
|
+
> 4 Reviewers in parallel: spec compliance (all ACs?) / correctness / quality / security
|
|
280
314
|
|
|
281
315
|
```
|
|
282
316
|
/buildflow-ship
|
|
283
317
|
```
|
|
284
|
-
>
|
|
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
|
|
285
322
|
|
|
286
323
|
```
|
|
287
324
|
/buildflow-deploy staging
|
|
@@ -416,21 +453,23 @@ buildflow-dev/
|
|
|
416
453
|
│ │ all available /buildflow-* commands.
|
|
417
454
|
│ │ {{APP_NAME}} is replaced with the detected project name.
|
|
418
455
|
│ │
|
|
419
|
-
│ └── commands/
|
|
456
|
+
│ └── commands/ 19 markdown files — one per slash command.
|
|
420
457
|
│ │ Each file is the full instruction set for that command.
|
|
421
458
|
│ │ The AI reads and executes these when you trigger the command.
|
|
422
459
|
│ │ Format: YAML frontmatter (name, description, agent, tools)
|
|
423
460
|
│ │ followed by numbered steps the agent follows.
|
|
424
461
|
│ │
|
|
425
|
-
│ ├── start.md Vision gathering, mode detection
|
|
426
|
-
│ ├── think.md Parallel research
|
|
427
|
-
│ ├──
|
|
462
|
+
│ ├── start.md Vision gathering, mode detection, light.md pruning on session start
|
|
463
|
+
│ ├── think.md Parallel research + architecture review + build-vs-buy + debt + complexity modes
|
|
464
|
+
│ ├── spec.md Generate PRD + TDD + Acceptance Criteria (required before plan)
|
|
465
|
+
│ ├── plan.md AC-traced dependency mapping → wave-based execution plan
|
|
428
466
|
│ ├── build.md Wave-by-wave parallel Builder execution
|
|
429
467
|
│ ├── test.md Run tests + UI verification after each wave
|
|
430
468
|
│ ├── check.md 3-reviewer parallel quality check
|
|
431
|
-
│ ├── ship.md
|
|
432
|
-
│ ├──
|
|
433
|
-
│ ├──
|
|
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
|
|
471
|
+
│ ├── onboard.md Deep codebase analysis → MAP/GRAPH/PATTERNS/DEPENDENCIES/HOTSPOTS with risk scores
|
|
472
|
+
│ ├── modify.md Transitive impact chain + risk scoring + test coverage map + surgical change
|
|
434
473
|
│ ├── refactor.md Quality improvement without behavior change
|
|
435
474
|
│ ├── audit.md OWASP Top 10 AI-powered scan
|
|
436
475
|
│ ├── debug.md Root-cause analysis for failing tests or broken behavior
|
|
@@ -472,12 +511,17 @@ their-project/
|
|
|
472
511
|
│ settings, parallelization limits. The AI adapts its
|
|
473
512
|
│ explanation depth based on the experience: field.
|
|
474
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
|
+
│
|
|
475
521
|
├── memory/
|
|
476
|
-
│ └── light.md
|
|
477
|
-
│
|
|
478
|
-
│
|
|
479
|
-
│ Kept under 5K tokens deliberately — costs less to load than
|
|
480
|
-
│ 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.
|
|
481
525
|
│
|
|
482
526
|
├── learnings/
|
|
483
527
|
│ ├── glossary.md Project-specific jargon and BuildFlow concepts. Grows as
|
|
@@ -492,14 +536,19 @@ their-project/
|
|
|
492
536
|
│ with sources, trust scores, and the synthesized recommendation.
|
|
493
537
|
│
|
|
494
538
|
├── codebase/ Generated by /buildflow-onboard (existing projects only).
|
|
495
|
-
│ ├── MAP.md Architecture overview,
|
|
496
|
-
│ ├──
|
|
497
|
-
│
|
|
498
|
-
│
|
|
539
|
+
│ ├── MAP.md Architecture overview, module boundaries, load-bearing files
|
|
540
|
+
│ ├── GRAPH.md Import dependency graph — fan-in/fan-out per file. Used by
|
|
541
|
+
│ │ /buildflow-modify for transitive impact analysis.
|
|
542
|
+
│ ├── PATTERNS.md Code conventions: naming, imports, error handling, testing.
|
|
543
|
+
│ │ Used by Builders as the "closest example" source.
|
|
544
|
+
│ ├── DEPENDENCIES.md Top dependencies with purpose, criticality, security status
|
|
545
|
+
│ └── HOTSPOTS.md Files with risk scores ≥ 3.5 — high fan-in, low test coverage,
|
|
546
|
+
│ large size. Surgeon always checks this before modifying.
|
|
499
547
|
│
|
|
500
548
|
├── phases/ One subfolder per phase (01/, 02/, etc.)
|
|
501
549
|
│ └── 01/
|
|
502
|
-
│ ├── PLAN.md Task breakdown with dependency waves
|
|
550
|
+
│ ├── PLAN.md Task breakdown with AC references and dependency waves.
|
|
551
|
+
│ │ Archived context from light.md lands here after /buildflow-ship.
|
|
503
552
|
│ └── retro.md Written during /buildflow-ship: what worked, what didn't
|
|
504
553
|
│
|
|
505
554
|
└── security/
|
|
@@ -638,6 +687,36 @@ buildflow fix
|
|
|
638
687
|
|
|
639
688
|
---
|
|
640
689
|
|
|
690
|
+
## v4.0: What Changed
|
|
691
|
+
|
|
692
|
+
### Spec-Driven Layer
|
|
693
|
+
Every phase now has a formal spec before any code is planned or written.
|
|
694
|
+
|
|
695
|
+
| Old flow | New flow |
|
|
696
|
+
|----------|----------|
|
|
697
|
+
| vision → plan → build | vision → **spec** → plan → build |
|
|
698
|
+
| Plan tasks were freeform | Plan tasks trace to Acceptance Criteria |
|
|
699
|
+
| Check was code review only | Check verifies every AC is satisfied |
|
|
700
|
+
| Ship had security gate | Ship has **spec gate** + security gate |
|
|
701
|
+
|
|
702
|
+
### Context Isolation (Token Pruning)
|
|
703
|
+
Agents now receive minimal context packets instead of full project state.
|
|
704
|
+
|
|
705
|
+
| What changed | Effect |
|
|
706
|
+
|-------------|--------|
|
|
707
|
+
| Each Builder gets max 5 relevant files | −10–30K tokens per wave |
|
|
708
|
+
| `light.md` auto-pruned to ≤3K at session start | Prevents bloat across long projects |
|
|
709
|
+
| `light.md` pruned after every `/buildflow-ship` | Stale phase data archived, not re-loaded |
|
|
710
|
+
| Reviewers receive diff + ACs only (not full codebase) | Faster, more focused reviews |
|
|
711
|
+
|
|
712
|
+
### New Commands
|
|
713
|
+
| Command | Purpose |
|
|
714
|
+
|---------|---------|
|
|
715
|
+
| `/buildflow-spec` | Generate PRD + TDD + Acceptance Criteria |
|
|
716
|
+
| `/buildflow-hotfix` | Fast-path for incidents — no planning overhead |
|
|
717
|
+
|
|
718
|
+
---
|
|
719
|
+
|
|
641
720
|
## Token Economics
|
|
642
721
|
|
|
643
722
|
| Scenario | Tokens | Notes |
|
|
@@ -645,10 +724,18 @@ buildflow fix
|
|
|
645
724
|
| Greenfield full workflow | 130–160K | All phases, one session |
|
|
646
725
|
| Onboarding existing project | +35K | One-time, never again |
|
|
647
726
|
| Existing project after onboard | 130–160K | Same as greenfield |
|
|
727
|
+
| `/buildflow-spec` | ~18K | One-time per phase — produces PRD + TDD + ACs |
|
|
648
728
|
| Security gate (per ship) | +10K | Always runs with `/buildflow-ship` |
|
|
649
|
-
| Light memory load (per session) | ~
|
|
650
|
-
|
|
651
|
-
|
|
729
|
+
| Light memory load (per session) | ~1.5K | Pruned to ≤3K — **saves** ~10K in re-detection |
|
|
730
|
+
| Context pruning savings | −5–15K | Old phase data archived, not reloaded each session |
|
|
731
|
+
| Hotfix (vs full build) | ~10K vs ~50K | 5× cheaper for small patches |
|
|
732
|
+
| Per-agent context packets | −10–30K | Builders get minimal context, not full codebase |
|
|
733
|
+
|
|
734
|
+
**Token efficiency strategy:**
|
|
735
|
+
- `light.md` stays under 3K (auto-pruned after each ship and at session start)
|
|
736
|
+
- Each agent gets a context packet: only task spec + relevant files + style rules
|
|
737
|
+
- Builders never receive full codebase — they get max 5 relevant files
|
|
738
|
+
- Old phase data lives in `phases/N/retro.md`, not loaded unless needed
|
|
652
739
|
|
|
653
740
|
---
|
|
654
741
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "buildflow-dev",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "4.0.2",
|
|
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,8 @@ function loadCommandTemplates() {
|
|
|
620
620
|
const templatesDir = join(__dirname, '../../templates/commands')
|
|
621
621
|
const commands = {}
|
|
622
622
|
const commandNames = [
|
|
623
|
-
'start', 'think', 'plan', 'build', 'test', 'check', 'ship',
|
|
624
|
-
'onboard', 'modify', 'refactor', 'audit',
|
|
623
|
+
'start', 'think', 'spec', 'plan', 'build', 'test', 'check', 'ship',
|
|
624
|
+
'onboard', 'modify', 'refactor', 'hotfix', 'audit',
|
|
625
625
|
'debug', 'deploy',
|
|
626
626
|
'status', 'explain', 'back', 'help',
|
|
627
627
|
]
|
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,45 +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-test` — run tests and verify UI/functionality after each wave
|
|
33
|
-
- `/buildflow-check` — verify quality with 3 parallel reviewers
|
|
34
|
-
- `/buildflow-debug` — root-cause analysis when tests fail or something breaks
|
|
35
|
-
- `/buildflow-ship` — finalize with security gate
|
|
36
|
-
- `/buildflow-deploy` — pre-flight checks then deploy to staging or production
|
|
37
|
-
- `/buildflow-audit` — run security scan
|
|
38
|
-
- `/buildflow-modify` — surgical change or bugfix to existing code
|
|
39
|
-
- `/buildflow-status` — see where you are
|
|
40
|
-
- `/buildflow-help` — get help or recover from issues
|
|
27
|
+
## BuildFlow v4.0 Workflow
|
|
41
28
|
|
|
42
|
-
|
|
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
|
+
```
|
|
43
39
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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 |
|
|
47
59
|
|
|
48
60
|
## Core Rules
|
|
49
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
|
|
50
64
|
- Ask confidence (1-5) before locking major decisions
|
|
51
|
-
-
|
|
52
|
-
-
|
|
65
|
+
- Run `/buildflow-spec` before `/buildflow-plan` — no spec, no plan
|
|
66
|
+
- `/buildflow-ship` blocks if any Acceptance Criterion is unsatisfied
|
|
53
67
|
- Create git restore points before destructive operations
|
|
54
68
|
- Run `/buildflow-audit` before every `/buildflow-ship`
|
|
55
|
-
- Cite research sources with trust scores (1-5)
|
|
56
|
-
- Keep `.buildflow/memory/light.md` under 5K tokens
|
|
57
69
|
|
|
58
70
|
## Agents
|
|
59
71
|
|
|
@@ -62,14 +74,14 @@ Type `/` in Claude Code to see available commands:
|
|
|
62
74
|
| Strategist | Vision, decisions, direction |
|
|
63
75
|
| Researcher | Parallel web research with sources |
|
|
64
76
|
| Synthesizer | Combines research findings |
|
|
65
|
-
| Architect |
|
|
66
|
-
| Builder | Code matching project style |
|
|
67
|
-
| Reviewer |
|
|
77
|
+
| Architect | Spec-traced dependency planning |
|
|
78
|
+
| Builder | Code matching project style, AC-referenced |
|
|
79
|
+
| Reviewer | Spec compliance + quality checks |
|
|
68
80
|
| Cartographer | Maps existing codebases |
|
|
69
81
|
| Surgeon | Precise modifications to existing code |
|
|
70
82
|
| Security Auditor | OWASP Top 10 scanning |
|
|
71
83
|
|
|
72
|
-
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.
|
|
73
85
|
|
|
74
86
|
## Project Structure
|
|
75
87
|
|
|
@@ -78,10 +90,14 @@ Each agent gets a **fresh context window** — no context rot.
|
|
|
78
90
|
├── core/
|
|
79
91
|
│ ├── vision.md ← What we're building
|
|
80
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...)
|
|
81
97
|
├── you/
|
|
82
98
|
│ └── preferences.md ← Experience level, style prefs
|
|
83
99
|
├── memory/
|
|
84
|
-
│ └── light.md ← Persistent context (≤
|
|
100
|
+
│ └── light.md ← Persistent context (≤3K tokens, auto-pruned)
|
|
85
101
|
├── codebase/ ← Generated by /buildflow-onboard
|
|
86
102
|
│ ├── MAP.md
|
|
87
103
|
│ ├── PATTERNS.md
|