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,56 +1,91 @@
1
1
  ---
2
2
  name: buildflow-ship
3
- description: Finalize phase with mandatory pre-ship security gate
3
+ description: Finalize phase with spec gate, security gate, and context pruning
4
4
  allowed-tools: Read, Write, Bash
5
5
  agents: strategist, security-auditor
6
6
  ---
7
7
 
8
8
  # /buildflow-ship
9
9
 
10
- Finalize current phase. Security gate runs automatically before shipping.
10
+ Finalize current phase. Three gates run before shipping: spec compliance, security scan, and test pass. After shipping, session context is pruned so the next phase starts clean.
11
11
 
12
- ## MANDATORY Step 0: Pre-Ship Security Gate
12
+ ## Context Packet (load only these)
13
+ - `.buildflow/specs/acceptance.md`
14
+ - `.buildflow/core/state.md`
15
+ - `.buildflow/memory/light.md`
16
+ - Git diff of changed files (not full codebase)
17
+
18
+ ## MANDATORY Gate 0: Spec Compliance Check
19
+
20
+ Read `.buildflow/specs/acceptance.md`. Verify every AC is satisfied.
21
+
22
+ ```
23
+ Spec Gate
24
+ ─────────
25
+ AC-001 ✓
26
+ AC-002 ✓
27
+ AC-003 ✗ FAIL — password reset not implemented
28
+ ```
29
+
30
+ **If any AC is ✗ FAIL → BLOCK:**
31
+ ```
32
+ 🔴 SHIP BLOCKED — Spec Not Complete
33
+
34
+ These acceptance criteria are not satisfied:
35
+ [AC-003] password reset not implemented
36
+
37
+ Fix them with /buildflow-build or /buildflow-modify, then re-run /buildflow-ship.
38
+ Override (skips spec gate only): /buildflow-ship --skip-spec
39
+ ```
40
+
41
+ **If all ACs pass → proceed to Gate 1.**
42
+
43
+ ---
44
+
45
+ ## MANDATORY Gate 1: Pre-Ship Security Scan
13
46
 
14
47
  Spawn Security Auditor in `--pre-ship` mode:
15
- - Scan only changed files (git diff since last commit)
48
+ - Scan changed files only (git diff since last commit)
16
49
  - Check for secrets
17
50
  - Check critical injection patterns
18
51
  - Check auth bypass risks
19
52
  - Check critical dependency CVEs
20
- - Token cost: ~10K
21
-
22
- ### Gate Outcomes
23
53
 
24
54
  **Critical found → BLOCK:**
25
55
  ```
26
56
  🔴 SHIP BLOCKED — Critical Security Issues
27
57
 
28
- Fix these before shipping:
29
- [C1] [Issue] at [file:line]
58
+ [C1] [issue] at [file:line]
30
59
  Fix: [specific action]
31
60
 
32
61
  Run /buildflow-modify for surgical fixes.
33
62
  Override (not recommended): /buildflow-ship --force
34
63
  ```
35
64
 
36
- **High found → WARN:**
65
+ **High found → WARN (non-blocking):**
37
66
  ```
38
- ⚠️ Security Warnings (non-blocking)
39
- [H1] [Issue]
40
- Risk: [...]
41
- Fix later: /buildflow-audit for details
67
+ ⚠️ Security Warnings
68
+ [H1] [issue] — fix in next phase
42
69
  ```
43
70
 
44
- **Clean → proceed:**
45
- ```
46
- ✅ Security gate passed. No critical issues.
47
- ```
71
+ **Clean → proceed.**
72
+
73
+ ---
74
+
75
+ ## MANDATORY Gate 2: Tests Pass
76
+
77
+ Run the test suite one final time.
78
+ If any test fails: BLOCK. "Fix test failures before shipping."
79
+
80
+ ---
48
81
 
49
- ## Step 1: Pre-Ship Checklist
50
- - [ ] All acceptance criteria met
51
- - [ ] /buildflow-check passed
52
- - [ ] Tests pass
53
- - [ ] Security gate passed (above)
82
+ ## Step 1: Pre-Ship Checklist (summary)
83
+ - [ ] All ACs satisfied (Gate 0)
84
+ - [ ] Security gate passed (Gate 1)
85
+ - [ ] All tests passing (Gate 2)
86
+ - [ ] `/buildflow-check` run and reviewed
87
+
88
+ ---
54
89
 
