@c0x12c/spartan-ai-toolkit 1.2.1 → 1.3.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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +2 -2
- package/README.md +6 -4
- package/VERSION +2 -1
- package/claude-md/00-header.md +2 -2
- package/claude-md/01-core.md +21 -2
- package/claude-md/20-frontend-react.md +1 -1
- package/claude-md/30-project-mgmt.md +1 -0
- package/claude-md/40-product.md +3 -1
- package/commands/spartan/brownfield.md +1 -1
- package/commands/spartan/build.md +22 -3
- package/commands/spartan/epic.md +190 -0
- package/commands/spartan/map-codebase.md +1 -1
- package/commands/spartan/plan.md +210 -0
- package/commands/spartan/spec.md +131 -0
- package/commands/spartan/think.md +1 -1
- package/commands/spartan/workstreams.md +1 -1
- package/commands/spartan.md +1 -1
- package/package.json +1 -1
- package/packs/core.yaml +2 -1
- package/packs/packs.compiled.json +3 -1
- package/packs/project-mgmt.yaml +1 -0
- package/templates/epic.md +1 -1
- package/commands/spartan/quickplan.md +0 -122
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
"plugins": [
|
|
9
9
|
{
|
|
10
10
|
"name": "spartan-ai-toolkit",
|
|
11
|
-
"description": "5 workflows,
|
|
11
|
+
"description": "5 workflows, 53 commands, 11 rules, 19 skills, 4 agents — organized in 11 packs with dependencies",
|
|
12
12
|
"source": "./toolkit",
|
|
13
|
-
"version": "1.
|
|
13
|
+
"version": "1.3.0"
|
|
14
14
|
}
|
|
15
15
|
]
|
|
16
16
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spartan-ai-toolkit",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Engineering discipline layer for Claude Code — 5 workflows,
|
|
3
|
+
"version": "1.3.0",
|
|
4
|
+
"description": "Engineering discipline layer for Claude Code — 5 workflows, 53 commands, 11 rules, 19 skills, 4 agents organized in 11 packs",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Khoa Tran",
|
|
7
7
|
"url": "https://github.com/spartan-stratos"
|
package/README.md
CHANGED
|
@@ -66,7 +66,8 @@ After install, open any project, run `claude`, then type `/spartan`.
|
|
|
66
66
|
**Direct commands** — one command, one job. Best when you know what step you need. Saves tokens.
|
|
67
67
|
|
|
68
68
|
```
|
|
69
|
-
/spartan:
|
|
69
|
+
/spartan:spec "feature" ← write the spec
|
|
70
|
+
/spartan:plan "feature" ← plan the implementation
|
|
70
71
|
/spartan:review ← just the code review
|
|
71
72
|
/spartan:pr-ready ← just the PR creation
|
|
72
73
|
/spartan:migration "desc" ← just the migration
|
|
@@ -135,7 +136,7 @@ npx @c0x12c/spartan-ai-toolkit@latest --all
|
|
|
135
136
|
|
|
136
137
|
| Pack | Category | Depends on | What you get |
|
|
137
138
|
|------|----------|------------|--------------|
|
|
138
|
-
| **core** | Core | — | Always installed. Workflows (build, fix, onboard),
|
|
139
|
+
| **core** | Core | — | Always installed. Workflows (build, fix, onboard), spec, plan, pr-ready, daily, safety commands |
|
|
139
140
|
| **backend-micronaut** | Backend | database, shared-backend | Kotlin service scaffold, code review, testcontainers, API/DB/Kotlin rules, 5 skills, 2 agents |
|
|
140
141
|
| **backend-nodejs** | Backend | database, shared-backend | Coming soon |
|
|
141
142
|
| **backend-python** | Backend | database, shared-backend | Coming soon |
|
|
@@ -151,7 +152,7 @@ Hidden packs (`database`, `shared-backend`) get pulled in as dependencies — yo
|
|
|
151
152
|
|
|
152
153
|
## Commands
|
|
153
154
|
|
|
154
|
-
All commands start with `/spartan:` (e.g., `/spartan:
|
|
155
|
+
All commands start with `/spartan:` (e.g., `/spartan:spec "feature"`).
|
|
155
156
|
|
|
156
157
|
Type `/spartan` to get the smart router — it asks what you need and picks the right command.
|
|
157
158
|
|
|
@@ -167,7 +168,8 @@ Type `/spartan` to get the smart router — it asks what you need and picks the
|
|
|
167
168
|
### Core (always installed)
|
|
168
169
|
| Command | What it does |
|
|
169
170
|
|---------|-------------|
|
|
170
|
-
| `
|
|
171
|
+
| `spec "feature"` | Write a feature spec — saves to `.planning/specs/` |
|
|
172
|
+
| `plan "feature"` | Write implementation plan from spec — saves to `.planning/plans/` |
|
|
171
173
|
| `daily` | Standup summary from git history |
|
|
172
174
|
| `pr-ready` | Full checklist before creating any PR |
|
|
173
175
|
| `init-project` | Auto-generate CLAUDE.md from codebase scan |
|
package/VERSION
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
1.
|
|
1
|
+
1.3.0
|
|
2
|
+
|
package/claude-md/00-header.md
CHANGED
|
@@ -34,6 +34,6 @@ What do you need?
|
|
|
34
34
|
| Size | Use |
|
|
35
35
|
|---|---|
|
|
36
36
|
| < 30 min, ≤ 3 files | Just ask Claude (no command needed) |
|
|
37
|
-
| < 1 day | `/spartan:
|
|
38
|
-
| 1–3 days | `/spartan:
|
|
37
|
+
| < 1 day | `/spartan:spec` → `/spartan:build` |
|
|
38
|
+
| 1–3 days | `/spartan:spec` → `/spartan:plan` → `/spartan:build` |
|
|
39
39
|
| > 3 days, multi-session | `/spartan:project new` (full lifecycle) |
|
package/claude-md/01-core.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
**Detect the language of the user's message and respond entirely in that same language.** This is not optional — it overrides the default English behavior of all commands. If the user writes in Vietnamese, ALL output must be in Vietnamese. If in French, respond in French. If in English, respond in English. This applies to everything: explanations, questions, gate prompts, debug reports, summaries, and PR descriptions. Only code syntax, variable names, file paths, and command names (e.g., `/spartan:fix`) stay in their original form.
|
|
8
8
|
|
|
9
9
|
### 2. Spec Before Code
|
|
10
|
-
- Task < 1 day → `/spartan:
|
|
10
|
+
- Task < 1 day → `/spartan:spec` + `/spartan:plan` + `/spartan:build`
|
|
11
11
|
- Task > 1 day → `/spartan:project new` or `/spartan:project milestone-new`
|
|
12
12
|
- Never write production code without a written spec or plan
|
|
13
13
|
|
|
@@ -61,6 +61,19 @@ Auto mode is ideal for experienced users who trust the workflow and want maximum
|
|
|
61
61
|
|
|
62
62
|
## Core Commands (always available)
|
|
63
63
|
|
|
64
|
+
### Feature Workflow
|
|
65
|
+
```
|
|
66
|
+
/spartan:epic → /spartan:spec → [/spartan:design] → /spartan:plan → /spartan:build → /spartan:pr-ready
|
|
67
|
+
↑ ↑ ↑ ↑
|
|
68
|
+
Gate 1 Gate 2 Gate 3 Gate 4
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
| Size | Path |
|
|
72
|
+
|---|---|
|
|
73
|
+
| Single feature | `/spartan:spec` → `/spartan:plan` → `/spartan:build` |
|
|
74
|
+
| Batch of features (1-2 weeks) | `/spartan:epic` → then spec/plan/build each feature |
|
|
75
|
+
| Multi-week project | `/spartan:project new` → milestones + phases |
|
|
76
|
+
|
|
64
77
|
### Workflows (start here)
|
|
65
78
|
| Command | Purpose |
|
|
66
79
|
|---|---|
|
|
@@ -69,10 +82,16 @@ Auto mode is ideal for experienced users who trust the workflow and want maximum
|
|
|
69
82
|
| `/spartan:fix "symptom"` | Bug workflow: reproduce → investigate → fix → PR |
|
|
70
83
|
| `/spartan:onboard` | Codebase understanding: scan → map → setup |
|
|
71
84
|
|
|
85
|
+
### Spec & Plan (saved artifacts)
|
|
86
|
+
| Command | Purpose |
|
|
87
|
+
|---|---|
|
|
88
|
+
| `/spartan:spec "feature"` | Write a feature spec → saves to `.planning/specs/` → Gate 1 |
|
|
89
|
+
| `/spartan:plan "feature"` | Write implementation plan from spec → saves to `.planning/plans/` → Gate 2 |
|
|
90
|
+
| `/spartan:epic "name"` | Break big work into ordered features → saves to `.planning/epics/` |
|
|
91
|
+
|
|
72
92
|
### Individual Commands
|
|
73
93
|
| Command | Purpose |
|
|
74
94
|
|---|---|
|
|
75
|
-
| `/spartan:quickplan "task"` | Spec + plan + branch in one shot (< 1 day) |
|
|
76
95
|
| `/spartan:pr-ready` | Pre-PR checklist + auto PR description |
|
|
77
96
|
| `/spartan:daily` | Standup summary from git log |
|
|
78
97
|
| `/spartan:init-project` | Auto-generate CLAUDE.md from codebase |
|
|
@@ -27,7 +27,7 @@ See `templates/workflow-frontend-react.md` for the full workflow with:
|
|
|
27
27
|
- File location guide (App Router conventions)
|
|
28
28
|
- Parallel vs sequential task planning
|
|
29
29
|
|
|
30
|
-
For
|
|
30
|
+
For any feature, use `/spartan:spec` → `/spartan:plan` → `/spartan:build`.
|
|
31
31
|
|
|
32
32
|
### Frontend Skills
|
|
33
33
|
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
| Command | Purpose |
|
|
7
7
|
|---|---|
|
|
8
|
+
| `/spartan:epic "name"` | Break big work into ordered features → each goes through spec → plan → build |
|
|
8
9
|
| `/spartan:project [action]` | Manage large projects: `new`, `status`, `milestone-new`, `milestone-complete`, `milestone-summary`, `manager` |
|
|
9
10
|
| `/spartan:phase [action] [N]` | Manage phases: `discuss`, `plan`, `execute`, `verify` |
|
|
10
11
|
| `/spartan:workstreams [action]` | Parallel workstreams: `list`, `create`, `switch`, `status`, `progress`, `complete`, `resume` |
|
package/claude-md/40-product.md
CHANGED
|
@@ -19,7 +19,9 @@ These commands help you think deep before writing code. Use them when starting a
|
|
|
19
19
|
↓
|
|
20
20
|
/spartan:think "feature" ← 6-phase deep thinking before code
|
|
21
21
|
↓
|
|
22
|
-
/spartan:
|
|
22
|
+
/spartan:spec "task" ← Write the spec
|
|
23
|
+
/spartan:plan "task" ← Plan the work
|
|
24
|
+
/spartan:build "task" ← Then build it
|
|
23
25
|
```
|
|
24
26
|
|
|
25
27
|
You don't have to use all of them. Pick what fits your stage.
|
|
@@ -154,4 +154,4 @@ This prevents scope creep and keeps each change independently reviewable.
|
|
|
154
154
|
|
|
155
155
|
After analysis, present the Context Map summary and ask:
|
|
156
156
|
"Analysis complete. What change would you like to make first?
|
|
157
|
-
I'll create a change folder and use `/spartan:
|
|
157
|
+
I'll create a change folder and use `/spartan:spec` → `/spartan:build` for it."
|
|
@@ -52,13 +52,21 @@ ls .planning/PROJECT.md 2>/dev/null && echo "GSD_ACTIVE"
|
|
|
52
52
|
|
|
53
53
|
## Stage 1: Understand
|
|
54
54
|
|
|
55
|
-
**
|
|
55
|
+
**First, check for a saved spec:**
|
|
56
|
+
```bash
|
|
57
|
+
ls .planning/specs/*.md 2>/dev/null
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
If a spec exists for this feature (matching the feature name), read it and use it as the scope. Skip the 3 questions — the spec already answered them. Show:
|
|
61
|
+
> "Found spec: `.planning/specs/{name}.md` — using it as scope."
|
|
62
|
+
|
|
63
|
+
If no spec exists, **ask 3 forcing questions. Always. Even in auto mode.**
|
|
56
64
|
|
|
57
65
|
1. **"What pain does this solve?"** — Not the feature. The pain. If the user says "add a profiles endpoint" ask what user problem it fixes.
|
|
58
66
|
2. **"What's the narrowest version we can ship?"** — Force MVP thinking. Cut scope until it hurts.
|
|
59
67
|
3. **"What assumption could be wrong?"** — Surface hidden risks early.
|
|
60
68
|
|
|
61
|
-
After the user answers, produce a scope block:
|
|
69
|
+
After the user answers (or after reading the spec), produce a scope block:
|
|
62
70
|
|
|
63
71
|
```markdown
|
|
64
72
|
## Scope: [feature name]
|
|
@@ -86,10 +94,21 @@ After the user answers, produce a scope block:
|
|
|
86
94
|
|
|
87
95
|
## Stage 2: Plan
|
|
88
96
|
|
|
97
|
+
### Check for saved plan
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
ls .planning/plans/*.md 2>/dev/null
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
If a plan exists for this feature, read it and use it. Skip the inline planning — go straight to Stage 3 (Implement). Show:
|
|
104
|
+
> "Found plan: `.planning/plans/{name}.md` — using it."
|
|
105
|
+
|
|
106
|
+
If no plan exists, do the size check below.
|
|
107
|
+
|
|
89
108
|
### Size check
|
|
90
109
|
|
|
91
110
|
Count the expected work:
|
|
92
|
-
- **Small** (1-4 tasks, < 1 day): Inline plan right here.
|
|
111
|
+
- **Small** (1-4 tasks, < 1 day): Inline plan right here.
|
|
93
112
|
- **Big** (5+ tasks, multi-day): Use `/spartan:phase plan` for a full wave-parallel plan.
|
|
94
113
|
|
|
95
114
|
### Inline plan format (small features)
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spartan:epic
|
|
3
|
+
description: Define an epic — break big work into ordered features with specs and plans
|
|
4
|
+
argument-hint: "[epic name]"
|
|
5
|
+
preamble-tier: 3
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Epic: {{ args[0] | default: "unnamed epic" }}
|
|
9
|
+
|
|
10
|
+
You are running the **Epic workflow** — break a big piece of work into ordered features, each of which goes through the full spec → plan → build cycle.
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
► Epic → Spec → [Design] → Plan → Build → Review
|
|
14
|
+
↑
|
|
15
|
+
start
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
The epic gets saved to `.planning/epics/{{ args[0] | default: "epic-name" }}.md`.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Step 0: Setup
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
mkdir -p .planning/epics
|
|
26
|
+
ls .planning/epics/{{ args[0] | default: "epic-name" }}.md 2>/dev/null
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
If it exists, ask:
|
|
30
|
+
> "An epic for **{{ args[0] }}** already exists. Want to **update** it or **start fresh**?"
|
|
31
|
+
>
|
|
32
|
+
> - A) Update — I'll show the current epic and we'll revise
|
|
33
|
+
> - B) Start fresh — overwrite
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Step 1: Understand the Big Picture
|
|
38
|
+
|
|
39
|
+
Ask these questions **one at a time**:
|
|
40
|
+
|
|
41
|
+
1. **"What are we building and why?"** — Get the big picture in 2-3 sentences. What outcome does this epic deliver?
|
|
42
|
+
|
|
43
|
+
2. **"How do we know it's done?"** — Get 2-3 concrete success criteria. Not vague ("users are happy") — specific ("users can create and manage profiles").
|
|
44
|
+
|
|
45
|
+
3. **"What are the main pieces?"** — Have the user list the features they can think of. Don't worry about order yet.
|
|
46
|
+
|
|
47
|
+
4. **"Anything risky or tricky?"** — What could block the whole epic?
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Step 2: Break into Features
|
|
52
|
+
|
|
53
|
+
Take the user's feature list and organize it:
|
|
54
|
+
|
|
55
|
+
1. **Order by dependency.** Feature 2 shouldn't need Feature 5.
|
|
56
|
+
2. **Keep features small.** Each should be 1-3 days of work. If one is bigger, split it.
|
|
57
|
+
3. **Write a brief for each.** 2-3 sentences: what it does, why it matters, rough scope.
|
|
58
|
+
|
|
59
|
+
Present as a table:
|
|
60
|
+
|
|
61
|
+
```markdown
|
|
62
|
+
| # | Feature | Depends On | Effort |
|
|
63
|
+
|---|---------|------------|--------|
|
|
64
|
+
| 1 | [name] | — | [S/M/L] |
|
|
65
|
+
| 2 | [name] | #1 | [S/M/L] |
|
|
66
|
+
| 3 | [name] | #1, #2 | [S/M/L] |
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Ask:
|
|
70
|
+
> "Here's how I'd order the features. Anything to change?"
|
|
71
|
+
>
|
|
72
|
+
> **Auto mode on?** → Show the order and continue.
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Step 3: Fill the Epic Document
|
|
77
|
+
|
|
78
|
+
Use the `epic.md` template structure:
|
|
79
|
+
|
|
80
|
+
```markdown
|
|
81
|
+
# Epic: {{ args[0] }}
|
|
82
|
+
|
|
83
|
+
**Created**: [today's date]
|
|
84
|
+
**Status**: planning
|
|
85
|
+
**Owner**: [user's name or "team"]
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Why
|
|
90
|
+
|
|
91
|
+
[2-3 sentences from Step 1, question 1]
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Success Criteria
|
|
96
|
+
|
|
97
|
+
- [ ] [from Step 1, question 2]
|
|
98
|
+
- [ ] [criteria 2]
|
|
99
|
+
- [ ] [criteria 3]
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Features
|
|
104
|
+
|
|
105
|
+
| # | Feature | Status | Spec | Plan | Depends On |
|
|
106
|
+
|---|---------|--------|------|------|------------|
|
|
107
|
+
| 1 | [name] | todo | — | — | — |
|
|
108
|
+
| 2 | [name] | todo | — | — | #1 |
|
|
109
|
+
| 3 | [name] | todo | — | — | #1, #2 |
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## Feature Briefs
|
|
114
|
+
|
|
115
|
+
### Feature 1: [name]
|
|
116
|
+
[2-3 sentences from Step 2]
|
|
117
|
+
|
|
118
|
+
### Feature 2: [name]
|
|
119
|
+
[2-3 sentences]
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## Risks
|
|
124
|
+
|
|
125
|
+
- [from Step 1, question 4]
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## Notes
|
|
130
|
+
|
|
131
|
+
- [anything else]
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## Step 4: Save and Confirm
|
|
137
|
+
|
|
138
|
+
Save the epic to `.planning/epics/{{ args[0] | default: "epic-name" }}.md`.
|
|
139
|
+
|
|
140
|
+
Then tell the user:
|
|
141
|
+
|
|
142
|
+
> "Epic saved to `.planning/epics/{{ args[0] }}.md` with [N] features."
|
|
143
|
+
>
|
|
144
|
+
> **The workflow for each feature:**
|
|
145
|
+
> ```
|
|
146
|
+
> /spartan:spec [feature-name] ← write the spec, pass Gate 1
|
|
147
|
+
> /spartan:design [feature-name] ← if it has UI work (optional)
|
|
148
|
+
> /spartan:plan [feature-name] ← write the plan, pass Gate 2
|
|
149
|
+
> /spartan:build [feature-name] ← build it, TDD, pass Gates 3-4
|
|
150
|
+
> ```
|
|
151
|
+
>
|
|
152
|
+
> **Start with:** `/spartan:spec [first-feature-name]`
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## Tracking Progress
|
|
157
|
+
|
|
158
|
+
When a spec or plan is written for a feature, update the epic's Features table:
|
|
159
|
+
|
|
160
|
+
| Status change | When |
|
|
161
|
+
|---|---|
|
|
162
|
+
| `todo` → `spec` | After `/spartan:spec` saves |
|
|
163
|
+
| `spec` → `planned` | After `/spartan:plan` saves |
|
|
164
|
+
| `planned` → `building` | After `/spartan:build` starts |
|
|
165
|
+
| `building` → `done` | After PR merged |
|
|
166
|
+
| any → `skipped` | User decides to skip |
|
|
167
|
+
|
|
168
|
+
The user can check progress anytime by reading `.planning/epics/{{ args[0] }}.md`.
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## When NOT to Use This
|
|
173
|
+
|
|
174
|
+
| Situation | Use instead |
|
|
175
|
+
|---|---|
|
|
176
|
+
| Single feature | `/spartan:spec` → `/spartan:plan` → `/spartan:build` |
|
|
177
|
+
| Multi-week project with milestones | `/spartan:project new` (GSD lifecycle) |
|
|
178
|
+
|
|
179
|
+
Epics sit between a single feature (too small) and full GSD projects (too big). Use them for a batch of 3-8 related features.
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## Rules
|
|
184
|
+
|
|
185
|
+
- **Ask questions one at a time.** Don't dump everything at once.
|
|
186
|
+
- **Keep features small.** If a feature is > 3 days, split it.
|
|
187
|
+
- **Order by dependency.** Feature N+1 can depend on Feature N, not the other way around.
|
|
188
|
+
- **Each feature gets its own spec.** The epic is the container, not the spec.
|
|
189
|
+
- **Update the epic as features progress.** Keep the Features table current.
|
|
190
|
+
- **Auto mode on?** → Skip confirmations, save directly.
|
|
@@ -66,7 +66,7 @@ Once mapping is complete, suggest next steps based on context:
|
|
|
66
66
|
|
|
67
67
|
- **Starting a new project?** → `/spartan:project new` (map feeds into roadmap creation)
|
|
68
68
|
- **Planning a phase?** → `/spartan:phase plan N` (agents read codebase docs automatically)
|
|
69
|
-
- **Major refactoring?** → `/spartan:
|
|
69
|
+
- **Major refactoring?** → `/spartan:spec "refactor description"` → `/spartan:build` (informed by CONCERNS.md)
|
|
70
70
|
- **Team onboarding?** → Share `.planning/codebase/` docs with new team members
|
|
71
71
|
|
|
72
72
|
The codebase map is consumed automatically by GSD planning and execution agents — no manual wiring needed.
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spartan:plan
|
|
3
|
+
description: Write an implementation plan — reads spec, designs architecture, breaks into tasks, runs Gate 2
|
|
4
|
+
argument-hint: "[feature name]"
|
|
5
|
+
preamble-tier: 3
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Plan: {{ args[0] | default: "unnamed feature" }}
|
|
9
|
+
|
|
10
|
+
You are running the **Plan workflow** — turn a spec into a concrete implementation plan with architecture, file locations, and ordered tasks.
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
Epic → Spec → [Design] → ► Plan → Build → Review
|
|
14
|
+
↑
|
|
15
|
+
Gate 2
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
The plan gets saved to `.planning/plans/{{ args[0] | default: "feature-name" }}.md`.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Step 0: Find the Spec
|
|
23
|
+
|
|
24
|
+
Look for the spec in this order:
|
|
25
|
+
1. `.planning/specs/{{ args[0] | default: "feature-name" }}.md`
|
|
26
|
+
2. If not found, ask: "No spec found for **{{ args[0] }}**. Want to:"
|
|
27
|
+
- A) Write the spec first → `/spartan:spec {{ args[0] }}`
|
|
28
|
+
- B) Give me a quick description and I'll plan from that (skip spec)
|
|
29
|
+
|
|
30
|
+
If spec exists, read it. Confirm:
|
|
31
|
+
> "Found spec: `.planning/specs/{{ args[0] }}.md`. Planning from this."
|
|
32
|
+
|
|
33
|
+
Also check:
|
|
34
|
+
```bash
|
|
35
|
+
mkdir -p .planning/plans
|
|
36
|
+
ls .planning/plans/{{ args[0] | default: "feature-name" }}.md 2>/dev/null
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
If a plan already exists, ask:
|
|
40
|
+
> "A plan for **{{ args[0] }}** already exists. Want to **update** it or **start fresh**?"
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Step 1: Detect Stack
|
|
45
|
+
|
|
46
|
+
Same auto-detect as `/spartan:build`:
|
|
47
|
+
```bash
|
|
48
|
+
ls build.gradle.kts settings.gradle.kts 2>/dev/null && echo "STACK:kotlin-micronaut"
|
|
49
|
+
ls package.json 2>/dev/null && cat package.json 2>/dev/null | grep -q '"next"' && echo "STACK:nextjs-react"
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
| Detected | Mode |
|
|
53
|
+
|----------|------|
|
|
54
|
+
| Kotlin only | Backend plan |
|
|
55
|
+
| Next.js only | Frontend plan |
|
|
56
|
+
| Both | Ask: "Backend, frontend, or full-stack plan?" |
|
|
57
|
+
| Neither | Ask the user |
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Step 2: Design Architecture
|
|
62
|
+
|
|
63
|
+
Based on the spec and detected stack, lay out:
|
|
64
|
+
|
|
65
|
+
### Components Table
|
|
66
|
+
List every component this feature needs:
|
|
67
|
+
```markdown
|
|
68
|
+
| Component | Type | Purpose |
|
|
69
|
+
|-----------|------|---------|
|
|
70
|
+
| [Name] | [Controller / Manager / Service / Repository / Component / Hook / etc.] | [what it does] |
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### File Locations Table
|
|
74
|
+
Where every file goes:
|
|
75
|
+
```markdown
|
|
76
|
+
| File | Location | Purpose |
|
|
77
|
+
|------|----------|---------|
|
|
78
|
+
| [file name] | [directory path] | [what it does] |
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Files to Change
|
|
82
|
+
Existing files that need changes:
|
|
83
|
+
```markdown
|
|
84
|
+
| File | What Changes | Why |
|
|
85
|
+
|------|-------------|-----|
|
|
86
|
+
| [file path] | [description] | [reason] |
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**Backend plans** follow: Controller → Manager → Repository (layered architecture).
|
|
90
|
+
**Frontend plans** follow: Types → Components → Pages → State.
|
|
91
|
+
**Full-stack plans** do backend first, then frontend. Mark the integration point.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Step 3: Break into Tasks
|
|
96
|
+
|
|
97
|
+
Split the work into phases with ordered tasks.
|
|
98
|
+
|
|
99
|
+
### Phase ordering by stack:
|
|
100
|
+
|
|
101
|
+
**Backend:** Database → Business Logic → API → Tests
|
|
102
|
+
**Frontend:** Types/Interfaces → Components → Pages/Routes → Tests
|
|
103
|
+
**Full-stack:** Database → API → Types → Components → Integration → Tests
|
|
104
|
+
|
|
105
|
+
### Task rules:
|
|
106
|
+
- Each task: max 3 files, one commit
|
|
107
|
+
- Each task has: description, files, what to test
|
|
108
|
+
- Group into phases by dependency
|
|
109
|
+
- Mark parallel vs sequential
|
|
110
|
+
|
|
111
|
+
### Format:
|
|
112
|
+
```markdown
|
|
113
|
+
### Phase 1: [name]
|
|
114
|
+
|
|
115
|
+
| # | Task | Files |
|
|
116
|
+
|---|------|-------|
|
|
117
|
+
| 1 | [description] | [file(s)] |
|
|
118
|
+
| 2 | [description] | [file(s)] |
|
|
119
|
+
|
|
120
|
+
### Phase 2: [name] (depends on Phase 1)
|
|
121
|
+
|
|
122
|
+
| # | Task | Files |
|
|
123
|
+
|---|------|-------|
|
|
124
|
+
| 3 | [description] | [file(s)] |
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Parallel vs Sequential table:
|
|
128
|
+
```markdown
|
|
129
|
+
| Parallel Group | Tasks | Why |
|
|
130
|
+
|---------------|-------|-----|
|
|
131
|
+
| Group A | 1, 2 | independent files |
|
|
132
|
+
|
|
133
|
+
| Sequential | Depends On | Why |
|
|
134
|
+
|-----------|-----------|-----|
|
|
135
|
+
| Task 3 | Task 1, 2 | needs their output |
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## Step 4: Testing Plan
|
|
141
|
+
|
|
142
|
+
Map tests from the spec's testing criteria:
|
|
143
|
+
|
|
144
|
+
- **Data layer tests** — insert, read, update, soft delete, query filters
|
|
145
|
+
- **Business logic tests** — happy path, error cases, validation
|
|
146
|
+
- **API / integration tests** — endpoints, auth, invalid input
|
|
147
|
+
- **UI tests** (if applicable) — render, interaction, states
|
|
148
|
+
|
|
149
|
+
Each test ties back to a spec requirement or edge case.
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## Step 5: Run Gate 2
|
|
154
|
+
|
|
155
|
+
Before saving, run the Gate 2 checklist from `quality-gates.md`:
|
|
156
|
+
|
|
157
|
+
**Architecture:**
|
|
158
|
+
- [ ] Follows the project's existing architecture patterns
|
|
159
|
+
- [ ] Each layer only calls the layer below it
|
|
160
|
+
- [ ] Components are in the right directories
|
|
161
|
+
|
|
162
|
+
**Task Breakdown:**
|
|
163
|
+
- [ ] All files to change are listed
|
|
164
|
+
- [ ] All new files are listed with their locations
|
|
165
|
+
- [ ] Each task is small (one file or one function)
|
|
166
|
+
- [ ] Dependencies between tasks are clear
|
|
167
|
+
- [ ] Parallel vs sequential tasks are marked
|
|
168
|
+
|
|
169
|
+
**Testing:**
|
|
170
|
+
- [ ] Data layer tests planned
|
|
171
|
+
- [ ] Business logic tests planned
|
|
172
|
+
- [ ] API/integration tests planned
|
|
173
|
+
- [ ] UI tests planned (if applicable)
|
|
174
|
+
- [ ] Edge cases from spec are covered in test plan
|
|
175
|
+
|
|
176
|
+
If any item fails → fix it before saving.
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## Step 6: Save and Confirm
|
|
181
|
+
|
|
182
|
+
Save the plan to `.planning/plans/{{ args[0] | default: "feature-name" }}.md`.
|
|
183
|
+
|
|
184
|
+
Set the metadata:
|
|
185
|
+
```
|
|
186
|
+
**Spec**: .planning/specs/{{ args[0] }}.md
|
|
187
|
+
**Epic**: [epic name or "none"]
|
|
188
|
+
**Created**: [today's date]
|
|
189
|
+
**Status**: draft
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Then tell the user:
|
|
193
|
+
|
|
194
|
+
> "Plan saved to `.planning/plans/{{ args[0] }}.md` — Gate 2 passed."
|
|
195
|
+
>
|
|
196
|
+
> **Next steps:**
|
|
197
|
+
> - Small feature (1-4 tasks)? → `/spartan:build {{ args[0] }}`
|
|
198
|
+
> - Big feature (5+ tasks)? → `/spartan:phase execute N`
|
|
199
|
+
> - Want a dual-agent review first? → `/spartan:gate-review`
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## Rules
|
|
204
|
+
|
|
205
|
+
- **Read the spec first.** Don't invent requirements the spec doesn't have.
|
|
206
|
+
- **Match the codebase.** Check existing patterns before proposing architecture. Run searches to find how similar features are built.
|
|
207
|
+
- **Small tasks.** Each task = one commit, max 3 files, completable in minutes not hours.
|
|
208
|
+
- **Gate 2 is not optional.** Every plan must pass before saving.
|
|
209
|
+
- **Auto mode on?** → Skip confirmations, show the plan and save it directly.
|
|
210
|
+
- **Link back to spec.** Every task should trace to a spec requirement. If a task doesn't come from the spec, question why it's there.
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spartan:spec
|
|
3
|
+
description: Write a feature spec — interactive Q&A, saves to .planning/specs/, runs Gate 1
|
|
4
|
+
argument-hint: "[feature name]"
|
|
5
|
+
preamble-tier: 3
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Spec: {{ args[0] | default: "unnamed feature" }}
|
|
9
|
+
|
|
10
|
+
You are running the **Spec workflow** — turn a feature idea into a clear, written spec that other commands (`/spartan:plan`, `/spartan:build`) can use.
|
|
11
|
+
|
|
12
|
+
The spec gets saved to `.planning/specs/{{ args[0] | default: "feature-name" }}.md`.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Step 0: Setup
|
|
17
|
+
|
|
18
|
+
Create the directory if it doesn't exist:
|
|
19
|
+
```bash
|
|
20
|
+
mkdir -p .planning/specs
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Check if a spec already exists:
|
|
24
|
+
```bash
|
|
25
|
+
ls .planning/specs/{{ args[0] | default: "feature-name" }}.md 2>/dev/null
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
If it exists, ask:
|
|
29
|
+
> "A spec for **{{ args[0] }}** already exists. Want to **update** it or **start fresh**?"
|
|
30
|
+
>
|
|
31
|
+
> - A) Update — I'll show you the current spec and we'll revise it
|
|
32
|
+
> - B) Start fresh — overwrite with a new spec
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Step 1: Understand the Problem
|
|
37
|
+
|
|
38
|
+
Ask these questions **one at a time**, not all at once. Wait for an answer before the next question.
|
|
39
|
+
|
|
40
|
+
1. **"What problem does this solve?"** — Not the feature. The pain. If the user says "add a profiles endpoint", ask what user problem it fixes.
|
|
41
|
+
|
|
42
|
+
2. **"Who's affected and how?"** — Get at least one concrete user story. Push for specifics: role, action, benefit.
|
|
43
|
+
|
|
44
|
+
3. **"What's out of scope?"** — Force the user to draw a line. What are we NOT building? This prevents scope creep later.
|
|
45
|
+
|
|
46
|
+
4. **"Any data or API changes needed?"** — Only ask if it's backend-touching. Skip for pure frontend or config changes.
|
|
47
|
+
|
|
48
|
+
5. **"What could go wrong?"** — Get at least 3 edge cases. Prompt with examples if the user is stuck: "What about empty data? Concurrent access? Permission denied?"
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Step 2: Fill the Template
|
|
53
|
+
|
|
54
|
+
Use the `feature-spec.md` template structure. Fill in every section from the user's answers.
|
|
55
|
+
|
|
56
|
+
The spec must have:
|
|
57
|
+
- **Problem** — 2-3 sentences, specific
|
|
58
|
+
- **Goal** — what success looks like
|
|
59
|
+
- **User Stories** — at least 1, in "As a [role]..." format
|
|
60
|
+
- **Requirements** — must-have, nice-to-have, out of scope
|
|
61
|
+
- **Data Model** — if applicable (tables, columns, types)
|
|
62
|
+
- **API Changes** — if applicable (endpoints, request/response)
|
|
63
|
+
- **UI Changes** — if applicable (screens, components)
|
|
64
|
+
- **Edge Cases** — at least 3
|
|
65
|
+
- **Testing Criteria** — happy path + edge case tests
|
|
66
|
+
- **Dependencies** — what this needs to work
|
|
67
|
+
|
|
68
|
+
Set the metadata:
|
|
69
|
+
```
|
|
70
|
+
**Created**: [today's date]
|
|
71
|
+
**Status**: draft
|
|
72
|
+
**Author**: [user's name or "team"]
|
|
73
|
+
**Epic**: [epic name if part of one, otherwise "none"]
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Step 3: Run Gate 1
|
|
79
|
+
|
|
80
|
+
Before saving, run the Gate 1 checklist from `quality-gates.md`:
|
|
81
|
+
|
|
82
|
+
**Completeness:**
|
|
83
|
+
- [ ] Problem is clearly stated (not vague)
|
|
84
|
+
- [ ] Goal is specific and measurable
|
|
85
|
+
- [ ] At least one user story exists
|
|
86
|
+
- [ ] Requirements split into must-have, nice-to-have, out of scope
|
|
87
|
+
- [ ] Out of scope section exists
|
|
88
|
+
|
|
89
|
+
**Data Model** (if applicable):
|
|
90
|
+
- [ ] New tables have standard columns (id, timestamps)
|
|
91
|
+
- [ ] Column types are correct
|
|
92
|
+
- [ ] Soft delete strategy is defined
|
|
93
|
+
|
|
94
|
+
**API Design** (if applicable):
|
|
95
|
+
- [ ] Endpoints follow project naming convention
|
|
96
|
+
- [ ] Request/response examples included
|
|
97
|
+
- [ ] JSON field naming matches project convention
|
|
98
|
+
|
|
99
|
+
**Quality:**
|
|
100
|
+
- [ ] Edge cases listed (at least 3)
|
|
101
|
+
- [ ] Testing criteria for happy path
|
|
102
|
+
- [ ] Testing criteria for edge cases
|
|
103
|
+
- [ ] Dependencies listed
|
|
104
|
+
|
|
105
|
+
If any item fails → fix it before saving. Don't skip the gate.
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Step 4: Save and Confirm
|
|
110
|
+
|
|
111
|
+
Save the spec to `.planning/specs/{{ args[0] | default: "feature-name" }}.md`.
|
|
112
|
+
|
|
113
|
+
Then tell the user:
|
|
114
|
+
|
|
115
|
+
> "Spec saved to `.planning/specs/{{ args[0] }}.md` — Gate 1 passed."
|
|
116
|
+
>
|
|
117
|
+
> **Next steps:**
|
|
118
|
+
> - Has UI work? → `/spartan:design {{ args[0] }}`
|
|
119
|
+
> - Ready to plan? → `/spartan:plan {{ args[0] }}`
|
|
120
|
+
> - Part of a bigger epic? → `/spartan:epic`
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Rules
|
|
125
|
+
|
|
126
|
+
- **One feature per spec.** If the user describes multiple features, suggest splitting into separate specs or using `/spartan:epic` first.
|
|
127
|
+
- **Ask questions one at a time.** Don't dump all 5 questions in one message.
|
|
128
|
+
- **Use the Structured Question Format** when asking for decisions: simplify → recommend → options (A/B/C) → one decision per turn.
|
|
129
|
+
- **Be specific.** Push back on vague answers. "Make it faster" → "What's the target latency?"
|
|
130
|
+
- **Gate 1 is not optional.** Every spec must pass before saving.
|
|
131
|
+
- **Auto mode on?** → Still ask the questions, but skip the "anything to change?" confirmation. Show the spec and save it.
|
|
@@ -208,7 +208,7 @@ Ask: **"This is the final scope. Ready to build?"**
|
|
|
208
208
|
|
|
209
209
|
Based on the T-shirt size from Phase 4, route to the right build command:
|
|
210
210
|
|
|
211
|
-
- **S (< 1 day):** "Run `/spartan:
|
|
211
|
+
- **S (< 1 day):** "Run `/spartan:spec` then `/spartan:build` with this scope to start building."
|
|
212
212
|
- **M-L (1-7 days):** "Run `/spartan:project new` to set up the full project lifecycle."
|
|
213
213
|
- **XL (> 1 week):** "Run `/spartan:project new` — this needs milestones and wave planning."
|
|
214
214
|
|
|
@@ -42,7 +42,7 @@ Create a new parallel workstream for independent work.
|
|
|
42
42
|
**Run:** `/gsd:workstreams create {{ args[1] | default: "<name>" }}`
|
|
43
43
|
|
|
44
44
|
After creation, tell the user:
|
|
45
|
-
"Workstream '{{ args[1] | default: "<name>" }}' created. You are now working in this workstream. Next step: `/spartan:project new` or `/spartan:
|
|
45
|
+
"Workstream '{{ args[1] | default: "<name>" }}' created. You are now working in this workstream. Next step: `/spartan:project new` or `/spartan:spec` to start work."
|
|
46
46
|
|
|
47
47
|
{% elif args[0] == "switch" %}
|
|
48
48
|
## Switch Workstream: {{ args[1] | default: "<name>" }}
|
package/commands/spartan.md
CHANGED
|
@@ -104,7 +104,7 @@ Route here when the user wants a specific tool, not a full workflow.
|
|
|
104
104
|
**Planning & project management:**
|
|
105
105
|
| User says... | Route to |
|
|
106
106
|
|---|---|
|
|
107
|
-
| "plan a task"
|
|
107
|
+
| "plan a task", "write a spec" | `/spartan:spec` → `/spartan:plan` |
|
|
108
108
|
| "big project", "multi-day", "new milestone" | `/spartan:project new` |
|
|
109
109
|
| "continue phase", "next phase" | `/spartan:phase` |
|
|
110
110
|
| "workstreams", "parallel work" | `/spartan:workstreams` |
|
package/package.json
CHANGED
package/packs/core.yaml
CHANGED
|
@@ -8,10 +8,11 @@
|
|
|
8
8
|
"comingSoon": false,
|
|
9
9
|
"depends": [],
|
|
10
10
|
"commands": [
|
|
11
|
+
"spec",
|
|
12
|
+
"plan",
|
|
11
13
|
"build",
|
|
12
14
|
"fix",
|
|
13
15
|
"onboard",
|
|
14
|
-
"quickplan",
|
|
15
16
|
"daily",
|
|
16
17
|
"context-save",
|
|
17
18
|
"update",
|
|
@@ -175,6 +176,7 @@
|
|
|
175
176
|
"comingSoon": false,
|
|
176
177
|
"depends": [],
|
|
177
178
|
"commands": [
|
|
179
|
+
"epic",
|
|
178
180
|
"project",
|
|
179
181
|
"phase",
|
|
180
182
|
"workstreams",
|
package/packs/project-mgmt.yaml
CHANGED
package/templates/epic.md
CHANGED
|
@@ -96,5 +96,5 @@ What could block us or go wrong?
|
|
|
96
96
|
|-----------|-----|
|
|
97
97
|
| Big feature set (3+ features, multi-week) | This epic template |
|
|
98
98
|
| Single feature (1-3 days) | Skip epic, start with `feature-spec.md` |
|
|
99
|
-
| Quick task (< 1 day) | Skip
|
|
99
|
+
| Quick task (< 1 day) | Skip epic, use `/spartan:spec` → `/spartan:build` |
|
|
100
100
|
| Product-level vision doc for stakeholders | Use `prd-template.md` instead |
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: spartan:quickplan
|
|
3
|
-
description: Fast-forward planning — scaffold spec + plan + branch in one shot for tasks too small for full GSD lifecycle but too important to skip planning.
|
|
4
|
-
argument-hint: "[task description]"
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Quick Plan: {{ args[0] }}
|
|
8
|
-
|
|
9
|
-
You are running a **fast-forward planning session** — inspired by OpenSpec's `/opsx:ff`.
|
|
10
|
-
Goal: go from idea → actionable plan in one pass, without multi-step ceremony.
|
|
11
|
-
|
|
12
|
-
This command is for tasks that are:
|
|
13
|
-
- Too small for a full GSD milestone (< 1 day of work)
|
|
14
|
-
- Too important to just "vibe code" without a plan
|
|
15
|
-
- Self-contained with clear scope
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
## Step 1: Research (parallel, 2 min)
|
|
20
|
-
|
|
21
|
-
Run these two investigations simultaneously using subagents:
|
|
22
|
-
|
|
23
|
-
**Subagent A — Codebase scan:**
|
|
24
|
-
- Find all files relevant to: {{ args[0] }}
|
|
25
|
-
- Identify existing patterns, conventions already in use
|
|
26
|
-
- Note any tests that might be affected
|
|
27
|
-
|
|
28
|
-
**Subagent B — Impact analysis:**
|
|
29
|
-
- What could break?
|
|
30
|
-
- Any DB migrations needed?
|
|
31
|
-
- API contract changes?
|
|
32
|
-
- Dependencies between services?
|
|
33
|
-
|
|
34
|
-
---
|
|
35
|
-
|
|
36
|
-
## Step 2: Generate Spec (inline, no file needed)
|
|
37
|
-
|
|
38
|
-
Present a concise spec in this format. Keep it under 30 lines:
|
|
39
|
-
|
|
40
|
-
```markdown
|
|
41
|
-
## Spec: [task name]
|
|
42
|
-
|
|
43
|
-
**Goal:** [one sentence — what success looks like]
|
|
44
|
-
|
|
45
|
-
**Scope:**
|
|
46
|
-
- IN: [what will be built]
|
|
47
|
-
- OUT: [what is explicitly NOT in scope]
|
|
48
|
-
|
|
49
|
-
**Acceptance criteria:**
|
|
50
|
-
1. [testable criterion]
|
|
51
|
-
2. [testable criterion]
|
|
52
|
-
3. [testable criterion]
|
|
53
|
-
|
|
54
|
-
**Approach:** [2-3 sentences on implementation approach]
|
|
55
|
-
|
|
56
|
-
**Risks / unknowns:** [any?]
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
Ask: "Does this spec match your intent? Any changes before we plan?"
|
|
60
|
-
**Auto mode on?** → Skip this question, continue immediately. Show spec but don't wait.
|
|
61
|
-
**Auto mode off (default)?** → Wait for approval. If the user says "yes" / "go" / "lgtm" → continue.
|
|
62
|
-
|
|
63
|
-
---
|
|
64
|
-
|
|
65
|
-
## Step 3: Generate Plan (immediately after spec approval)
|
|
66
|
-
|
|
67
|
-
Break into **max 4 atomic tasks**. Each task must:
|
|
68
|
-
- Be completable in one commit
|
|
69
|
-
- Have a clear verification step
|
|
70
|
-
- Follow TDD (test first)
|
|
71
|
-
|
|
72
|
-
Format:
|
|
73
|
-
```markdown
|
|
74
|
-
## Plan: [task name]
|
|
75
|
-
Branch: feature/[ticket-or-slug]
|
|
76
|
-
|
|
77
|
-
### Task 1: [name]
|
|
78
|
-
Files: [exact file paths]
|
|
79
|
-
Test first: [what test to write]
|
|
80
|
-
Implementation: [what to change]
|
|
81
|
-
Commit: feat([scope]): [message]
|
|
82
|
-
Verify: [how to confirm it works]
|
|
83
|
-
|
|
84
|
-
### Task 2: ...
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
---
|
|
88
|
-
|
|
89
|
-
## Step 4: Create branch + first test
|
|
90
|
-
|
|
91
|
-
```bash
|
|
92
|
-
git checkout -b feature/[slug]
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
Then immediately write the first failing test for Task 1.
|
|
96
|
-
Do NOT write any production code yet.
|
|
97
|
-
|
|
98
|
-
Show the red test output, then:
|
|
99
|
-
**Auto mode on?** → Immediately start executing task by task. Don't wait.
|
|
100
|
-
**Auto mode off?** → Say "Plan is ready. Say **'go'** to start executing task by task, or **'adjust'** to modify the plan."
|
|
101
|
-
|
|
102
|
-
---
|
|
103
|
-
|
|
104
|
-
## Execution mode (after "go")
|
|
105
|
-
|
|
106
|
-
Execute each task in sequence:
|
|
107
|
-
1. Write test → confirm it fails (red)
|
|
108
|
-
2. Write minimal implementation → confirm test passes (green)
|
|
109
|
-
3. Refactor if needed
|
|
110
|
-
4. Commit with atomic message
|
|
111
|
-
5. Show summary, move to next task
|
|
112
|
-
|
|
113
|
-
After all tasks: run full test suite, then say:
|
|
114
|
-
"All tasks complete. Ready for `/spartan:pr-ready` to prep the PR."
|
|
115
|
-
|
|
116
|
-
## Rules
|
|
117
|
-
|
|
118
|
-
- Max 4 tasks — if you need more, the scope is too big for quickplan
|
|
119
|
-
- Every task must be one commit
|
|
120
|
-
- Test first (TDD) — write the failing test before the implementation
|
|
121
|
-
- Don't skip the spec approval step unless auto mode is on
|
|
122
|
-
- Keep the spec under 30 lines — if it's longer, use `/spartan:phase` instead
|