buildflow-dev 1.0.7 → 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.
@@ -1,105 +1,116 @@
1
1
  ---
2
2
  name: buildflow-build
3
- description: Execute the plan with parallel Builder agents, auto-test and auto-fix each wave
3
+ description: Execute the spec-traced plan wave-by-wave with auto-test and auto-fix per wave
4
4
  allowed-tools: Read, Write, Bash, Grep, Glob
5
5
  agents: builder, reviewer
6
6
  ---
7
7
 
8
8
  # /buildflow-build
9
9
 
10
- Execute the current phase plan. Spawns parallel Builder agents per wave. After every wave, automatically runs tests and fixes failures the next wave does not start until the current wave passes all tests.
10
+ Execute the current phase plan. Spawns parallel Builder agents per wave. Each wave auto-tests and auto-fixes until green. The next wave does not start until the current wave fully passes.
11
+
12
+ Every task is traced to an acceptance criterion. Builders reference specs — not opinions.
11
13
 
12
14
  ## Usage
13
- - `/buildflow-build` — execute current phase plan (all waves, auto-test each)
14
- - `/buildflow-build wave-2` — execute and test a specific wave
15
+ - `/buildflow-build` — execute all waves in the current plan
16
+ - `/buildflow-build wave-2` — execute a specific wave
15
17
  - `/buildflow-build <task>` — build and test a single task
16
18
 
19
+ ## Context Packet for this command (load only these)
20
+ - `.buildflow/phases/[N]/PLAN.md`
21
+ - `.buildflow/memory/light.md` (app_name, framework, style_fingerprint fields only)
22
+ - `.buildflow/codebase/PATTERNS.md` (if exists)
23
+ - Do NOT load: full codebase, specs, research, retros, old phases
24
+
17
25
  ## Step 1: Load Plan
18
26
  Read `.buildflow/phases/[N]/PLAN.md`.
19
- Load `.buildflow/memory/light.md` for style preferences.
20
- If existing project: load `.buildflow/codebase/PATTERNS.md`.
27
+ Confirm: "Phase [N] — [N] waves, [N] tasks, [N] ACs covered. Starting Wave 1."
21
28
 
22
29
  ## Step 2: Style Fingerprint
23
- Before writing any code, confirm:
30
+ Before writing any code:
24
31
  - Naming conventions (camelCase, PascalCase, snake_case)
25
- - Import organization
32
+ - Import organization pattern
26
33
  - Error handling style
27
34
  - Test file location and naming
35
+ - Comment style
36
+
37
+ ---
38
+
39
+ ## Step 3: Wave Execution Loop
28
40
 
29
- ## Step 3: Execute Wave
41
+ Repeat this block for each wave:
30
42
 
31
- Repeat this block for each wave in the plan:
43
+ ### 3a Prepare Builder Context Packets
44
+ For each task in this wave, prepare a minimal context packet:
45
+ ```
46
+ Task spec (from PLAN.md)
47
+ AC refs: [which ACs this task satisfies]
48
+ Relevant files: [max 5 files this task touches — not full codebase]
49
+ Style rules: [3-5 key conventions from PATTERNS.md]
50
+ ```
51
+ Builders receive ONLY this packet — not full project state.
52
+ This is what keeps token usage low and context clean.
32
53
 
33
- ### 3a — Build
34
- Spawn Builder agents in parallel for all tasks in this wave.
54
+ ### 3b — Build (parallel)
55
+ Spawn Builder agents in parallel, one per task.
35
56
  Each Builder:
36
- - Gets the task spec and relevant context files
37
- - Writes code matching the detected style
38
- - Adds LEARN: comments for non-obvious patterns
39
- - Reports back: files created/modified, decisions made
57
+ - Receives its context packet only
58
+ - Writes code that satisfies the referenced ACs
59
+ - Adds LEARN: comment for non-obvious patterns
60
+ - Reports back: files created/modified, AC coverage confirmed
40
61
 
41
- ### 3b — Review
62
+ ### 3c — Review
42
63
  Reviewer checks each output:
43
- - Does it meet the task spec?
44
- - Does it match codebase style?
64
+ - Does it satisfy the referenced ACs?
65
+ - Does it match PATTERNS.md style?
45
66
  - Any security concerns?
46
- - Are tests written for new logic?
67
+ - Tests written for new logic?
47
68
 
48
- ### 3c — Test (automatic, runs after every wave)
49
- Detect and run the test suite:
69
+ ### 3d — Test + Fix Loop
70
+ Run the full test suite:
50
71
  ```bash
51
- npm test # Node / JS / TS projects
72
+ npm test # Node / TS / JS
52
73
  pytest # Python
53
74
  go test ./... # Go
54
75
  cargo test # Rust
55
- # etc. based on detected framework
56
76
  ```
