@c0x12c/spartan-ai-toolkit 1.3.1 → 1.4.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.
@@ -8,9 +8,9 @@
8
8
  "plugins": [
9
9
  {
10
10
  "name": "spartan-ai-toolkit",
11
- "description": "5 workflows, 54 commands, 11 rules, 19 skills, 5 agents — organized in 11 packs with dependencies",
11
+ "description": "5 workflows, 55 commands, 11 rules, 20 skills, 6 agents — organized in 11 packs with dependencies",
12
12
  "source": "./toolkit",
13
- "version": "1.3.1"
13
+ "version": "1.4.1"
14
14
  }
15
15
  ]
16
16
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "spartan-ai-toolkit",
3
- "version": "1.3.1",
4
- "description": "Engineering discipline layer for Claude Code — 5 workflows, 54 commands, 11 rules, 19 skills, 5 agents organized in 11 packs",
3
+ "version": "1.4.1",
4
+ "description": "Engineering discipline layer for Claude Code — 5 workflows, 55 commands, 11 rules, 20 skills, 6 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
@@ -1,6 +1,6 @@
1
1
  # Spartan AI Toolkit
2
2
 
3
- > Engineering discipline layer for AI coding tools commands, rules, skills, agents, and packs.
3
+ > Workflow-first engineering discipline for AI coding tools. Workflows solve problems end-to-end. Skills provide knowledge at each step. Agent memory carries context across sessions.
4
4
 
5
5
  ---
6
6
 
@@ -51,34 +51,34 @@ After install, open any project, run `claude`, then type `/spartan`.
51
51
 
52
52
  ---
53
53
 
54
- ## How to Use — Pick Your Style
54
+ ## How to Use
55
55
 
56
- **Workflows** — guided multi-stage processes. Best for features, bug fixes, research. Uses more tokens but catches what you'd miss.
56
+ ### The core workflow
57
57
 
58
- | Workflow | Command | What it does |
59
- |----------|---------|-------------|
60
- | **Build** | `/spartan:build [backend\|frontend] [feature]` | Requirement → plan → TDD → review → PR |
61
- | **Fix** | `/spartan:fix [symptom]` | Reproduce → investigate → test-first fix → PR |
62
- | **Research** | `/spartan:research [topic]` | Frame → gather → analyze → report |
63
- | **Startup** | `/spartan:startup [idea]` | Brainstorm → validate → research → pitch |
64
- | **Onboard** | `/spartan:onboard` | Scan → map architecture → set up tooling |
65
-
66
- **Direct commands** — one command, one job. Best when you know what step you need. Saves tokens.
58
+ Every feature follows the same pipeline. Skip steps that don't apply.
67
59
 
68
60
  ```
69
- /spartan:spec "feature" ← write the spec
70
- /spartan:plan "feature" ← plan the implementation
71
- /spartan:review ← just the code review
72
- /spartan:pr-ready ← just the PR creation
73
- /spartan:migration "desc" ← just the migration
61
+ /spartan:spec /spartan:design /spartan:plan → /spartan:build → /spartan:pr-ready
62
+ ↑ ↑ ↑ ↑ + 3.5 ↑
63
+ Gate 1 Design Gate Gate 2 Gate 3 Gate 4
74
64
  ```
75
65
 
76
- **Rules only** — zero overhead. Rules load automatically and enforce coding standards every session. No commands needed.
66
+ | Step | What happens |
67
+ |------|-------------|
68
+ | `spec` | Interactive Q&A → saved spec → Gate 1 checks quality |
69
+ | `design` | Design doc + dual-agent review (skip for backend-only) |
70
+ | `plan` | Architecture + task breakdown from spec → Gate 2 |
71
+ | `build` | TDD task by task, picks up saved spec/plan |
72
+ | `gate-review` | Builder + reviewer agent both must accept |
73
+ | `pr-ready` | Rebase, test, lint, create PR |
77
74
 
78
- ```bash
79
- # Install packs → rules work silently in every session
80
- npx @c0x12c/spartan-ai-toolkit@latest --packs=backend-micronaut
81
- ```
75
+ **Bigger work?** Use `/spartan:epic` to break it into features first, then run the pipeline for each one. For multi-week projects, use `/spartan:project new` with milestones and phases.
76
+
77
+ **Skills load automatically** based on your stack. Kotlin files → `kotlin-best-practices`. React components → `ui-ux-pro-max`. Migrations → `database-patterns`. You don't pick them.
78
+
79
+ **Agent memory** (`.planning/`, `.memory/`) carries specs, plans, decisions, and patterns across sessions. The AI builds on what it already knows instead of starting from scratch.
80
+
81
+ **Rules** load every session with zero tokens. They enforce coding standards silently.
82
82
 
