buildflow-dev 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +266 -0
- package/bin/buildflow.js +80 -0
- package/package.json +60 -0
- package/src/commands/audit.js +230 -0
- package/src/commands/init.js +239 -0
- package/src/commands/install.js +537 -0
- package/src/commands/status.js +62 -0
- package/src/commands/update.js +35 -0
- package/src/index.js +5 -0
- package/src/utils/welcome.js +83 -0
- package/templates/CLAUDE.md +75 -0
- package/templates/commands/audit.md +119 -0
- package/templates/commands/back.md +59 -0
- package/templates/commands/build.md +61 -0
- package/templates/commands/check.md +62 -0
- package/templates/commands/explain.md +53 -0
- package/templates/commands/help.md +84 -0
- package/templates/commands/modify.md +65 -0
- package/templates/commands/onboard.md +78 -0
- package/templates/commands/plan.md +60 -0
- package/templates/commands/refactor.md +58 -0
- package/templates/commands/ship.md +97 -0
- package/templates/commands/start.md +39 -0
- package/templates/commands/status.md +50 -0
- package/templates/commands/think.md +49 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: buildflow-onboard
|
|
3
|
+
description: Analyze existing codebase and create knowledge maps
|
|
4
|
+
allowed-tools: Read, Bash, Glob, Grep
|
|
5
|
+
agent: cartographer
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /buildflow-onboard
|
|
9
|
+
|
|
10
|
+
ONE-TIME analysis of your existing codebase. Creates knowledge maps for all other agents.
|
|
11
|
+
|
|
12
|
+
## When to Run
|
|
13
|
+
- First time using BuildFlow on existing project
|
|
14
|
+
- After major refactor
|
|
15
|
+
- After framework upgrade
|
|
16
|
+
- Use --update flag to refresh incrementally
|
|
17
|
+
|
|
18
|
+
## Step 1: Check Prior State
|
|
19
|
+
If `.buildflow/codebase/MAP.md` exists, ask: "Re-onboard (full) or update (incremental)?"
|
|
20
|
+
|
|
21
|
+
## Step 2: Structural Analysis
|
|
22
|
+
- Read folder structure
|
|
23
|
+
- Find entry points (package.json, main.py, Cargo.toml, go.mod)
|
|
24
|
+
- Map src/ organization
|
|
25
|
+
- Note configuration files
|
|
26
|
+
|
|
27
|
+
## Step 3: Technology Detection
|
|
28
|
+
Parse dependency files. Detect:
|
|
29
|
+
- Language(s)
|
|
30
|
+
- Framework(s)
|
|
31
|
+
- Major libraries
|
|
32
|
+
- Build tools
|
|
33
|
+
- Test setup
|
|
34
|
+
|
|
35
|
+
## Step 4: Pattern Recognition
|
|
36
|
+
Read 5-10 representative source files. Document:
|
|
37
|
+
- Component structure conventions
|
|
38
|
+
- Naming patterns (PascalCase, camelCase, snake_case)
|
|
39
|
+
- Import organization order
|
|
40
|
+
- Comment style
|
|
41
|
+
- Error handling approach
|
|
42
|
+
- Test file conventions
|
|
43
|
+
|
|
44
|
+
## Step 5: Complexity Assessment
|
|
45
|
+
- Identify large files (>300 lines)
|
|
46
|
+
- Find deeply nested code
|
|
47
|
+
- Note files with many imports (high coupling)
|
|
48
|
+
- Mark as HOTSPOTS for Surgeon agent
|
|
49
|
+
|
|
50
|
+
## Step 6: Generate Knowledge Files
|
|
51
|
+
|
|
52
|
+
Write these files:
|
|
53
|
+
|
|
54
|
+
### `.buildflow/codebase/MAP.md`
|
|
55
|
+
Architecture overview, folder structure, entry points, key patterns, top dependencies.
|
|
56
|
+
|
|
57
|
+
### `.buildflow/codebase/PATTERNS.md`
|
|
58
|
+
Code conventions: naming, component structure, imports, comments, error handling, testing.
|
|
59
|
+
|
|
60
|
+
### `.buildflow/codebase/DEPENDENCIES.md`
|
|
61
|
+
Top 10-15 dependencies with purpose, criticality, and security status.
|
|
62
|
+
|
|
63
|
+
### `.buildflow/codebase/HOTSPOTS.md`
|
|
64
|
+
Files to handle carefully: high complexity, frequently changed, low test coverage.
|
|
65
|
+
|
|
66
|
+
## Step 7: Update Memory
|
|
67
|
+
```yaml
|
|
68
|
+
.buildflow/memory/light.md:
|
|
69
|
+
onboarded: true
|
|
70
|
+
onboarded_date: [today]
|
|
71
|
+
codebase_summary: [3-line summary]
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Step 8: Summary
|
|
75
|
+
Show: framework, file count, test coverage estimate, complexity summary.
|
|
76
|
+
Suggest: /buildflow-modify, /buildflow-refactor, or /buildflow-think.
|
|
77
|
+
|
|
78
|
+
## Token Budget: 30-40K (one-time cost, pays back immediately)
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: buildflow-plan
|
|
3
|
+
description: Create a dependency-aware execution plan with the Architect agent
|
|
4
|
+
allowed-tools: Read, Write
|
|
5
|
+
agent: architect
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /buildflow-plan
|
|
9
|
+
|
|
10
|
+
Create a detailed, phased execution plan. The Architect agent maps dependencies before sequencing work.
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
- `/buildflow-plan` — plan the next phase
|
|
14
|
+
- `/buildflow-plan phase-2` — plan a specific phase
|
|
15
|
+
- `/buildflow-plan <feature>` — plan a specific feature
|
|
16
|
+
|
|
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`.
|
|
20
|
+
|
|
21
|
+
## Step 2: Scope Confirmation
|
|
22
|
+
Ask: "What are we building in this phase? What's the definition of done?"
|
|
23
|
+
Confirm scope before planning.
|
|
24
|
+
|
|
25
|
+
## Step 3: Dependency Mapping
|
|
26
|
+
List all components/features needed. For each:
|
|
27
|
+
- What does it depend on?
|
|
28
|
+
- What depends on it?
|
|
29
|
+
- Can it be built in parallel?
|
|
30
|
+
|
|
31
|
+
## Step 4: Task Breakdown
|
|
32
|
+
For each task:
|
|
33
|
+
```
|
|
34
|
+
Task: [name]
|
|
35
|
+
Description: [what it does]
|
|
36
|
+
Depends on: [prerequisite tasks]
|
|
37
|
+
Parallelizable: yes/no
|
|
38
|
+
Estimated complexity: low/medium/high
|
|
39
|
+
Files affected: [list]
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Step 5: Wave Planning
|
|
43
|
+
Group tasks into parallel waves:
|
|
44
|
+
```
|
|
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]
|
|
48
|
+
```
|
|
49
|
+
|
|
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
|
|
55
|
+
|
|
56
|
+
## Step 7: Save Plan
|
|
57
|
+
Write to `.buildflow/phases/[N]/PLAN.md`
|
|
58
|
+
Update state.md with current phase number.
|
|
59
|
+
|
|
60
|
+
## Token Budget: ~20K
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: buildflow-refactor
|
|
3
|
+
description: Improve existing code quality without changing behavior
|
|
4
|
+
allowed-tools: Read, Write, Grep, Glob, Bash
|
|
5
|
+
agents: surgeon, reviewer
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /buildflow-refactor
|
|
9
|
+
|
|
10
|
+
Improve code quality, readability, or performance — without changing observable behavior.
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
- `/buildflow-refactor src/components/Dashboard.tsx`
|
|
14
|
+
- `/buildflow-refactor "Extract auth logic into middleware"`
|
|
15
|
+
- `/buildflow-refactor --scope=module src/api/`
|
|
16
|
+
|
|
17
|
+
## Step 1: Load Context
|
|
18
|
+
Read `.buildflow/codebase/MAP.md`, `PATTERNS.md`, `HOTSPOTS.md`.
|
|
19
|
+
|
|
20
|
+
## Step 2: Define Refactor Goal
|
|
21
|
+
Clarify what kind of improvement:
|
|
22
|
+
- Readability (rename, extract function, reduce nesting)
|
|
23
|
+
- Performance (memoization, lazy loading, caching)
|
|
24
|
+
- Maintainability (extract module, reduce coupling)
|
|
25
|
+
- Test coverage (add tests for existing logic)
|
|
26
|
+
|
|
27
|
+
## Step 3: Behavior Contract
|
|
28
|
+
Before refactoring:
|
|
29
|
+
- Document current behavior (inputs → outputs)
|
|
30
|
+
- Identify existing tests
|
|
31
|
+
- Note any implicit side effects
|
|
32
|
+
|
|
33
|
+
The refactor must NOT change this contract.
|
|
34
|
+
|
|
35
|
+
## Step 4: Restore Point
|
|
36
|
+
```bash
|
|
37
|
+
git commit -m "pre-refactor restore point: [scope]"
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Step 5: Incremental Refactor
|
|
41
|
+
Small, reviewable steps:
|
|
42
|
+
1. Rename in isolation
|
|
43
|
+
2. Extract without logic changes
|
|
44
|
+
3. Move with no modifications
|
|
45
|
+
4. Simplify one function at a time
|
|
46
|
+
|
|
47
|
+
After each step: verify behavior unchanged.
|
|
48
|
+
|
|
49
|
+
## Step 6: Quality Check (Reviewer agent)
|
|
50
|
+
- Is the refactored code simpler?
|
|
51
|
+
- Are existing tests still passing?
|
|
52
|
+
- Does it match PATTERNS.md conventions?
|
|
53
|
+
- Any new complexity introduced?
|
|
54
|
+
|
|
55
|
+
## Step 7: Update Codebase Map
|
|
56
|
+
If patterns changed significantly, update `.buildflow/codebase/PATTERNS.md`.
|
|
57
|
+
|
|
58
|
+
## Token Budget: ~40K
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: buildflow-ship
|
|
3
|
+
description: Finalize phase with mandatory pre-ship security gate
|
|
4
|
+
allowed-tools: Read, Write, Bash
|
|
5
|
+
agents: strategist, security-auditor
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /buildflow-ship
|
|
9
|
+
|
|
10
|
+
Finalize current phase. Security gate runs automatically before shipping.
|
|
11
|
+
|
|
12
|
+
## MANDATORY Step 0: Pre-Ship Security Gate
|
|
13
|
+
|
|
14
|
+
Spawn Security Auditor in `--pre-ship` mode:
|
|
15
|
+
- Scan only changed files (git diff since last commit)
|
|
16
|
+
- Check for secrets
|
|
17
|
+
- Check critical injection patterns
|
|
18
|
+
- Check auth bypass risks
|
|
19
|
+
- Check critical dependency CVEs
|
|
20
|
+
- Token cost: ~10K
|
|
21
|
+
|
|
22
|
+
### Gate Outcomes
|
|
23
|
+
|
|
24
|
+
**Critical found → BLOCK:**
|
|
25
|
+
```
|
|
26
|
+
🔴 SHIP BLOCKED — Critical Security Issues
|
|
27
|
+
|
|
28
|
+
Fix these before shipping:
|
|
29
|
+
[C1] [Issue] at [file:line]
|
|
30
|
+
Fix: [specific action]
|
|
31
|
+
|
|
32
|
+
Run /buildflow-modify for surgical fixes.
|
|
33
|
+
Override (not recommended): /buildflow-ship --force
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**High found → WARN:**
|
|
37
|
+
```
|
|
38
|
+
⚠️ Security Warnings (non-blocking)
|
|
39
|
+
[H1] [Issue]
|
|
40
|
+
Risk: [...]
|
|
41
|
+
Fix later: /buildflow-audit for details
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**Clean → proceed:**
|
|
45
|
+
```
|
|
46
|
+
✅ Security gate passed. No critical issues.
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Step 1: Pre-Ship Checklist
|
|
50
|
+
- [ ] All acceptance criteria met
|
|
51
|
+
- [ ] /buildflow-check passed
|
|
52
|
+
- [ ] Tests pass
|
|
53
|
+
- [ ] Security gate passed (above)
|
|
54
|
+
|
|
55
|
+
## Step 2: Retrospective
|
|
56
|
+
Ask:
|
|
57
|
+
1. What worked well this phase?
|
|
58
|
+
2. What was harder than expected?
|
|
59
|
+
3. What did you learn?
|
|
60
|
+
4. Confidence in deliverables (1-5)?
|
|
61
|
+
|
|
62
|
+
Save to `.buildflow/phases/[N]/retro.md`
|
|
63
|
+
|
|
64
|
+
## Step 3: Update Docs
|
|
65
|
+
- README if needed
|
|
66
|
+
- vision.md if pivots occurred
|
|
67
|
+
- state.md: Phase X → Shipped
|
|
68
|
+
|
|
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
|
|
74
|
+
|
|
75
|
+
## Step 5: Tag Release
|
|
76
|
+
```bash
|
|
77
|
+
git add .
|
|
78
|
+
git commit -m "buildflow: phase X shipped"
|
|
79
|
+
git tag "buildflow-phase-X-complete"
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Step 6: Update Memory
|
|
83
|
+
```yaml
|
|
84
|
+
last_ship_date: [today]
|
|
85
|
+
phase: X
|
|
86
|
+
security_gate: passed|passed-with-warnings|overridden
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Step 7: Next Phase
|
|
90
|
+
Suggest next phase based on roadmap.
|
|
91
|
+
|
|
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
|
|
96
|
+
|
|
97
|
+
## Token Budget: ~22K (including pre-ship audit)
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: buildflow-start
|
|
3
|
+
description: Start a project with BuildFlow's Strategist agent
|
|
4
|
+
allowed-tools: Read, Write, WebSearch
|
|
5
|
+
agent: strategist
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /buildflow-start
|
|
9
|
+
|
|
10
|
+
Begin your project. Works for both greenfield and existing codebases.
|
|
11
|
+
|
|
12
|
+
## Step 1: Load Memory
|
|
13
|
+
Read `.buildflow/memory/light.md` and `.buildflow/you/preferences.md`.
|
|
14
|
+
|
|
15
|
+
## Step 2: Detect Mode
|
|
16
|
+
|
|
17
|
+
**Greenfield (no src/ code):**
|
|
18
|
+
Ask vision questions one at a time:
|
|
19
|
+
1. What are you building?
|
|
20
|
+
2. Who is it for?
|
|
21
|
+
3. What problem does it solve?
|
|
22
|
+
4. What's the simplest useful version?
|
|
23
|
+
5. Timeline, team size, budget?
|
|
24
|
+
6. Confidence in the idea (1-5)?
|
|
25
|
+
|
|
26
|
+
**Existing codebase (src/ exists):**
|
|
27
|
+
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.
|
|
30
|
+
|
|
31
|
+
## Step 3: Save Vision
|
|
32
|
+
Write to `.buildflow/core/vision.md` and update `.buildflow/core/state.md`.
|
|
33
|
+
|
|
34
|
+
## 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"
|
|
38
|
+
|
|
39
|
+
## Token Budget: ~8K
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: buildflow-status
|
|
3
|
+
description: Show current project state and phase progress
|
|
4
|
+
allowed-tools: Read
|
|
5
|
+
agent: strategist
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /buildflow-status
|
|
9
|
+
|
|
10
|
+
Quick orientation — where are you in the BuildFlow workflow?
|
|
11
|
+
|
|
12
|
+
## Step 1: Load State
|
|
13
|
+
Read `.buildflow/core/state.md` and `.buildflow/memory/light.md`.
|
|
14
|
+
|
|
15
|
+
## Step 2: Display Summary
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
Project: [app name]
|
|
19
|
+
Phase: [current phase]
|
|
20
|
+
Status: [Initialized / In Progress / Shipped]
|
|
21
|
+
Type: [greenfield / existing]
|
|
22
|
+
Framework: [detected framework]
|
|
23
|
+
Onboarded: [yes / no / n/a]
|
|
24
|
+
Last session: [date]
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Step 3: Current Phase Progress
|
|
28
|
+
If in a phase, read `.buildflow/phases/[N]/PLAN.md` and show:
|
|
29
|
+
- Total tasks
|
|
30
|
+
- Completed tasks
|
|
31
|
+
- Remaining tasks
|
|
32
|
+
- Estimated completion
|
|
33
|
+
|
|
34
|
+
## Step 4: Security Status
|
|
35
|
+
Read `.buildflow/security/DEBT.md`:
|
|
36
|
+
- Clean: "No outstanding security debt"
|
|
37
|
+
- Issues: List open items with severity
|
|
38
|
+
|
|
39
|
+
## Step 5: Recommend Next Action
|
|
40
|
+
|
|
41
|
+
Based on state:
|
|
42
|
+
- Phase 0 (just initialized): "Run /buildflow-start"
|
|
43
|
+
- Greenfield + no vision: "Run /buildflow-start"
|
|
44
|
+
- Has vision, no plan: "Run /buildflow-think or /buildflow-plan"
|
|
45
|
+
- Has plan, not built: "Run /buildflow-build"
|
|
46
|
+
- Built, not checked: "Run /buildflow-check"
|
|
47
|
+
- Checked: "Run /buildflow-ship"
|
|
48
|
+
- Existing + not onboarded: "Run /buildflow-onboard first"
|
|
49
|
+
|
|
50
|
+
## Token Budget: ~3K
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: buildflow-think
|
|
3
|
+
description: Research and discuss with parallel Researcher agents
|
|
4
|
+
allowed-tools: Read, Write, WebSearch
|
|
5
|
+
agents: strategist, researcher, synthesizer
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /buildflow-think
|
|
9
|
+
|
|
10
|
+
Deep research and discussion mode. Spawns parallel Researcher agents then synthesizes findings.
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
- `/buildflow-think` — open-ended discussion
|
|
14
|
+
- `/buildflow-think <topic>` — research a specific topic
|
|
15
|
+
- `/buildflow-think tech-stack` — compare technology options
|
|
16
|
+
- `/buildflow-think risks` — identify project risks
|
|
17
|
+
|
|
18
|
+
## Step 1: Load Context
|
|
19
|
+
Read `.buildflow/memory/light.md`, `.buildflow/core/vision.md`.
|
|
20
|
+
|
|
21
|
+
## Step 2: Clarify Research Goal
|
|
22
|
+
Ask: "What do you want to explore or decide?"
|
|
23
|
+
If already specified in the command, confirm understanding.
|
|
24
|
+
|
|
25
|
+
## Step 3: Parallel Research (if web research needed)
|
|
26
|
+
Spawn up to 3 Researcher agents in parallel, each with:
|
|
27
|
+
- A specific research question
|
|
28
|
+
- Instructions to find 2-3 sources
|
|
29
|
+
- Trust score (1-5) for each source
|
|
30
|
+
- Key findings in bullet points
|
|
31
|
+
|
|
32
|
+
## Step 4: Synthesize
|
|
33
|
+
Synthesizer agent combines findings:
|
|
34
|
+
- Points of agreement across sources
|
|
35
|
+
- Conflicting information (flag explicitly)
|
|
36
|
+
- Recommendation with confidence (1-5)
|
|
37
|
+
- Open questions remaining
|
|
38
|
+
|
|
39
|
+
## Step 5: Discussion
|
|
40
|
+
Ask confidence check: "How confident are you in this direction? (1-5)"
|
|
41
|
+
- 1-2: Explore alternatives
|
|
42
|
+
- 3: Identify what would increase confidence
|
|
43
|
+
- 4-5: Move forward, suggest next step
|
|
44
|
+
|
|
45
|
+
## Step 6: Save Insights
|
|
46
|
+
Write to `.buildflow/research/[topic]-[date].md`
|
|
47
|
+
Update `.buildflow/memory/light.md` with key decisions.
|
|
48
|
+
|
|
49
|
+
## Token Budget: ~30K (parallel research)
|