@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,109 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spartan:workstreams
|
|
3
|
+
description: Manage parallel workstreams for concurrent milestone work. List, create, switch between, and track progress across independent work tracks. This is the Spartan wrapper for GSD workstream commands.
|
|
4
|
+
argument-hint: "[list | create <name> | switch <name> | status <name> | progress | complete <name> | resume <name>]"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Workstreams: {{ args[0] | default: "list" }}
|
|
8
|
+
|
|
9
|
+
You are managing parallel workstreams using GSD under the hood.
|
|
10
|
+
The user does NOT need to know about `/gsd:*` commands — everything runs through `/spartan:*`.
|
|
11
|
+
|
|
12
|
+
**What are workstreams?** Independent work tracks that run in parallel within a project. Each workstream has its own milestone, phases, and progress — useful when multiple features or initiatives need to move forward simultaneously.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Route by argument
|
|
17
|
+
|
|
18
|
+
{% if args[0] == "list" or args[0] == nil %}
|
|
19
|
+
## List Workstreams
|
|
20
|
+
|
|
21
|
+
Show all active workstreams and their current state.
|
|
22
|
+
|
|
23
|
+
**Run:** `/gsd:workstreams list`
|
|
24
|
+
|
|
25
|
+
Display each workstream with:
|
|
26
|
+
- Name and description
|
|
27
|
+
- Current milestone/phase
|
|
28
|
+
- Progress status
|
|
29
|
+
|
|
30
|
+
Then suggest next actions using `/spartan:` commands:
|
|
31
|
+
- Want to create a new workstream? → "Run `/spartan:workstreams create <name>`"
|
|
32
|
+
- Want to switch to a different workstream? → "Run `/spartan:workstreams switch <name>`"
|
|
33
|
+
- Want overall progress? → "Run `/spartan:workstreams progress`"
|
|
34
|
+
|
|
35
|
+
**Never suggest `/gsd:*` commands to the user.** Always translate to `/spartan:*`.
|
|
36
|
+
|
|
37
|
+
{% elif args[0] == "create" %}
|
|
38
|
+
## Create Workstream: {{ args[1] | default: "<name>" }}
|
|
39
|
+
|
|
40
|
+
Create a new parallel workstream for independent work.
|
|
41
|
+
|
|
42
|
+
**Run:** `/gsd:workstreams create {{ args[1] | default: "<name>" }}`
|
|
43
|
+
|
|
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:spec` to start work."
|
|
46
|
+
|
|
47
|
+
{% elif args[0] == "switch" %}
|
|
48
|
+
## Switch Workstream: {{ args[1] | default: "<name>" }}
|
|
49
|
+
|
|
50
|
+
Switch active context to a different workstream.
|
|
51
|
+
|
|
52
|
+
**Run:** `/gsd:workstreams switch {{ args[1] | default: "<name>" }}`
|
|
53
|
+
|
|
54
|
+
After switching, tell the user:
|
|
55
|
+
"Switched to workstream '{{ args[1] | default: "<name>" }}'. Run `/spartan:project status` to see where you left off."
|
|
56
|
+
|
|
57
|
+
{% elif args[0] == "status" %}
|
|
58
|
+
## Workstream Status: {{ args[1] | default: "<name>" }}
|
|
59
|
+
|
|
60
|
+
Show detailed status for a specific workstream.
|
|
61
|
+
|
|
62
|
+
**Run:** `/gsd:workstreams status {{ args[1] | default: "<name>" }}`
|
|
63
|
+
|
|
64
|
+
Display:
|
|
65
|
+
- Current milestone and phase
|
|
66
|
+
- Completed vs remaining work
|
|
67
|
+
- Any blockers or dependencies
|
|
68
|
+
|
|
69
|
+
{% elif args[0] == "progress" %}
|
|
70
|
+
## All Workstreams Progress
|
|
71
|
+
|
|
72
|
+
Show progress overview across all active workstreams.
|
|
73
|
+
|
|
74
|
+
**Run:** `/gsd:workstreams progress`
|
|
75
|
+
|
|
76
|
+
Display a summary table showing each workstream's completion percentage and current phase.
|
|
77
|
+
|
|
78
|
+
{% elif args[0] == "complete" %}
|
|
79
|
+
## Complete Workstream: {{ args[1] | default: "<name>" }}
|
|
80
|
+
|
|
81
|
+
Mark a workstream as complete and archive it.
|
|
82
|
+
|
|
83
|
+
**Run:** `/gsd:workstreams complete {{ args[1] | default: "<name>" }}`
|
|
84
|
+
|
|
85
|
+
After completion, tell the user:
|
|
86
|
+
"Workstream '{{ args[1] | default: "<name>" }}' completed and archived. Run `/spartan:workstreams list` to see remaining workstreams."
|
|
87
|
+
|
|
88
|
+
{% elif args[0] == "resume" %}
|
|
89
|
+
## Resume Workstream: {{ args[1] | default: "<name>" }}
|
|
90
|
+
|
|
91
|
+
Resume a paused or previously active workstream.
|
|
92
|
+
|
|
93
|
+
**Run:** `/gsd:workstreams resume {{ args[1] | default: "<name>" }}`
|
|
94
|
+
|
|
95
|
+
After resuming, tell the user:
|
|
96
|
+
"Workstream '{{ args[1] | default: "<name>" }}' resumed. Run `/spartan:project status` to pick up where you left off."
|
|
97
|
+
|
|
98
|
+
{% else %}
|
|
99
|
+
## Unknown argument: {{ args[0] }}
|
|
100
|
+
|
|
101
|
+
Available options:
|
|
102
|
+
- `/spartan:workstreams` — List all workstreams (default)
|
|
103
|
+
- `/spartan:workstreams create <name>` — Create a new parallel workstream
|
|
104
|
+
- `/spartan:workstreams switch <name>` — Switch to a different workstream
|
|
105
|
+
- `/spartan:workstreams status <name>` — Check status of a workstream
|
|
106
|
+
- `/spartan:workstreams progress` — Overview of all workstream progress
|
|
107
|
+
- `/spartan:workstreams complete <name>` — Archive a completed workstream
|
|
108
|
+
- `/spartan:workstreams resume <name>` — Resume a paused workstream
|
|
109
|
+
{% endif %}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spartan:write
|
|
3
|
+
description: Write a blog post or article — sounds human, not AI
|
|
4
|
+
argument-hint: "[topic]"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Write: {{ args[0] | default: "your topic" }}
|
|
8
|
+
|
|
9
|
+
Write long-form content.
|
|
10
|
+
|
|
11
|
+
## Steps
|
|
12
|
+
|
|
13
|
+
1. Use the `article-writing` skill
|
|
14
|
+
2. Check if there's existing research in the project folders to use as source
|
|
15
|
+
3. Ask: Who's the audience? What's the goal?
|
|
16
|
+
4. No AI slop. Sound like a human.
|
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spartan
|
|
3
|
+
description: Smart entry point for the Spartan AI Toolkit. Detects project context, routes to the right workflow or command. Use this when you're not sure where to start.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Spartan AI Toolkit — What do you need?
|
|
7
|
+
|
|
8
|
+
You are the **smart router** — the single entry point for the Spartan AI Toolkit.
|
|
9
|
+
Your job: understand what the user needs, then route to the right **workflow leader** or command.
|
|
10
|
+
|
|
11
|
+
**Workflow leaders first. Commands second.** Each leader runs a full pipeline — spec, plan, implement, review, ship — so the user doesn't chain commands manually. Route to a leader whenever the user has a job to do.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Language Rule
|
|
16
|
+
|
|
17
|
+
**Detect the language of the user's message and respond entirely in that same language.** This overrides the default English behavior. Vietnamese input → Vietnamese output. French → French. English → English. Only code syntax, file paths, and command names stay in their original form.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Preamble (run first)
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
mkdir -p ~/.spartan/sessions
|
|
25
|
+
touch ~/.spartan/sessions/"$PPID"
|
|
26
|
+
_SESSIONS=$(find ~/.spartan/sessions -mmin -120 -type f 2>/dev/null | wc -l | tr -d ' ')
|
|
27
|
+
find ~/.spartan/sessions -mmin +120 -type f -delete 2>/dev/null || true
|
|
28
|
+
_BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown")
|
|
29
|
+
_PROJECT=$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || basename "$(pwd)")
|
|
30
|
+
echo "SESSIONS: $_SESSIONS"
|
|
31
|
+
echo "BRANCH: $_BRANCH"
|
|
32
|
+
echo "PROJECT: $_PROJECT"
|
|
33
|
+
cat .spartan/commands.yaml 2>/dev/null || true
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**Read the output.** Use `SESSIONS`, `BRANCH`, and `PROJECT` for the rest of this session.
|
|
37
|
+
|
|
38
|
+
**If `SESSIONS` >= 3:** Start EVERY response with a grounding line:
|
|
39
|
+
|
|
40
|
+
> **[PROJECT / BRANCH]** Currently working on: [brief task description]
|
|
41
|
+
|
|
42
|
+
This prevents "which terminal am I?" confusion during parallel builds. One line, no big deal.
|
|
43
|
+
|
|
44
|
+
**If `.spartan/commands.yaml` exists** and has a `prompts.[command-name]` entry matching the command being routed to, pass those custom instructions to the command after the built-in prompt.
|
|
45
|
+
|
|
46
|
+
## Completeness Principle
|
|
47
|
+
|
|
48
|
+
AI makes completeness near-free. Always recommend the complete option over shortcuts. See `ETHOS.md` for the full philosophy. When presenting options, include `Completeness: X/10` (10 = all edge cases, 7 = happy path, 3 = shortcut).
|
|
49
|
+
|
|
50
|
+
## AskUserQuestion Format
|
|
51
|
+
|
|
52
|
+
**ALWAYS use this structure for every question to the user:**
|
|
53
|
+
|
|
54
|
+
1. **Re-ground:** State project + branch (from preamble). One sentence.
|
|
55
|
+
2. **Simplify:** Explain so a smart 16-year-old can follow. No function names. Say what it DOES.
|
|
56
|
+
3. **Recommend:** `RECOMMENDATION: Choose [X] because [reason]` — prefer the complete option.
|
|
57
|
+
4. **Options:** `A) ... B) ... C) ...` — one decision per question. Never ask two things at once.
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Step 1: Detect Project Context (silent, no questions)
|
|
62
|
+
|
|
63
|
+
Before asking anything, scan the environment:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
# What kind of project is this?
|
|
67
|
+
ls CLAUDE.md .planning/ .memory/ .handoff/ 2>/dev/null
|
|
68
|
+
ls build.gradle.kts package.json next.config.* 2>/dev/null
|
|
69
|
+
ls .git 2>/dev/null && git branch --show-current 2>/dev/null
|
|
70
|
+
ls .planning/PROJECT.md 2>/dev/null && echo "GSD_ACTIVE"
|
|
71
|
+
|
|
72
|
+
# Check for Spartan updates (silent, non-blocking)
|
|
73
|
+
LOCAL_VER=$(cat ~/.claude/.spartan-version 2>/dev/null || echo "")
|
|
74
|
+
REPO_PATH=$(cat ~/.claude/.spartan-repo 2>/dev/null || echo "")
|
|
75
|
+
if [ -n "$REPO_PATH" ] && [ -d "$REPO_PATH/.git" ]; then
|
|
76
|
+
DEFAULT_BRANCH=$(cd "$REPO_PATH" && git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@')
|
|
77
|
+
[ -z "$DEFAULT_BRANCH" ] && DEFAULT_BRANCH=$(cd "$REPO_PATH" && git rev-parse --verify origin/master >/dev/null 2>&1 && echo master || echo main)
|
|
78
|
+
REMOTE_VER=$(cd "$REPO_PATH" && git fetch origin "$DEFAULT_BRANCH" --quiet 2>/dev/null && git show "origin/$DEFAULT_BRANCH:toolkit/VERSION" 2>/dev/null || echo "")
|
|
79
|
+
if [ -n "$REMOTE_VER" ] && [ -n "$LOCAL_VER" ] && [ "$REMOTE_VER" != "$LOCAL_VER" ]; then
|
|
80
|
+
echo "SPARTAN_UPDATE_AVAILABLE=$REMOTE_VER"
|
|
81
|
+
fi
|
|
82
|
+
fi
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**If update available**, show banner before anything else:
|
|
86
|
+
> **Update available:** Spartan vX.Y.Z (you have v$LOCAL_VER). Run `/spartan:update` to upgrade.
|
|
87
|
+
|
|
88
|
+
Classify silently:
|
|
89
|
+
- **No project files** → New project journey
|
|
90
|
+
- **Has code but no CLAUDE.md** → Needs onboarding → suggest `/spartan:onboard`
|
|
91
|
+
- **Has CLAUDE.md + .planning/** → Active GSD project, resume
|
|
92
|
+
- **Has CLAUDE.md, no .planning/** → Active project, task-based work
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Step 2: Route to Workflow or Command
|
|
97
|
+
|
|
98
|
+
### Primary routing: Workflow Leaders
|
|
99
|
+
|
|
100
|
+
These are the 5 leaders. Each one runs a full pipeline. Route here first.
|
|
101
|
+
|
|
102
|
+
| User says something like... | Route to | What the leader does |
|
|
103
|
+
|---|---|---|
|
|
104
|
+
| "build feature X", "add Y", "implement Z", "new endpoint", "new page" | `/spartan:build` | Checks context → spec → design? → plan → implement → review → ship |
|
|
105
|
+
| "bug", "broken", "error", "not working", "fix this", "debug" | `/spartan:debug` | Checks known issues → reproduce → investigate → fix → ship |
|
|
106
|
+
| "research X", "dig into", "find out about", "what's the market for" | `/spartan:research` | Frame question → gather sources → analyze → report |
|
|
107
|
+
| "startup idea", "new idea", "validate idea", "full pipeline" | `/spartan:startup` | Auto-resumes → brainstorm → validate → research → pitch |
|
|
108
|
+
| "new project", "just joined", "understand this codebase", "onboard" | `/spartan:onboard` | Checks memory → scan → map → setup → save findings |
|
|
109
|
+
|
|
110
|
+
**Route to leaders when the user has a JOB to do.** The leader decides which skills and sub-commands to call — the user doesn't need to know about them.
|
|
111
|
+
|
|
112
|
+
### Secondary routing: Individual commands
|
|
113
|
+
|
|
114
|
+
Route here when the user wants a specific tool, not a full workflow.
|
|
115
|
+
|
|
116
|
+
**Planning & project management:**
|
|
117
|
+
| User says... | Route to |
|
|
118
|
+
|---|---|
|
|
119
|
+
| "plan a task", "write a spec" | `/spartan:spec` → `/spartan:plan` |
|
|
120
|
+
| "break into features", "epic" | `/spartan:epic` |
|
|
121
|
+
| "design a screen", "UI design", "design doc" | `/spartan:ux prototype` |
|
|
122
|
+
| "UX research", "user interviews", "design system" | `/spartan:ux` |
|
|
123
|
+
| "review my code", "dual review", "gate review" | `/spartan:gate-review` |
|
|
124
|
+
| "big project", "multi-day", "new milestone" | `/spartan:project new` |
|
|
125
|
+
| "continue phase", "next phase" | `/spartan:phase` |
|
|
126
|
+
| "workstreams", "parallel work" | `/spartan:workstreams` |
|
|
127
|
+
| "agent team", "spawn team", "create team", "multi-agent" | `/spartan:team` |
|
|
128
|
+
| "run wave with agents", "execute wave with team" | `/spartan:team wave` |
|
|
129
|
+
| "parallel review", "team review" | `/spartan:team review` |
|
|
130
|
+
| "research swarm", "parallel research" | `/spartan:team research` |
|
|
131
|
+
| "parallel build", "team build" | `/spartan:team build` |
|
|
132
|
+
| "standup", "what did I do" | `/spartan:daily` |
|
|
133
|
+
|
|
134
|
+
**Product thinking:**
|
|
135
|
+
| User says... | Route to |
|
|
136
|
+
|---|---|
|
|
137
|
+
| "think through this", "before we build" | `/spartan:think` |
|
|
138
|
+
| "brainstorm ideas" | `/spartan:brainstorm` |
|
|
139
|
+
| "validate this idea" | `/spartan:validate` |
|
|
140
|
+
| "competitor teardown" | `/spartan:teardown` |
|
|
141
|
+
| "user interviews", "mom test" | `/spartan:interview` |
|
|
142
|
+
| "lean canvas", "business model" | `/spartan:lean-canvas` |
|
|
143
|
+
|
|
144
|
+
**Backend tools:**
|
|
145
|
+
| User says... | Route to |
|
|
146
|
+
|---|---|
|
|
147
|
+
| "database migration", "add table" | `/spartan:migration` |
|
|
148
|
+
| "new Kotlin service" | `/spartan:kotlin-service` |
|
|
149
|
+
| "add testcontainers" | `/spartan:testcontainer` |
|
|
150
|
+
| "review backend code" | `/spartan:review` |
|
|
151
|
+
|
|
152
|
+
**Frontend tools:**
|
|
153
|
+
| User says... | Route to |
|
|
154
|
+
|---|---|
|
|
155
|
+
| "new Next.js app" | `/spartan:next-app` |
|
|
156
|
+
| "new feature/page" (frontend-specific) | `/spartan:next-feature` |
|
|
157
|
+
| "Figma to code" | `/spartan:figma-to-code` |
|
|
158
|
+
| "add E2E tests" | `/spartan:e2e` |
|
|
159
|
+
| "review frontend code" | `/spartan:fe-review` |
|
|
160
|
+
|
|
161
|
+
**Shipping:**
|
|
162
|
+
| User says... | Route to |
|
|
163
|
+
|---|---|
|
|
164
|
+
| "ready for PR", "create PR" | `/spartan:pr-ready` |
|
|
165
|
+
| "deploy", "push to prod" | `/spartan:deploy` |
|
|
166
|
+
| "env setup", "environment vars" | `/spartan:env-setup` |
|
|
167
|
+
|
|
168
|
+
**Startup pipeline (individual stages):**
|
|
169
|
+
| User says... | Route to |
|
|
170
|
+
|---|---|
|
|
171
|
+
| "kickoff", "brainstorm + validate" | `/spartan:kickoff` |
|
|
172
|
+
| "deep dive", "market + competitors" | `/spartan:deep-dive` |
|
|
173
|
+
| "pitch deck", "investor materials" | `/spartan:pitch` |
|
|
174
|
+
| "investor emails", "outreach" | `/spartan:outreach` |
|
|
175
|
+
| "fundraise", "raise money" | `/spartan:fundraise` |
|
|
176
|
+
| "write a post", "blog" | `/spartan:write` |
|
|
177
|
+
| "content", "social media" | `/spartan:content` |
|
|
178
|
+
|
|
179
|
+
**QA & Testing:**
|
|
180
|
+
| User says... | Route to |
|
|
181
|
+
|---|---|
|
|
182
|
+
| "test in browser", "QA", "check the app", "test the UI" | `/spartan:qa` |
|
|
183
|
+
| "add E2E tests" | `/spartan:e2e` |
|
|
184
|
+
|
|
185
|
+
**Rules & Config:**
|
|
186
|
+
| User says... | Route to |
|
|
187
|
+
|---|---|
|
|
188
|
+
| "set up rules", "configure rules", "init rules" | `/spartan:init-rules` |
|
|
189
|
+
| "scan for patterns", "detect conventions" | `/spartan:scan-rules` |
|
|
190
|
+
| "check my config", "validate rules" | `/spartan:lint-rules` |
|
|
191
|
+
|
|
192
|
+
**Safety:**
|
|
193
|
+
| User says... | Route to |
|
|
194
|
+
|---|---|
|
|
195
|
+
| "be careful", "careful mode" | `/spartan:careful` |
|
|
196
|
+
| "lock to directory", "freeze" | `/spartan:freeze` |
|
|
197
|
+
| "max safety", "guard mode" | `/spartan:guard` |
|
|
198
|
+
| "unlock", "unfreeze" | `/spartan:unfreeze` |
|
|
199
|
+
|
|
200
|
+
**Sessions:**
|
|
201
|
+
| User says... | Route to |
|
|
202
|
+
|---|---|
|
|
203
|
+
| "what sessions", "active sessions", "other windows" | `/spartan:sessions` |
|
|
204
|
+
| "clean sessions" | `/spartan:sessions clean` |
|
|
205
|
+
|
|
206
|
+
**Feedback & Meta:**
|
|
207
|
+
| User says... | Route to |
|
|
208
|
+
|---|---|
|
|
209
|
+
| "contributor mode", "self-improvement", "file reports" | `/spartan:contribute` |
|
|
210
|
+
| "view reports", "skill ratings" | `/spartan:contribute reports` |
|
|
211
|
+
| "what went wrong", "post-mortem" | `/spartan:forensics` |
|
|
212
|
+
| "map the codebase" | `/spartan:map-codebase` |
|
|
213
|
+
| "save context", "running out of context" | `/spartan:context-save` |
|
|
214
|
+
| "upgrade GSD" | `/spartan:gsd-upgrade` |
|
|
215
|
+
| "update spartan" | `/spartan:update` |
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
## Step 3: Explain briefly WHY, then run it
|
|
220
|
+
|
|
221
|
+
Before running the routed command, give a 1-sentence reason:
|
|
222
|
+
|
|
223
|
+
Examples:
|
|
224
|
+
- "Building a feature → `/spartan:build` walks you through understand → plan → implement → ship."
|
|
225
|
+
- "Sounds like a bug → `/spartan:debug` does structured investigation before touching code."
|
|
226
|
+
- "New codebase → `/spartan:onboard` scans and maps everything before you start."
|
|
227
|
+
|
|
228
|
+
Then run the command. Don't ask "shall I proceed?" — just do it.
|
|
229
|
+
|
|
230
|
+
### Preamble Tiers
|
|
231
|
+
|
|
232
|
+
Not every command needs the same amount of context. Check the command/skill's `preamble-tier` field:
|
|
233
|
+
|
|
234
|
+
| Tier | Context Weight | Use for | Examples |
|
|
235
|
+
|------|---------------|---------|----------|
|
|
236
|
+
| **1** | Minimal — just run | Toggles, simple actions | `/spartan:careful`, `/spartan:freeze`, `/spartan:sessions` |
|
|
237
|
+
| **2** | Light — project context only | Quick tasks, status checks | `/spartan:daily`, `/spartan:contribute`, `/spartan:context-save` |
|
|
238
|
+
| **3** | Standard — project + stack context | Most commands | `/spartan:build`, `/spartan:debug`, `/spartan:review` |
|
|
239
|
+
| **4** | Full — everything, deep context | Complex workflows, multi-phase | `/spartan:project`, `/spartan:phase`, `/spartan:onboard` |
|
|
240
|
+
|
|
241
|
+
**How tiers affect behavior:**
|
|
242
|
+
- **Tier 1:** Skip project detection (Step 1). Just run.
|
|
243
|
+
- **Tier 2:** Run Step 1 but skip stack-specific context loading.
|
|
244
|
+
- **Tier 3:** Full Step 1 + load relevant stack skills. (Default if no tier specified.)
|
|
245
|
+
- **Tier 4:** Full Step 1 + load all relevant skills + check `.memory/` + check `.planning/`.
|
|
246
|
+
|
|
247
|
+
### Contributor Mode Check
|
|
248
|
+
|
|
249
|
+
After a command finishes, check if contributor mode is active:
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
[ -f ~/.spartan/contributor-mode ] && echo "CONTRIBUTOR_MODE=on"
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
If active, silently file a field report (see `/spartan:contribute` for format). Don't ask the user. Don't slow anything down.
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## Step 2.5: Proactive Suggestions (always active)
|
|
260
|
+
|
|
261
|
+
You don't have to wait for the user to type `/spartan`. When you notice these patterns in conversation, **suggest the right command** — one line, not pushy.
|
|
262
|
+
|
|
263
|
+
### When to suggest
|
|
264
|
+
|
|
265
|
+
| You notice... | Suggest |
|
|
266
|
+
|---|---|
|
|
267
|
+
| User describes a product idea or feature concept | "This sounds like a good fit for `/spartan:think` before we code." |
|
|
268
|
+
| User just finished building/coding something | "Ready to test? `/spartan:qa` can check it in a real browser." |
|
|
269
|
+
| User says something is broken or not working | "Want me to run `/spartan:debug`? It does structured debugging." |
|
|
270
|
+
| User is about to merge or says "ready for PR" | "Run `/spartan:pr-ready` to do the full pre-PR checklist." |
|
|
271
|
+
| User asks about competitors or market | "I can dig deeper with `/spartan:research`." |
|
|
272
|
+
| User mentions deploying or going live | "Want to use `/spartan:deploy` for a proper deploy checklist?" |
|
|
273
|
+
| User is confused about what to do next | "Type `/spartan` and I'll figure out the right workflow." |
|
|
274
|
+
| User just finished a big feature, no tests mentioned | "Should we add tests? `/spartan:e2e` for browser tests, or unit tests first." |
|
|
275
|
+
| User has been coding for a while, no review mentioned | "Want a quick review before moving on? `/spartan:review`" |
|
|
276
|
+
| User has a wave plan with 3+ parallel work units | "This wave has parallel tasks — want to use `/spartan:team wave` to run them with Agent Teams?" |
|
|
277
|
+
| User wants multiple things reviewed or researched at once | "I can spin up a team for parallel work — `/spartan:team`" |
|
|
278
|
+
|
|
279
|
+
### How to suggest
|
|
280
|
+
|
|
281
|
+
- **One line.** Don't write a paragraph about why they should use the command.
|
|
282
|
+
- **Suggest, don't force.** Say "want me to run X?" not "I'm running X now."
|
|
283
|
+
- **Max once per conversation turn.** Don't spam 3 suggestions at once.
|
|
284
|
+
- **Skip if obvious.** If the user clearly knows what they're doing, don't suggest.
|
|
285
|
+
- **Context matters.** Don't suggest `/spartan:qa` if there's no frontend. Don't suggest `/spartan:deploy` for a library.
|
|
286
|
+
|
|
287
|
+
---
|
|
288
|
+
|
|
289
|
+
## Structured Question Format (all skills must follow)
|
|
290
|
+
|
|
291
|
+
When any `/spartan:*` command needs to ask the user a question, follow this format. Every time. No exceptions.
|
|
292
|
+
|
|
293
|
+
### The Format
|
|
294
|
+
|
|
295
|
+
1. **Simplify** — State the question in plain English. No jargon. One sentence.
|
|
296
|
+
2. **Recommend** — Give your recommendation. Say which option you'd pick and why.
|
|
297
|
+
3. **Options** — List 2-3 lettered options (A/B/C). Each option = one line with a clear trade-off.
|
|
298
|
+
4. **One decision** — Never bundle two unrelated questions. One question per turn.
|
|
299
|
+
|
|
300
|
+
### Example
|
|
301
|
+
|
|
302
|
+
**Bad (vague, no options):**
|
|
303
|
+
> "How would you like to handle the authentication flow? There are several approaches we could take depending on your requirements."
|
|
304
|
+
|
|
305
|
+
**Good (structured):**
|
|
306
|
+
> "How should login work?
|
|
307
|
+
>
|
|
308
|
+
> I'd go with **B** — it's simpler and covers 90% of cases.
|
|
309
|
+
>
|
|
310
|
+
> - **A) Session-based** — server stores state, simpler frontend, harder to scale
|
|
311
|
+
> - **B) JWT tokens** — stateless, easy to scale, needs refresh logic
|
|
312
|
+
> - **C) OAuth only** — delegate to Google/GitHub, no password management"
|
|
313
|
+
|
|
314
|
+
### Rules
|
|
315
|
+
|
|
316
|
+
- **Always pick a side.** Don't say "it depends." Say which option you'd choose and why.
|
|
317
|
+
- **Trade-offs, not descriptions.** Each option should say what you gain AND what you lose.
|
|
318
|
+
- **Short options.** One line each. If you need more detail, the user will ask.
|
|
319
|
+
- **Never ask without options.** If you can't think of options, you probably don't need to ask.
|
|
320
|
+
- **Skip questions when possible.** If there's an obvious best choice, just do it and explain why.
|
|
321
|
+
|
|
322
|
+
---
|
|
323
|
+
|
|
324
|
+
## When NOT to route
|
|
325
|
+
|
|
326
|
+
**Not everything needs a command.** If the user's request is:
|
|
327
|
+
- A simple question → Just answer it
|
|
328
|
+
- A small code change (< 30 min, 1-2 files) → Just do it
|
|
329
|
+
- Asking for an explanation → Just explain
|
|
330
|
+
- Chatting / discussing → Have the conversation
|
|
331
|
+
|
|
332
|
+
Say: "This doesn't need a command — let me handle it directly."
|
|
333
|
+
|
|
334
|
+
---
|
|
335
|
+
|
|
336
|
+
## If user asks "what can you do?"
|
|
337
|
+
|
|
338
|
+
Show the 5 workflow leaders first, then mention commands exist for specific tasks:
|
|
339
|
+
|
|
340
|
+
"Spartan has **5 workflow leaders** — each one runs a full pipeline end-to-end. You don't need to chain commands manually.
|
|
341
|
+
|
|
342
|
+
**Build** — `/spartan:build [backend|frontend] [feature]`
|
|
343
|
+
The main orchestrator. Checks for existing specs/plans, runs spec → design → plan → implement → review → ship. For small work, does everything inline. For big work, saves artifacts and can resume across sessions.
|
|
344
|
+
|
|
345
|
+
**Debug** — `/spartan:debug [symptom]`
|
|
346
|
+
Checks memory for known issues, then runs reproduce → investigate → fix → ship. Saves recurring patterns for future sessions.
|
|
347
|
+
|
|
348
|
+
**Startup** — `/spartan:startup [idea]`
|
|
349
|
+
Full pipeline: brainstorm → validate → research → pitch. Auto-resumes from where you left off if you come back later.
|
|
350
|
+
|
|
351
|
+
**Onboard** — `/spartan:onboard`
|
|
352
|
+
Scan → map architecture → set up tooling → save findings to memory. Future sessions start with the knowledge this one captured.
|
|
353
|
+
|
|
354
|
+
**Research** — `/spartan:research [topic]`
|
|
355
|
+
Deep research with source tracking and a structured report.
|
|
356
|
+
|
|
357
|
+
**Fast path:** For quick work (< 1 day), just run `/spartan:build` — it handles spec + plan inline. No separate commands needed.
|
|
358
|
+
|
|
359
|
+
There are also 40+ individual commands for specific tasks. Type `/spartan` anytime and I'll route you to the right one."
|
|
360
|
+
|
|
361
|
+
---
|
|
362
|
+
|
|
363
|
+
## Auto Mode
|
|
364
|
+
|
|
365
|
+
If user says **"auto on"** or **"auto mode"**:
|
|
366
|
+
- Acknowledge: "Auto mode ON — running straight through without confirmations. Say 'auto off' or 'stop' anytime."
|
|
367
|
+
- All commands skip confirmation gates and run through
|
|
368
|
+
- Still SHOW output at each step
|
|
369
|
+
- Still STOP for destructive actions (force push, drop table, delete files)
|
|
370
|
+
|
|
371
|
+
If user says **"auto off"**:
|
|
372
|
+
- Acknowledge: "Auto mode OFF — asking for confirmation at each step."
|
|
373
|
+
|
|
374
|
+
---
|
|
375
|
+
|
|
376
|
+
## Context Management (always active)
|
|
377
|
+
|
|
378
|
+
Monitor your own context health:
|
|
379
|
+
- Losing track of earlier decisions → **compact now**
|
|
380
|
+
- Repeating questions already answered → **compact now**
|
|
381
|
+
- Responses getting slower or less precise → **warn user + compact**
|
|
382
|
+
|
|
383
|
+
Action sequence:
|
|
384
|
+
1. First sign of pressure → run `/compact` silently, tell user: "Context getting heavy — compacted."
|
|
385
|
+
2. If still struggling after compact → trigger `/spartan:context-save`
|
|
386
|
+
3. Never let quality drop silently — always tell the user.
|