57
77
 
58
- Also check:
59
- - If frontend code changed: start dev server and verify UI renders, flows work, no console errors
60
- - No import errors, missing modules, or broken references
61
- - All previously passing tests still pass (no regressions)
62
-
63
- ### 3d — Fix loop (runs only if tests fail)
64
- If any test fails:
65
- 1. Identify root cause (trace error → file → line → why)
66
- 2. Apply minimal fix — change only what broke, do not refactor surrounding code
67
- 3. Re-run the full test suite
68
- 4. Repeat until all tests pass
78
+ If frontend code changed: verify dev server renders without errors, core UI flow works.
69
79
 
70
- **Do not move to the next wave until this wave is fully green.**
80
+ **If tests fail:**
81
+ 1. Identify root cause (error → file → line → why)
82
+ 2. Apply minimal fix (change only what broke)
83
+ 3. Re-run full test suite
84
+ 4. Repeat until green
71
85
 
72
- Maximum fix attempts per wave: 5.
73
- If still failing after 5 attempts: stop, report the unresolved failure, and ask the user how to proceed.
86
+ Max 5 fix attempts per wave.
87
+ If still failing after 5: stop, report unresolved failures, ask user how to proceed.
74
88
 
75
- Fix attempt log format:
89
+ Fix log:
76
90
  ```
77
- Wave [N] Fix attempt [X]/5
78
- Error: [error message]
79
- Root cause: [explanation]
80
- Fix applied: [what changed]
81
- Result: [pass / still failing]
91
+ Wave [N] Fix [X]/5: [error] → [root cause] → [fix applied] → [result]
82
92
  ```
83
93
 
84
- ## Step 4: Wave Complete
85
- Only after a wave is fully tested and passing:
86
- - Log the wave as complete in `.buildflow/phases/[N]/PLAN.md`
87
- - Continue to the next wave (back to Step 3)
94
+ ### 3e Wave Complete
95
+ Only after all tests pass:
96
+ - Mark wave as complete in `phases/[N]/PLAN.md`
97
+ - Continue to next wave
98
+
99
+ ---
88
100
 
89
- ## Step 5: Integration Check
101
+ ## Step 4: Integration Check
90
102
  After all waves pass:
91
- - Run the full test suite one final time
92
- - Verify all pieces connect correctly end-to-end
93
- - Check for any import/dependency issues across wave boundaries
103
+ - Run full test suite one final time
104
+ - Verify pieces connect correctly across wave boundaries
105
+ - Check for import errors or missing dependencies
94
106
 
95
- ## Step 6: Update Memory
107
+ ## Step 5: Update Memory (minimal — prune stale fields)
96
108
  ```yaml
97
109
  last_build_date: [today]
98
- phase: [N]
99
- tasks_completed: [list]
100
- files_changed: [list]
101
- waves_completed: [N]
102
- test_status: all passing
110
+ current_phase: [N]
111
+ plan_status: built
112
+ test_status: passing
103
113
  ```
114
+ Remove from light.md: any per-wave task details from previous builds (keep it lean).
104
115
 
105
- ## Token Budget: ~50K per wave (build + test + fix loop)
116
+ ## Token Budget: ~50K per wave (build + context packets + test-fix loop)
@@ -1,62 +1,97 @@
1
1
  ---
2
2
  name: buildflow-check
3
- description: Verify quality with parallel Reviewer agents
3
+ description: Verify quality and spec compliance with parallel Reviewer agents
4
4
  allowed-tools: Read, Bash, Grep, Glob
5
5
  agent: reviewer
6
6
  ---
7
7
 
8
8
  # /buildflow-check
9
9
 
10
- Quality verification. Parallel Reviewers check code against acceptance criteria.
10
+ Quality and spec-compliance verification. Four parallel Reviewers check code correctness, quality, security, and — most importantly — whether every acceptance criterion is actually satisfied.
11
11
 
12
12
  ## Usage
13
- - `/buildflow-check` — check current phase
13
+ - `/buildflow-check` — full check: spec + code + security
14
14
  - `/buildflow-check <file>` — check a specific file
15
- - `/buildflow-check tests` — verify test coverage
16
- - `/buildflow-check acceptance` — verify acceptance criteria only
15
+ - `/buildflow-check acceptance` — spec compliance only
16
+ - `/buildflow-check tests` — test coverage only
17
+
18
+ ## Context Packet (load only these)
19
+ - `.buildflow/specs/acceptance.md` — the source of truth for what must be true
20
+ - `.buildflow/phases/[N]/PLAN.md` — what was supposed to be built
21
+ - Changed files only (git diff since last commit) — NOT the full codebase
22
+ - `.buildflow/codebase/PATTERNS.md` (if exists)
23
+
24
+ Do NOT load: PRD, TDD, old phases, research files, retros.
17
25
 