55
90
  ## Step 2: Retrospective
56
91
  Ask:
@@ -61,37 +96,64 @@ Ask:
61
96
 
62
97
  Save to `.buildflow/phases/[N]/retro.md`
63
98
 
64
- ## Step 3: Update Docs
65
- - README if needed
66
- - vision.md if pivots occurred
67
- - state.md: Phase X → Shipped
99
+ ---
100
+
101
+ ## Step 3: Context Pruning (token efficiency)
102
+
103
+ After a successful ship, prune `light.md` to stay lean for the next phase:
104
+
105
+ **Archive** these from `light.md` to `phases/[N]/retro.md`:
106
+ - Phase-specific task lists
107
+ - Wave completion details
108
+ - Build timestamps
109
+ - Hotfix history older than current phase
68
110
 
69
- ## Step 4: Update Codebase Map (existing projects)
70
- If patterns changed, new hotspots added, or dependencies updated:
71
- - Update PATTERNS.md
72
- - Update HOTSPOTS.md
73
- - Update DEPENDENCIES.md
111
+ **Keep** in `light.md`:
112
+ - app_name, framework, language
113
+ - current_phase (update to N+1 or "complete")
114
+ - spec_status (reset to "none" for next phase)
115
+ - style_fingerprint
116
+ - last 2 architectural decisions
117
+ - onboard_status
118
+
119
+ **Target:** `light.md` must be under 3K tokens after pruning.
120
+
121
+ Update `light.md`:
122
+ ```yaml
123
+ current_phase: [N+1 or complete]
124
+ last_ship_date: [today]
125
+ spec_status: none
126
+ plan_status: none
127
+ context_pruned: [today]
128
+ ```
129
+
130
+ ---
131
+
132
+ ## Step 4: Update Docs
133
+ - README if public-facing features shipped
134
+ - `vision.md` if pivots occurred during the phase
135
+
136
+ ---
74
137
 
75
138
  ## Step 5: Tag Release
76
139
  ```bash
77
140
  git add .
78
- git commit -m "buildflow: phase X shipped"
79
- git tag "buildflow-phase-X-complete"
141
+ git commit -m "ship: phase [N] complete"
142
+ git tag "phase-[N]-complete"
80
143
  ```
81
144
 
82
- ## Step 6: Update Memory
83
- ```yaml
84
- last_ship_date: [today]
85
- phase: X
86
- security_gate: passed|passed-with-warnings|overridden
87
- ```
145
+ ---
146
+
147
+ ## Step 6: Next Phase
148
+ Suggest next phase based on remaining roadmap items.
149
+ "Phase [N] shipped. Run `/buildflow-spec` to define the next phase."
150
+
151
+ ---
88
152
 
89
- ## Step 7: Next Phase
90
- Suggest next phase based on roadmap.
153
+ ## Override Flags
154
+ - `--skip-spec` skips spec gate only. Logs to `security/DEBT.md`: "Spec gate skipped — [reason]"
155
+ - `--force` — skips security gate. Requires typed confirmation. Logged with timestamp.
91
156
 
92
- ## --force Override
93
- If used, adds to `.buildflow/security/DEBT.md` and requires:
94
- - Typed confirmation: "I understand the risk"
95
- - Logged with timestamp
157
+ Neither flag skips the test gate.
96
158
 
