This is an AI agent skill / CLI tool. It provides a staged scaffold for AI-assisted software projects: stay light during MVP exploration, then add Specs, ADRs, and Harnesses only after the architecture stabilizes.
🇨🇳 中文版 README
AI SDD Bootstrap helps you practice Spec-Driven Development (SDD) with AI agents such as Codex, Claude Code, Kimi Code, Cursor, and Copilot. It generates the right amount of structure at the right time, so you don't over-engineer your MVP or lose control during long-term iteration.
- MVP phase: Move fast, validate ideas, avoid premature specs.
- Foundation phase: After the MVP works, document architecture and project rules.
- Iteration phase: Lock stable decisions into specs and executable harnesses.
Use this skill when:
- You are starting a new project with AI assistance.
- The MVP is validated and you want to prevent future AI changes from breaking existing behavior.
- You need a reusable structure for ADRs, feature specs, and harness tests.
- You want Codex, Kimi, Cursor, Claude Code, and Copilot to read the same project rules.
Do not bootstrap the full framework for throwaway prototypes. Run init only.
pip install git+https://github.com/Goldloli/ai-sdd-bootstrap.gitAfter installation you get the ai-sdd command:
ai-sdd --helpgit clone https://github.com/Goldloli/ai-sdd-bootstrap.git
cd ai-sdd-bootstrap
pip install -e .Place this repository in your agent's skill directory, for example:
~/.agents/skills/ai-sdd-bootstrapThen invoke the wrapper script:
python3 ~/.agents/skills/ai-sdd-bootstrap/scripts/ai_sdd_bootstrap.py --helpThe rest of this document uses ai-sdd. If you are using the local script, replace ai-sdd with the path above.
Choose one primary stack and optionally additional stacks:
nodejs-tspythonrustgolanguage-agnosticshell
Run inside your project root:
ai-sdd initNon-interactive example:
ai-sdd init --primary-stack nodejs-tsThis creates only:
AGENTS.md
README.md
.gitignore
It intentionally does not create docs/, CLAUDE.md, AI_HANDOFF.md, or harness files. An MVP is still a draft; don't bury it in process.
During the MVP phase:
- Let the AI explore implementation options.
- Keep the codebase small and easy to change.
- Avoid writing many specs.
- Record only decisions that are truly locked.
Signals that you are ready for the next phase:
- You have used the MVP as a real user.
- The product direction is no longer changing every hour.
- You can describe the main modules and boundaries.
- You start worrying that new AI changes will break old behavior.
After the MVP is validated, run:
ai-sdd bootstrap-foundationNon-interactive example:
ai-sdd bootstrap-foundation \
--primary-stack nodejs-ts \
--additional-stack pythonThis creates the full SDD structure:
docs/
INDEX.md
adr/
feature/
guide/
ai-behavior.md
project-meta.md
examples/
AGENTS.md
AI_HANDOFF.md
CLAUDE.md
README.md
From this point on, agents should read AGENTS.md, CLAUDE.md, AI_HANDOFF.md, and docs/guide/ai-behavior.md before making substantive changes.
At any time run:
ai-sdd statusIt reports:
- Whether the project is initialized.
- Whether the foundation framework exists.
- Current stage.
- ADR count.
- Feature spec count.
- Harness count.
- Git branch and uncommitted files.
- Recommended next actions.
Write an ADR when an architectural decision should not be re-debated in every new AI session.
Interactive:
ai-sdd add-adrNon-interactive:
ai-sdd add-adr \
--title "Use SQLite For Local Storage" \
--background "The desktop app needs reliable local persistence." \
--decision "Use SQLite as the local persistence layer." \
--consequences "Simple local-first storage, but not a multi-user database." \
--status acceptedThis creates a file under docs/adr/ and updates docs/INDEX.md.
Write a feature spec when a behavior or boundary has stabilized.
Interactive:
ai-sdd add-specNon-interactive:
ai-sdd add-spec \
--title "Login Flow" \
--in-scope "Email and password login" \
--out-scope "Social login, password reset" \
--boundaries "Do not bypass password verification,Do not mutate user roles during login" \
--acceptance "Reject wrong password,Create session for valid credentials" \
--dependencies "ADR-001-use-sqlite-for-local-storage.md"This creates a file under docs/feature/ and updates docs/INDEX.md.
Add a harness when a behavior is important enough to enforce with an executable check.
Interactive:
ai-sdd add-harnessNon-interactive:
ai-sdd add-harness \
--stack nodejs-ts \
--title "Login Rejects Wrong Password" \
--module auth \
--purpose "Lock the invariant that invalid credentials never create a session." \
--related-spec docs/feature/login-flow.md \
--kind testImportant: generated harnesses are draft constraints. They intentionally fail until you replace the placeholder with real setup, inputs, and assertions. Do not count them as coverage before that.
Output paths:
nodejs-ts -> tests/harness/<module>/<name>.spec.ts
python -> tests/harness/<module>/test_<name>.py
rust -> tests/harness/<module>/<name>.rs
go -> tests/harness/<module>/<name>_test.go
shell -> tests/harness/<module>/<name>.sh
Harness kinds (--kind):
test(default) — single-invariant unit harness, one stack per file.evaluation— fixed task set + scorer + pass threshold, for LLM / agent quality (Python template only).scenario— full workflow with expected trajectory and forbidden side effects (Python template only).
--related-spec writes a Related spec: line into the harness header. status uses these explicit links (with stem matching as a fallback) to report which specs still lack a hard constraint.
After the MVP works, generate an architecture review document:
ai-sdd review-architectureIt scans source files and writes:
docs/guide/architecture-review.md
Use the output as discussion material with your AI. Do not blindly refactor everything it lists.
Find good places to add harnesses:
ai-sdd suggest-harnessHeuristics used:
- Core flow names:
auth,login,payment,permission,security. - Files modified frequently in recent git history.
- Large files.
- Files with many functions.
- Files marked with TODO/FIXME/HACK.
Treat the output as suggestions, not commands.
Non-interactive usage:
# Auto-generate a harness for the top candidate (good for AI agent calls)
ai-sdd suggest-harness --top 1
# List candidates without writing files
ai-sdd suggest-harness --dry-runCheck that links, specs, and harnesses are consistent:
ai-sdd validateIt reports broken docs/INDEX.md links, harnesses still in draft state, and specs without a related harness.
For AI agent consumption:
ai-sdd validate --jsonAll write commands support --dry-run to preview changes without writing files, and --strict to fail instead of prompting or silently using defaults. Use these when invoking the tool from an AI agent:
ai-sdd init --primary-stack python --dry-run
ai-sdd add-adr --strict --title "Use SQLite" --background "..." --decision "..." --consequences "..."status and validate support --json for machine-readable output.
| File or Directory | Purpose |
|---|---|
AGENTS.md |
Entry instructions for AI agents. |
CLAUDE.md |
Claude-specific project charter. |
AI_HANDOFF.md |
Current project state for new AI sessions. |
docs/INDEX.md |
Navigation map for specs and ADRs. |
docs/guide/ai-behavior.md |
Required AI collaboration rules. |
docs/guide/project-meta.md |
Stack, stage, and harness metadata. |
docs/adr/ |
Architecture Decision Records. |
docs/feature/ |
Feature specs and stable behavior boundaries. |
tests/harness/ |
Executable checks for important invariants. |
| Stage | Optimize For | Avoid |
|---|---|---|
| MVP | End-to-end works | Heavy docs, comprehensive specs, fake architectural certainty |
| Foundation | Module boundaries, ADRs, project rules | Putting harnesses on everything |
| Iteration | Stable specs, precise harnesses, safe changes | Docs drifting away from code |
Good MVP usage:
ai-sdd init --primary-stack nodejs-tsThen build freely until the idea is validated.
Good foundation usage:
ai-sdd bootstrap-foundation --primary-stack nodejs-ts
ai-sdd review-architecture
ai-sdd add-adrGood iteration usage:
ai-sdd add-spec
ai-sdd add-harness
ai-sdd statusIf the product direction is still changing rapidly, stay in the MVP phase. Premature specs become constraints around guesses.
Generated harness files intentionally fail. Replace placeholders with real tests before counting them as coverage.
Specs are for validated or intentionally locked decisions. If an idea is still a guess, don't write it into a spec.
This framework is designed for on-demand loading. Read the index first, then load only relevant ADRs and specs.
Update it before important planning sessions or handoffs. It should reflect current focus, recent decisions, open questions, and next steps.
Use the ai-sdd-bootstrap skill to initialize this project for MVP exploration.
The MVP is validated. Use ai-sdd-bootstrap to bootstrap the foundation framework.
Use ai-sdd-bootstrap to add an ADR for choosing SQLite as local storage.
Use ai-sdd-bootstrap to suggest where this project needs harness tests.
Use ai-sdd-bootstrap to add a harness for the login rejection behavior.
After completing a meaningful feature:
- Decide whether any decision has now stabilized.
- If yes, add or update a feature spec.
- Decide whether breaking this behavior would be costly or hard to notice.
- If yes, add a real harness.
- Update
AI_HANDOFF.mdif project direction, current focus, or open questions changed. - Run
statusto see what is still missing.
# MVP only
ai-sdd init --primary-stack nodejs-ts
# After MVP validation
ai-sdd bootstrap-foundation --primary-stack nodejs-ts
# Check current state
ai-sdd status
# Record an architectural decision
ai-sdd add-adr
# Record a stable feature boundary
ai-sdd add-spec
# Generate a draft harness that needs real assertions
ai-sdd add-harness
# Generate architecture review notes
ai-sdd review-architecture
# Find good harness candidates
ai-sdd suggest-harness --top 1See CONTRIBUTING.md.
MIT. See LICENSE.
