@c0x12c/spartan-ai-toolkit 1.6.2 → 1.6.3
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/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/VERSION +1 -1
- package/commands/spartan/build.md +120 -1
- package/commands/spartan/epic.md +14 -5
- package/package.json +1 -1
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.6.
|
|
1
|
+
1.6.3
|
|
@@ -12,16 +12,24 @@ You are the **Build workflow leader** — the main way to go from requirement to
|
|
|
12
12
|
You decide which steps to run, which skills to call, and when to move forward. The user doesn't need to chain commands manually — you handle the full pipeline.
|
|
13
13
|
|
|
14
14
|
```
|
|
15
|
-
|
|
15
|
+
SINGLE FEATURE:
|
|
16
16
|
|
|
17
17
|
Check Context → Spec → Design? → Plan → Implement → Review → Ship
|
|
18
18
|
│ │ │ │ │ │ │
|
|
19
19
|
.memory/ Gate 1 Design Gate 2 Gate 3 Gate 3.5 Gate 4
|
|
20
20
|
.planning/ Gate (UI)
|
|
21
|
+
|
|
22
|
+
EPIC (multi-feature — auto-detected):
|
|
23
|
+
|
|
24
|
+
Check Context → Epic detected → Combined Plan → Parallel Build → Review → Ship
|
|
25
|
+
│ │ │ │ │ │
|
|
26
|
+
.planning/ read all specs wave grouping Agent Teams Gate 3.5 Gate 4
|
|
27
|
+
epics/ + designs (auto) one PR
|
|
21
28
|
```
|
|
22
29
|
|
|
23
30
|
**Fast path:** For small work (< 1 day, ≤ 4 tasks), you do spec + plan inline. No separate commands needed.
|
|
24
31
|
**Full path:** For bigger work, you call `/spartan:spec`, `/spartan:design`, `/spartan:plan` as sub-steps.
|
|
32
|
+
**Epic path:** If the feature name matches an epic with 2+ specs ready, build all features together — one branch, one PR.
|
|
25
33
|
|
|
26
34
|
---
|
|
27
35
|
|
|
@@ -66,6 +74,9 @@ ls .planning/specs/*.md 2>/dev/null
|
|
|
66
74
|
ls .planning/designs/*.md 2>/dev/null
|
|
67
75
|
ls .planning/plans/*.md 2>/dev/null
|
|
68
76
|
|
|
77
|
+
# Check for epic
|
|
78
|
+
ls .planning/epics/*.md 2>/dev/null
|
|
79
|
+
|
|
69
80
|
# Check for handoff from a previous session
|
|
70
81
|
ls .handoff/*.md 2>/dev/null
|
|
71
82
|
```
|
|
@@ -79,6 +90,25 @@ ls .handoff/*.md 2>/dev/null
|
|
|
79
90
|
**If spec/design/plan already exist** for this feature, skip those stages and jump ahead. Show what you found:
|
|
80
91
|
> "Found: spec ✓, design ✓, plan ✓ — jumping to Implement."
|
|
81
92
|
|
|
93
|
+
### Epic detection (auto — no questions)
|
|
94
|
+
|
|
95
|
+
**If an epic exists** that matches the feature name (or the user passed an epic name):
|
|
96
|
+
|
|
97
|
+
1. Read the epic file at `.planning/epics/{name}.md`
|
|
98
|
+
2. Find all features listed in the epic's Features table
|
|
99
|
+
3. Check which features have specs ready (status = `spec` or `planned`)
|
|
100
|
+
4. Check which features are already `done` or `skipped`
|
|
101
|
+
|
|
102
|
+
**If 2+ features have specs ready → switch to Epic mode:**
|
|
103
|
+
> "Found epic **{name}** with {N} features. {X} specs ready, {Y} already done. Building all ready features together — one branch, one PR."
|
|
104
|
+
|
|
105
|
+
Then jump to **Stage 1E: Epic Build** below. Skip Stages 1-2 (individual spec/plan).
|
|
106
|
+
|
|
107
|
+
**If only 1 feature has a spec** → build that one normally (single feature mode).
|
|
108
|
+
|
|
109
|
+
**If no features have specs yet** → tell the user to write specs first:
|
|
110
|
+
> "Epic exists but no specs are ready. Run `/spartan:spec {first-feature}` to start."
|
|
111
|
+
|
|
82
112
|
---
|
|
83
113
|
|
|
84
114
|
## Stage 1: Understand (Spec)
|
|
@@ -169,6 +199,93 @@ If user picks C → read the Figma reference and use it as the design source.
|
|
|
169
199
|
|
|
170
200
|
---
|
|
171
201
|
|
|
202
|
+
## Stage 1E: Epic Build (multi-feature mode)
|
|
203
|
+
|
|
204
|
+
**This stage replaces Stages 1–3 when epic mode is active.** It builds all ready features from the epic on one branch and creates one PR.
|
|
205
|
+
|
|
206
|
+
### Step 1: Collect all features
|
|
207
|
+
|
|
208
|
+
Read the epic file. For each feature with status `spec`, `planned`, or `building`:
|
|
209
|
+
1. Read its spec from `.planning/specs/`
|
|
210
|
+
2. Read its design from `.planning/designs/` (if exists)
|
|
211
|
+
3. Read its plan from `.planning/plans/` (if exists)
|
|
212
|
+
|
|
213
|
+
### Step 2: Build a combined plan
|
|
214
|
+
|
|
215
|
+
Create one unified plan that covers all features:
|
|
216
|
+
|
|
217
|
+
1. **Dependency order** — respect the epic's dependency table. Feature 3 depends on Feature 1? Build 1 first.
|
|
218
|
+
2. **Group into waves** — features with no dependency between them go in the same wave (parallel).
|
|
219
|
+
3. **Plan each feature** — if a feature has no plan yet, generate one (fast path for small, full path for big).
|
|
220
|
+
|
|
221
|
+
```markdown
|
|
222
|
+
## Epic Build Plan: [epic name]
|
|
223
|
+
Branch: `feature/[epic-slug]`
|
|
224
|
+
|
|
225
|
+
### Wave 1 (parallel — no dependencies)
|
|
226
|
+
**Feature: [name-1]** — [N] tasks
|
|
227
|
+
- Task 1.1: ...
|
|
228
|
+
- Task 1.2: ...
|
|
229
|
+
|
|
230
|
+
**Feature: [name-3]** — [N] tasks
|
|
231
|
+
- Task 3.1: ...
|
|
232
|
+
- Task 3.2: ...
|
|
233
|
+
|
|
234
|
+
### Wave 2 (after wave 1)
|
|
235
|
+
**Feature: [name-2]** (depends on #1) — [N] tasks
|
|
236
|
+
- Task 2.1: ...
|
|
237
|
+
- Task 2.2: ...
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### Step 3: Create branch
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
git checkout -b feature/[epic-slug]
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
### Step 4: Execute with auto-parallelism
|
|
247
|
+
|
|
248
|
+
```bash
|
|
249
|
+
echo "${CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS:-not_set}"
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
**If Agent Teams is enabled AND a wave has 2+ features:**
|
|
253
|
+
|
|
254
|
+
Use Agent Teams automatically — one agent per feature in the wave. Each agent gets:
|
|
255
|
+
- Its feature's spec, design doc (if exists), and plan
|
|
256
|
+
- Worktree isolation (`isolation: "worktree"`)
|
|
257
|
+
- TDD instructions and relevant rules
|
|
258
|
+
- `.memory/` context
|
|
259
|
+
|
|
260
|
+
Between waves:
|
|
261
|
+
1. Merge worktrees from completed agents
|
|
262
|
+
2. Run full test suite — all tests must pass before next wave
|
|
263
|
+
3. Update epic Features table (status → `building`)
|
|
264
|
+
|
|
265
|
+
**If Agent Teams is NOT enabled:**
|
|
266
|
+
|
|
267
|
+
Build features sequentially in dependency order. Use TDD for each task within each feature. Commit after each task.
|
|
268
|
+
|
|
269
|
+
### Step 5: After all features built
|
|
270
|
+
|
|
271
|
+
1. Run full test suite
|
|
272
|
+
2. Update epic Features table — mark all built features as `done`
|
|
273
|
+
3. Continue to **Stage 3.5: Review** and **Stage 4: Ship** as normal — one review, one PR for the whole epic
|
|
274
|
+
|
|
275
|
+
**GATE 3 (Epic) — STOP and ask:**
|
|
276
|
+
> "All {N} features built. {X} tests passing. Here's what's in it:
|
|
277
|
+
> - Feature 1: [summary]
|
|
278
|
+
> - Feature 2: [summary]
|
|
279
|
+
> - ...
|
|
280
|
+
>
|
|
281
|
+
> Ready for review?"
|
|
282
|
+
>
|
|
283
|
+
> **Auto mode on?** → Continue to Review immediately.
|
|
284
|
+
|
|
285
|
+
After this, skip to **Stage 3.5: Review**. Don't go through Stage 2/3 individually.
|
|
286
|
+
|
|
287
|
+
---
|
|
288
|
+
|
|
172
289
|
## Stage 2: Plan
|
|
173
290
|
|
|
174
291
|
### Check for saved plan
|
|
@@ -453,6 +570,8 @@ If a previous session was interrupted (context overflow, user stopped, etc.), th
|
|
|
453
570
|
- **Don't over-plan.** If the whole thing is 1-2 files and 30 minutes of work, don't force it into this workflow. Just do it. This workflow is for features that need structure — at least 2-3 tasks.
|
|
454
571
|
- **Save state for big work.** If 5+ tasks, save artifacts to `.planning/` so future sessions can resume.
|
|
455
572
|
- **Full-stack = both layers done.** If the feature touches both backend and frontend, you MUST implement both before creating the PR. Backend-only completion is NOT "done" for a full-stack feature.
|
|
573
|
+
- **Epic = one branch, one PR.** When building from an epic, all features go on one branch and ship as one PR. Don't create separate PRs per feature. Parallelize independent features with Agent Teams when available.
|
|
574
|
+
- **Epic auto-detection.** If the user's feature name matches an epic in `.planning/epics/`, switch to epic mode automatically. Don't ask.
|
|
456
575
|
|
|
457
576
|
---
|
|
458
577
|
|
package/commands/spartan/epic.md
CHANGED
|
@@ -141,13 +141,22 @@ Then tell the user:
|
|
|
141
141
|
|
|
142
142
|
> "Epic saved to `.planning/epics/{{ args[0] }}.md` with [N] features."
|
|
143
143
|
>
|
|
144
|
-
> **
|
|
144
|
+
> **Next steps:**
|
|
145
|
+
>
|
|
146
|
+
> 1. Write specs for each feature (can do multiple before building):
|
|
147
|
+
> ```
|
|
148
|
+
> /spartan:spec [feature-1]
|
|
149
|
+
> /spartan:spec [feature-2]
|
|
150
|
+
> /spartan:design [feature-2] ← if it has UI work
|
|
151
|
+
> /spartan:spec [feature-3]
|
|
145
152
|
> ```
|
|
146
|
-
>
|
|
147
|
-
>
|
|
148
|
-
> /spartan:plan [feature-name] ← write the plan, pass Gate 2
|
|
149
|
-
> /spartan:build [feature-name] ← build it, TDD, pass Gates 3-4
|
|
153
|
+
>
|
|
154
|
+
> 2. When specs are ready, build the whole epic at once:
|
|
150
155
|
> ```
|
|
156
|
+
> /spartan:build {{ args[0] }} ← builds all ready features, one branch, one PR
|
|
157
|
+
> ```
|
|
158
|
+
>
|
|
159
|
+
> Build auto-detects the epic, plans all features together, parallelizes independent ones with Agent Teams, and ships one PR.
|
|
151
160
|
>
|
|
152
161
|
> **Start with:** `/spartan:spec [first-feature-name]`
|
|
153
162
|
|
package/package.json
CHANGED