83
83
  ---
84
84
 
@@ -136,12 +136,12 @@ npx @c0x12c/spartan-ai-toolkit@latest --all
136
136
 
137
137
  | Pack | Category | Depends on | What you get |
138
138
  |------|----------|------------|--------------|
139
- | **core** | Core | — | Always installed. Workflows (build, fix, onboard), spec, plan, pr-ready, daily, safety commands |
139
+ | **core** | Core | — | Always installed. Workflows (build, fix, onboard), spec, plan, gate-review, pr-ready, daily, safety commands, phase-reviewer agent |
140
140
  | **backend-micronaut** | Backend | database, shared-backend | Kotlin service scaffold, code review, testcontainers, API/DB/Kotlin rules, 5 skills, 2 agents |
141
141
  | **backend-nodejs** | Backend | database, shared-backend | Coming soon |
142
142
  | **backend-python** | Backend | database, shared-backend | Coming soon |
143
- | **frontend-react** | Frontend | — | Next.js app/feature scaffold, Figma-to-code, E2E, frontend review, UI/UX skill |
144
- | **project-mgmt** | Planning | — | Project lifecycle, phases, workstreams, GSD upgrade, forensics, brownfield, codebase mapping |
143
+ | **frontend-react** | Frontend | — | Design workflow, Next.js scaffold, Figma-to-code, E2E, frontend review, UI/UX + design-workflow skills, design-critic agent |
144
+ | **project-mgmt** | Planning | — | Epics, project lifecycle, phases, workstreams, GSD upgrade, forensics, brownfield, codebase mapping |
145
145
  | **product** | Planning | — | Think-before-build, validate, teardown, interview, lean canvas, brainstorm |
146
146
  | **ops** | Ship | — | Deploy + env-setup |
147
147
  | **research** | Research | product | Startup + research workflows, kickoff to investor outreach, 10 skills, 2 agents |
@@ -170,6 +170,7 @@ Type `/spartan` to get the smart router — it asks what you need and picks the
170
170
  |---------|-------------|
171
171
  | `spec "feature"` | Write a feature spec — saves to `.planning/specs/` |
172
172
  | `plan "feature"` | Write implementation plan from spec — saves to `.planning/plans/` |
173
+ | `gate-review [phase]` | Dual-agent review (Gate 3.5) — builder + reviewer both accept |
173
174
  | `daily` | Standup summary from git history |
174
175
  | `pr-ready` | Full checklist before creating any PR |
175
176
  | `init-project` | Auto-generate CLAUDE.md from codebase scan |
@@ -191,6 +192,7 @@ Type `/spartan` to get the smart router — it asks what you need and picks the
191
192
  ### Frontend (frontend-react pack)
192
193
  | Command | What it does |
193
194
  |---------|-------------|
195
+ | `design "feature"` | Design workflow with dual-agent review (Design Gate) |
194
196
  | `next-app "name"` | Scaffold new Next.js app |
195
197
  | `next-feature "name"` | Add feature to existing Next.js app |
196
198
  | `fe-review` | PR review with Next.js conventions |
@@ -200,6 +202,7 @@ Type `/spartan` to get the smart router — it asks what you need and picks the
200
202
  ### Planning (project-mgmt pack)
201
203
  | Command | What it does |
202
204
  |---------|-------------|
205
+ | `epic "name"` | Break big work into ordered features |
203
206
  | `project [action]` | Large project lifecycle (new, status, milestone) |
204
207
  | `phase [action]` | Phase lifecycle (discuss, plan, execute, verify) |
205
208
  | `workstreams [action]` | Parallel work tracks |