18
26
  ## Step 1: Load Acceptance Criteria
19
- Read `.buildflow/phases/[N]/PLAN.md` for definition of done.
27
+ Read every AC from `.buildflow/specs/acceptance.md`.
28
+ This is the primary verification target — all other checks are secondary.
29
+
30
+ ## Step 2: Parallel Review (4 reviewers)
31
+
32
+ **Reviewer A — Spec Compliance (most important):**
33
+ For each acceptance criterion:
34
+ - AC-001: Given [context], when [action], then [outcome] — does the code make this true?
35
+ - AC-002: ... etc.
20
36
 
21
- ## Step 2: Parallel Review (3 reviewers)
37
+ Score each:
38
+ ```
39
+ AC-001 ✓ PASS — [brief evidence]
40
+ AC-002 ✓ PASS — [brief evidence]
41
+ AC-003 ✗ FAIL — [what's missing or wrong]
42
+ AC-NF-001 ⚠ PARTIAL — [what works, what doesn't]
43
+ ```
22
44
 
23
- **Reviewer A — Correctness:**
45
+ **Reviewer B — Correctness:**
24
46
  - Does the code do what was specified?
25
47
  - Are edge cases handled?
26
48
  - Are there logical errors?
27
49
 
28
- **Reviewer B — Quality:**
50
+ **Reviewer CCode Quality:**
29
51
  - Is the code readable?
30
52
  - Are there unnecessary duplications?
31
53
  - Does it match `.buildflow/codebase/PATTERNS.md`?
32
54
  - Are functions appropriately sized?
33
55
 
34
- **Reviewer C — Security:**
56
+ **Reviewer D — Security:**
35
57
  - No hardcoded secrets?
36
58
  - No obvious injection risks?
37
59
  - No sensitive data in logs?
38
- - Dependencies up to date?
60
+ - Relevant ACs for auth/security satisfied?
39
61
 
40
62
  ## Step 3: Test Check
41
- - Do existing tests pass?
63
+ - Do all tests pass?
42
64
  - Are new tests written for new code?
43
- - Is critical logic tested?
65
+ - Is each AC covered by at least one test?
44
66
 
45
67
  ## Step 4: Synthesize Findings
46
68
 
47
- Report format:
48
69
  ```
49
- PASS — criterion
50
- ⚠ WARN — issue (non-blocking)
51
- FAIL issue (must fix before /buildflow-ship)
70
+ Spec Compliance
71
+ ───────────────
72
+ AC-001 login with valid credentials redirects to dashboard
73
+ AC-002 ✓ login with wrong password shows error message
74
+ AC-003 ✗ FAIL — password reset email not implemented
75
+ AC-NF-001 ⚠ login endpoint has no rate limiting
76
+
77
+ Code Quality
78
+ ────────────
79
+ ✓ PASS naming conventions match PATTERNS.md
80
+ ⚠ WARN AuthService is 340 lines — consider splitting
81
+ ✗ FAIL SQL query in getUserById is not parameterized (injection risk)
52
82
  ```
53
83
 
54
- ## Step 5: Confidence Check
55
- Ask: "How confident are you in this code? (1-5)"
84
+ ## Step 5: Ship Readiness
85
+
86
+ | Condition | Status |
87
+ |-----------|--------|
88
+ | All ACs passing | ✓ / ✗ |
89
+ | No FAIL-level code issues | ✓ / ✗ |
90
+ | Tests passing | ✓ / ✗ |
91
+ | Security gate clear | ✓ / ✗ |
56
92
 
57
- ## Step 6: Next Steps
58
- - All pass: "Ready for /buildflow-ship"
59
- - Warnings: "Warnings noted. Run /buildflow-ship or fix first."
60
- - Failures: "Fix these issues, then re-run /buildflow-check"
93
+ - **All green:** "Ready for `/buildflow-ship`"
94
+ - **AC failures:** "Spec not complete. Fix AC failures before shipping — they represent unfinished features, not code style."
95
+ - **Code failures only:** "Spec satisfied. Fix code issues or proceed with caution."
61
96
 
