@c0x12c/ai-toolkit 1.15.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 +16 -0
- package/.claude-plugin/plugin.json +12 -0
- package/README.md +439 -0
- package/VERSION +1 -0
- package/agents/design-critic.md +127 -0
- package/agents/idea-killer.md +72 -0
- package/agents/infrastructure-expert.md +49 -0
- package/agents/micronaut-backend-expert.md +45 -0
- package/agents/phase-reviewer.md +150 -0
- package/agents/research-planner.md +70 -0
- package/agents/solution-architect-cto.md +49 -0
- package/agents/sre-architect.md +49 -0
- package/agents/team-coordinator.md +111 -0
- package/bin/cli.js +780 -0
- package/claude-md/00-header.md +39 -0
- package/claude-md/01-core.md +105 -0
- package/claude-md/05-database.md +20 -0
- package/claude-md/11-backend-micronaut.md +19 -0
- package/claude-md/20-frontend-react.md +44 -0
- package/claude-md/25-ux-design.md +56 -0
- package/claude-md/30-infrastructure.md +24 -0
- package/claude-md/30-project-mgmt.md +119 -0
- package/claude-md/40-product.md +39 -0
- package/claude-md/50-ops.md +34 -0
- package/claude-md/60-research.md +27 -0
- package/claude-md/90-footer.md +21 -0
- package/commands/spartan/brainstorm.md +134 -0
- package/commands/spartan/brownfield.md +157 -0
- package/commands/spartan/build.md +435 -0
- package/commands/spartan/careful.md +94 -0
- package/commands/spartan/commit-message.md +112 -0
- package/commands/spartan/content.md +17 -0
- package/commands/spartan/context-save.md +161 -0
- package/commands/spartan/contribute.md +140 -0
- package/commands/spartan/daily.md +42 -0
- package/commands/spartan/debug.md +308 -0
- package/commands/spartan/deep-dive.md +55 -0
- package/commands/spartan/deploy.md +207 -0
- package/commands/spartan/e2e.md +264 -0
- package/commands/spartan/env-setup.md +166 -0
- package/commands/spartan/epic.md +199 -0
- package/commands/spartan/fe-review.md +181 -0
- package/commands/spartan/figma-to-code.md +260 -0
- package/commands/spartan/forensics.md +46 -0
- package/commands/spartan/freeze.md +84 -0
- package/commands/spartan/fundraise.md +53 -0
- package/commands/spartan/gate-review.md +229 -0
- package/commands/spartan/gsd-upgrade.md +376 -0
- package/commands/spartan/guard.md +42 -0
- package/commands/spartan/init-project.md +178 -0
- package/commands/spartan/init-rules.md +298 -0
- package/commands/spartan/interview.md +154 -0
- package/commands/spartan/kickoff.md +73 -0
- package/commands/spartan/kotlin-service.md +109 -0
- package/commands/spartan/lean-canvas.md +222 -0
- package/commands/spartan/lint-rules.md +122 -0
- package/commands/spartan/map-codebase.md +124 -0
- package/commands/spartan/migration.md +82 -0
- package/commands/spartan/next-app.md +317 -0
- package/commands/spartan/next-feature.md +212 -0
- package/commands/spartan/onboard.md +326 -0
- package/commands/spartan/outreach.md +16 -0
- package/commands/spartan/phase.md +142 -0
- package/commands/spartan/pitch.md +18 -0
- package/commands/spartan/plan.md +210 -0
- package/commands/spartan/pr-ready.md +202 -0
- package/commands/spartan/project.md +106 -0
- package/commands/spartan/qa.md +222 -0
- package/commands/spartan/research.md +254 -0
- package/commands/spartan/review.md +132 -0
- package/commands/spartan/scan-rules.md +173 -0
- package/commands/spartan/sessions.md +143 -0
- package/commands/spartan/spec.md +131 -0
- package/commands/spartan/startup.md +257 -0
- package/commands/spartan/team.md +570 -0
- package/commands/spartan/teardown.md +161 -0
- package/commands/spartan/testcontainer.md +97 -0
- package/commands/spartan/tf-cost.md +123 -0
- package/commands/spartan/tf-deploy.md +116 -0
- package/commands/spartan/tf-drift.md +100 -0
- package/commands/spartan/tf-import.md +107 -0
- package/commands/spartan/tf-module.md +121 -0
- package/commands/spartan/tf-plan.md +100 -0
- package/commands/spartan/tf-review.md +106 -0
- package/commands/spartan/tf-scaffold.md +109 -0
- package/commands/spartan/tf-security.md +147 -0
- package/commands/spartan/think.md +221 -0
- package/commands/spartan/unfreeze.md +13 -0
- package/commands/spartan/update.md +134 -0
- package/commands/spartan/ux.md +1233 -0
- package/commands/spartan/validate.md +193 -0
- package/commands/spartan/web-to-prd.md +706 -0
- package/commands/spartan/workstreams.md +109 -0
- package/commands/spartan/write.md +16 -0
- package/commands/spartan.md +386 -0
- package/frameworks/00-framework-comparison-guide.md +317 -0
- package/frameworks/01-lean-canvas.md +196 -0
- package/frameworks/02-design-sprint.md +304 -0
- package/frameworks/03-foundation-sprint.md +337 -0
- package/frameworks/04-business-model-canvas.md +391 -0
- package/frameworks/05-customer-development.md +426 -0
- package/frameworks/06-jobs-to-be-done.md +358 -0
- package/frameworks/07-mom-test.md +392 -0
- package/frameworks/08-value-proposition-canvas.md +488 -0
- package/frameworks/09-javelin-board.md +428 -0
- package/frameworks/10-build-measure-learn.md +467 -0
- package/frameworks/11-mvp-approaches.md +533 -0
- package/frameworks/think-before-build.md +593 -0
- package/lib/assembler.js +197 -0
- package/lib/assembler.test.js +159 -0
- package/lib/detector.js +166 -0
- package/lib/detector.test.js +221 -0
- package/lib/packs.js +16 -0
- package/lib/resolver.js +272 -0
- package/lib/resolver.test.js +298 -0
- package/lib/worktree.sh +104 -0
- package/package.json +50 -0
- package/packs/backend-micronaut.yaml +35 -0
- package/packs/backend-nodejs.yaml +15 -0
- package/packs/backend-python.yaml +15 -0
- package/packs/core.yaml +37 -0
- package/packs/database.yaml +21 -0
- package/packs/frontend-react.yaml +24 -0
- package/packs/infrastructure.yaml +40 -0
- package/packs/ops.yaml +16 -0
- package/packs/packs.compiled.json +371 -0
- package/packs/product.yaml +22 -0
- package/packs/project-mgmt.yaml +24 -0
- package/packs/research.yaml +39 -0
- package/packs/shared-backend.yaml +14 -0
- package/packs/ux-design.yaml +21 -0
- package/rules/backend-micronaut/API_DESIGN.md +313 -0
- package/rules/backend-micronaut/BATCH_PROCESSING.md +92 -0
- package/rules/backend-micronaut/CONTROLLERS.md +388 -0
- package/rules/backend-micronaut/KOTLIN.md +414 -0
- package/rules/backend-micronaut/RETROFIT_PLACEMENT.md +290 -0
- package/rules/backend-micronaut/SERVICES_AND_BEANS.md +325 -0
- package/rules/core/NAMING_CONVENTIONS.md +208 -0
- package/rules/core/SKILL_AUTHORING.md +174 -0
- package/rules/core/TIMEZONE.md +316 -0
- package/rules/database/ORM_AND_REPO.md +289 -0
- package/rules/database/SCHEMA.md +146 -0
- package/rules/database/TRANSACTIONS.md +311 -0
- package/rules/frontend-react/FRONTEND.md +344 -0
- package/rules/infrastructure/MODULES.md +260 -0
- package/rules/infrastructure/NAMING.md +196 -0
- package/rules/infrastructure/PROVIDERS.md +309 -0
- package/rules/infrastructure/SECURITY.md +310 -0
- package/rules/infrastructure/STATE_AND_BACKEND.md +237 -0
- package/rules/infrastructure/STRUCTURE.md +234 -0
- package/rules/infrastructure/VARIABLES.md +285 -0
- package/rules/shared-backend/ARCHITECTURE.md +46 -0
- package/rules/ux-design/DESIGN_PROCESS.md +176 -0
- package/skills/api-endpoint-creator/SKILL.md +455 -0
- package/skills/api-endpoint-creator/error-handling-guide.md +244 -0
- package/skills/api-endpoint-creator/examples.md +522 -0
- package/skills/api-endpoint-creator/testing-patterns.md +302 -0
- package/skills/article-writing/SKILL.md +109 -0
- package/skills/article-writing/examples.md +59 -0
- package/skills/backend-api-design/SKILL.md +84 -0
- package/skills/backend-api-design/code-patterns.md +138 -0
- package/skills/brainstorm/SKILL.md +95 -0
- package/skills/browser-qa/SKILL.md +87 -0
- package/skills/browser-qa/playwright-snippets.md +110 -0
- package/skills/ci-cd-patterns/SKILL.md +108 -0
- package/skills/ci-cd-patterns/workflows.md +149 -0
- package/skills/competitive-teardown/SKILL.md +93 -0
- package/skills/competitive-teardown/example-analysis.md +50 -0
- package/skills/content-engine/SKILL.md +131 -0
- package/skills/content-engine/examples.md +72 -0
- package/skills/database-patterns/SKILL.md +72 -0
- package/skills/database-patterns/code-templates.md +114 -0
- package/skills/database-table-creator/SKILL.md +141 -0
- package/skills/database-table-creator/examples.md +552 -0
- package/skills/database-table-creator/kotlin-templates.md +400 -0
- package/skills/database-table-creator/migration-template.sql +68 -0
- package/skills/database-table-creator/validation-checklist.md +337 -0
- package/skills/deep-research/SKILL.md +80 -0
- package/skills/design-intelligence/SKILL.md +268 -0
- package/skills/design-workflow/SKILL.md +127 -0
- package/skills/design-workflow/checklists.md +45 -0
- package/skills/idea-validation/SKILL.md +129 -0
- package/skills/idea-validation/example-report.md +50 -0
- package/skills/investor-materials/SKILL.md +122 -0
- package/skills/investor-materials/example-outline.md +70 -0
- package/skills/investor-outreach/SKILL.md +112 -0
- package/skills/investor-outreach/examples.md +76 -0
- package/skills/kotlin-best-practices/SKILL.md +58 -0
- package/skills/kotlin-best-practices/code-patterns.md +132 -0
- package/skills/market-research/SKILL.md +99 -0
- package/skills/security-checklist/SKILL.md +65 -0
- package/skills/security-checklist/audit-reference.md +95 -0
- package/skills/service-debugging/SKILL.md +116 -0
- package/skills/service-debugging/common-issues.md +65 -0
- package/skills/startup-pipeline/SKILL.md +152 -0
- package/skills/terraform-best-practices/SKILL.md +244 -0
- package/skills/terraform-module-creator/SKILL.md +284 -0
- package/skills/terraform-review/SKILL.md +222 -0
- package/skills/terraform-security-audit/SKILL.md +280 -0
- package/skills/terraform-service-scaffold/SKILL.md +574 -0
- package/skills/testing-strategies/SKILL.md +116 -0
- package/skills/testing-strategies/examples.md +103 -0
- package/skills/testing-strategies/integration-test-setup.md +71 -0
- package/skills/ui-ux-pro-max/SKILL.md +238 -0
- package/skills/ui-ux-pro-max/data/charts.csv +26 -0
- package/skills/ui-ux-pro-max/data/colors.csv +97 -0
- package/skills/ui-ux-pro-max/data/icons.csv +101 -0
- package/skills/ui-ux-pro-max/data/landing.csv +31 -0
- package/skills/ui-ux-pro-max/data/products.csv +97 -0
- package/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
- package/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
- package/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
- package/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
- package/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
- package/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
- package/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
- package/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/skills/ui-ux-pro-max/data/styles.csv +68 -0
- package/skills/ui-ux-pro-max/data/typography.csv +58 -0
- package/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
- package/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
- package/skills/ui-ux-pro-max/python-setup.md +146 -0
- package/skills/ui-ux-pro-max/scripts/core.py +253 -0
- package/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
- package/skills/ui-ux-pro-max/scripts/search.py +114 -0
- package/skills/web-to-prd/SKILL.md +478 -0
- package/templates/build-config.yaml +44 -0
- package/templates/commands-config.yaml +55 -0
- package/templates/competitor-analysis.md +60 -0
- package/templates/content/AGENT_TEMPLATE.md +47 -0
- package/templates/content/COMMAND_TEMPLATE.md +27 -0
- package/templates/content/RULE_TEMPLATE.md +40 -0
- package/templates/content/SKILL_TEMPLATE.md +41 -0
- package/templates/design-config.md +105 -0
- package/templates/design-doc.md +207 -0
- package/templates/epic.md +100 -0
- package/templates/feature-spec.md +181 -0
- package/templates/idea-canvas.md +47 -0
- package/templates/implementation-plan.md +159 -0
- package/templates/prd-template.md +86 -0
- package/templates/preamble.md +89 -0
- package/templates/project-readme.md +35 -0
- package/templates/quality-gates.md +230 -0
- package/templates/spartan-config.yaml +164 -0
- package/templates/user-interview.md +69 -0
- package/templates/validation-checklist.md +108 -0
- package/templates/workflow-backend-micronaut.md +409 -0
- package/templates/workflow-frontend-react.md +233 -0
|
@@ -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,202 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spartan:pr-ready
|
|
3
|
+
description: Full pre-PR workflow — rebase onto main, run all checks (tests, conventions, security), generate PR description, and create the GitHub PR. Run when a feature/fix is complete.
|
|
4
|
+
argument-hint: "[optional: PR title]"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# PR Ready: {{ args[0] | default: "current branch" }}
|
|
8
|
+
|
|
9
|
+
Full workflow: rebase → checks → push → create PR.
|
|
10
|
+
Fix ALL blockers before proceeding to the next step.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Step 1: Current State
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
git branch --show-current
|
|
18
|
+
git status
|
|
19
|
+
git log main...HEAD --oneline
|
|
20
|
+
git diff main...HEAD --shortstat
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
If uncommitted changes exist → commit or stash before continuing.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Step 2: Rebase onto Main
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# Fetch latest and detect default branch
|
|
31
|
+
git fetch origin
|
|
32
|
+
DEFAULT_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@')
|
|
33
|
+
[ -z "$DEFAULT_BRANCH" ] && DEFAULT_BRANCH=$(git rev-parse --verify origin/master >/dev/null 2>&1 && echo master || echo main)
|
|
34
|
+
|
|
35
|
+
# See what's new on the default branch
|
|
36
|
+
git log HEAD..origin/$DEFAULT_BRANCH --oneline
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
If the default branch has new commits:
|
|
40
|
+
```bash
|
|
41
|
+
git rebase origin/$DEFAULT_BRANCH
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**Conflict resolution:**
|
|
45
|
+
1. Find conflict markers `<<<<<<<` / `=======` / `>>>>>>>`
|
|
46
|
+
2. Resolve each file — keep the correct version
|
|
47
|
+
3. `git add [file]` → `git rebase --continue`
|
|
48
|
+
4. Repeat until done
|
|
49
|
+
|
|
50
|
+
Abort if needed: `git rebase --abort`
|
|
51
|
+
|
|
52
|
+
Verify after rebase:
|
|
53
|
+
```bash
|
|
54
|
+
git log main...HEAD --oneline # commits look correct?
|
|
55
|
+
git diff main...HEAD --stat # changes still intact?
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Step 3: Tests (hard blocker)
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# Kotlin BE
|
|
64
|
+
./gradlew clean test
|
|
65
|
+
./gradlew integrationTest 2>/dev/null
|
|
66
|
+
|
|
67
|
+
# Next.js FE
|
|
68
|
+
npm run test:run 2>/dev/null
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**Any failure = stop. Fix tests before continuing.**
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Step 4: Code Quality
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
./gradlew ktlintCheck 2>/dev/null
|
|
79
|
+
./gradlew detekt 2>/dev/null
|
|
80
|
+
./gradlew compileKotlin 2>&1 | grep -i "warning"
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Check the diff for:
|
|
84
|
+
- [ ] No `!!` operator (null safety violation)
|
|
85
|
+
- [ ] No `println` — use SLF4J
|
|
86
|
+
- [ ] No hardcoded values (URLs, secrets, magic numbers)
|
|
87
|
+
- [ ] No commented-out code
|
|
88
|
+
- [ ] No TODOs without ticket reference
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Step 5: Architecture Check
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
# Verify layered architecture (Controller → Manager → Repository)
|
|
96
|
+
# Controllers should only call Managers
|
|
97
|
+
grep -r "Repository\|Service" src/main/kotlin/*/controller/ --include="*.kt" | grep -v "import"
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
- [ ] Controllers are thin — delegate to Manager only
|
|
101
|
+
- [ ] `@Secured` annotation on all controllers
|
|
102
|
+
- [ ] `@ExecuteOn(TaskExecutors.BLOCKING)` on blocking endpoints
|
|
103
|
+
- [ ] Manager returns `Either<ClientException, T>`, not raw types
|
|
104
|
+
- [ ] No business logic in controllers or repositories
|
|
105
|
+
- [ ] Query parameters only — no path parameters (API_RULES)
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Step 6: DB & Security
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
# Migration order correct?
|
|
113
|
+
ls src/main/resources/db/migration/ | sort | tail -5
|
|
114
|
+
./gradlew flywayValidate 2>/dev/null
|
|
115
|
+
|
|
116
|
+
# Accidental secrets?
|
|
117
|
+
git diff main...HEAD | grep -iE "(password|secret|api_key|token)\s*=" \
|
|
118
|
+
| grep -v "test\|mock\|example\|placeholder\|your-"
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
- [ ] Flyway migration version number is next in sequence
|
|
122
|
+
- [ ] Migration is backward-compatible
|
|
123
|
+
- [ ] No secrets committed
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Step 7: Generate PR Description
|
|
128
|
+
|
|
129
|
+
From `git log main...HEAD` and `git diff`, write:
|
|
130
|
+
|
|
131
|
+
```markdown
|
|
132
|
+
## Summary
|
|
133
|
+
[2-3 sentences: what and why]
|
|
134
|
+
|
|
135
|
+
## Changes
|
|
136
|
+
- [change 1]
|
|
137
|
+
- [change 2]
|
|
138
|
+
- [change 3]
|
|
139
|
+
|
|
140
|
+
## Testing
|
|
141
|
+
- [ ] Unit tests added/updated
|
|
142
|
+
- [ ] Integration tests pass
|
|
143
|
+
- [ ] Manual testing: [describe if any]
|
|
144
|
+
|
|
145
|
+
## DB Changes
|
|
146
|
+
[None / Migration V{N}__desc — backward compatible]
|
|
147
|
+
|
|
148
|
+
## Breaking Changes
|
|
149
|
+
[None / describe]
|
|
150
|
+
|
|
151
|
+
## Related
|
|
152
|
+
- Ticket: [if applicable]
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## Step 8: Push & Create PR
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
# Push (force-with-lease is safe after rebase — won't overwrite others' work)
|
|
161
|
+
git push origin HEAD --force-with-lease
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
**Create PR with GitHub CLI (if installed):**
|
|
165
|
+
```bash
|
|
166
|
+
gh pr create \
|
|
167
|
+
--title "{{ args[0] | default: "type(scope): description" }}" \
|
|
168
|
+
--body "[PR description from Step 7]" \
|
|
169
|
+
--base main \
|
|
170
|
+
--draft
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Creates as **draft** — review on GitHub, then mark "Ready for review" when satisfied.
|
|
174
|
+
|
|
175
|
+
**If `gh` not installed:**
|
|
176
|
+
```bash
|
|
177
|
+
# Get remote URL to open in browser
|
|
178
|
+
git remote get-url origin
|
|
179
|
+
```
|
|
180
|
+
Go to GitHub → compare & pull request → paste description from Step 7.
|
|
181
|
+
|
|
182
|
+
Install `gh` CLI for next time: `brew install gh && gh auth login`
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## Final Verdict
|
|
187
|
+
|
|
188
|
+
**✅ PR CREATED** — link above. Review on GitHub and mark ready when satisfied.
|
|
189
|
+
|
|
190
|
+
**❌ BLOCKERS:**
|
|
191
|
+
```
|
|
192
|
+
[file:line — what to fix]
|
|
193
|
+
```
|
|
194
|
+
Fix → re-run `/spartan:pr-ready`.
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
## Rebase Rules (Spartan Convention)
|
|
199
|
+
|
|
200
|
+
- Always rebase **feature/fix branches** onto `main` before PR
|
|
201
|
+
- Never rebase `main`, `develop`, or any shared branch
|
|
202
|
+
- `--force-with-lease` instead of `--force` — safer, won't overwrite teammates' pushes
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spartan:project
|
|
3
|
+
description: Manage large multi-session projects (> 3 days). Handles full lifecycle — create, check status, start new milestones, complete milestones. This is the Spartan wrapper for GSD project commands.
|
|
4
|
+
argument-hint: "[new | status | milestone-new | milestone-complete | milestone-summary | manager]"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Project Management: {{ args[0] | default: "status" }}
|
|
8
|
+
|
|
9
|
+
You are managing a large project using the GSD lifecycle under the hood.
|
|
10
|
+
The user does NOT need to know about `/gsd:*` commands — everything runs through `/spartan:*`.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Route by argument
|
|
15
|
+
|
|
16
|
+
{% if args[0] == "new" %}
|
|
17
|
+
## New Project
|
|
18
|
+
|
|
19
|
+
Starting a full project lifecycle. This is for work spanning multiple days/weeks.
|
|
20
|
+
|
|
21
|
+
**Run:** `/gsd:new-project`
|
|
22
|
+
|
|
23
|
+
Claude will interview the user about:
|
|
24
|
+
- What is the project?
|
|
25
|
+
- Tech stack and constraints?
|
|
26
|
+
- Milestones and goals?
|
|
27
|
+
|
|
28
|
+
Then generate:
|
|
29
|
+
- `PROJECT.md` — full project brief
|
|
30
|
+
- `ROADMAP.md` — all milestones + phases
|
|
31
|
+
- `.planning/config.json` — GSD settings
|
|
32
|
+
|
|
33
|
+
After creation, tell the user:
|
|
34
|
+
"Project created. Next step: `/spartan:phase discuss 1` to start Phase 1."
|
|
35
|
+
|
|
36
|
+
{% elif args[0] == "status" or args[0] == nil %}
|
|
37
|
+
## Project Status
|
|
38
|
+
|
|
39
|
+
**Run:** `/gsd:status`
|
|
40
|
+
|
|
41
|
+
Show current state:
|
|
42
|
+
- Which project is active
|
|
43
|
+
- Current milestone and phase
|
|
44
|
+
- What was completed, what's next
|
|
45
|
+
|
|
46
|
+
Then suggest the next action using `/spartan:` commands:
|
|
47
|
+
- Need to discuss next phase? → "Run `/spartan:phase discuss N`"
|
|
48
|
+
- Need to plan? → "Run `/spartan:phase plan N`"
|
|
49
|
+
- Need to execute? → "Run `/spartan:phase execute N`"
|
|
50
|
+
- Need to verify? → "Run `/spartan:phase verify N`"
|
|
51
|
+
- Milestone done? → "Run `/spartan:project milestone-complete`"
|
|
52
|
+
|
|
53
|
+
**Never suggest `/gsd:*` commands to the user.** Always translate to `/spartan:*`.
|
|
54
|
+
|
|
55
|
+
{% elif args[0] == "milestone-new" %}
|
|
56
|
+
## New Milestone
|
|
57
|
+
|
|
58
|
+
Starting the next milestone on an existing project.
|
|
59
|
+
|
|
60
|
+
**Run:** `/gsd:new-milestone`
|
|
61
|
+
|
|
62
|
+
After creation, tell the user:
|
|
63
|
+
"Milestone created. Next step: `/spartan:phase discuss 1` to start Phase 1 of this milestone."
|
|
64
|
+
|
|
65
|
+
{% elif args[0] == "milestone-complete" %}
|
|
66
|
+
## Complete Milestone
|
|
67
|
+
|
|
68
|
+
Archiving current milestone and tagging the release.
|
|
69
|
+
|
|
70
|
+
**Run:** `/gsd:complete-milestone`
|
|
71
|
+
|
|
72
|
+
After completion, tell the user:
|
|
73
|
+
"Milestone archived and tagged. Next step: `/spartan:project milestone-new` if there's more work, or you're done!"
|
|
74
|
+
|
|
75
|
+
{% elif args[0] == "milestone-summary" %}
|
|
76
|
+
## Milestone Summary
|
|
77
|
+
|
|
78
|
+
Generate a comprehensive summary document from completed milestone artifacts. Useful for team onboarding, stakeholder updates, or reviewing what was accomplished.
|
|
79
|
+
|
|
80
|
+
**Run:** `/gsd:milestone-summary`
|
|
81
|
+
|
|
82
|
+
After generation, tell the user:
|
|
83
|
+
"Milestone summary generated. Share it with your team for onboarding or review."
|
|
84
|
+
|
|
85
|
+
{% elif args[0] == "manager" %}
|
|
86
|
+
## Project Manager (Interactive Command Center)
|
|
87
|
+
|
|
88
|
+
Launch an interactive command center for managing multiple phases from one terminal. Power user tool for overseeing complex projects.
|
|
89
|
+
|
|
90
|
+
**Run:** `/gsd:manager`
|
|
91
|
+
|
|
92
|
+
This provides a dashboard view of all phases, their status, and quick actions — all through `/spartan:*` commands.
|
|
93
|
+
|
|
94
|
+
**Never suggest `/gsd:*` commands to the user.** Always translate to `/spartan:*`.
|
|
95
|
+
|
|
96
|
+
{% else %}
|
|
97
|
+
## Unknown argument: {{ args[0] }}
|
|
98
|
+
|
|
99
|
+
Available options:
|
|
100
|
+
- `/spartan:project new` — Start a new multi-day project
|
|
101
|
+
- `/spartan:project status` — Check where you are
|
|
102
|
+
- `/spartan:project milestone-new` — Start next milestone
|
|
103
|
+
- `/spartan:project milestone-complete` — Archive current milestone
|
|
104
|
+
- `/spartan:project milestone-summary` — Generate onboarding doc from milestone
|
|
105
|
+
- `/spartan:project manager` — Interactive command center for power users
|
|
106
|
+
{% endif %}
|