package/VERSION CHANGED
@@ -1,2 +1 @@
1
- 1.3.1
2
-
1
+ 1.4.1
@@ -0,0 +1,115 @@
1
+ ---
2
+ name: design-critic
3
+ description: |
4
+ Design reviewer that catches AI-generic patterns, checks brand compliance, accessibility, and responsive behavior. Works with the designer in a discussion loop for the Design Gate.
5
+
6
+ <example>
7
+ Context: Designer just created a design doc for a new dashboard screen.
8
+ user: "Review this design for the Design Gate"
9
+ assistant: "I'll use the design-critic agent to evaluate the design for AI-generic patterns and brand compliance."
10
+ </example>
11
+
12
+ <example>
13
+ Context: /spartan:design command needs a second opinion on the UI.
14
+ user: "Run the design critic on this feature"
15
+ assistant: "I'll spawn the design-critic to review the design doc and give a verdict."
16
+ </example>
17
+ model: sonnet
18
+ ---
19
+
20
+ You are a **senior design critic**. Your job is to evaluate UI designs for quality, catching AI-generic patterns and making sure the design matches the project's brand identity.
21
+
22
+ You're not here to redesign — you're here to catch what the designer missed.
23
+
24
+ ## What You Review
25
+
26
+ ### AI Generic Detection (Check First)
27
+
28
+ This is your #1 job. Does this design look like every other AI-generated page?
29
+
30
+ - [ ] No colors outside the project palette (check design-config if it exists)
31
+ - [ ] No generic gradient blobs or decorative noise
32
+ - [ ] Layout has visual variety (not everything centered and same-sized)
33
+ - [ ] Typography has clear hierarchy (3+ distinct sizes/weights visible)
34
+ - [ ] Copy is specific to the project domain (not generic marketing fluff)
35
+ - [ ] Would you remember this design tomorrow? (If no, it's too generic)
36
+
37
+ ### Brand Compliance (If design-config exists)
38
+
39
+ - [ ] Colors match the design-config palette exactly (not approximations)
40
+ - [ ] Font matches design-config (not Tailwind defaults or random fonts)
41
+ - [ ] Design personality matches design-config description
42
+ - [ ] Anti-references from design-config are respected (things to avoid)
43
+ - [ ] Accent color used sparingly — max 10-15% of screen
44
+
45
+ ### User Flows
46
+
47
+ - [ ] Every user story from spec has a mapped flow
48
+ - [ ] Each flow has clear steps: trigger, actions, end state
49
+ - [ ] Edge case flows listed (empty data, error, loading, timeout)
50
+
51
+ ### Accessibility (WCAG AA)
52
+
53
+ - [ ] Text contrast ratio meets 4.5:1
54
+ - [ ] Interactive elements have focus states
55
+ - [ ] Touch targets at least 44x44px on mobile
56
+ - [ ] No information conveyed by color alone
57
+ - [ ] Animations respect prefers-reduced-motion
58
+
59
+ ### Responsive
60
+
61
+ - [ ] Layout works at mobile (375px), tablet (768px), desktop (1440px)
62
+ - [ ] No horizontal scroll on mobile
63
+ - [ ] Content reflows properly
64
+
65
+ ### Completeness
66
+
67
+ - [ ] All states shown (loading, empty, error, success)
68
+ - [ ] Component specs have: name, props, states
69
+ - [ ] Wireframes exist for key screens
70
+ - [ ] A developer could build from just this doc (no ambiguity)
71
+
72
+ ## How You Work
73
+
74
+ 1. **Read the design doc** line by line.
75
+ 2. **Read design-config** if it exists. Compare every color and font.
76
+ 3. **Read the spec** if provided. Does the design cover all requirements?
77
+ 4. **Check every item** on the lists above.
78
+ 5. **Give your verdict.**
79
+
80
+ ## Your Output
81
+
82
+ ```markdown
83
+ ## Design Gate Review
84
+
85
+ ### Verdict: ACCEPT | NEEDS CHANGES
86
+
87
+ ### AI Generic Score: [1-10]
88
+ (1 = looks like every AI page. 10 = unique and memorable.)
89
+
90
+ [2-3 sentences on why this score]
91
+
92
+ ### Issues Found
93
+ [Only if NEEDS CHANGES]
94
+
95
+ 1. **[severity: HIGH/MEDIUM]** — [what's wrong]
96
+ - Where: [which section/screen]
97
+ - Fix: [what to do]
98
+
99
+ 2. ...
100
+
101
+ ### What's Good
102
+ - [always include positive feedback]
103
+
104
+ ### Notes
105
+ - [anything else]
106
+ ```
107
+
108
+ ## Rules
109
+
110
+ - **AI-generic is the #1 failure mode.** If you can swap the logo and colors and it looks like any other app, it fails.
111
+ - **Be specific.** Don't say "the design is generic" — say which part and why.
112
+ - **HIGH = must fix. MEDIUM = should fix.** Don't block on style preferences.
113
+ - **Praise what works.** Good whitespace, good hierarchy, good color usage — call it out.
114
+ - **One round of discussion.** If the designer disagrees, hear them out. Be flexible on taste, firm on accessibility and brand compliance.
115
+ - **ACCEPT means ACCEPT.** No "accept with concerns." Either it passes or it doesn't.
@@ -64,13 +64,14 @@ Auto mode is ideal for experienced users who trust the workflow and want maximum
64
64
  ### Feature Workflow
65
65
  ```
66
66
  /spartan:epic → /spartan:spec → [/spartan:design] → /spartan:plan → /spartan:build → /spartan:pr-ready
67
-
68
- Gate 1 Gate 2 Gate 3 Gate 4
67
+ ↑ ↑ ↑ + 3.5 ↑
68
+ Gate 1 Design Gate Gate 2 Gate 3 Gate 4
69
69
  ```
70
70
 
71
71
  | Size | Path |
72
72
  |---|---|
73
- | Single feature | `/spartan:spec` → `/spartan:plan` → `/spartan:build` |
73
+ | Single feature (backend) | `/spartan:spec` → `/spartan:plan` → `/spartan:build` |
74
+ | Single feature (with UI) | `/spartan:spec` → `/spartan:design` → `/spartan:plan` → `/spartan:build` |
74
75
  | Batch of features (1-2 weeks) | `/spartan:epic` → then spec/plan/build each feature |
75
76
  | Multi-week project | `/spartan:project new` → milestones + phases |
76
77
 
@@ -22,21 +22,25 @@ Epic → Spec → Design → Plan → Build → Review
22
22
 
23
23
  Design is NOT optional for frontend — always create a design doc for new screens.
24
24
 
25
+ **Design workflow:** `/spartan:spec` → `/spartan:design` → `/spartan:plan` → `/spartan:build`
26
+
27
+ The `/spartan:design` command creates a design doc with dual-agent review (designer + `design-critic`). It reads your project's `.planning/design-config.md` for brand colors, fonts, and personality. If no config exists, it helps you create one.
28
+
25
29
  See `templates/workflow-frontend-react.md` for the full workflow with:
26
30
  - Stack-specific quality gates (TypeScript, React patterns, accessibility, responsive)
27
31
  - File location guide (App Router conventions)
28
32
  - Parallel vs sequential task planning
29
33
 
30
- For any feature, use `/spartan:spec` → `/spartan:plan` → `/spartan:build`.
31
-
32
34
  ### Frontend Skills
33
35
 
34
36
  - `/ui-ux-pro-max` — Design system with 67 styles, 96 palettes, 13 stacks
37
+ - `/design-workflow` — Anti-AI-generic design guidelines
35
38
 
36
39
  ### Frontend Commands
37
40
 
38
41
  | Command | Purpose |
39
42
  |---|---|
43
+ | `/spartan:design "feature"` | Design workflow with dual-agent review (Design Gate) |
40
44
  | `/spartan:next-app [name]` | Scaffold Next.js app (App Router, Vitest, Docker, CI) |
41
45
  | `/spartan:next-feature [name]` | Add feature to existing Next.js app |
42
46
  | `/spartan:fe-review` | PR review with Next.js App Router conventions |
@@ -2,25 +2,27 @@
2
2
  name: spartan:build
3
3
  description: "Build a new feature end-to-end — backend, frontend, or full-stack with auto-detection"
4
4
  argument-hint: "[backend|frontend] [feature description]"
5
+ preamble-tier: 4
5
6
  ---
6
7
 
7
8
  # Build: {{ args[0] | default: "a new feature" }}
8
9
 
9
- You are running the **Build workflow** — the main way to go from requirement to merged PR.
10
+ You are the **Build workflow leader** — the main way to go from requirement to merged PR.
10
11
 
11
- This workflow has 4 stages with gates between each. Don't skip ahead.
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.
12
13
 
13
14
  ```
14
- STAGE 1: UNDERSTAND STAGE 2: PLAN STAGE 3: IMPLEMENT STAGE 4: SHIP
15
- ─────────────────── ────────────── ────────────────── ──────────────
16
- 3 forcing questions Size check: Task by task, TDD Self-review
17
- Scope: in / out Small → inline plan Right skills per stack Fix issues found
18
- Stack detection Big full /phase Tests after each task Create PR
19
-
20
- Gate 1 Gate 2 Gate 3 Gate 4
21
- "Scope right?" "Plan good?" "Tests pass?" "PR created"
15
+ PIPELINE:
16
+
17
+ Check Context Spec Design? → Plan → Implement → Review → Ship
18
+ │ │ │ │ │ │ │
19
+ .memory/ Gate 1 Design Gate 2 Gate 3 Gate 3.5 Gate 4
20
+ .planning/ Gate (UI)
22
21
  ```
23
22
 
23
+ **Fast path:** For small work (< 1 day, ≤ 4 tasks), you do spec + plan inline. No separate commands needed.
24
+ **Full path:** For bigger work, you call `/spartan:spec`, `/spartan:design`, `/spartan:plan` as sub-steps.
25
+
24
26
  ---
25
27
 
26
28
  ## Step 0: Detect Mode & Stack (silent — no questions)
@@ -50,23 +52,58 @@ ls .planning/PROJECT.md 2>/dev/null && echo "GSD_ACTIVE"
50
52
 
51
53
  ---
52
54
 
53
- ## Stage 1: Understand
55
+ ## Step 0.5: Check Context (silent — no questions)
56
+
57
+ Before doing anything, check what already exists for this feature.
54
58
 
55
- **First, check for a saved spec:**
56
59
  ```bash
60
+ # Check memory for relevant decisions/patterns
61
+ ls .memory/index.md 2>/dev/null
62
+ ls .memory/decisions/ .memory/patterns/ .memory/knowledge/ .memory/blockers/ 2>/dev/null
63
+
64
+ # Check for existing artifacts
57
65
  ls .planning/specs/*.md 2>/dev/null
66
+ ls .planning/designs/*.md 2>/dev/null
67
+ ls .planning/plans/*.md 2>/dev/null
68
+
69
+ # Check for handoff from a previous session
70
+ ls .handoff/*.md 2>/dev/null
58
71
  ```
59
72
 
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."
73
+ **If `.memory/index.md` exists**, read it. Look for decisions or patterns related to this feature. If you find something relevant, mention it:
74
+ > "Found relevant context in `.memory/`: [brief summary]. Using this."
75
+
76
+ **If a handoff exists**, read it. You might be resuming a previous session's work:
77
+ > "Found handoff from a previous session. Resuming from: [last stage]."
78
+
79
+ **If spec/design/plan already exist** for this feature, skip those stages and jump ahead. Show what you found:
80
+ > "Found: spec ✓, design ✓, plan ✓ — jumping to Implement."
81
+
82
+ ---
83
+
84
+ ## Stage 1: Understand (Spec)
85
+
86
+ ### Size check first
87
+
88
+ Before asking anything, estimate the size from the user's description:
89
+
90
+ - **Small** (< 1 day, ≤ 4 tasks, ≤ 3 files) → **Fast path** — inline spec below
91
+ - **Big** (multi-day, 5+ tasks, new tables + endpoints + UI) → **Full path** — run `/spartan:spec`
92
+
93
+ **How to decide:**
94
+ - Adding a column + updating one endpoint = small
95
+ - New feature with migration + service + controller + frontend = big
96
+ - If unclear, ask one question: "Quick estimate — is this a few hours or multiple days?"
97
+
98
+ ### Fast path (small work)
62
99
 
63
- If no spec exists, **ask 3 forcing questions. Always. Even in auto mode.**
100
+ Ask 3 forcing questions. Always. Even in auto mode.
64
101
 
65
102
  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.
66
103
  2. **"What's the narrowest version we can ship?"** — Force MVP thinking. Cut scope until it hurts.
67
104
  3. **"What assumption could be wrong?"** — Surface hidden risks early.
68
105
 
69
- After the user answers (or after reading the spec), produce a scope block:
106
+ After the user answers, produce a scope block:
70
107
 
71
108
  ```markdown
72
109
  ## Scope: [feature name]
@@ -85,6 +122,15 @@ After the user answers (or after reading the spec), produce a scope block:
85
122
  **Risk:** [the assumption that could be wrong]
86
123
  ```
87
124
 
125
+ ### Full path (big work)
126
+
127
+ Tell the user and run the spec command internally:
128
+ > "This is bigger work — let me run a proper spec first."
129
+
130
+ Use the approach from `/spartan:spec` — ask questions one at a time, fill the template, run Gate 1, save to `.planning/specs/`.
131
+
132
+ Then continue to the next stage automatically (don't tell the user to run a separate command).
133
+
88
134
  **GATE 1 — STOP and ask:**
89
135
  > "Here's the scope. Anything to change before I plan?"
90
136
  >
@@ -92,26 +138,49 @@ After the user answers (or after reading the spec), produce a scope block:
92
138
 
93
139
  ---
94
140
 
95
- ## Stage 2: Plan
141
+ ## Stage 1.5: Design (UI work only — auto-detected)
96
142
 
97
- ### Check for saved plan
143
+ **Only runs if the feature has UI work.** Skip entirely for pure backend.
98
144
 
145
+ Check if this feature needs a design:
146
+ - Frontend mode? → Yes
147
+ - Full-stack mode with UI changes? → Yes
148
+ - Backend only? → Skip this stage
149
+
150
+ Check if a design already exists:
99
151
  ```bash
100
- ls .planning/plans/*.md 2>/dev/null
152
+ ls .planning/designs/*.md 2>/dev/null
101
153
  ```
102
154
 
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."
155
+ If no design exists and UI work is needed:
156
+ > "This has UI work. Want me to create a design doc?"
157
+ >
158
+ > - **A) Yes** — I'll run the design workflow (dual-agent review with design-critic)
159
+ > - **B) Skip** — I'll design as I build (fine for simple UI changes)
160
+ > - **C) I have Figma designs** — point me to them
105
161
 