97
- ## Token Budget: ~22K (including pre-ship audit)
159
+ ## Token Budget: ~22K (including gates)
@@ -0,0 +1,147 @@
1
+ ---
2
+ name: buildflow-spec
3
+ description: Generate formal PRD, Technical Design, and Acceptance Criteria before planning
4
+ allowed-tools: Read, Write, WebSearch
5
+ agent: strategist
6
+ ---
7
+
8
+ # /buildflow-spec
9
+
10
+ Spec-Driven Development layer. Produces three locked spec artifacts before any code is planned or written. The Architect, Builder, and Reviewer agents all reference these during execution.
11
+
12
+ Run this after `/buildflow-start` and before `/buildflow-plan`.
13
+
14
+ ## Usage
15
+ - `/buildflow-spec` — generate full spec from vision
16
+ - `/buildflow-spec prd` — regenerate PRD only
17
+ - `/buildflow-spec tdd` — regenerate Technical Design only
18
+ - `/buildflow-spec acceptance` — regenerate acceptance criteria only
19
+ - `/buildflow-spec --review` — re-read and review existing specs without regenerating
20
+
21
+ ## Context Packet (load only these — nothing else)
22
+ - `.buildflow/core/vision.md`
23
+ - `.buildflow/memory/light.md` (summary fields only: app_name, framework, phase)
24
+ - `.buildflow/specs/` (existing specs if regenerating)
25
+
26
+ ## Step 1: Validate Vision Exists
27
+ Read `.buildflow/core/vision.md`.
28
+ If empty or missing: "Run /buildflow-start first to capture the project vision."
29
+
30
+ ## Step 2: Clarify Ambiguities
31
+ Before writing specs, ask only questions that are unanswered in vision.md:
32
+ - What does success look like for the user? (measurable outcome, not a feature)
33
+ - What is explicitly OUT of scope for this phase?
34
+ - Are there known constraints? (tech stack lock-in, deadline, budget, team size)
35
+ - Any third-party integrations required?
36
+
37
+ Ask all questions at once. Do not ask one at a time.
38
+ Maximum 5 questions. Skip any already answered in vision.md.
39
+
40
+ ## Step 3: Generate PRD
41
+ Write `.buildflow/specs/PRD.md`:
42
+
43
+ ```markdown
44
+ # Product Requirements Document
45
+ **App:** [name] **Phase:** [N] **Date:** [today]
46
+
47
+ ## Problem Statement
48
+ [One paragraph: what problem exists, who has it, why current solutions fail]
49
+
50
+ ## Users
51
+ | User Type | Goal | Key Pain Point |
52
+ |-----------|------|----------------|
53
+ | [type] | [goal] | [pain] |
54
+
55
+ ## Features — In Scope
56
+ | ID | Feature | Priority | Success Metric |
57
+ |----|---------|----------|----------------|
58
+ | F-01 | [name] | Must-have / Should-have / Nice-to-have | [measurable] |
59
+
60
+ ## Out of Scope
61
+ - [what we are explicitly NOT building this phase]
62
+
63
+ ## Constraints
64
+ - [tech, timeline, team, budget constraints]
65
+
66
+ ## Success Criteria
67
+ Phase is complete when:
68
+ - [ ] [measurable outcome 1]
69
+ - [ ] [measurable outcome 2]
70
+ ```
71
+
72
+ ## Step 4: Generate Technical Design Doc
73
+ Write `.buildflow/specs/TDD.md`:
74
+
75
+ ```markdown
76
+ # Technical Design Document
77
+ **App:** [name] **Phase:** [N] **Date:** [today]
78
+
79
+ ## Architecture Overview
80
+ [Brief description of the system architecture]
81
+
82
+ ## Components
83
+ | Component | Responsibility | Interface |
84
+ |-----------|---------------|-----------|
85
+ | [name] | [what it does] | [API / function / event] |
86
+
87
+ ## Data Model
88
+ [Key entities and their relationships — use simple table or diagram]
89
+
90
+ ## API Contracts
91
+ | Endpoint / Function | Input | Output | Auth Required |
92
+ |--------------------|-------|--------|---------------|
93
+ | [name] | [type] | [type] | yes/no |
94
+
95
+ ## Technology Decisions
96
+ | Decision | Choice | Reason | Alternatives Rejected |
97
+ |----------|--------|--------|----------------------|
98
+ | [area] | [choice] | [why] | [what else was considered] |
99
+
100
+ ## Known Risks
101
+ | Risk | Likelihood | Impact | Mitigation |
102
+ |------|-----------|--------|-----------|
103
+ | [risk] | low/med/high | low/med/high | [how to mitigate] |
104
+ ```
105
+
106
+ ## Step 5: Generate Acceptance Criteria
107
+ Write `.buildflow/specs/acceptance.md`:
108
+
109
+ Each AC must be:
110
+ - **Testable** — a human or automated test can verify it
111
+ - **Binary** — pass or fail, no partial credit
112
+ - **Specific** — no vague terms like "works correctly"
113
+
114
+ ```markdown
115
+ # Acceptance Criteria
116
+ **App:** [name] **Phase:** [N] **Date:** [today]
117
+
118
+ ## [Feature F-01 name]
119
+ - AC-001: Given [context], when [action], then [outcome]
120
+ - AC-002: Given [context], when [action], then [outcome]
121
+
122
+ ## [Feature F-02 name]
123
+ - AC-003: Given [context], when [action], then [outcome]
124
+
125
+ ## Non-Functional
126
+ - AC-NF-001: [performance/security/accessibility requirement]
127
+ ```
128
+
129
+ ## Step 6: Spec Review Gate
130
+ Show a summary of all three specs. Ask:
131
+
132
+ > "Do these specs accurately capture what you want to build? (yes / revise [area])"
133
+
134
+ - If yes: lock specs. Update `light.md`:
135
+ ```yaml
136
+ spec_status: locked
137
+ spec_phase: [N]
138
+ ac_count: [N]
139
+ ```
140
+ - If revise: ask what's wrong, update the relevant section, repeat Step 6.
141
+
142
+ Do not proceed until the user approves.
143
+
144
+ ## Step 7: Next Step
145
+ "Specs locked. Run `/buildflow-plan` — the Architect will map tasks to your acceptance criteria."
146
+
147
+ ## Token Budget: ~18K
@@ -9,31 +9,61 @@ agent: strategist
9
9
 