62
- ## Token Budget: ~20K
97
+ ## Token Budget: ~22K
@@ -0,0 +1,94 @@
1
+ ---
2
+ name: buildflow-hotfix
3
+ description: Fast-path fix for production incidents and small patches — no planning, no waves
4
+ allowed-tools: Read, Write, Bash, Grep, Glob
5
+ agent: surgeon
6
+ ---
7
+
8
+ # /buildflow-hotfix
9
+
10
+ Emergency and small-patch path. Skips all planning, spec, and wave orchestration. Goes directly: understand → restore point → fix → test → ship.
11
+
12
+ Use this for:
13
+ - Production incidents
14
+ - One-liner bug fixes
15
+ - Small patches that don't justify a full plan
16
+ - Dependency version bumps
17
+ - Config changes
18
+
19
+ Do NOT use for: new features, refactors, or anything that touches more than ~5 files. Use `/buildflow-plan` + `/buildflow-build` for those.
20
+
21
+ ## Usage
22
+ - `/buildflow-hotfix "fix login crash on empty password"`
23
+ - `/buildflow-hotfix "bump lodash to 4.17.21"`
24
+ - `/buildflow-hotfix src/api/auth.ts "rate limiting not applying to /refresh"`
25
+
26
+ ## Context Packet (minimal — load only what's needed)
27
+ - `.buildflow/memory/light.md` (app_name, framework fields only)
28
+ - Target file(s) if specified
29
+ - Do NOT load: specs, phases, codebase MAP, PATTERNS — keep it fast
30
+
31
+ ## Step 1: Understand the Fix
32
+ Parse the description. Identify:
33
+ - What is broken?
34
+ - What file(s) are likely involved?
35
+ - What is the expected behavior after the fix?
36
+
37
+ If the description is ambiguous, ask ONE clarifying question only.
38
+
39
+ ## Step 2: Scope Check
40
+ Count files that need to change.
41
+ - 1–5 files: proceed
42
+ - 6+ files: warn — "This looks larger than a hotfix. Consider /buildflow-plan instead."
43
+ - Ask: "Proceed as hotfix anyway? (yes/no)"
44
+
45
+ ## Step 3: Create Restore Point
46
+ ```bash
47
+ git stash push -m "hotfix restore point: [description]"
48
+ # or if clean working tree:
49
+ git tag "pre-hotfix-[timestamp]"
50
+ ```
51
+
52
+ ## Step 4: Apply Fix
53
+ Make the minimal change:
54
+ - Fix only the root cause
55
+ - Do not refactor, rename, or clean up surrounding code
56
+ - Match existing code style
57
+
58
+ ## Step 5: Test
59
+ Run the test suite:
60
+ ```bash
61
+ npm test # or pytest / go test etc.
62
+ ```
63
+
64
+ If tests fail: fix and re-test. Max 3 attempts before stopping and asking the user.
65
+
66
+ If no tests exist for the changed area: flag it after shipping.
67
+
68
+ ## Step 6: Ship
69
+ ```bash
70
+ git add [changed files only]
71
+ git commit -m "hotfix: [description]"
72
+ ```
73
+
74
+ Do not create a phase, do not update state.md phase number.
75
+ Update `light.md`:
76
+ ```yaml
77
+ last_hotfix: [today]
78
+ last_hotfix_desc: [description]
79
+ ```
80
+
81
+ ## Step 7: Report
82
+ ```
83
+ Hotfix complete
84
+ ───────────────
85
+ Fix: [what changed]
86
+ Files: [list]
87
+ Tests: passing
88
+ Commit: [hash]
89
+ Time: fast-path (no planning)
90
+ ```
91
+
92
+ If no test coverage existed: "⚠ No test covers this area. Consider adding one."
93
+
94
+ ## Token Budget: ~10K
@@ -1,60 +1,102 @@
1
1
  ---
2
2
  name: buildflow-plan
3
- description: Create a dependency-aware execution plan with the Architect agent
3
+ description: Create a spec-traced, dependency-aware execution plan with the Architect agent
4
4
  allowed-tools: Read, Write
5
5
  agent: architect
6
6
  ---
7
7
 
8
8
  # /buildflow-plan
9
9
 
10
- Create a detailed, phased execution plan. The Architect agent maps dependencies before sequencing work.
10
+ Create a detailed, phased execution plan. Every task traces back to an acceptance criterion. The Architect reads specs, maps dependencies, and groups work into parallel waves.
11
+
12
+ Run after `/buildflow-spec`. If specs don't exist, the Architect will ask you to create them first.
11
13
 
12
14
  ## Usage
13
15
  - `/buildflow-plan` — plan the next phase
14
16
  - `/buildflow-plan phase-2` — plan a specific phase
15
17
  - `/buildflow-plan <feature>` — plan a specific feature
16
18
 
