agent-sdd-toolkit
v2.1.0
Published
Plug and play CLI to prepare machines and repositories for agent-agnostic Spec Driven Development with Spec Kit, AGENTS.md, AI agent adapters and executable harness validation.
Maintainers
Readme
agent-sdd-toolkit
agent-sdd-toolkit is a CLI for preparing machines and repositories for agent-agnostic Specification-Driven Development (SDD).
It is designed around one core rule:
AGENTS.mdis the source of truth.
Everything else is derived from that:
- Spec Kit integrations when available
- repository harness files
- agent-specific adapters for Codex, Claude, Copilot, Cursor, Windsurf, and generic agents
The package exposes two runnable bins:
agent-sddagent-sdd-toolkit
What the toolkit does
The toolkit helps with four practical problems:
- Preparing a local machine or SSH box for AI-agent-assisted development
- Bootstrapping a brand-new repository for SDD
- Adopting SDD in an existing repository without blindly overwriting files
- Diagnosing, repairing, and syncing the non-sensitive parts of the setup
It also includes an optional capability pack:
- Installing or exporting a reusable multi-agent skills pack for Codex-first environments
The generated repository model is:
AGENTS.mddefines the shared operating contractharness.config.jsonstores real detected commandsinit.shis the executable verification gatescripts/validate_harness.pyvalidates the static setupfeature_list.jsontracks bootstrap or feature lifecycle state- agent adapters point back to
AGENTS.mdinstead of duplicating the whole methodology
Repo vs machine
The toolkit separates repository-local scaffold from machine-global agent assets.
Repository-local outputs created by new and adopt include:
AGENTS.mdCLAUDE.md.claude/.specify/harness.config.jsoninit.shfeature_list.jsonscripts/validate_harness.py
Machine-global outputs created by machine and skills install include:
~/.agents/...~/.codex/...~/.claude/...
Important rule:
newandadoptdo not keep.agents/inside the repository as part of the final scaffoldmachineandskills installare the supported ways to populate~/.agents/...
Cleanup on error
Mutating commands try to clean up after themselves automatically when a run fails:
machinenewadoptrepairsyncskills installskills export
The cleanup contract is intentionally narrow:
- it rolls back toolkit-owned files and directories created or modified during the current execution
- it restores previous content when the toolkit rewrote an existing file
- it preserves
repairbackups such as.bak - it does not promise full rollback for external side effects from
git,specify,ssh, orrsync - remote sync is reported clearly, but not rolled back automatically
Typical messages are:
WARN: command failed; attempting cleanup of toolkit-owned changesOK: cleanup completed for toolkit-owned changesWARN: cleanup completed partially; some external side effects may remain
Supported agents
codexclaudecopilotcursorwindsurfgenericall
Install and run
Run directly with npx:
npx agent-sdd-toolkit doctor --agents all --no-run-initOr install globally if you prefer:
npm install -g agent-sdd-toolkit
agent-sdd doctor --agents all --no-run-initStart here
If you want the complete path from machine setup to GitHub-linked repository and day-to-day development, read START_HERE.md.
Quick navigation:
- CHEATSHEET.md: short operational commands
- START_HERE.md: end-to-end onboarding for new and active projects
Commands
machine
Prepare the current machine for agent-driven SDD.
Example:
npx agent-sdd-toolkit machine --agents codex,claudeWhat it does:
- checks
git,node,npm,python3,uv, andspecify - installs or refreshes supported global adapters for selected agents
- manages machine-global assets such as
~/.agents/...and~/.codex/... - does not touch the current repository
- works in diagnose-first mode by default
- rolls back toolkit-owned global changes if the command fails mid-run
Use --dry-run to preview behavior:
npx agent-sdd-toolkit machine --agents all --dry-runnew
Bootstrap a new SDD-ready project in a target directory.
Example:
npx agent-sdd-toolkit new my-project --agents claude,copilot,genericWhat it does:
- creates the target directory if needed
- initializes Git if needed
- attempts Spec Kit integrations for selected agents
- creates the universal SDD layer
- creates repository-local adapters
- removes repo-local
.agents/artifacts if an external integration generated them - writes
feature_list.jsonwith the initial pending feature - optionally runs
./init.sh - rolls back toolkit-owned scaffold from the current run if the command fails
Useful option:
--no-run-initadopt
Adopt the toolkit into an existing repository.
Example:
npx agent-sdd-toolkit adopt --agents allWhat it does:
- checks that the current directory is a Git repo
- warns if the working tree is dirty
- creates or recommends
chore/adopt-agent-sddwhen starting frommainormaster - detects stack, commands, CI, and existing agent files
- writes or updates the universal SDD layer
- merges adapter content safely instead of replacing blindly
- removes repo-local
.agents/artifacts if an external integration generated them - records blockers in
progress/current.mdwhen bootstrap verification fails - rolls back toolkit-owned changes from the current run if the command fails
Use --dry-run first on important repositories.
doctor
Diagnose machine state and repository state.
Example:
npx agent-sdd-toolkit doctor --agents all --no-run-initWhat it checks:
- machine tooling availability
- presence of the universal harness files
- selected adapter coherence
feature_list.jsonpresence- optional
./init.shexecution unless skipped
This is the safest first command to run when you are unsure of the current state.
repair
Repair older or inconsistent setups.
Example:
npx agent-sdd-toolkit repair --agents allWhat it does:
- looks for older naming and legacy adapter content
- creates
.bakbackups for sensitive files before rewriting them - rewrites adapters toward pointer-style files that reference
AGENTS.md - runs a
doctorpass afterward - restores toolkit-owned rewrites if the command fails, while keeping
.bakbackups
Use --dry-run to inspect the changes before writing them.
sync
Sync non-sensitive global toolkit assets to a remote host over SSH/rsync.
Example:
npx agent-sdd-toolkit sync --to devbox --agents codex,claudeWhat it syncs:
- Codex skills
- Codex subagents
- Codex config
- Claude global adapter files
What it does not sync:
.env- secrets
- tokens
- SSH keys
- sessions
- private history
If sync fails, the toolkit cleans up any local staging it created, but it does
not promise rollback on the remote host.
skills
Manage the optional agent-sdd-skills pack.
Examples:
npx agent-sdd-toolkit skills list
npx agent-sdd-toolkit skills validate
npx agent-sdd-toolkit skills doctor --agents codex,claude
npx agent-sdd-toolkit skills install --agents codex
npx agent-sdd-toolkit skills export --agents claude,generic,cursor --output ./skills-exportWhat it does:
- lists the bundled skills and their support state by target
- validates the pack structure and metadata
- checks whether installable targets are already present
- installs Codex skills globally
- exports best-effort artifacts for Claude, generic, Copilot, Cursor, and Windsurf
- cleans up toolkit-owned install/export output from the current run if it fails
Support model:
codex: installableclaude: exportablegeneric: exportablecopilot: exportablecursor: exportablewindsurf: exportable
Dogfooding
This repository is intended to use agent-sdd-toolkit on itself.
That means the repo-local scaffold is expected to be versioned here, while
.agents/ remains a machine-global concern and is not part of the repository
contract.
Main options
--agents <list>: comma-separated list orall--dry-run: preview operations without writing files--force: overwrite toolkit-managed outputs where supported--no-run-init: skip./init.sh--yes: reserved for install-allowed flows such as future machine enhancements--to <host>: sync destination forsync--output <dir>: export destination forskills export
Skills pack
The repository includes agent-sdd-skills/, a Codex-first but AI-ready pack of small operational skills.
Included skills:
token-disciplinespec-driven-developmentrepo-cartographerminimal-implementersenior-code-reviewersecurity-passdocs-writerux-polish-reviewer
Design rules:
AGENTS.mdremains the source of truth- skills are optional accelerators, not replacements for repo policy
- each skill has one universal definition plus target-specific adapters
- non-Codex targets are exportable even when they are not natively installable yet
How to work with the agent
In an adopted repository, you should not need to restate the whole setup each time. The agent should already use:
AGENTS.mdas the source of truth- repo-local scaffold before inventing files or commands
- SDD gates for feature work
./init.shas the final verification gate
Good request patterns:
Start a new feature
I want to add this feature: [description].
Follow the repo setup. First analyze the context and prepare spec, plan, and
tasks. Do not implement until I approve them.Implement approved work
Implement feature [name] following the repo setup.
Review the existing spec, plan, and tasks first, then implement and validate
with ./init.sh.Fix a bug
Investigate and fix this bug: [description].
Use the repo setup, explain the root cause first, then implement the fix and
validate with the harness.Review a change
Review this change following the repo rules.
Focus on bugs, regressions, missing validation, and conflicts with AGENTS.md.Tight-scope improvement
Improve this area: [description].
Use the repo setup, keep scope tight, and validate at the end.These prompts can be written in English or Spanish. The important part is to make clear:
- the goal
- whether you want spec first or implementation directly
- whether it is a feature, bugfix, review, or refactor
- whether the harness must be run at the end
Working with skills
Think of skills as an optional behavior layer on top of the core toolkit.
machineprepares machine-global assetsnewandadoptprepare repo-local scaffoldskills install --agents codeximproves Codex behavior globallyskills exportgives you portable artifacts for Claude, generic, Copilot, Cursor, and Windsurf- failing runs clean up toolkit-owned output from that execution
Recommended commands:
npx agent-sdd-toolkit skills list
npx agent-sdd-toolkit skills validate
npx agent-sdd-toolkit skills doctor --agents codex,claude
npx agent-sdd-toolkit skills install --agents codex
npx agent-sdd-toolkit skills export --agents claude,generic,cursor --output ./skills-exportGenerated files in repositories
The toolkit may generate or update:
AGENTS.mdharness.config.jsoninit.shscripts/validate_harness.pyfeature_list.jsonREADME_AGENT.mdCLAUDE.md.claude/commands/*.claude/agents/*.claude/rules/*.github/copilot-instructions.md.cursor/rules/agent-sdd.mdc.windsurfrules
Global files on a machine
Depending on the selected agents, machine may create:
~/.agents/skills/sdd-project-bootstrap/SKILL.md~/.codex/agents/project_explorer.toml~/.codex/agents/spec_author.toml~/.codex/agents/implementer.toml~/.codex/agents/reviewer.toml~/.codex/config.toml~/.claude/CLAUDE.md~/.claude/rules/agent-sdd.md
With skills install --agents codex, the toolkit may also create:
~/.agents/skills/token-discipline/~/.agents/skills/spec-driven-development/~/.agents/skills/repo-cartographer/~/.agents/skills/minimal-implementer/~/.agents/skills/senior-code-reviewer/~/.agents/skills/security-pass/~/.agents/skills/docs-writer/~/.agents/skills/ux-polish-reviewer/
Recommended usage flow
Prepare a machine
npx agent-sdd-toolkit machine --agents codex,claude,copilot,cursor,generic
npx agent-sdd-toolkit doctor --agents all --no-run-init
npx agent-sdd-toolkit skills install --agents codexCreate a new project
mkdir my-project
cd my-project
git init -b main
npx agent-sdd-toolkit new --agents allTo create and link a GitHub repository with GitHub CLI:
gh auth status
gh repo create my-project --private --source=. --remote=origin --pushIf you prefer creating the repository on the GitHub website first:
git remote add origin [email protected]:<user-or-org>/<repo>.git
git branch -M main
git push -u origin mainAdopt an existing project
git checkout -b chore/adopt-agent-sdd
npx agent-sdd-toolkit adopt --agents all
./init.shIf the existing project has no remote yet, create one on GitHub and link it:
git remote add origin [email protected]:<user-or-org>/<repo>.git
git branch -M main
git push -u origin mainCheck a repository safely
npx agent-sdd-toolkit doctor --agents all --no-run-init
npx agent-sdd-toolkit adopt --agents all --dry-runTeam policy
Version these files in each repository when applicable:
AGENTS.mdCLAUDE.md.github/copilot-instructions.md.cursor/rules/.specify/specs/harness.config.jsoninit.shscripts/validate_harness.pyfeature_list.jsonprogress/current.md
Do not version:
- personal home-directory agent config
.env- credentials
- tokens
- private keys
- sessions
SSH workflow
For remote bootstrap:
ssh devbox
node --version
npm --version
python3 --version
git --versionThen on the remote side:
npx agent-sdd-toolkit machine --agents codex,claude
npx agent-sdd-toolkit doctor --agents codex,claude --no-run-initTo copy global non-sensitive assets from local to remote:
npx agent-sdd-toolkit sync --to devbox --agents codex,claudeTo export skills for other AI environments:
npx agent-sdd-toolkit skills export --agents claude,generic,copilot,cursor,windsurf --output ./skills-exportPublish and release flow
Typical release flow:
npm test
npm run lint
npm run format:check
npm pack --dry-run
npm version patch
git push origin main --follow-tagsIf GitHub Actions and npm Trusted Publisher are configured, the tag push publishes automatically.
Local development
npm install
npm test
npm run lint
npm run format:check
npm pack --dry-runWhen using the toolkit on this repository itself, the repo-local scaffold is
expected to be versioned, while .agents/ remains machine-global and must stay
out of the repository tree.
Notes
doctoris the safest entrypoint for unknown repositoriesadopt --dry-runis recommended before touching important reposmachineis intentionally conservative and diagnose-firstAGENTS.mdshould stay short, universal, and authoritative