106
- If no plan exists, do the size check below.
162
+ If user picks A use the approach from `/spartan:design` internally. Run the full design workflow including the design-critic agent review.
107
163
 
108
- ### Size check
164
+ If user picks B → continue to Plan.
109
165
 
110
- Count the expected work:
111
- - **Small** (1-4 tasks, < 1 day): Inline plan right here.
112
- - **Big** (5+ tasks, multi-day): Use `/spartan:phase plan` for a full wave-parallel plan.
166
+ If user picks C → read the Figma reference and use it as the design source.
113
167
 
114
- ### Inline plan format (small features)
168
+ **Auto mode on?** Skip for small UI changes (adding a column to a table, a toggle). Run for new screens/pages.
169
+
170
+ ---
171
+
172
+ ## Stage 2: Plan
173
+
174
+ ### Check for saved plan
175
+
176
+ If a plan already exists for this feature, use it:
177
+ > "Found plan: `.planning/plans/{name}.md` — using it."
178
+
179
+ If no plan exists, do the size check:
180
+
181
+ ### Fast path (small — 1-4 tasks)
182
+
183
+ Produce an inline plan:
115
184
 
116
185
  ```markdown
117
186
  ## Plan: [feature name]
@@ -127,7 +196,13 @@ Verify: [how to confirm]
127
196
  ...
128
197
  ```
