Anssol
Back to Skills
Development

Spartan AI Toolkit

Engineering workflow commands with quality gates, TDD enforcement, and atomic commits.

workflowtddengineering
<p align="center"> <h1 align="center">Spartan AI Toolkit</h1> <p align="center"> <strong>Stop AI coding agents from shipping sloppy code.</strong> <br /> Structured workflows &middot; Configurable rules &middot; Quality gates &middot; Any stack </p> <p align="center"> <a href="https://www.npmjs.com/package/@c0x12c/ai-toolkit"><img src="https://img.shields.io/npm/v/@c0x12c/ai-toolkit.svg" alt="npm version"></a> <a href="https://www.npmjs.com/package/@c0x12c/ai-toolkit"><img src="https://img.shields.io/npm/dm/@c0x12c/ai-toolkit.svg" alt="npm downloads"></a> <a href="https://github.com/c0x12c/ai-toolkit/stargazers"><img src="https://img.shields.io/github/stars/c0x12c/ai-toolkit.svg" alt="GitHub stars"></a> <a href="https://github.com/c0x12c/ai-toolkit/blob/main/LICENSE"><img src="https://img.shields.io/github/license/c0x12c/ai-toolkit.svg" alt="license"></a> </p> </p>

AI coding agents are fast. They're also careless. They skip tests, ignore your coding standards, push without review, and forget everything between sessions.

Spartan fixes that. One command runs a full engineering workflow — spec, plan, TDD, code review, PR — with quality gates between each step. Your rules, your standards, enforced every time.

npx @c0x12c/ai-toolkit@latest --local

Works with Claude Code, Codex, Cursor, Windsurf, and Copilot. Rules are plain markdown — works with any AI tool.


Before & After

Without SpartanWith Spartan
"Build this feature" → jumps straight to code, no plan, no tests, pushes broken code/spartan:build → writes spec, plans tasks, TDD for each, code review, then PR
"Fix this bug" → guesses a fix, no repro, no test, hopes for the best/spartan:debug → reproduces first, finds root cause, writes test, then fixes
5 devs on the team → AI writes different code style for each personConfigurable rules → same standards for everyone, checked automatically
3-week feature → AI forgets all context between sessionsAgent memory layer → carries decisions across sessions
Code review catches AI slop → back-and-forth for daysQuality gates → review happens before PR, not after

Quick Start

# 1. Install (30 seconds, interactive menu)
npx @c0x12c/ai-toolkit@latest --local

# 2. Set up rules for your stack
/spartan:init-rules

# 3. Build something
/spartan:build "add user authentication"

That's it. The /spartan:build command handles the full pipeline:

spec → design (if UI) → plan → TDD → code review → PR
  |         |              |      |         |          |
Gate 1   Design Gate    Gate 2  Gate 3   Gate 3.5   Gate 4

Nothing ships without passing every gate.


What's Inside

WhatCountDescription
Slash commands73End-to-end workflows, not just prompts
Coding rules28Your standards, enforced automatically
Skills34Domain knowledge (Kotlin, React, Python, DB, security, etc.)
Agents10Specialized reviewers, researchers, planners
Stack profiles8Pre-built configs for Go, Python, Java, Kotlin, React, etc.
Quality gates5Automated checkpoints between every step
Agent memory3 layersIndex → topics → transcripts (grep-only archive)

5 Workflow Leaders

Each leader runs a full pipeline. One command — it handles the rest.

LeaderCommandWhat happens
Build/spartan:build "feature"spec → design → plan → TDD → review → PR
Debug/spartan:debug "symptom"reproduce → root cause → test-first fix → PR
Startup/spartan:startup "idea"brainstorm → validate → research → pitch
Onboard/spartan:onboardscan codebase → map architecture → save to memory
Research/spartan:research "topic"frame question → gather sources → analyze → report

Or just type /spartan — the smart router figures out what you need.


Works With Any Stack