10
10
  Begin your project. Works for both greenfield and existing codebases.
11
11
 
12
+ ## Context Packet (load only these)
13
+ - `.buildflow/memory/light.md`
14
+ - `.buildflow/you/preferences.md`
15
+
16
+ Do NOT load: specs, phases, codebase files — this is vision only.
17
+
12
18
  ## Step 1: Load Memory
13
19
  Read `.buildflow/memory/light.md` and `.buildflow/you/preferences.md`.
20
+ If `light.md` is over 3K tokens: prune it now (see pruning rules below).
14
21
 
15
22
  ## Step 2: Detect Mode
16
23
 
17
- **Greenfield (no src/ code):**
24
+ **Greenfield (no src/ code yet):**
18
25
  Ask vision questions one at a time:
19
26
  1. What are you building?
20
27
  2. Who is it for?
21
28
  3. What problem does it solve?
22
29
  4. What's the simplest useful version?
23
- 5. Timeline, team size, budget?
30
+ 5. Timeline, team size, constraints?
24
31
  6. Confidence in the idea (1-5)?
25
32
 
26
33
  **Existing codebase (src/ exists):**
27
34
  Check if `.buildflow/codebase/MAP.md` exists.
28
- - If NO: "Run /buildflow-onboard first to analyze your codebase."
29
- - If YES: Load MAP.md. Ask about goals for this work session.
35
+ - If NO: "Run `/buildflow-onboard` first to analyze your codebase."
36
+ - If YES: Load MAP.md summary only (not full file). Ask about goals for this session.
30
37
 
31
38
  ## Step 3: Save Vision
32
- Write to `.buildflow/core/vision.md` and update `.buildflow/core/state.md`.
39
+ Write to `.buildflow/core/vision.md`.
40
+ Initialize `light.md` with:
41
+ ```yaml
42
+ app_name: [name]
43
+ framework: [detected or stated]
44
+ language: [detected or stated]
45
+ phase: 0
46
+ spec_status: none
47
+ plan_status: none
48
+ onboard_status: [yes/no]
49
+ last_session: [today]
50
+ ```
33
51
 
34
52
  ## Step 4: Recommend Next Step
35
- - High confidence (4-5) + greenfield: "Run /buildflow-think"
36
- - Low confidence: "Let's research first with /buildflow-think"
37
- - Existing project, onboarded: "Ready! Try /buildflow-modify or /buildflow-think"
53
+
54
+ | Situation | Next command |
55
+ |-----------|-------------|
56
+ | Greenfield, confidence 4–5 | `/buildflow-spec` — define what to build formally |
57
+ | Greenfield, confidence 1–3 | `/buildflow-think [topic]` — research first |
58
+ | Existing project, not onboarded | `/buildflow-onboard` — map codebase first |
59
+ | Existing project, onboarded | `/buildflow-spec` or `/buildflow-modify` |
60
+ | Emergency fix needed | `/buildflow-hotfix "description"` |
61
+
62
+ ## light.md Pruning Rules
63
+ If `light.md` exceeds 3K tokens on session start:
64
+ - Remove: completed phase task lists, wave details, build timestamps older than last phase
65
+ - Archive these to the most recent `phases/[N]/retro.md`
66
+ - Keep: app_name, framework, language, current_phase, spec_status, style_fingerprint, last 2 decisions
67
+ - After pruning: report "Context pruned: light.md reduced from [X] → [Y] tokens"
38
68
 
39
69
  ## Token Budget: ~8K