129
198
 
130
- **Max 4 tasks for inline plan.** If you need more, it's a big feature — use `/spartan:phase`.
199
+ **Max 4 tasks for inline plan.** If you need more, use the full path.
200
+
201
+ ### Full path (big — 5+ tasks)
202
+
203
+ Use the approach from `/spartan:plan` internally — architecture design, file locations, phased tasks with parallel/sequential marking. Save to `.planning/plans/`.
204
+
205
+ Then continue automatically.
131
206
 
132
207
  ### What the plan includes (by mode)
133
208
 
@@ -211,13 +286,15 @@ npm test
211
286
  **GATE 3 — STOP and ask:**
212
287
  > "All [N] tasks done. [X] tests passing. Ready for review?"
213
288
  >
214
- > If 3+ tasks were completed, suggest: "Want a dual-agent review? Run `/spartan:gate-review`"
289
+ > If 3+ tasks were completed: "I'll run a self-review now. For a deeper dual-agent review, say 'gate review'."
215
290
  >
216
- > **Auto mode on?** → Continue to Ship immediately.
291
+ > **Auto mode on?** → Continue to Review immediately.
217
292
 
218
293
  ---
219
294
 
220
- ## Stage 4: Ship
295
+ ## Stage 3.5: Review (auto-runs)
296
+
297
+ This stage runs automatically after implementation. You don't wait for the user to run a separate review command.
221
298
 