Pick a built-in profile or write your own rules in markdown:

ProfileStackRules included
kotlin-micronautKotlin + Micronaut8 backend + 3 database rules
react-nextjsReact + Next.jsFrontend conventions
go-standardGoError handling, interfaces, concurrency, project layout
python-djangoPython + DjangoModels, views, ORM, testing
python-fastapiPython + FastAPIEndpoints, Pydantic, async patterns
java-springJava + Spring BootControllers, services, JPA, security
typescript-nodeTypeScript + Node.jsExpress/Fastify, Zod, strict mode
customAnythingBlank template — bring your own rules

Not on this list? Create rules in markdown, point the config at them. The toolkit reads whatever you give it.

# .spartan/config.yaml — you control everything
stack: go-standard
architecture: clean

rules:
  backend:
    - rules/go/ERROR_HANDLING.md
    - rules/go/INTERFACES.md
    - rules/custom/OUR_AUTH_RULES.md

commands:
  test:
    backend: "go test ./..."
  lint:
    backend: "golangci-lint run"

Install

Three ways. Pick one.

Option 1: npx (recommended)

npx @c0x12c/ai-toolkit@latest --local

Interactive menu. Pick your AI tool and packs. Done in 30 seconds.

# Pick specific packs
npx @c0x12c/ai-toolkit@latest --local --packs=backend-micronaut,frontend-react

# Install everything
npx @c0x12c/ai-toolkit@latest --local --all

Option 2: Setup script

git clone https://github.com/c0x12c/ai-toolkit.git
cd ai-toolkit/toolkit
chmod +x scripts/setup.sh && ./scripts/setup.sh --local

Option 3: Claude Code plugin

Search for "Spartan AI Toolkit" in the Claude Code plugin marketplace.

Local vs Global

  • --local (recommended) — installs to ./.claude/ in your project. Your team can see, review, and version-control the setup.
  • --global — installs to ~/.claude/, works across all your projects.

Not using Claude Code?

npx @c0x12c/ai-toolkit@latest --local --agent=claude-code  # default
npx @c0x12c/ai-toolkit@latest --local --agent=codex        # full install
npx @c0x12c/ai-toolkit@latest --local --agent=cursor       # rules only
npx @c0x12c/ai-toolkit@latest --local --agent=windsurf     # rules only
npx @c0x12c/ai-toolkit@latest --local --agent=copilot      # rules only
ToolWhat gets installedWhere
Claude CodeCommands + rules + skills + agents + CLAUDE.md.claude/
CodexCommands + rules + skills + agents + CLAUDE.md.codex/
CursorRules + AGENTS.md.cursor/rules/
WindsurfRules + AGENTS.md.windsurf/rules/
CopilotRules + AGENTS.md.github/instructions/

Uninstall

# Remove from current project
npx @c0x12c/ai-toolkit@latest --uninstall --local

# Remove global install
npx @c0x12c/ai-toolkit@latest --uninstall --global

# Remove for other agents
npx @c0x12c/ai-toolkit@latest --uninstall --local --agent=cursor

How It Works

Review uses your rules

When /spartan:build reaches the review step:

  1. Reads .spartan/config.yaml to find your rules
  2. Spawns a separate review agent (fresh eyes, not the same AI that wrote the code)
  3. The reviewer reads all your rule files, then checks the code against them
  4. Issues found → fix → re-review → repeat until clean

No config? The reviewer still runs — it just uses a generic checklist.

Skills: domain knowledge at each step

Leaders call the right skill at the right time based on your stack:

SkillWhen the leader calls it
kotlin-best-practicesDuring build (Kotlin files)
database-patternsDuring plan + build (migration tasks)
ui-ux-pro-maxDuring design + build (React components)
testing-strategiesDuring build (test tasks)
security-checklistDuring review (security scan)

Agent memory: context across sessions

AI forgets everything when you close the terminal. Agent memory fixes that with 3 layers:

