@shipfast-ai/shipfast 1.1.0 → 1.3.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 +166 -201
- package/agents/architect.md +7 -7
- package/agents/builder.md +9 -10
- package/agents/critic.md +3 -3
- package/agents/scout.md +1 -1
- package/agents/scribe.md +9 -13
- package/bin/install.js +250 -9
- package/brain/index.cjs +38 -80
- package/brain/indexer.cjs +6 -9
- package/brain/schema.sql +4 -2
- package/commands/sf/brain.md +4 -0
- package/commands/sf/check-plan.md +3 -4
- package/commands/sf/config.md +1 -0
- package/commands/sf/cost.md +83 -0
- package/commands/sf/diff.md +53 -0
- package/commands/sf/discuss.md +115 -68
- package/commands/sf/do.md +140 -72
- package/commands/sf/help.md +10 -5
- package/commands/sf/map.md +16 -24
- package/commands/sf/plan.md +6 -9
- package/commands/sf/project.md +4 -4
- package/commands/sf/rollback.md +70 -0
- package/commands/sf/ship.md +13 -0
- package/commands/sf/status.md +1 -3
- package/commands/sf/verify.md +4 -9
- package/commands/sf/worktree.md +286 -0
- package/core/ambiguity.cjs +229 -125
- package/core/architecture.cjs +5 -8
- package/core/autopilot.cjs +1 -0
- package/core/budget.cjs +5 -11
- package/core/constants.cjs +63 -0
- package/core/context-builder.cjs +1 -58
- package/core/executor.cjs +18 -4
- package/core/guardrails.cjs +6 -5
- package/core/model-selector.cjs +5 -48
- package/core/retry.cjs +5 -1
- package/core/session.cjs +2 -2
- package/core/skip-logic.cjs +5 -1
- package/core/verify.cjs +11 -14
- package/hooks/sf-first-run.js +2 -2
- package/mcp/server.cjs +135 -4
- package/package.json +18 -4
- package/scripts/postinstall.js +1 -1
- package/commands/sf/workstream.md +0 -51
package/README.md
CHANGED
|
@@ -4,7 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
**Autonomous context-engineered development system with SQLite brain.**
|
|
6
6
|
|
|
7
|
-
**5 agents.
|
|
7
|
+
**5 agents. 20 commands. Per-task fresh context. 70-90% fewer tokens.**
|
|
8
|
+
|
|
9
|
+
[](https://www.npmjs.com/package/@shipfast-ai/shipfast)
|
|
10
|
+
[](https://www.npmjs.com/package/@shipfast-ai/shipfast)
|
|
11
|
+
[](LICENSE)
|
|
12
|
+
[](https://github.com/shipfast-ai/shipfast/actions/workflows/test.yml)
|
|
8
13
|
|
|
9
14
|
Claude Code, OpenCode, Gemini CLI, Kilo, Codex, Copilot, Cursor, Windsurf, Antigravity, Augment, Trae, Qwen Code, CodeBuddy, Cline
|
|
10
15
|
|
|
@@ -20,19 +25,19 @@ Works on Mac, Windows, and Linux.
|
|
|
20
25
|
|
|
21
26
|
## Why ShipFast?
|
|
22
27
|
|
|
23
|
-
Context rot kills AI coding quality. As the context window fills up, output degrades.
|
|
28
|
+
Context rot kills AI coding quality. As the context window fills up, output degrades — Task 5 is worse than Task 1.
|
|
24
29
|
|
|
25
30
|
ShipFast fixes this with a **SQLite knowledge graph** that gives each agent fresh context and gets smarter every session.
|
|
26
31
|
|
|
27
|
-
- **
|
|
28
|
-
- **
|
|
32
|
+
- **SQLite brain** — queryable knowledge graph replaces markdown state files
|
|
33
|
+
- **Fresh context per task** — each Builder agent starts clean, quality stays consistent
|
|
29
34
|
- **3K-40K tokens per feature** — 70-90% less than typical AI dev workflows
|
|
30
|
-
- **
|
|
31
|
-
- **
|
|
32
|
-
- **
|
|
33
|
-
- **
|
|
34
|
-
- **Cross-repo
|
|
35
|
-
- **
|
|
35
|
+
- **Self-improving** — records patterns and decisions, gets cheaper over time
|
|
36
|
+
- **Smart model selection** — dynamically picks haiku/sonnet/opus based on task + feedback loop
|
|
37
|
+
- **Domain-aware questioning** — 6 domains, 20+ question templates, zero LLM cost
|
|
38
|
+
- **Wave-based execution** — independent tasks run in parallel, dependent tasks run sequentially
|
|
39
|
+
- **Cross-repo support** — link repos, search across brains, cross-repo blast radius
|
|
40
|
+
- **22 languages indexed** in <1 second — architecture layers auto-derived from import graph
|
|
36
41
|
- **Works with 14 AI coding tools** — auto-detects and installs for all
|
|
37
42
|
|
|
38
43
|
---
|
|
@@ -41,45 +46,64 @@ ShipFast fixes this with a **SQLite knowledge graph** that gives each agent fres
|
|
|
41
46
|
|
|
42
47
|
```bash
|
|
43
48
|
npm i -g @shipfast-ai/shipfast
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
Auto-detects your AI tools and installs for all of them. Then index your repo:
|
|
47
|
-
|
|
48
|
-
```bash
|
|
49
49
|
cd your-project
|
|
50
50
|
shipfast init
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
-
Verify: run `/sf-help` in your AI tool.
|
|
54
|
-
|
|
55
|
-
### Staying Updated
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
shipfast update
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
Updates the package and re-detects runtimes (catches newly installed AI tools).
|
|
53
|
+
Auto-detects your AI tools and installs for all of them. Verify: run `/sf-help` in your AI tool.
|
|
62
54
|
|
|
63
55
|
### Terminal Commands
|
|
64
56
|
|
|
65
57
|
```bash
|
|
66
|
-
shipfast init # Index
|
|
58
|
+
shipfast init # Index repo + auto-configure permissions (no --dangerously-skip-permissions needed)
|
|
67
59
|
shipfast init --fresh # Full reindex (clears existing brain)
|
|
68
60
|
shipfast link <path> # Link another repo for cross-repo search
|
|
69
61
|
shipfast unlink [path] # Unlink a repo (or all)
|
|
62
|
+
shipfast doctor # Check brain.db health + diagnose issues
|
|
63
|
+
shipfast permissions # Show configured permission allowlist
|
|
70
64
|
shipfast status # Show installed runtimes + brain + links
|
|
71
65
|
shipfast update # Update + re-detect runtimes
|
|
72
66
|
shipfast uninstall # Remove from all AI tools
|
|
73
|
-
shipfast help # Show all commands
|
|
74
67
|
```
|
|
75
68
|
|
|
69
|
+
### Permissions (Zero Prompts)
|
|
70
|
+
|
|
71
|
+
`shipfast init` auto-configures safe permission rules in `.claude/settings.json`. ShipFast operations (Read, Edit, Write, git, build, test, grep) run without permission prompts. Destructive commands (rm, curl, ssh, sudo) still require approval.
|
|
72
|
+
|
|
73
|
+
No `--dangerously-skip-permissions` needed. Run `shipfast permissions` to view the allowlist.
|
|
74
|
+
|
|
75
|
+
If auto-configured permissions don't work for your setup, you can fall back to:
|
|
76
|
+
```bash
|
|
77
|
+
claude --dangerously-skip-permissions
|
|
78
|
+
```
|
|
79
|
+
This skips ALL permission checks — use only in trusted environments.
|
|
80
|
+
|
|
76
81
|
---
|
|
77
82
|
|
|
78
83
|
## How It Works
|
|
79
84
|
|
|
80
|
-
|
|
85
|
+
### 1. Discuss (when needed)
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
/sf-discuss Add authentication
|
|
89
|
+
```
|
|
81
90
|
|
|
82
|
-
|
|
91
|
+
**Domain-aware** ambiguity detection — zero LLM tokens:
|
|
92
|
+
|
|
93
|
+
| Domain | Example Questions |
|
|
94
|
+
|--------|-------------------|
|
|
95
|
+
| **UI** | Layout density? Interaction pattern? Empty state? Responsive approach? |
|
|
96
|
+
| **API** | Response format? Error handling? Auth mechanism? Versioning? |
|
|
97
|
+
| **Database** | ORM? Migration strategy? Data access pattern? |
|
|
98
|
+
| **Auth** | JWT/session/OAuth? Token storage? Role model? |
|
|
99
|
+
| **Content** | Markdown/rich text? Tone? i18n? |
|
|
100
|
+
| **Infra** | Deploy target? CI/CD pipeline? |
|
|
101
|
+
|
|
102
|
+
Auto-detects domain from task keywords. Answers stored as locked decisions — never asked again, even across sessions.
|
|
103
|
+
|
|
104
|
+
**Flags**: `--batch` (group questions), `--chain` (auto-run discuss → plan → check → execute), `--assume` (auto-resolve from brain.db patterns)
|
|
105
|
+
|
|
106
|
+
### 2. Plan
|
|
83
107
|
|
|
84
108
|
```
|
|
85
109
|
/sf-plan Add Stripe billing with webhooks
|
|
@@ -87,112 +111,103 @@ Already have code? `shipfast init` indexes your codebase in under 1 second — f
|
|
|
87
111
|
|
|
88
112
|
Spawns two agents in fresh contexts:
|
|
89
113
|
|
|
90
|
-
**Scout** — Researches the codebase. Finds relevant files, functions, consumers. Tags findings
|
|
114
|
+
**Scout** — Researches the codebase. Finds relevant files, functions, consumers. Tags findings: [VERIFIED], [CITED], [ASSUMED].
|
|
91
115
|
|
|
92
|
-
**Architect** — Creates
|
|
116
|
+
**Architect** — Creates tasks using goal-backward methodology. Each task has exact file paths, consumer lists, verify commands, and done criteria. Sets dependency graph for wave grouping.
|
|
93
117
|
|
|
94
|
-
Tasks
|
|
118
|
+
Tasks stored in brain.db.
|
|
95
119
|
|
|
96
|
-
###
|
|
120
|
+
### 3. Execute
|
|
97
121
|
|
|
98
122
|
```
|
|
99
123
|
/sf-do
|
|
100
124
|
```
|
|
101
125
|
|
|
102
|
-
|
|
126
|
+
**Complexity auto-detection** routes to the right workflow:
|
|
103
127
|
|
|
104
|
-
**Trivial
|
|
128
|
+
**Trivial** (fix a typo) — executes inline, no agents. ~3K tokens.
|
|
105
129
|
|
|
106
|
-
**Medium
|
|
130
|
+
**Medium** (add a component) — one Builder agent with all tasks batched. ~15K tokens.
|
|
107
131
|
|
|
108
|
-
**Complex
|
|
132
|
+
**Complex** (new feature across files) — per-task Builder agents with **fresh context each**:
|
|
109
133
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
4. Commits with conventional format
|
|
114
|
-
5. Updates task status in brain.db
|
|
134
|
+
```
|
|
135
|
+
[1/6] Building: Split LocationList into layouts...
|
|
136
|
+
[1/6] ✓ Split LocationList (commit: a1b2c3d)
|
|
115
137
|
|
|
116
|
-
|
|
138
|
+
[2/6] Building: Extract RectangleTile sub-components...
|
|
139
|
+
[2/6] ✓ Extract RectangleTile (commit: e4f5g6h)
|
|
117
140
|
|
|
118
|
-
|
|
141
|
+
...
|
|
119
142
|
|
|
120
|
-
|
|
121
|
-
/sf-verify
|
|
143
|
+
[6/6] ✓ Extract Featured hooks (commit: m7n8o9p)
|
|
122
144
|
```
|
|
123
145
|
|
|
124
|
-
|
|
146
|
+
Each Builder gets fresh context — no accumulated garbage from previous tasks. Quality stays consistent from Task 1 to Task 6.
|
|
125
147
|
|
|
126
|
-
|
|
127
|
-
- **Data flow tracing**: components receive real data, not hardcoded empty arrays
|
|
128
|
-
- **Consumer integrity**: removed exports have zero remaining consumers
|
|
129
|
-
- **Stub detection**: TODO, FIXME, placeholder, empty handlers, console.log, debugger
|
|
130
|
-
- **Build verification**: runs build command, reports pass/fail
|
|
131
|
-
|
|
132
|
-
Scores: PASS / PASS_WITH_WARNINGS / FAIL with specific failure details.
|
|
133
|
-
|
|
134
|
-
### 4. Discuss (when needed)
|
|
148
|
+
**Wave-based parallel execution:**
|
|
135
149
|
|
|
136
150
|
```
|
|
137
|
-
|
|
151
|
+
Independent tasks (no shared files) → same wave → run in parallel
|
|
152
|
+
Dependent tasks (shared files/imports) → separate waves → run sequentially
|
|
138
153
|
```
|
|
139
154
|
|
|
140
|
-
|
|
155
|
+
The Architect sets the dependency graph. `groupIntoWaves()` computes waves. Independent tasks in the same wave launch simultaneously — multiple Builder agents at once.
|
|
141
156
|
|
|
142
|
-
|
|
143
|
-
- **
|
|
144
|
-
- **
|
|
145
|
-
- **
|
|
146
|
-
- **SCOPE**: Broad request with conjunctions
|
|
157
|
+
**After all tasks complete:**
|
|
158
|
+
- **Critic** agent (fresh context) reviews the entire `git diff` — checks consumer integrity, import consistency, security
|
|
159
|
+
- **Scribe** agent (fresh context) records decisions + learnings to brain.db
|
|
160
|
+
- **Branch audit** (automatic on non-default branches) — reports MIGRATED / MISSING / SAFELY REMOVED vs default branch
|
|
147
161
|
|
|
148
|
-
|
|
162
|
+
**Dynamic model selection** per agent:
|
|
149
163
|
|
|
150
|
-
|
|
164
|
+
| Condition | Model |
|
|
165
|
+
|-----------|-------|
|
|
166
|
+
| Well-known domain (2+ high-confidence learnings) | **Haiku** (cheapest) |
|
|
167
|
+
| Standard task | **Sonnet** (default) |
|
|
168
|
+
| Complex multi-area, no prior patterns | **Opus** (best reasoning) |
|
|
169
|
+
| Budget low (<40%) | **All Haiku** (degradation) |
|
|
170
|
+
| `--cheap` flag | **All Haiku** |
|
|
171
|
+
| `--quality` flag | **Sonnet/Opus** |
|
|
151
172
|
|
|
152
|
-
|
|
153
|
-
/sf-ship
|
|
154
|
-
```
|
|
173
|
+
Models auto-adjust via feedback loop — tracks success/failure rates per model+domain, upgrades haiku→sonnet when failing, downgrades when consistently succeeding.
|
|
155
174
|
|
|
156
|
-
|
|
175
|
+
**All execution flags**: `--tdd` (test-first), `--research` (force Scout), `--verify` (force verification), `--no-plan` (skip planning), `--discuss` (force discussion), `--cheap` (all haiku), `--quality` (sonnet/opus)
|
|
157
176
|
|
|
158
|
-
###
|
|
177
|
+
### 4. Verify
|
|
159
178
|
|
|
160
179
|
```
|
|
161
|
-
/sf-discuss Phase 2
|
|
162
|
-
/sf-plan Phase 2: Payment webhooks
|
|
163
|
-
/sf-do
|
|
164
180
|
/sf-verify
|
|
165
|
-
/sf-ship
|
|
166
|
-
...
|
|
167
|
-
/sf-milestone complete
|
|
168
|
-
/sf-milestone new v2.0
|
|
169
181
|
```
|
|
170
182
|
|
|
171
|
-
|
|
183
|
+
Fresh context verification:
|
|
172
184
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
185
|
+
- **3-level artifact validation**: exists → substantive (not stubs) → wired (imported and used)
|
|
186
|
+
- **Data flow tracing**: components receive real data, not hardcoded empty arrays
|
|
187
|
+
- **Consumer integrity**: removed exports have zero remaining consumers
|
|
188
|
+
- **Stub detection**: TODO, FIXME, placeholder, empty handlers, console.log, debugger
|
|
189
|
+
- **Schema drift detection**: warns when ORM models change without migrations (Prisma, Drizzle, TypeORM, Django, Rails, Knex)
|
|
190
|
+
- **TDD sequence check**: verifies test(...) commits before feat(...) commits
|
|
191
|
+
- **Build verification**: runs build command, reports pass/fail
|
|
192
|
+
- **Branch audit**: compares changes vs default branch, flags missing migrations
|
|
176
193
|
|
|
177
|
-
|
|
194
|
+
Scores: **PASS** / **PASS_WITH_WARNINGS** / **FAIL** with specific details.
|
|
178
195
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
## Why Fresh Context Matters
|
|
196
|
+
### 5. Ship
|
|
182
197
|
|
|
183
|
-
|
|
198
|
+
```
|
|
199
|
+
/sf-ship
|
|
200
|
+
```
|
|
184
201
|
|
|
185
|
-
|
|
202
|
+
Creates branch, generates PR description from brain.db (decisions, tasks, changes), pushes, outputs PR link. Runs configurable post-ship hook if set.
|
|
186
203
|
|
|
187
|
-
|
|
188
|
-
|---|---|---|
|
|
189
|
-
| Research | Scout (Haiku) | Fresh — only brain.db context |
|
|
190
|
-
| Planning | Architect (Sonnet) | Fresh — Scout findings + brain.db |
|
|
191
|
-
| Execution | Builder (Sonnet) × N | Fresh per task — task plan + brain.db |
|
|
192
|
-
| Review | Critic (Haiku) | Fresh — git diff only |
|
|
193
|
-
| Documentation | Scribe (Haiku) | Fresh — session summary |
|
|
204
|
+
### 6. Workflows
|
|
194
205
|
|
|
195
|
-
|
|
206
|
+
```
|
|
207
|
+
Simple: /sf-do fix the typo in header
|
|
208
|
+
Standard: /sf-plan add dark mode → /sf-check-plan → /sf-do → /sf-verify
|
|
209
|
+
Complex: /sf-project Build billing → /sf-discuss → /sf-plan → /sf-do → /sf-verify → /sf-ship
|
|
210
|
+
```
|
|
196
211
|
|
|
197
212
|
---
|
|
198
213
|
|
|
@@ -202,154 +217,102 @@ All state lives in `.shipfast/brain.db`. Zero markdown files.
|
|
|
202
217
|
|
|
203
218
|
| Table | What it stores |
|
|
204
219
|
|---|---|
|
|
205
|
-
| `nodes` | Functions, types, classes, components (auto-extracted) |
|
|
220
|
+
| `nodes` | Functions, types, classes, components (auto-extracted, 22 languages) |
|
|
206
221
|
| `edges` | Import/call/dependency relationships + git co-change patterns |
|
|
207
|
-
| `decisions` |
|
|
208
|
-
| `learnings` | Error→fix patterns with confidence scoring |
|
|
209
|
-
| `tasks` | Execution history with commit SHAs |
|
|
210
|
-
| `
|
|
222
|
+
| `decisions` | Locked Q&A pairs with domain tags (~40 tokens each) |
|
|
223
|
+
| `learnings` | Error→fix patterns with confidence scoring (0.0-1.0) |
|
|
224
|
+
| `tasks` | Execution history with commit SHAs, tokens used, duration |
|
|
225
|
+
| `seeds` | Forward ideas captured during work for future milestones |
|
|
226
|
+
| `model_performance` | Success/failure tracking per model+domain (feedback loop) |
|
|
211
227
|
| `checkpoints` | Git stash refs for rollback |
|
|
212
|
-
| `
|
|
228
|
+
| `requirements` | REQ-IDs mapped to phases for tracing |
|
|
213
229
|
| `architecture` | Auto-computed layers from import graph (zero hardcoding) |
|
|
214
|
-
| `folders` | Directory roles
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
**MCP Server**: brain.db is exposed as 17 structured MCP tools. LLMs call these instead of improvising SQL.
|
|
219
|
-
|
|
220
|
-
---
|
|
221
|
-
|
|
222
|
-
## Architecture Intelligence
|
|
223
|
-
|
|
224
|
-
ShipFast auto-derives architecture layers from the import graph — **zero hardcoded folder patterns**. Works with any project structure, any language.
|
|
225
|
-
|
|
226
|
-
**How it works**:
|
|
227
|
-
1. BFS from entry points (files nothing imports) assigns layer depth
|
|
228
|
-
2. Fuzzy import resolution handles `@/`, `~/`, and alias paths
|
|
229
|
-
3. Folder roles detected from aggregate import/export ratios
|
|
230
|
-
4. Recomputed on every `shipfast init` (instant)
|
|
231
|
-
|
|
232
|
-
**What it produces**:
|
|
233
|
-
|
|
234
|
-
- **Layer 0** (entry): files nothing imports — pages, routes, App.tsx
|
|
235
|
-
- **Layer 1-N** (deeper): each layer imported by the layer above
|
|
236
|
-
- **Leaf layer**: files that import nothing — types, constants
|
|
237
|
-
- **Folder roles**: entry (imports many), shared (imported by many), consumer, leaf, foundation
|
|
230
|
+
| `folders` | Directory roles: entry, shared, consumer, leaf, foundation |
|
|
231
|
+
| `hot_files` | Most frequently changed files from git history |
|
|
232
|
+
| `config` | Token budget, model tiers, post-ship hooks, default branch |
|
|
238
233
|
|
|
239
|
-
**
|
|
234
|
+
**Incremental indexing**: ~300ms for changed files. Deleted files auto-cleaned. Stale learnings auto-pruned.
|
|
240
235
|
|
|
241
|
-
|
|
236
|
+
**MCP Server**: 23 structured tools for IDE integration. Commands and agents use MCP tools — no raw SQL.
|
|
242
237
|
|
|
243
238
|
---
|
|
244
239
|
|
|
245
240
|
## Agents
|
|
246
241
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
| Agent | Role | Model | Key Rules |
|
|
242
|
+
| Agent | Role | Default Model | Key Behaviors |
|
|
250
243
|
|---|---|---|---|
|
|
251
|
-
| **Scout** | Research | Haiku |
|
|
252
|
-
| **Architect** | Planning | Sonnet | Goal-backward,
|
|
253
|
-
| **Builder** | Execution | Sonnet | Impact analysis before every change, per-task build verify, 3-attempt limit
|
|
254
|
-
| **Critic** | Review | Haiku |
|
|
255
|
-
| **Scribe** | Documentation | Haiku | Records decisions + learnings to brain.db
|
|
256
|
-
|
|
257
|
-
### Builder's Rule Zero
|
|
258
|
-
|
|
259
|
-
Before deleting, removing, or modifying ANY function, type, or export:
|
|
244
|
+
| **Scout** | Research | Haiku | 6-direction flow tracing, confidence tagging, consumer discovery |
|
|
245
|
+
| **Architect** | Planning | Sonnet (Opus for complex) | Goal-backward, dependency graph, STRIDE threats, scope guard |
|
|
246
|
+
| **Builder** | Execution | Sonnet (Haiku if learned) | Impact analysis before every change, per-task build verify, 3-attempt limit |
|
|
247
|
+
| **Critic** | Review | Haiku (Sonnet for security) | Auto-depth (quick/standard/deep), import graph tracing, consumer integrity |
|
|
248
|
+
| **Scribe** | Documentation | Haiku | Records decisions + learnings to brain.db, generates PR descriptions |
|
|
260
249
|
|
|
261
|
-
|
|
262
|
-
grep -r "functionName" --include="*.ts" --include="*.tsx" .
|
|
263
|
-
```
|
|
264
|
-
|
|
265
|
-
If other files use it → update them or keep it. **NEVER remove without checking consumers.** This single rule prevents 80% of refactoring bugs.
|
|
250
|
+
Models are **dynamically selected** — not fixed. The feedback loop tracks which model succeeds for which domain and auto-adjusts.
|
|
266
251
|
|
|
267
252
|
---
|
|
268
253
|
|
|
269
254
|
## Commands
|
|
270
255
|
|
|
271
|
-
### Core
|
|
272
|
-
|
|
273
|
-
| Command | What it does |
|
|
274
|
-
|---|---|
|
|
275
|
-
| `/sf-do <task>` | Execute a task. Auto-detects complexity: trivial → medium → complex |
|
|
276
|
-
| `/sf-plan <task>` | Research (Scout) + Plan (Architect). Stores tasks in brain.db |
|
|
277
|
-
| `/sf-check-plan` | Verify plan before execution: scope, consumers, deps, STRIDE threats |
|
|
278
|
-
| `/sf-verify` | Verify completed work: artifacts, data flow, stubs, build, consumers |
|
|
279
|
-
| `/sf-discuss <task>` | Detect ambiguity, ask targeted questions, lock decisions |
|
|
280
|
-
|
|
281
|
-
### Projects
|
|
256
|
+
### Core
|
|
282
257
|
|
|
283
258
|
| Command | What it does |
|
|
284
259
|
|---|---|
|
|
285
|
-
| `/sf-
|
|
286
|
-
| `/sf-
|
|
287
|
-
| `/sf-
|
|
260
|
+
| `/sf-do <task>` | The one command. Auto-detects complexity, runs the right workflow. |
|
|
261
|
+
| `/sf-plan <task>` | Research (Scout) + Plan (Architect). Stores tasks in brain.db. |
|
|
262
|
+
| `/sf-discuss <task>` | Domain-aware questioning. 6 domains, 20+ templates, zero LLM cost. |
|
|
263
|
+
| `/sf-check-plan` | Validate plan: scope, consumers, dependencies, STRIDE threats. |
|
|
264
|
+
| `/sf-verify` | Verify: artifacts, data flow, stubs, schema drift, build, consumers. |
|
|
288
265
|
|
|
289
|
-
###
|
|
266
|
+
### Projects & Worktrees
|
|
290
267
|
|
|
291
268
|
| Command | What it does |
|
|
292
269
|
|---|---|
|
|
293
|
-
| `/sf-
|
|
270
|
+
| `/sf-project <desc>` | Decompose large project into phases with REQ-ID tracing. |
|
|
271
|
+
| `/sf-milestone` | Complete current milestone or start next version. |
|
|
272
|
+
| `/sf-worktree create` | Create isolated worktree with smart branch naming + multi-repo support. |
|
|
273
|
+
| `/sf-worktree check` | Migration audit: MIGRATED / MISSING / SAFELY REMOVED / MODIFIED / ADDED. |
|
|
274
|
+
| `/sf-worktree list\|switch\|status\|complete` | Manage parallel worktrees. |
|
|
294
275
|
|
|
295
|
-
### Session
|
|
276
|
+
### Shipping & Session
|
|
296
277
|
|
|
297
278
|
| Command | What it does |
|
|
298
279
|
|---|---|
|
|
299
|
-
| `/sf-
|
|
300
|
-
| `/sf-
|
|
301
|
-
| `/sf-
|
|
280
|
+
| `/sf-ship` | Create branch, push, PR link + post-ship hook. |
|
|
281
|
+
| `/sf-status` | Brain stats, tasks, checkpoints, version. |
|
|
282
|
+
| `/sf-resume` | Resume from previous session. |
|
|
283
|
+
| `/sf-undo [task-id]` | Rollback a specific task. |
|
|
284
|
+
| `/sf-rollback [last\|all\|N]` | Rollback last task, last N, or entire session. |
|
|
302
285
|
|
|
303
|
-
### Knowledge
|
|
286
|
+
### Knowledge & Analysis
|
|
304
287
|
|
|
305
288
|
| Command | What it does |
|
|
306
289
|
|---|---|
|
|
307
|
-
| `/sf-brain <query>` | Query knowledge graph: files, decisions, learnings, hot files |
|
|
308
|
-
| `/sf-learn <pattern>` | Teach a reusable pattern (persists across sessions) |
|
|
309
|
-
| `/sf-map` |
|
|
290
|
+
| `/sf-brain <query>` | Query knowledge graph: files, decisions, learnings, seeds, hot files. |
|
|
291
|
+
| `/sf-learn <pattern>` | Teach a reusable pattern (persists across sessions). |
|
|
292
|
+
| `/sf-map` | Codebase report: architecture layers, hot files, co-change clusters. |
|
|
293
|
+
| `/sf-cost` | Token usage breakdown by agent, domain, model + success rates. |
|
|
294
|
+
| `/sf-diff` | Smart diff — changes grouped by task with file stats. |
|
|
310
295
|
|
|
311
296
|
### Config
|
|
312
297
|
|
|
313
298
|
| Command | What it does |
|
|
314
299
|
|---|---|
|
|
315
|
-
| `/sf-config` | View or set model tiers
|
|
316
|
-
| `/sf-help` | Show all commands
|
|
317
|
-
|
|
318
|
-
---
|
|
319
|
-
|
|
320
|
-
## Workflows
|
|
321
|
-
|
|
322
|
-
```
|
|
323
|
-
Simple: /sf-do fix the typo in header
|
|
324
|
-
Standard: /sf-plan add dark mode → /sf-check-plan → /sf-do → /sf-verify
|
|
325
|
-
Complex: /sf-project Build billing → /sf-discuss → /sf-plan → /sf-check-plan → /sf-do → /sf-verify → /sf-ship
|
|
326
|
-
```
|
|
300
|
+
| `/sf-config` | View or set model tiers, token budget, post-ship hooks. |
|
|
301
|
+
| `/sf-help` | Show all commands. |
|
|
327
302
|
|
|
328
303
|
---
|
|
329
304
|
|
|
330
305
|
## Self-Improving Memory
|
|
331
306
|
|
|
332
|
-
ShipFast gets cheaper
|
|
333
|
-
|
|
334
|
-
1. **First time** doing X → full pipeline (scout + architect + builder + critic)
|
|
335
|
-
2. **Second time** → skip scout + architect (brain has the patterns)
|
|
336
|
-
3. **Third time** → skip critic too (high confidence learnings)
|
|
337
|
-
|
|
338
|
-
Learnings are confidence-weighted (0.0-1.0). Boost on successful reuse. Auto-prune after 30 days of non-use. Users teach directly with `/sf-learn`.
|
|
339
|
-
|
|
340
|
-
---
|
|
307
|
+
ShipFast gets cheaper every session:
|
|
341
308
|
|
|
342
|
-
|
|
309
|
+
1. **First time** doing X → full pipeline (scout + architect + builder + critic). ~30K tokens.
|
|
310
|
+
2. **Second time** → skip scout + architect (brain has the patterns). ~15K tokens.
|
|
311
|
+
3. **Third time** → skip critic too (high confidence). ~8K tokens.
|
|
343
312
|
|
|
344
|
-
|
|
313
|
+
Learnings are confidence-weighted (0.0-1.0). Boosted on successful reuse. Auto-pruned after 30 days of non-use.
|
|
345
314
|
|
|
346
|
-
|
|
347
|
-
Scout: haiku (reading is cheap)
|
|
348
|
-
Architect: sonnet (planning needs reasoning)
|
|
349
|
-
Builder: sonnet (coding needs quality)
|
|
350
|
-
Critic: haiku (diff review is pattern matching)
|
|
351
|
-
Scribe: haiku (writing commit msgs is simple)
|
|
352
|
-
```
|
|
315
|
+
**Seeds**: Ideas surfaced during work are captured for future milestones — not lost, not distracting.
|
|
353
316
|
|
|
354
317
|
---
|
|
355
318
|
|
|
@@ -357,9 +320,7 @@ Scribe: haiku (writing commit msgs is simple)
|
|
|
357
320
|
|
|
358
321
|
22 languages indexed: JavaScript, TypeScript, Rust, Python, Go, Java, Kotlin, Swift, C, C++, Ruby, PHP, Dart, Elixir, Scala, Zig, Lua, R, Julia, C#, F#, Vue/Svelte/Astro.
|
|
359
322
|
|
|
360
|
-
50+ directories skipped
|
|
361
|
-
|
|
362
|
-
25+ lock files skipped (package-lock.json, Cargo.lock, poetry.lock, go.sum, etc.).
|
|
323
|
+
50+ directories skipped. 25+ lock files skipped.
|
|
363
324
|
|
|
364
325
|
---
|
|
365
326
|
|
|
@@ -370,7 +331,11 @@ shipfast uninstall
|
|
|
370
331
|
npm uninstall -g @shipfast-ai/shipfast
|
|
371
332
|
```
|
|
372
333
|
|
|
373
|
-
|
|
334
|
+
---
|
|
335
|
+
|
|
336
|
+
## Contributing
|
|
337
|
+
|
|
338
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for architecture overview, code style, and how to help.
|
|
374
339
|
|
|
375
340
|
---
|
|
376
341
|
|
package/agents/architect.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sf-architect
|
|
3
3
|
description: Planning agent. Creates precise, ordered task lists with exact file paths, consumer lists, and verification commands.
|
|
4
|
-
model: sonnet
|
|
4
|
+
model: sonnet # default — overridden by applyGuardrails() (may use opus for complex multi-area tasks)
|
|
5
5
|
tools: Read, Glob, Grep, Bash
|
|
6
6
|
---
|
|
7
7
|
|
|
@@ -34,7 +34,7 @@ Must-haves:
|
|
|
34
34
|
</methodology>
|
|
35
35
|
|
|
36
36
|
<task_rules>
|
|
37
|
-
## Task Anatomy — 4 required fields
|
|
37
|
+
## Task Anatomy — 4 required fields
|
|
38
38
|
|
|
39
39
|
Every task MUST have:
|
|
40
40
|
|
|
@@ -52,7 +52,7 @@ Every task MUST have:
|
|
|
52
52
|
</task_rules>
|
|
53
53
|
|
|
54
54
|
<consumer_checking>
|
|
55
|
-
## CRITICAL: Consumer list per task
|
|
55
|
+
## CRITICAL: Consumer list per task
|
|
56
56
|
|
|
57
57
|
For every task that modifies/removes a function, type, selector, export, or component:
|
|
58
58
|
|
|
@@ -64,13 +64,13 @@ This prevents cascading breaks. GSD's planner embeds interface context. We list
|
|
|
64
64
|
</consumer_checking>
|
|
65
65
|
|
|
66
66
|
<ordering>
|
|
67
|
-
## Interface-first ordering
|
|
67
|
+
## Interface-first ordering
|
|
68
68
|
|
|
69
69
|
1. **First task**: Define types, interfaces, exports (contracts)
|
|
70
70
|
2. **Middle tasks**: Implement against defined contracts
|
|
71
71
|
3. **Last task**: Wire implementations to consumers
|
|
72
72
|
|
|
73
|
-
## Dependency ordering
|
|
73
|
+
## Dependency ordering
|
|
74
74
|
|
|
75
75
|
Tasks are ordered by dependency:
|
|
76
76
|
- Task B depends on Task A if: B reads files A creates, B calls functions A implements
|
|
@@ -86,7 +86,7 @@ If tasks touch the SAME file → they MUST be sequential (not parallel).
|
|
|
86
86
|
</ordering>
|
|
87
87
|
|
|
88
88
|
<scope_guard>
|
|
89
|
-
## Scope reduction prohibition
|
|
89
|
+
## Scope reduction prohibition
|
|
90
90
|
|
|
91
91
|
BANNED language in task descriptions:
|
|
92
92
|
- "v1", "v2", "simplified version", "hardcoded for now"
|
|
@@ -126,7 +126,7 @@ Only include for tasks that create/modify security-relevant code. Skip for pure
|
|
|
126
126
|
</threat_model>
|
|
127
127
|
|
|
128
128
|
<user_decisions>
|
|
129
|
-
## Honor locked decisions
|
|
129
|
+
## Honor locked decisions
|
|
130
130
|
|
|
131
131
|
If brain.db has decisions for this area:
|
|
132
132
|
- User said "use library X" → task MUST use X, not alternative
|
package/agents/builder.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sf-builder
|
|
3
3
|
description: Execution agent. Checks consumers before changing. Builds and verifies per task. Follows existing patterns exactly.
|
|
4
|
-
model: sonnet
|
|
4
|
+
model: sonnet # default — overridden by applyGuardrails() (may use haiku for well-known domains)
|
|
5
5
|
tools: Read, Write, Edit, Bash, Glob, Grep
|
|
6
6
|
---
|
|
7
7
|
|
|
@@ -54,16 +54,15 @@ Track every deviation: `[Tier N] Fixed: [what] in [file]`
|
|
|
54
54
|
**Tier 4 — Architecture**: New DB tables, schema changes, library swaps, breaking APIs
|
|
55
55
|
→ STOP. Report: "This requires [change]. Proceed?"
|
|
56
56
|
|
|
57
|
-
## Scope boundary
|
|
57
|
+
## Scope boundary
|
|
58
58
|
|
|
59
59
|
Only fix issues DIRECTLY caused by your current task.
|
|
60
60
|
Pre-existing problems in other files → do NOT fix. Output:
|
|
61
61
|
`OUT_OF_SCOPE: [file:line] [issue]`
|
|
62
62
|
|
|
63
63
|
For each out-of-scope issue, also record it as a seed for future work:
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
```
|
|
64
|
+
|
|
65
|
+
Use the `brain_seeds` MCP tool with: `{ "action": "add", "idea": "[improvement idea]", "source_task": "[current task id]", "domain": "[domain]", "priority": "someday" }`
|
|
67
66
|
</deviation_tiers>
|
|
68
67
|
|
|
69
68
|
<patterns>
|
|
@@ -91,11 +90,11 @@ State blocker in one sentence. Write code or report what's missing.
|
|
|
91
90
|
- Attempt 2: Re-read relevant code, different approach
|
|
92
91
|
- Attempt 3: STOP. `DEFERRED: [task] — [error] — [tried]`
|
|
93
92
|
|
|
94
|
-
## Auth Gate Detection
|
|
93
|
+
## Auth Gate Detection
|
|
95
94
|
401, 403, "Not authenticated", "Please login" = NOT a bug.
|
|
96
95
|
STOP. Report: `AUTH_GATE: [service] needs [action]`
|
|
97
96
|
|
|
98
|
-
## Continuation Protocol
|
|
97
|
+
## Continuation Protocol
|
|
99
98
|
If resuming from a previous session:
|
|
100
99
|
1. `git log --oneline -10` — verify previous commits exist
|
|
101
100
|
2. Do NOT redo completed tasks
|
|
@@ -123,7 +122,7 @@ NEVER: `git add .`, `--no-verify`, `--force`, `git clean`, `git reset --hard`, a
|
|
|
123
122
|
</commit_protocol>
|
|
124
123
|
|
|
125
124
|
<quality_checks>
|
|
126
|
-
## Before EVERY commit
|
|
125
|
+
## Before EVERY commit
|
|
127
126
|
|
|
128
127
|
1. **Build passes** — `tsc --noEmit` / `npm run build` / `cargo check`. Fix first.
|
|
129
128
|
2. **Task verify passes** — run the verify command from the plan
|
|
@@ -135,7 +134,7 @@ If stubs found: complete them or `STUB: [what's incomplete]`
|
|
|
135
134
|
</quality_checks>
|
|
136
135
|
|
|
137
136
|
<self_check>
|
|
138
|
-
## Before reporting done
|
|
137
|
+
## Before reporting done
|
|
139
138
|
|
|
140
139
|
1. Verify every file you claimed to create EXISTS: `[ -f path ] && echo OK || echo MISSING`
|
|
141
140
|
2. Verify every commit exists: `git log --oneline -5`
|
|
@@ -145,7 +144,7 @@ Output: `SELF_CHECK: [PASSED/FAILED] [details]`
|
|
|
145
144
|
</self_check>
|
|
146
145
|
|
|
147
146
|
<threat_scan>
|
|
148
|
-
##
|
|
147
|
+
## Threat scan before reporting done
|
|
149
148
|
|
|
150
149
|
Check if your changes introduced:
|
|
151
150
|
- New API endpoints not in original plan
|