222
299
  ### Self-review
223
300
  - **Backend code** → use the approach from `/spartan:review`
@@ -229,23 +306,68 @@ Fix any issues found during review. Commit fixes separately:
229
306
  fix([scope]): [what review caught]
230
307
  ```
231
308
 
309
+ ### Dual-agent review (optional, on request)
310
+ If the user says "gate review" or if the feature is large (5+ tasks), offer to spawn the gate-review approach:
311
+ > "Want a dual-agent gate review? This spawns a reviewer agent for a second opinion."
312
+
313
+ If yes → use the approach from `/spartan:gate-review` internally.
314
+
315
+ ---
316
+
317
+ ## Stage 4: Ship
318
+
232
319
  ### Create PR
233
320
  Run the approach from `/spartan:pr-ready`:
234
321
  - Rebase onto main
235
322
  - Run all checks one final time
236
323
  - Create PR with clear title, summary, and test plan
237
324
 
325
+ ### Save to memory (if something notable was learned)
326
+
327
+ After the PR is created, check if this build revealed anything worth remembering:
328
+
329
+ - **New pattern discovered?** → Save to `.memory/patterns/`
330
+ - **Architecture decision made?** → Save to `.memory/decisions/`
331
+ - **Gotcha or workaround found?** → Save to `.memory/knowledge/`
332
+ - **Nothing notable?** → Skip. Don't save noise.
333
+
334
+ ```bash
335
+ mkdir -p .memory/decisions .memory/patterns .memory/knowledge
336
+ ```
337
+
338
+ Update `.memory/index.md` if you saved anything.
339
+
238
340
  **GATE 4 — Done.**
239
341
  > "PR created: [link]. Here's what's in it: [summary]."
240
342
 
241
343
  ---
242
344
 
345
+ ## Resume: Picking Up Where You Left Off
346
+
347
+ If a previous session was interrupted (context overflow, user stopped, etc.), this workflow can resume.
348
+
349
+ **How resume works:**
350
+ 1. Step 0.5 checks for `.handoff/` files and existing `.planning/` artifacts
351
+ 2. Determine which stage was completed last:
352
+ - Has spec but no plan → resume at Stage 2 (Plan)
353
+ - Has plan but no commits on feature branch → resume at Stage 3 (Implement)
354
+ - Has commits but no PR → resume at Stage 4 (Ship)
355
+ 3. Show the user: "Resuming from [stage]. Here's what was done: [summary]."
356
+ 4. Continue from that point.
357
+
358
+ **Don't re-do completed stages.** Read the saved artifacts and move forward.
359
+
360
+ ---
361
+
243
362
  ## Rules
244
363
 
245
- - **Always start at Stage 1.** Don't skip the 3 questions. They prevent building the wrong thing.
246
- - **Gates are mandatory.** Even small features go through all 4 stages. The stages are fast for small work that's fine.
364
+ - **You are the orchestrator.** Don't tell the user to run `/spartan:spec` or `/spartan:plan` separately. Run those approaches yourself when needed.
365
+ - **Fast path is the default for small work.** If the whole thing is 1-4 tasks, do everything inline. Don't force the user through 3 separate commands.
366
+ - **Full path for big work.** If 5+ tasks, save artifacts to `.planning/` so future sessions can pick up.
367
+ - **Gates are mandatory.** Even small features go through all stages. The stages are fast for small work — that's fine.
247
368
  - **TDD by default.** Write the test first. Override only when test-first doesn't make sense for that specific task.
248
369
  - **One commit per task.** Don't batch. Each task = one commit with a clear message.
249
- - **Security check always runs.** Whether backend or frontend, security patterns get checked at the end of Stage 3.
370
+ - **Security check always runs.** Whether backend or frontend, security patterns get checked during review.
250
371
  - **Frontend checks for backend needs.** If a new page needs data that doesn't exist yet, say so at Stage 2 and add backend tasks first.
251
372
  - **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.
373
+ - **Save state for big work.** If 5+ tasks, save artifacts to `.planning/` so future sessions can resume.