.memory/
  index.md        — Layer 1: always loaded, pointers only (~150 chars per line)
  decisions/      — Layer 2: loaded on demand when relevant
  patterns/       —   architecture decisions, code patterns
  knowledge/      —   domain facts, API gotchas
  blockers/       —   known issues and workarounds
  transcripts/    — Layer 3: never loaded, grep-only archive
LayerLoadedPurpose
IndexEvery turnQuick lookup — what do we know?
TopicsOn demandFull knowledge when the task needs it
TranscriptsNever (grep only)"What did we try last week?" without wasting context

Leaders read and write memory automatically. /spartan:memory-consolidate cleans stale entries. /spartan:magic-doc keeps docs in sync with code.

Configurable rules

Rules load every session. The AI follows them without you asking.

/spartan:init-rules go-standard      # Pick a profile
/spartan:scan-rules                   # Or auto-detect from your code
/spartan:lint-rules                   # Validate your config

Parallel builds

Build 2+ features at the same time. Each /spartan:build automatically creates a git worktree — no manual setup:

# Terminal 1                          # Terminal 2
/spartan:build auth                   /spartan:build payments
# → .worktrees/auth/ (feature/auth)  # → .worktrees/payments/ (feature/payments)
# → PR #1                            # → PR #2

Each build creates its own worktree, branch, and PR. No conflicts. Worktrees are cleaned up after PR merge.

Project config

Customize any command per project. Two config files in .spartan/:

.spartan/build.yaml — controls the build workflow:

branch-prefix: "feature"    # branch name: [prefix]/[slug]
max-review-rounds: 3        # review-fix cycles before asking user
skip-stages: []             # skip: spec, design, plan, ship (never review)

prompts:                    # inject custom instructions per stage
  spec: |
    Always include performance requirements.
  review: |
    Check all API responses include request_id.
  ship: |
    PR title: [PROJ-123] Short description.

.spartan/commands.yaml — inject prompts into any command:

prompts:
  review: "Flag any function longer than 50 lines."
  pr-ready: "Always add Reviewers: @backend-team."
  daily: "Include blockers section."
  debug: "Always check CloudWatch logs first."

Templates in toolkit/templates/. The AI reads your config every session — no manual reminders needed.


Pick Your Packs

Packs group commands, rules, skills, and agents by use case. Core is always installed. You pick the rest.

Common setups

SituationCommand
Kotlin + Micronaut backend--packs=backend-micronaut
React + Next.js frontend--packs=frontend-react
Full-stack (Kotlin + Next.js)--packs=backend-micronaut,frontend-react
Exploring startup ideas--packs=research
Everything--all

All packs

PackCategoryAuto-pullsWhat's inside
coreCoreAlways installed. Workflows + safety + configurable rules
backend-micronautBackenddatabase, shared-backendKotlin + Micronaut: commands, rules, skills, agents
backend-nodejsBackenddatabase, shared-backendComing soon
backend-pythonBackenddatabase, shared-backendComing soon
frontend-reactFrontendReact + Next.js: commands, rules, skills
productPlanningProduct thinking before building
opsShipDeploy + environment management
researchResearchproductFull startup pipeline: idea to investor

All Commands

Type /spartan for the smart router. Or go direct:

Workflow Leaders

LeaderCommandPipeline
Buildbuild [mode] [feature]context → spec → design? → plan → TDD → review → PR
Debugdebug [symptom]known issues → reproduce → investigate → test-first fix → PR
Startupstartup [idea]resume check → brainstorm → validate → research → pitch
Onboardonboardmemory check → scan → map → setup → save to memory
Researchresearch [topic]frame → gather → analyze → report

Core (always installed)