17
- ## Step 1: Load Context
18
- Read `.buildflow/core/vision.md`, `.buildflow/memory/light.md`.
19
- If existing project: read `.buildflow/codebase/MAP.md` and `DEPENDENCIES.md`.
19
+ ## Context Packet (load only these)
20
+ - `.buildflow/specs/PRD.md`
21
+ - `.buildflow/specs/TDD.md`
22
+ - `.buildflow/specs/acceptance.md`
23
+ - `.buildflow/memory/light.md` (phase, framework, spec_status fields only)
24
+ - `.buildflow/codebase/MAP.md` (if exists — existing projects only)
25
+ - `.buildflow/codebase/DEPENDENCIES.md` (if exists — existing projects only)
26
+
27
+ Do NOT load: full codebase, old phase plans, research files, retros.
28
+
29
+ ## Step 1: Validate Specs
30
+ Check `.buildflow/specs/acceptance.md` exists and `spec_status: locked` in light.md.
31
+ If missing: "Run `/buildflow-spec` first to define acceptance criteria before planning."
20
32
 
21
33
  ## Step 2: Scope Confirmation
22
- Ask: "What are we building in this phase? What's the definition of done?"
23
- Confirm scope before planning.
34
+ Read all acceptance criteria (AC-001, AC-002, ...).
35
+ Confirm: "I'll plan tasks to satisfy [N] acceptance criteria. Correct?"
24
36
 
25
37
  ## Step 3: Dependency Mapping
26
- List all components/features needed. For each:
38
+ For each AC, identify all components/tasks needed. For each task:
27
39
  - What does it depend on?
28
40
  - What depends on it?
29
- - Can it be built in parallel?
41
+ - Can it be built in parallel with other tasks?
30
42
 
31
43
  ## Step 4: Task Breakdown
32
44
  For each task:
33
45
  ```
34
46
  Task: [name]
47
+ AC refs: [AC-001, AC-003] ← which acceptance criteria this satisfies
35
48
  Description: [what it does]
36
- Depends on: [prerequisite tasks]
49
+ Depends on: [prerequisite tasks or "none"]
37
50
  Parallelizable: yes/no
38
- Estimated complexity: low/medium/high
51
+ Complexity: low / medium / high
39
52
  Files affected: [list]
40
53
  ```
41
54
 
55
+ Every AC must be covered by at least one task. Flag uncovered ACs before proceeding.
56
+
42
57
  ## Step 5: Wave Planning
43
58
  Group tasks into parallel waves:
44
59
  ```
45
- Wave 1 (parallel): [tasks with no dependencies]
46
- Wave 2 (parallel): [tasks depending only on Wave 1]
47
- Wave 3: [tasks depending on Wave 2]
60
+ Wave 1 (parallel no dependencies):
61
+ Task A [AC-001]
62
+ Task B [AC-002]
63
+
64
+ Wave 2 (parallel — depends on Wave 1):
65
+ • Task C [AC-001, AC-003]
66
+ • Task D [AC-004]
67
+
68
+ Wave 3 (depends on Wave 2):
69
+ • Task E [AC-005]
48
70
  ```
49
71
 
50
- ## Step 6: Risk Check
51
- Identify:
52
- - Tasks with high complexity
53
- - Tasks touching security-sensitive code
54
- - Tasks requiring external APIs or services
72
+ ## Step 6: AC Coverage Check
73
+ Verify every acceptance criterion from `acceptance.md` is referenced in at least one task.
74
+ Report:
75
+ ```
76
+ AC Coverage
77
+ ───────────
78
+ AC-001 ✓ covered by Task A, Task C
79
+ AC-002 ✓ covered by Task B
80
+ AC-003 ✗ NOT COVERED — add a task or flag as out of scope
81
+ ```
82
+
83
+ Do not write the plan if any AC is uncovered without explicit user confirmation to skip it.
55
84
 
56
- ## Step 7: Save Plan
57
- Write to `.buildflow/phases/[N]/PLAN.md`
58
- Update state.md with current phase number.
85
+ ## Step 7: Risk Check
86
+ Flag tasks that are:
87
+ - High complexity
88
+ - Touching security-sensitive code
89
+ - Requiring external APIs or services
90
+ - Not covered by existing tests
91
+
92
+ ## Step 8: Save Plan
93
+ Write to `.buildflow/phases/[N]/PLAN.md`.
94
+ Update `state.md` with current phase number.
95
+ Update `light.md`:
96
+ ```yaml
97
+ current_phase: [N]
98
+ ac_count: [N]
99
+ plan_status: ready
100
+ ```
59
101
 
60
102
  ## Token Budget: ~20K