@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,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spartan:freeze
|
|
3
|
+
description: Lock file edits to a single directory. Claude will refuse to create, modify, or delete files outside the specified directory until /spartan:unfreeze is called. Use when debugging a specific module or making surgical changes.
|
|
4
|
+
argument-hint: "[directory path]"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Freeze — Lock Edits to: {{ args[0] }}
|
|
8
|
+
|
|
9
|
+
You are now in **freeze mode**. File operations are restricted to:
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
ALLOWED: {{ args[0] }}/**
|
|
13
|
+
BLOCKED: everything else
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Rules (strictly enforced)
|
|
19
|
+
|
|
20
|
+
### ALLOWED inside {{ args[0] }}:
|
|
21
|
+
- Create new files
|
|
22
|
+
- Edit existing files
|
|
23
|
+
- Delete files
|
|
24
|
+
- Run tests that modify files in this directory
|
|
25
|
+
|
|
26
|
+
### BLOCKED outside {{ args[0] }}:
|
|
27
|
+
- ❌ Create files
|
|
28
|
+
- ❌ Edit files (including str_replace, sed, write operations)
|
|
29
|
+
- ❌ Delete files
|
|
30
|
+
- ❌ Move or rename files
|
|
31
|
+
|
|
32
|
+
### ALWAYS ALLOWED (regardless of freeze):
|
|
33
|
+
- ✅ **Read** any file anywhere (view, cat, grep, find)
|
|
34
|
+
- ✅ **Run** commands that don't modify files (tests, builds, git log, git status)
|
|
35
|
+
- ✅ **Git operations** on the frozen directory's changes (commit, diff)
|
|
36
|
+
- ✅ **Edit test files** in the corresponding test directory (e.g., if frozen to `src/main/kotlin/com/spartan/auth/`, also allow `src/test/kotlin/com/spartan/auth/`)
|
|
37
|
+
|
|
38
|
+
### Test Directory Auto-Mapping
|
|
39
|
+
When the frozen directory is a source directory, the corresponding test directory is also unlocked:
|
|
40
|
+
|
|
41
|
+
| Frozen directory | Also allowed |
|
|
42
|
+
|---|---|
|
|
43
|
+
| `src/main/kotlin/.../module/` | `src/test/kotlin/.../module/` |
|
|
44
|
+
| `src/app/feature/` | `src/app/feature/**/*.test.*` |
|
|
45
|
+
| `app/[route]/` | `app/[route]/**/*.test.*` + `e2e/[route].*` |
|
|
46
|
+
| `lib/module/` | `lib/module/**/*.test.*` |
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Enforcement
|
|
51
|
+
|
|
52
|
+
When Claude attempts to modify a file outside the frozen directory:
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
🧊 FREEZE: Cannot edit [file path]
|
|
56
|
+
|
|
57
|
+
Frozen to: {{ args[0] }}
|
|
58
|
+
This file is outside the allowed directory.
|
|
59
|
+
|
|
60
|
+
Options:
|
|
61
|
+
- /spartan:unfreeze → Remove restriction
|
|
62
|
+
- /spartan:freeze [dir] → Change to a different directory
|
|
63
|
+
- Read the file instead (reading is always allowed)
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Why Freeze?
|
|
69
|
+
|
|
70
|
+
Freeze prevents Claude from "helpfully" fixing things outside your focus area:
|
|
71
|
+
- Debugging `auth/` module → Claude won't refactor `payments/` while it's at it
|
|
72
|
+
- Working on a migration → Claude won't touch application code
|
|
73
|
+
- Fixing a specific test → Claude won't rewrite the implementation to make the test pass
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Behavior
|
|
78
|
+
|
|
79
|
+
- **Sticky:** Stays active until `/spartan:unfreeze` or session ends
|
|
80
|
+
- **Stacks with careful mode:** If both active, destructive ops inside the frozen dir still need confirmation
|
|
81
|
+
- **Auto mode respects freeze:** Even in auto mode, freeze is enforced
|
|
82
|
+
|
|
83
|
+
Claude should acknowledge:
|
|
84
|
+
"🧊 Freeze ON — edits locked to `{{ args[0] }}/`. Tôi chỉ sửa file trong directory này (+ test tương ứng). Nói '/spartan:unfreeze' để mở khóa."
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spartan:fundraise
|
|
3
|
+
description: "Create pitch materials + investor outreach drafts (Stage 4)"
|
|
4
|
+
argument-hint: "[project name]"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Fundraise: {{ args[0] | default: "your project" }}
|
|
8
|
+
|
|
9
|
+
Runs Stage 4: creates investor materials and outreach drafts.
|
|
10
|
+
Only do this AFTER deep-dive confirms the idea is worth building.
|
|
11
|
+
|
|
12
|
+
## Steps
|
|
13
|
+
|
|
14
|
+
### Check Prior Work
|
|
15
|
+
1. Find the project folder in `projects/`
|
|
16
|
+
2. Read EVERYTHING in `01-brainstorm/`, `02-research/`, `03-validation/`
|
|
17
|
+
3. Build a source of truth: key numbers, market size, competitors, positioning
|
|
18
|
+
|
|
19
|
+
### Pitch Materials
|
|
20
|
+
4. Use the `investor-materials` skill
|
|
21
|
+
5. Create pitch deck outline (12 slides):
|
|
22
|
+
- Company + wedge
|
|
23
|
+
- Problem → Solution → Product
|
|
24
|
+
- Market → Business model → Traction
|
|
25
|
+
- Team → Competition → Ask
|
|
26
|
+
- Use of funds → Milestones
|
|
27
|
+
6. Create one-pager (1 page summary)
|
|
28
|
+
7. Check: all numbers match across docs
|
|
29
|
+
8. Save to `04-build/pitch-deck-outline-{date}.md`
|
|
30
|
+
9. Save to `04-build/one-pager-{date}.md`
|
|
31
|
+
|
|
32
|
+
### Investor Outreach
|
|
33
|
+
10. Use the `investor-outreach` skill
|
|
34
|
+
11. Ask user: "Do you have specific investors to target? Or want me to suggest types?"
|
|
35
|
+
12. Create 3 email templates:
|
|
36
|
+
- Cold email (to unknown investors)
|
|
37
|
+
- Warm intro request (for connectors)
|
|
38
|
+
- Follow-up template
|
|
39
|
+
13. If specific investors given, personalize each one
|
|
40
|
+
14. Save to `04-build/investor-emails-{date}.md`
|
|
41
|
+
|
|
42
|
+
### Gate 4 Check
|
|
43
|
+
15. Show materials to user
|
|
44
|
+
16. Ask: "Can you defend every number here in a meeting?"
|
|
45
|
+
17. Flag any weak spots: "This claim needs better data: [X]"
|
|
46
|
+
18. If ready: "These are ready to send. Start with your best-fit investor."
|
|
47
|
+
|
|
48
|
+
## Rules
|
|
49
|
+
|
|
50
|
+
- Every number must come from the research files. No making stuff up.
|
|
51
|
+
- If research is thin, say so. "This section is weak because we don't have data on X."
|
|
52
|
+
- Don't hype. Investors see through it.
|
|
53
|
+
- Materials should be ready to send, not "almost done."
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spartan:gate-review
|
|
3
|
+
description: Dual-agent review — builder presents work, reviewer evaluates, both must accept
|
|
4
|
+
argument-hint: "[phase number or 'current']"
|
|
5
|
+
preamble-tier: 3
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Gate Review: Phase {{ args[0] | default: "current" }}
|
|
9
|
+
|
|
10
|
+
You are running the **Gate Review workflow** — a dual-agent quality check between phases.
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
Epic → Spec → [Design] → Plan → Build → Review
|
|
14
|
+
↑
|
|
15
|
+
Gate 3.5
|
|
16
|
+
(builder + reviewer)
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
This is Gate 3.5 from the quality gates. Two agents look at the work: the **builder** (you, the main agent) and a **reviewer** (spawned subagent). Both must accept before moving on.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## When to Use This
|
|
24
|
+
|
|
25
|
+
- After finishing a phase in `/spartan:phase execute N`
|
|
26
|
+
- After Stage 3 of `/spartan:build` (all tasks done, before shipping)
|
|
27
|
+
- Any time you want a second opinion on a batch of code changes
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Step 1: Collect What Was Built
|
|
32
|
+
|
|
33
|
+
Gather the scope of the review:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# What changed?
|
|
37
|
+
git diff main --stat
|
|
38
|
+
git log main..HEAD --oneline
|
|
39
|
+
|
|
40
|
+
# What files were touched?
|
|
41
|
+
git diff main --name-only
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
If no changes found, tell the user:
|
|
45
|
+
> "No changes to review. Did you commit your work?"
|
|
46
|
+
|
|
47
|
+
Read every changed file. Understand what was built and why.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Step 2: Builder Self-Assessment
|
|
52
|
+
|
|
53
|
+
Before spawning the reviewer, do your own check first. Run through the Gate 3.5 checklist:
|
|
54
|
+
|
|
55
|
+
**Code Design:**
|
|
56
|
+
- [ ] Single responsibility — each class/module does one thing
|
|
57
|
+
- [ ] No god classes or methods doing too much
|
|
58
|
+
- [ ] Proper separation between layers
|
|
59
|
+
- [ ] Naming is clear and consistent
|
|
60
|
+
- [ ] Method signatures are clean (not too many params)
|
|
61
|
+
|
|
62
|
+
**Best Practices:**
|
|
63
|
+
- [ ] No unnecessary complexity
|
|
64
|
+
- [ ] No dead code or unused imports
|
|
65
|
+
- [ ] Error messages are helpful
|
|
66
|
+
- [ ] Logging is right — enough to debug, not noisy
|
|
67
|
+
- [ ] No magic numbers or strings
|
|
68
|
+
|
|
69
|
+
**Clean Code:**
|
|
70
|
+
- [ ] Functions are short and focused
|
|
71
|
+
- [ ] No deeply nested conditionals (max 2-3 levels)
|
|
72
|
+
- [ ] No copy-paste duplication
|
|
73
|
+
- [ ] Code reads top to bottom
|
|
74
|
+
|
|
75
|
+
Note any issues you find. Fix what you can before calling the reviewer.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Step 3: Spawn the Reviewer(s)
|
|
80
|
+
|
|
81
|
+
### Agent Teams boost (if enabled)
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
echo "${CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS:-not_set}"
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**If Agent Teams is enabled AND the diff has 10+ changed files or touches 3+ modules:**
|
|
88
|
+
|
|
89
|
+
Offer to use a review team for parallel review:
|
|
90
|
+
> "This is a big change ([N] files across [N] modules). Want a parallel review team?
|
|
91
|
+
>
|
|
92
|
+
> I'd go with **A** — multiple reviewers catch different things.
|
|
93
|
+
>
|
|
94
|
+
> - **A) Review team** — quality reviewer + test reviewer + security reviewer, all in parallel
|
|
95
|
+
> - **B) Single reviewer** — one phase-reviewer agent (cheaper, faster for small changes)"
|
|
96
|
+
|
|
97
|
+
If user picks A → create a review team (NOT sub-agents):
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
TeamCreate(team_name: "gate-review-{phase}", description: "Gate 3.5 review")
|
|
101
|
+
|
|
102
|
+
TaskCreate(subject: "Quality review", description: "Code design, SOLID, clean code, stack conventions")
|
|
103
|
+
TaskCreate(subject: "Test review", description: "Test coverage, edge cases, test quality")
|
|
104
|
+
TaskCreate(subject: "Security review", description: "Auth, input validation, data handling")
|
|
105
|
+
|
|
106
|
+
Agent(
|
|
107
|
+
team_name: "gate-review-{phase}",
|
|
108
|
+
name: "quality-reviewer",
|
|
109
|
+
subagent_type: "phase-reviewer",
|
|
110
|
+
prompt: "Review for code design, SOLID, clean code, stack conventions.
|
|
111
|
+
Changed files: {list}. Spec: {path}. Plan: {path}.
|
|
112
|
+
Builder self-assessment: {findings from Step 2}.
|
|
113
|
+
Verdict: ACCEPT or NEEDS CHANGES. Check TaskList, claim your task."
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
Agent(
|
|
117
|
+
team_name: "gate-review-{phase}",
|
|
118
|
+
name: "test-reviewer",
|
|
119
|
+
subagent_type: "general-purpose",
|
|
120
|
+
prompt: "Review test coverage, edge cases, test quality.
|
|
121
|
+
Changed files: {list}. Check independence, assertions, no duplication.
|
|
122
|
+
Verdict: ACCEPT or NEEDS CHANGES. Check TaskList, claim your task."
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
Agent(
|
|
126
|
+
team_name: "gate-review-{phase}",
|
|
127
|
+
name: "security-reviewer",
|
|
128
|
+
subagent_type: "general-purpose",
|
|
129
|
+
prompt: "Review auth, input validation, data handling, injection risks.
|
|
130
|
+
Changed files: {list}. Check OWASP top 10.
|
|
131
|
+
Verdict: ACCEPT or NEEDS CHANGES. Check TaskList, claim your task."
|
|
132
|
+
)
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
After all teammates report back, synthesize findings, `TeamDelete()`, continue to Step 4 (Discussion).
|
|
136
|
+
|
|
137
|
+
If user picks B (or Agent Teams not enabled) → use single reviewer below.
|
|
138
|
+
|
|
139
|
+
### Single reviewer (default)
|
|
140
|
+
|
|
141
|
+
Spawn the `phase-reviewer` agent as a subagent. Give it:
|
|
142
|
+
|
|
143
|
+
1. **The list of changed files** (from git diff)
|
|
144
|
+
2. **The spec** (from `.planning/specs/` if it exists)
|
|
145
|
+
3. **The plan** (from `.planning/plans/` if it exists)
|
|
146
|
+
4. **Your self-assessment** from Step 2
|
|
147
|
+
|
|
148
|
+
The reviewer will read all changed files and evaluate them against the Gate 3.5 checklist plus project rules.
|
|
149
|
+
|
|
150
|
+
**Prompt for the reviewer agent:**
|
|
151
|
+
> "Review these changes for Gate 3.5. Changed files: [list]. Spec: [path or 'none']. Plan: [path or 'none']. Builder's self-assessment: [your findings]. Check code design, SOLID, clean code, and project rules. Give your verdict: ACCEPT or NEEDS CHANGES."
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## Step 4: Discussion
|
|
156
|
+
|
|
157
|
+
The reviewer will come back with findings. Two outcomes:
|
|
158
|
+
|
|
159
|
+
### If reviewer says ACCEPT:
|
|
160
|
+
Both agents agree. Gate 3.5 passed. Move on.
|
|
161
|
+
|
|
162
|
+
### If reviewer says NEEDS CHANGES:
|
|
163
|
+
Look at each issue the reviewer found.
|
|
164
|
+
|
|
165
|
+
For each issue:
|
|
166
|
+
- **Agree?** → Fix it right now. Commit the fix.
|
|
167
|
+
- **Disagree?** → Explain why. The reviewer gets to respond. One round of back-and-forth max.
|
|
168
|
+
|
|
169
|
+
After fixes, re-run the reviewer on the changed files. Keep going until both accept.
|
|
170
|
+
|
|
171
|
+
**Max 3 rounds.** If you can't agree after 3 rounds, tell the user:
|
|
172
|
+
> "Builder and reviewer can't agree on [issue]. Here are both sides: [summary]. Your call — fix it or ship it?"
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Step 5: Record the Outcome
|
|
177
|
+
|
|
178
|
+
After both accept, show the result:
|
|
179
|
+
|
|
180
|
+
```markdown
|
|
181
|
+
## Gate 3.5 Review — Phase {{ args[0] | default: "current" }}
|
|
182
|
+
|
|
183
|
+
**Verdict:** PASSED
|
|
184
|
+
**Builder:** ACCEPT
|
|
185
|
+
**Reviewer:** ACCEPT
|
|
186
|
+
**Rounds:** [N]
|
|
187
|
+
|
|
188
|
+
### Issues Found & Fixed
|
|
189
|
+
- [issue]: [how it was fixed]
|
|
190
|
+
|
|
191
|
+
### Issues Discussed & Accepted As-Is
|
|
192
|
+
- [issue]: [why it's fine]
|
|
193
|
+
|
|
194
|
+
### No Issues
|
|
195
|
+
- [what was clean]
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Then tell the user:
|
|
199
|
+
|
|
200
|
+
> "Gate 3.5 passed — both builder and reviewer accept."
|
|
201
|
+
>
|
|
202
|
+
> **Next steps:**
|
|
203
|
+
> - More phases? → `/spartan:phase execute [N+1]`
|
|
204
|
+
> - All done? → `/spartan:phase verify [N]`
|
|
205
|
+
> - Ready to ship? → `/spartan:pr-ready`
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## Stack-Specific Review Routing
|
|
210
|
+
|
|
211
|
+
Gate 3.5 is stack-agnostic (clean code, SOLID, design quality). But the reviewer also runs the right stack-specific checks:
|
|
212
|
+
|
|
213
|
+
| Files changed | Also check |
|
|
214
|
+
|---|---|
|
|
215
|
+
| `.kt` files | Kotlin rules — no `!!`, Either error handling, layered architecture |
|
|
216
|
+
| `.tsx` / `.ts` files | React rules — App Router patterns, TypeScript strictness |
|
|
217
|
+
| `.sql` files | Database rules — TEXT not VARCHAR, soft deletes, standard columns |
|
|
218
|
+
|
|
219
|
+
The reviewer agent knows how to pick the right rules based on file types.
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## Rules
|
|
224
|
+
|
|
225
|
+
- **Both must accept.** One-sided review doesn't count. That's just `/spartan:review`.
|
|
226
|
+
- **Fix issues before declaring pass.** Don't just acknowledge — actually fix them.
|
|
227
|
+
- **Max 3 rounds of discussion.** After that, escalate to the user.
|
|
228
|
+
- **Be honest in self-assessment.** Don't hide issues to avoid the reviewer catching them.
|
|
229
|
+
- **Auto mode on?** → Still run the full review. But skip the "your call" prompt if issues are clear-cut — just fix them.
|