CommandWhat it does
spec "feature"Write a feature spec — saves to .planning/specs/
plan "feature"Implementation plan from spec — saves to .planning/plans/
gate-reviewDual-agent review (builder + reviewer both accept)
dailyStandup summary from git history
pr-readyFull checklist before creating any PR
codexRun Codex as a second-opinion reviewer
commit-message-with-codexCommit, open PR, then chain into Codex PR review
ship-pr-codexRun Codex PR review rounds and apply clear fixes
init-projectAuto-generate CLAUDE.md from codebase scan
init-rulesSet up configurable rules for your stack
scan-rulesAuto-generate rules from code patterns
lint-rulesValidate your config and rule files
context-saveSave session state to resume later
magic-doc [file]Auto-update a doc file to match current codebase
memory-consolidateClean up agent memory — deduplicate, remove stale entries
updateCheck for toolkit updates
carefulWarn before destructive ops
freeze <dir>Lock edits to one directory
guard <dir>careful + freeze combined
epic "name"Break big work into ordered features
brownfield [svc]Map existing codebase before touching legacy code

Backend (backend-micronaut pack)

CommandWhat it does
kotlin-service "name"Scaffold new Micronaut microservice
reviewPR review with your configured rules
testcontainer "type"Setup Testcontainers
migration "desc"Create database migration

Frontend (frontend-react pack)

CommandWhat it does
design "feature"Design workflow with dual-agent review
next-app "name"Scaffold new Next.js app
next-feature "name"Add feature to existing Next.js app
fe-reviewPR review for frontend code
figma-to-code "url"Figma design to production React
e2e "feature"Setup Playwright E2E testing
js-securityNPM security audit — setup, deps, CI, Dependabot, incident response

Product (product pack)

CommandWhat it does
validateScore an idea — GO / TEST MORE / KILL
teardownDeep competitor analysis
interviewMom Test interview questions
lean-canvas9-block Lean Canvas
brainstormGenerate and rank ideas

Ship (ops pack)

CommandWhat it does
deploy "svc" "target"Deploy + verify
env-setup "svc"Audit env vars across environments

Research (research pack)

CommandWhat it does
startup [idea]Full pipeline: brainstorm to investor outreach
kickoff [theme]Start new idea — brainstorm + validate
deep-dive [project]Market research + competitor teardowns
fundraise [project]Pitch materials + investor outreach
pitch [type]Investor-facing materials
outreach [investor]Draft investor emails
content [source]Turn ideas into platform-native content
write [topic]Write blog posts and articles

AI-Powered Design (Optional)

The design workflow (/spartan:ux) can generate real images for prototypes using Google Gemini.

Setup

  1. Get a Gemini API key

  2. Create .spartan/ai.env in your project root:

echo "GEMINI_API_KEY=your-key-here" > .spartan/ai.env
  1. Install Python dependencies:
pip install google-genai Pillow
  1. Use it:
/spartan:ux prototype    # generates images for your design

Note: The installer adds .spartan/ai.env to .gitignore automatically. If you set this up manually, make sure .spartan/ai.env is in your .gitignore — never commit API keys.


Telegram Bridge

Control your AI coding sessions from your phone.

Phone (Telegram) <-> Bridge (Node.js) <-> Claude Agent SDK <-> Claude API

See bridges/ for setup.


Star History

<a href="https://www.star-history.com/?repos=c0x12c%2Fai-toolkit&type=date&legend=top-left"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/image?repos=c0x12c/ai-toolkit&type=date&theme=dark&legend=top-left" /> <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/image?repos=c0x12c/ai-toolkit&type=date&legend=top-left" /> <img alt="Star History Chart" src="https://api.star-history.com/image?repos=c0x12c/ai-toolkit&type=date&legend=top-left" /> </picture> </a>

Contributing

See CONTRIBUTING.md for how to add commands, skills, rules, and agents.


License

MIT

Want something like this for your team?

We build custom MCPs and Claude skills tailored to private workflows. Get in touch.

Start a Conversation

Ready to Ship Something?

Tell us about your project. We respond within one business day with honest scoping — not a sales pitch.

Get Started