SpecHatch
Spec-Driven Development (SDD) CLI, Native MCP Server & Multi-Project Incubator Server for human + AI agent teams.
spechatch keeps specifications as the living source of truth across one or many repositories: it scaffolds project constitutions, multi-lingual templates (en-US, es-ES, it-IT, fr-FR, de-DE), a 3-tier catalog of bundled & team-owned AI agent skills and rule packs (Antigravity, Cursor, Claude Code, Codex, VS Code / GitHub Copilot), a native Model Context Protocol (MCP) server, monotonic spec IDs (promote from BS-*/NTH-* to spec/epic), deterministic roadmaps (specs/ROADMAP.md), Keep a Changelog generation (changelog), SemVer/CalVer manifest bumping (version), single-command workspace diagnostics (doctor), zero-dependency shell autocompletion (zsh, bash, fish, powershell), Unix man pages, sh-* Makefile & justfile shortcuts, pre-commit spec-to-code drift verification, JUnit CI regression attribution, and an optional stateless FastAPI + PostgreSQL (Neon) / MySQL / MariaDB / SQLite incubator server for multi-developer and multi-agent coordination.
Table of Contents
Project & Agent Setup (
init,constitute,create,skills,rules,agents)Spec Authoring & Local Verification (
new,clarify,promote,step,test,verify,ci,resolve,doctor,roadmap,changelog,version,install-hooks)Incubator Server & Coordination (
incubator,serve,admin,bootstrap,healthcheck,ping,sync,approve,revise,claim,epic,context,webhook)
Related MCP server: MCP SDD Server
Documentation Guides
Prefer a step-by-step walkthrough with screenshots over the full reference below? Start here:
Guide | What You'll Learn |
Why SDD solves team/agent sync ( | |
Install | |
Every top-level and nested option in | |
Browse & sync the 31-pack catalog across Antigravity, Cursor, Claude Code, Codex & Copilot, build custom packs, and wire up the 19-tool MCP server. | |
Deploy the multi-project FastAPI Incubator (Neon PostgreSQL, MySQL/MariaDB, SQLite, or Docker), bootstrap RBAC, manage users/keys/projects via CLI, and ingest test health. | |
Stream HMAC-SHA256 signed lifecycle, regression, and version-bump alerts to Slack, Discord, Microsoft Teams, or custom JSON/Markdown templates. | |
Exhaustive reference of all 34 CLI commands, every nested subcommand, flag, option, example, file, and exit code (generated from |
Core Features
Zero-Ambiguity Spec Lifecycle & Ideation Promotion: Multi-artifact specs (
specification.md,plan.md,tasks.md) for full features, single-file stubs forbugfix(BUG-*),hotfix(HF-*),brainstorm(BS-*),nice-to-have(NTH-*), andcode-review(CR-*), first-classepic(E-*) initiatives with acyclicdepends_onDAGs, andspechatch promoteto graduateBS-*/NTH-*ideas into full specs or epics with fullpromoted_from/promoted_toaudit trails. Built-in BCP 47 localization (en-US,es-ES,it-IT,fr-FR,de-DE) keeps prose and roadmaps localized while preserving canonical English frontmatter keys and statuses.Project Constitution & 3-Tier Multi-Agent Packs:
spechatch init --scanandspechatch constitute --scanground AI agents in your repository's real stack, test runners, and canonical command entrypoints across Antigravity (.agents/), Cursor (.cursor/rules/*.mdc), Claude Code (.claude/skills/+ managedCLAUDE.md), Codex (managedAGENTS.md), and VS Code / GitHub Copilot (.github/skills/,.github/copilot-instructions.md,.github/instructions/*.instructions.md). Browse and toggle 31 bundled packs (12 skills + 19 rule packs across Core, Tier 1 Methodology, and Tier 2 Stack-Detected Tooling) plus Tier 3 Custom/Team packs from.spechatch/packs/or shared directories (agents.pack_dirs).Native MCP Server (
[mcp]extra) & Auto-Sync:spechatch mcpexposes 19 SDD tools and 3 live resources (spechatch://constitution,spechatch://roadmap,spechatch://config) overstdioorstreamable-http. SettingSPECHATCH_INCUBATOR_AUTO_SYNC=trueenables automatic Incubator sync across both CLI commands (with--localopt-out) and MCP tools, falling back gracefully with a warning when offline.Developer Ergonomics (
doctor, Autocompletion,manPages &sh-*Shortcuts): Single-command workspace audit (spechatch doctor), zero-dependency native shell autocompletion (spechatch completion <zsh|bash|fish|powershell> --installwith live spec-ID completion), grouped--help, dynamically generated Unixmanpages (spechatch man [COMMAND] --install), andspechatch create makefile/spechatch create justfilefor low-typingsh-*wrappers across macOS, Linux, and Windows.Deterministic Validation & Pre-Commit Drift Guard:
spechatch test,spechatch test run, andspechatch verify --stagedenforce frontmatter schemas, Clarify ambiguity gates ([NEEDS CLARIFICATION]), dead test-link detection, non-empty JUnit execution (executed_count > 0), roadmap sync, andfiles:/contracts:spec-to-implementation drift checks (mode: advisory | strict).Multi-Project Incubator Server (
[incubator]&[mysql]extras): FastAPI + SQLModel + Alembic supporting Neon/PostgreSQL, MySQL 8+/MariaDB 10.6+ ([mysql]), and local SQLite withSPECHATCH_TABLE_PREFIX, live DB healthchecks (SELECT 1), Argon2id users, SHA-256shk_*API keys (actor_type: human | agent | ci), project RBAC, atomic monotonic IDs (Idempotency-Key), human-only checkpoint approvals, living revisions with Change Deltas, soft advisory TTL leases, Epics DAG roll-up, live SSE streams, JUnit CI regression attribution (health: healthy | regressed), and HMAC-SHA256 signed filtered webhooks.Project-Scoped Local & Global Secrets:
spechatch secretmanages0600-permissioned.envstores (~/.config/spechatch/.envwithSPECHATCH_<SECRET_PREFIX>_<KEY>isolation +.spechatch/.envauto-gitignored overrides that keep.spechatch/templates/and.spechatch/packs/committable) and automatically trims stray outer whitespace on write.
Installation
spechatch requires Python 3.11+ and can be installed globally via uv (recommended), pipx, or pip:
# With uv (recommended — isolated global CLI)
uv tool install spechatch # Core standalone CLI
uv tool install "spechatch[incubator,mcp,mysql]" # Core + Incubator + MCP + MySQL/MariaDB
# With pipx (isolated global CLI)
pipx install "spechatch[incubator,mcp,mysql]"
# With pip (inside a virtual environment)
pip install spechatch # Core standalone CLI
pip install "spechatch[incubator,mcp,mysql]" # All optional extrasFor contributors working from a source checkout:
# Core CLI + dev tools
uv sync
# Optional extras (combine as needed):
uv sync --extra incubator # FastAPI / SQLModel / Alembic / PostgreSQL (Neon) / SQLite
uv sync --extra mcp # Native Model Context Protocol (MCP) server
uv sync --extra mysql # PyMySQL + cryptography driver for MySQL / MariaDB
uv sync --all-extras # Everything (recommended for contributors & full setups)Windows (PowerShell):
# Install uv (if not already installed)
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
# Install spechatch with all extras
uv tool install ".[incubator,mcp,mysql]"
# Optional: native PowerShell autocompletion & cross-platform justfile shortcuts
spechatch completion powershell --install
spechatch create justfileQuickstart
1. Standalone Local SDD Workflow
# 1. Scan repository and generate spechatch.project.yml
uv run spechatch init --scan
# 2. Generate starter specs/constitution.md from your repo stack
uv run spechatch constitute --scan
# 3. Sync bundled SDD skills & rules (Antigravity, Cursor, Claude Code, Codex)
uv run spechatch agents sync
# 4. Optional: set a default author handle and add low-typing `make sh-*` shortcuts
uv run spechatch secret put AUTHOR your-handle
uv run spechatch create makefile --append
# 5. Scaffold an epic and a child spec
uv run spechatch new epic "User Authentication"
uv run spechatch new spec "JWT Login Flow" --epic E-0001 --version 0.2.0
# 6. Validate specs, sync specs/ROADMAP.md, and audit workspace health
uv run spechatch test
uv run spechatch roadmap sync
uv run spechatch verify
uv run spechatch doctor --skip-remote
# 7. Optional: install pre-commit hook, shell autocompletion, and Unix man pages
uv run spechatch install-hooks
uv run spechatch completion zsh --install
uv run spechatch man --install2. Multi-Project Incubator (Neon PostgreSQL / MySQL / SQLite)
No local database Docker container is needed — connect directly to Neon (PostgreSQL 15+), MySQL 8+/MariaDB 10.6+ (with --extra mysql), or fall back to local SQLite.
Terminal 1 — Store your database URL and start the server:
# Saves SPECHATCH_<PREFIX>_DATABASE_URL into ~/.config/spechatch/.env (0600)
# (or pass --shared to share one database across all projects)
uv run --all-extras spechatch secret put DATABASE_URL
# Optional: wake/verify the database directly before starting the server
uv run --all-extras spechatch ping --db
# Starts FastAPI + uvicorn on 127.0.0.1:8787 and runs Alembic migrations (0001-0008) automatically
uv run --all-extras spechatch serveTerminal 2 — Register the project and bootstrap existing specs:
# Verify server health & live DB latency
uv run --all-extras spechatch healthcheck
# Create the project row (SPECHATCH_AUTH_ENABLED defaults to false for local dev;
# for authenticated deployments, first run `spechatch admin init` to mint a superuser key)
uv run --all-extras spechatch incubator project create my-project --name "My Project"
# Seed monotonic counters (highest + 1) and import existing local specs into the ledger
uv run --all-extras spechatch bootstrap
# Query live epic progress and agent orientation context
uv run --all-extras spechatch epic status E-0001
uv run --all-extras spechatch contextCLI Reference
Global Options
spechatch [--version] [--config PATH] [--lang LOCALE] <command> [options]Flag | Description |
| Print installed |
| Path to |
| BCP 47 locale for generated templates and roadmap ( |
spechatch man [COMMAND]
View, print, or install dynamically generated Unix man pages (spechatch(1) and spechatch-<command>(1)) derived from the live CLI parser and SpechatchSettings.
Option | Description |
| Optional subcommand name (e.g. |
| Print raw roff/troff source to stdout instead of opening the |
| Install |
| Export GitHub-Flavored Markdown reference (complete CLI or single |
| Write |
| Custom target directory for |
spechatch completion <zsh|bash|fish|powershell>
Generate or install zero-dependency native shell autocompletion scripts derived directly from the live CLI parser — completing all commands, nested subcommands, flags, value choices, paths, and live spec/epic IDs from specs/ with instant Tab response.
Option | Description |
| Target shell: |
| Write the completion script into the shell's user completion directory ( |
| Custom target directory for |
Quick activation:
# Zsh (add to ~/.zshrc) — or run: spechatch completion zsh --install
eval "$(spechatch completion zsh)"
# Bash (add to ~/.bashrc) — or run: spechatch completion bash --install
eval "$(spechatch completion bash)"
# Fish — or run: spechatch completion fish --install
spechatch completion fish | source
# PowerShell — or run: spechatch completion powershell --install
spechatch completion powershell | Out-String | Invoke-Expressionspechatch mcp
Start the native Model Context Protocol (MCP) server for AI coding agents (Antigravity, Cursor, Claude Code, Codex). Requires the optional [mcp] extra (uv sync --extra mcp or pip install spechatch[mcp]). Works standalone locally and automatically syncs with the Incubator when SPECHATCH_INCUBATOR_AUTO_SYNC=true (falling back gracefully with a warning if the server is unreachable).
Resources (3):
spechatch://constitution,spechatch://roadmap,spechatch://config.Tools (19):
spechatch_context,spechatch_list_specs,spechatch_new_spec,spechatch_clarify,spechatch_inspect,spechatch_security_audit,spechatch_security_scan,spechatch_promote,spechatch_step,spechatch_verify,spechatch_doctor,spechatch_version,spechatch_roadmap_sync,spechatch_claim,spechatch_revise,spechatch_epic_status,spechatch_epic_next,spechatch_healthcheck,spechatch_test_run.
Option | Description |
| Transport mode: |
| Bind host for |
| Bind port for |
MCP Client Configuration (Project-Local vs. Global)
IDE / Agent | Project-Local Config | Global User Config | Root Key |
Antigravity |
|
|
|
Cursor |
|
|
|
VS Code (Copilot) |
| User |
|
Claude Code |
|
|
|
Codex CLI |
|
|
|
Windsurf | — |
|
|
Tip (macOS / GUI IDEs): Desktop apps often do not inherit your shell
PATH. For global configs, use the absolute path touv(runwhich uv, e.g./Users/<you>/.local/bin/uv) and pass--directory /path/to/your/reposouvfinds your project'spyproject.tomlandspechatch.project.yml.
1. Project-Local — Cursor (.cursor/mcp.json) & Claude Code (.mcp.json):
{
"mcpServers": {
"spechatch": {
"command": "uv",
"args": ["run", "--extra", "mcp", "spechatch", "mcp"]
}
}
}2. Global — Antigravity (~/.gemini/config/mcp_config.json), Cursor (~/.cursor/mcp.json), Claude Code & Windsurf:
{
"mcpServers": {
"spechatch": {
"command": "/Users/<you>/.local/bin/uv",
"args": [
"run",
"--directory",
"/path/to/your/repo",
"--extra",
"mcp",
"spechatch",
"mcp"
]
}
}
}3. VS Code / GitHub Copilot — Project-Local (.vscode/mcp.json) or Global User mcp.json:
{
"servers": {
"spechatch": {
"type": "stdio",
"command": "uv",
"args": [
"run",
"--directory",
"${workspaceFolder}",
"--extra",
"mcp",
"spechatch",
"mcp"
]
}
}
}(For VS Code's global User mcp.json, replace "uv" with /Users/<you>/.local/bin/uv and "${workspaceFolder}" with your repo path — or use a globally installed spechatch via uv tool install ".[incubator,mcp,mysql]".)
4. Antigravity — Project-Local Workspace Plugin (.agents/plugins/spechatch/):
Create two files inside your repo so Antigravity discovers and scopes the MCP server strictly to that workspace:
// .agents/plugins/spechatch/plugin.json
{
"name": "spechatch"
}// .agents/plugins/spechatch/mcp_config.json
{
"mcpServers": {
"spechatch": {
"command": "/Users/<you>/.local/bin/uv",
"args": ["run", "--extra", "mcp", "spechatch", "mcp"]
}
}
}5. Codex CLI — Project-Local (.codex/config.toml) or Global (~/.codex/config.toml):
[mcp_servers.spechatch]
command = "uv"
args = ["run", "--extra", "mcp", "spechatch", "mcp"]
# For global ~/.codex/config.toml, use absolute uv path and add "--directory", "/path/to/your/repo"Windows Global MCP Config Paths:
Antigravity:
%USERPROFILE%\.gemini\antigravity\mcp_config.json(or portable workspace plugin at.agents/plugins/spechatch/)VS Code (Copilot):
%APPDATA%\Code\User\mcp.json(or portable.vscode/mcp.jsonusing${workspaceFolder})Cursor:
%USERPROFILE%\.cursor\mcp.json(or portable.cursor/mcp.json)Claude Code:
%USERPROFILE%\.claude.json(or portable.mcp.json)Codex CLI:
%USERPROFILE%\.codex\config.toml(or portable.codex/config.toml)Windsurf:
%USERPROFILE%\.codeium\windsurf\mcp_config.json(On Windows,
uvinstalls to%USERPROFILE%\.local\bin\uv.exe; JSON configs accept either escaped backslashesC:\\Users\\...\\repoor forward slashesC:/Users/.../repo, and"command": "uv"works portably across OSes whenuvis onPATH.)
Project & Agent Setup
spechatch init
Generate spechatch.project.yml for the current repository.
Option | Description |
| Scan repository languages, frameworks, |
| Explicit project slug (defaults to scanned project name or directory name; also derives |
| Default project locale written to |
| Automatically enable stack-detected Tier 2 rule packs ( |
| Comma-separated bundled skills or rule packs to enable immediately in |
| Overwrite an existing |
spechatch constitute
Generate starter constitution.md at paths.constitution_file (default specs/constitution.md). Resolves templates in order: explicit --template > .spechatch/templates/constitution.md > built-in renderer.
Option | Description |
| Pre-populate tech stack and tooling sections from a repository scan. |
| Optional path to a custom Markdown template file ( |
| Overwrite an existing constitution file. |
spechatch create blueprint
Scaffold a high-level architecture blueprint Markdown file (works even before spechatch init). Resolves templates in order: explicit --template > .spechatch/templates/blueprint.md > built-in template, substituting {{name}}, {{slug}}, {{project}}, and {{date}}.
Option | Description |
| (required) Human-readable blueprint title (default output: |
| Optional path to a custom Markdown template file. |
| Optional output path (creates missing parent directories). |
| Overwrite an existing blueprint file. |
spechatch create makefile
Generate a standalone Makefile (or non-destructively append/update a managed block in an existing Makefile) with low-typing sh-* shortcuts for every spechatch command.
Option | Description |
| Target directory where the |
| Output filename or path (defaults to |
| Override the |
| Include only standalone Local SDD shortcuts (omit Incubator targets). |
| Append or idempotently update the managed |
| Overwrite an existing |
spechatch create justfile
Generate a cross-platform justfile (or non-destructively append/update a managed block in an existing justfile/Justfile) with set windows-shell := ["powershell.exe", "-NoLogo", "-Command"] and sh-* recipes for macOS, Linux, and Windows.
Option | Description |
| Target directory where the |
| Output filename or path (defaults to |
| Override the |
| Include only standalone Local SDD recipes (omit Incubator recipes). |
| Append or idempotently update the managed |
| Overwrite an existing |
| Preview the rendered |
spechatch skills / spechatch rules / spechatch agents
Manage bundled SDD skills (3 core + 9 optional methodology skills: spechatch-code-review, spechatch-bug-triage, spechatch-safe-refactor, spechatch-security-review, spechatch-semver, spechatch-architecture-design, spechatch-accessibility-audit, spechatch-bdd-testing, spechatch-domain-driven-design), rule packs (4 core + 11 methodology + 4 tooling: python-uv, typescript-strict, go-standard, rust-cargo), canonical command entrypoint rules, and multi-agent mirrors across Antigravity (.agents/), Cursor (.cursor/rules/*.mdc), Claude Code (.claude/skills/*/SKILL.md + managed CLAUDE.md block), Codex (managed AGENTS.md block), and VS Code / GitHub Copilot (.github/skills/, .github/copilot-instructions.md, .github/instructions/*.instructions.md). All Tier 1/2 packs are localized across all 5 BCP 47 locales (see full table in Agent Skills & Rule Packs).
spechatch <skills|rules|agents> catalog [--tier core|methodology|tooling|custom]— Browse all bundled and Tier 3 custom/team skills and rule packs (agents.pack_dirs, default[".spechatch/packs"]) with enabled status.spechatch <skills|rules|agents> add <NAME...> [--sync]— Enable bundled skills/rule packs inspechatch.project.yml(and optionally sync immediately with--sync).spechatch <skills|rules|agents> remove <NAME...>— Disable bundled skills/rule packs inspechatch.project.yml.spechatch <skills|rules|agents> list— Show sync status (synced,drifted,missing,unmanaged).spechatch <skills|rules|agents> sync [--dry-run] [--diff] [--force]— Render and write managed files (<!-- managed-by: spechatch -->). Never overwrites custom unmanaged rules unless--forceis passed.
Spec Authoring & Local Verification
spechatch new <kind> <title>
Scaffold a new spec using configured counters and templates, executing matching before-spec and after-spec hooks.
Option | Description |
| Spec kind configured in |
| Human-readable spec title. |
| Owning epic ID (e.g. |
| Comma-separated upstream spec IDs (e.g. |
| Target or shipped SemVer version (e.g. |
| Author handle written to frontmatter |
| Allocate a non-colliding |
| Atomically allocate the spec ID from the incubator server ( |
| Explicit spec ID override. |
| Skip configured |
spechatch clarify <spec_id>
Audit a specification for ambiguities (SDD Clarify phase — eliminate the Ambiguity Tax): detects numbered [NEEDS CLARIFICATION] markers, TBD/TODO placeholders, missing or vague GIVEN / WHEN / THEN Acceptance Criteria, and missing Out of Scope sections.
Option | Description |
| Prompt interactively to resolve each |
| Resolve marker |
| Transition frontmatter |
| Upsert the clarified spec to the Incubator (or stay local when |
| Emit structured JSON clarify audit output. |
spechatch inspect [spec_id]
Inspect one or all specifications for structural conformance against their configured templates (project overrides in paths.templates_dir first, then built-in localized templates). Checks required sibling artifacts (plan.md, tasks.md), required frontmatter keys, ## H2 sections (normalizing optional numbering), and unfilled template boilerplate.
Option | Description |
| Optional single spec ID (e.g. |
| Filter inspection to a specific spec kind ( |
| Skip terminal/closed specs ( |
| Treat warnings (such as unfilled template placeholders) as failures. |
| Override template locale for inspection. |
| Emit structured JSON template conformance report. |
spechatch security audit
Run a deterministic, offline Layer 1 security audit across SDD and AI-agent workspaces: detects leaked secrets/credentials, AI-agent "Rules File Backdoor" hidden Unicode characters and curl|sh pipes, workspace/Incubator misconfigurations, and unpinned or over-privileged GitHub Actions workflows. Supports inline # spechatch-security-ignore / <!-- spechatch-security-ignore --> suppressions.
Option | Description |
| Audit category: |
| Minimum severity that causes exit code |
| Emit structured JSON security audit report. |
| Emit SARIF 2.1.0 report for GitHub Code Scanning (pair with |
spechatch security scan
Run external security scanners declared under security.scanners: in spechatch.project.yml (ruff-json, pip-audit-json, npm-audit-json, bandit-json, sarif, or universal exit-code), normalize findings into the shared SecurityFinding schema, optionally merge Layer 1 security audit findings, and export JSON or SARIF 2.1.0.
Option | Description |
| Run only the named configured scanner(s) (repeatable). |
| Merge built-in Layer 1 |
| Override |
| Do not fail if a configured scanner binary is not installed locally. |
| Emit normalized JSON or SARIF 2.1.0 (use |
spechatch promote <spec_id>
Promote a brainstorm (BS-*) or nice-to-have (NTH-*) spec into a full spec (default) or epic, preserving the source file and full audit trail (promoted_from / promoted_to cross-links, status: done on source, and automatic ROADMAP.md sync).
Option | Description |
| Source |
| Target kind: |
| Optional title override for the promoted spec (defaults to source title). |
| Owning epic ID (e.g. |
| Comma-separated upstream spec IDs. |
| Target SemVer version. |
| Author handle (defaults to |
| Atomically allocate the target ID from the incubator and upsert both specs. |
| Explicit target spec ID override. |
| Allow re-promoting a spec that already has |
| Skip configured |
spechatch step <spec_id>
Parse tasks.md checkboxes and print granular completion (tasks_done/tasks_total).
Option | Description |
| Upsert updated task progress to the incubator ledger. |
spechatch test [spec_id], spechatch test run & spechatch test ingest
Validate specs locally, run configured test runners with automatic JUnit attribution, or ingest pre-built CI JUnit XML reports.
Local Spec Validation:
spechatch test [spec_id] [--run-linked]Validates YAML frontmatter, required multi-artifacts, Clarify
[NEEDS CLARIFICATION]markers, and dead test links.--run-linkedexecutes linked test commands declared in spec frontmatter and enforces the non-empty JUnit execution gate (executed_count > 0).
One-Command Run & Health Sync (Language-Agnostic):
spechatch test run [--runner NAME] [--commit SHA] [--branch NAME] [--remote]Executes all configured
tests.runnersfromspechatch.project.yml(Python, Vitest, Playwright, Go, Rust, etc.) into temporary JUnit XML file(s), auto-detects Git commit & branch, attributes results to linked specs, and with--remoteupdates live spechealth(untested→healthy|regressed) in the incubator DB in one step:
uv run --all-extras spechatch test run --remoteCI JUnit Regression Attribution:
spechatch test ingest --junit <path_or_glob> [--junit ...] [--commit SHA] [--branch NAME] [--remote]Parses standard JUnit XML reports (
pytest,vitest,jest,playwright,go test,cargo nextest) and maps passing/failing test cases back to linked specs.Exits
1if any spec regressed; with--remote, pushes attribution toPOST /tests/ingest, updates livehealth(untested→healthy|regressed), and triggersspec.regressedSSE & webhook alerts.
Example — run pytest and update spec
healthin the incubator database:uv run --all-extras pytest --junitxml=/tmp/junit.xml uv run --all-extras spechatch test ingest --junit /tmp/junit.xml \ --commit $(git rev-parse --short HEAD) \ --branch $(git branch --show-current) \ --remote
spechatch verify
Unified offline pre-commit and CI gate combining spec validation, roadmap drift detection, and staged spec-to-implementation drift checks.
Option | Description |
| Inspect staged Git files ( |
| Also execute linked test commands declared in spec frontmatter. |
| Skip |
| Emit a machine-readable JSON verification report. |
Respects mode in spechatch.project.yml: exits 1 on findings in strict mode; prints warnings and exits 0 in advisory mode.
spechatch ci <init | summary>
Scaffold a ready-to-run GitHub Actions verification workflow and generate idempotent PR summary comments (touched specs, AC-* checkbox completion, and drift findings).
spechatch ci init [--provider github] [--path PATH] [--branches CSV] [--python-version VER] [--no-remote] [--no-pr-comment] [--force] [--dry-run]— Write.github/workflows/spechatch-verify.ymlusing least-privilege permissions,spechatch verify,spechatch test run, and idempotent PR commenting (<!-- spechatch-ci-summary -->).spechatch ci summary [--base REF] [--no-roadmap] [--markdown | --json] [-o PATH]— Verify specs (including PR changed-file drift against--base) and render a Markdown PR comment or structured JSON report.
spechatch resolve
Deterministically resolve post-merge conflicts in standalone/multi-branch repos: renumbers duplicate spec IDs (keeping the earliest spec by created timestamp, or --keep PATH), regenerates conflicted specs/ROADMAP.md, and flags any spec files with unresolved prose Git conflict markers (<<<<<<<) without modifying them.
Option | Description |
| Preview planned renumbering and roadmap regeneration without writing files. |
| Spec path that should retain its original ID when resolving a duplicate (repeatable). |
| Emit a machine-readable JSON resolution report. |
spechatch doctor
Run a read-only, single-command diagnostic audit of your workspace (config, constitution, specs, git-hooks, agents, secrets, shell-docs, and incubator).
Option | Description |
| Skip the Incubator HTTP/DB health probe (for standalone offline workspaces). |
| HTTP timeout in seconds for the Incubator probe (default |
| Treat warnings as failures (exit code |
| Emit a machine-readable JSON diagnostic report. |
spechatch roadmap
spechatch roadmap sync [--dry-run] [--remote] [--prune]— Deterministically renderspecs/ROADMAP.mdgrouped by kind (Epics,Specs,Bugfixes,Hotfixes, etc.) withVersionandYYYY-MM-DD HH:MMtimestamps. Pass--remoteto also upsert all local specs to the incubator database (developer+role), and combine with--prune(maintainer+role) to remove orphaned remote ledger rows not in Git and reconcile per-kind Incubator counter prefixes, padding, andnext_valuefloors (supports--dry-runpreview).spechatch roadmap diff— Exit1and show unified diff ifspecs/ROADMAP.mdis out of sync withspecs/.
spechatch changelog
Deterministically generate Keep a Changelog Markdown (or structured JSON) directly from completed, versioned specifications (Features for spec/epic, Bug Fixes for bugfix/hotfix, sorted by descending SemVer).
Option | Description |
| Render release notes for a single SemVer version (exits |
| Write rendered Markdown to |
| Include active non-done specs under an |
| Emit structured JSON ( |
spechatch version
Inspect or bump the project's version across all auto-detected manifests (pyproject.toml + uv.lock, package.json + package-lock.json, Cargo.toml, VERSION, and README.md Shields.io version badges) using SemVer or CalVer.
spechatch version [show] [--remote | --local] [--file PATH] [--json]— Print the current project version and detected manifests; with--remote(orSPECHATCH_INCUBATOR_AUTO_SYNC=true), compares against the Incubator's tracked version and flags drift.spechatch version bump [patch|minor|major|<explicit>] [--semver | --calver] [--pre LABEL] [--remote | --local] [--file PATH] [--dry-run] [--no-lock] [--json]— Bump and synchronize manifests (with--remote, atomically allocates the next monotonic version on the Incubator and dispatchesversion.bumpedwebhooks).
spechatch install-hooks
Install or remove the managed .git/hooks/pre-commit shim (# managed-by: spechatch, chmod 0755, supports Git worktrees) that runs spechatch verify --staged.
Option | Description |
| Overwrite an existing unmanaged |
| Remove the managed pre-commit hook (refuses to delete unmanaged hooks). |
Secrets Management
spechatch secret <put|edit|get|list|delete>
Manage 0600-permissioned secrets without editing .env files by hand or leaking credentials in shell history. Leading and trailing whitespace is automatically stripped on write (put / edit), and whitespace-only values are rejected.
Subcommand | Description |
| Create or update a secret (prompts securely via |
| Update an existing secret (fails if key does not exist). |
| Print a stored secret (masked by default; pass |
| List stored secrets with |
| Remove a secret key from the store. |
Scope & Prefix Flags:
Flag | Behavior |
(default) | Stores in |
| Stores in |
| Stores in |
| (on |
Incubator Server & Coordination
spechatch incubator <init | user | key | project | member | audit>
Scaffold Docker deployment files and manage multi-project Incubator users, API keys, projects, per-project RBAC memberships, and audit logs from the CLI (no raw curl needed):
spechatch incubator init [--path DIR] [--filename NAME] [--version VER] [--force]— Generate a PyPI-basedDockerfile(with non-rootUSER spechatch,[incubator,mysql]drivers, and/api/spechatch/v1/healthHEALTHCHECK) and.dockerignore.spechatch incubator user <create|list|update|activate|deactivate>— Manage user accounts (superuseronly; blocks deactivating/demoting the last active superuser).spechatch incubator key <create|list|revoke>— Mint (human/agent/ci), list, or revokeshk_*API keys.spechatch incubator project <create|list|show|update|activate|deactivate>— Create (superuser), inspect, update, or archive projects (owner/superuser).spechatch incubator member <add|list|remove>— Assign (owner/maintainer/developer/viewer), list, or remove project memberships (accepts user ID or username).spechatch incubator audit [--limit N] [--json]— View recent auth and admin audit log events (superuseronly).
spechatch serve
Start the FastAPI incubator server (requires [incubator] extra). Automatically runs Alembic upgrade head on startup.
Option | Description |
| Bind host (default |
| Bind port (default |
| Enable uvicorn auto-reload for local development. |
| Explicitly allow non-loopback binding with |
spechatch admin <init|reset-password|transfer-superuser>
DB-direct operator bootstrap and break-glass recovery commands against SPECHATCH_DATABASE_URL (requires [incubator] extra; all actions are logged to auth_audit_events):
spechatch admin init [--username USER] [--full-name NAME] [--key-name LABEL]— One-time creation of the initialsuperuserand one-timeshk_*humanAPI key (refuses to run if asuperuseralready exists).spechatch admin reset-password <username> [--rotate-key] [--key-name LABEL]— Resets the user's Argon2id password viagetpass; with--rotate-key, revokes all prior API keys and mints a fresh one-timeshk_*key.spechatch admin transfer-superuser --from <old_user> --to <new_user> [--full-name NAME] [--key-name LABEL]— Demotes and deactivates<old_user>(revoking all their API keys immediately) and promotes or creates<new_user>assuperuserwith a fresh one-timeshk_*key.
spechatch bootstrap
Idempotently seed the incubator server's counters (highest + 1) and ledger rows from existing local specs/ on disk.
spechatch healthcheck / spechatch ping
Check Incubator server availability, version, auth mode, and live database latency (SELECT 1 via GET /api/spechatch/v1/health) — or pass --db to ping SPECHATCH_DATABASE_URL directly without a running server (useful for waking scale-to-zero Neon databases).
Option | Description |
| Ping |
| HTTP request timeout in seconds (default |
| Print machine-readable JSON output. |
spechatch sync
Reconcile offline DRAFT-* specs against the incubator: atomically allocates sequential IDs (deterministic Idempotency-Key), renames draft folders/files, rewrites frontmatter id: + headings + cross-references (depends_on / epic_id), upserts to /roadmap, and syncs specs/ROADMAP.md.
spechatch approve <spec_id> --phase <phase> [--comment NOTE]
Record an immutable human checkpoint approval (phase: specify | clarify | plan | tasks | implement) bound to the spec's content_hash and constitution_hash. When SPECHATCH_AUTH_ENABLED=true, requires a human API key (agent/ci keys receive 403 Forbidden).
spechatch revise <spec_id> --summary TEXT [--added ...] [--modified ...] [--removed ...] [--no-local-delta]
Open a new living revision (rev + 1) with a structured Change Delta (Added / Modified / Removed), append the Change Delta section to the local spec file (unless --no-local-delta), and reopen a done spec to in_progress.
spechatch claim <spec_id> [--ttl 1800] [--force] [--release]
Acquire, renew, or release a soft advisory TTL lease (default 30 min; 60–86400s). Prevents parallel agents from picking the same spec; expired leases auto-release.
spechatch epic <status|next> <epic_id>
spechatch epic status <epic_id>— Show dynamically computed child progress (done/total,active,ready,blocked,derived_status).spechatch epic next <epic_id>— List unblocked, unleased child specs ready for parallel dispatch.
spechatch webhook <add|list|update|test|toggle|deliveries|delete>
Manage project-scoped actionable webhooks on the Incubator server (dispatched asynchronously on spec.claimed, spec.released, spec.approved, spec.revised, spec.regressed, spec.recovered, spec.abandoned, version.bumped, and status/version-changing roadmap.upserted events):
spechatch webhook add <url> [--events CSV] [--format json|slack|discord|teams] [--template PATH] [--secret STR]— Register a project webhook with optional event filtering, payload preset, custom local JSON/Markdown template ({{event}},{{project}},{{spec_id}},{{title}},{{kind}},{{status}},{{previous_status}},{{status_transition}},{{version}},{{actor}},{{next_action}},{{timestamp}}), and HMAC-SHA256 signing.spechatch webhook update <webhook_id> [--events CSV] [--format ...] [--template PATH] [--clear-template]— Update a webhook's events, format, or custom payload template (or revert to built-in cards with--clear-template).spechatch webhook list [--json]— List project webhooks (secrets are never exposed).spechatch webhook test <webhook_id>— Send a synchronous signedwebhook.pingdelivery and report HTTP status and latency.spechatch webhook toggle <webhook_id> --enable|--disable— Enable or disable a webhook.spechatch webhook deliveries <webhook_id> [--limit 20] [--json]— Inspect persisted delivery logs (rolling 50-row retention per webhook).spechatch webhook delete <webhook_id>— Delete a webhook.
spechatch context [--spec SPEC_ID] [--json]
Fetch project orientation context (active specs, active leases, regressed specs, parent epic, upstream depends_on, active siblings, and local constitution.md hash).
Agent Skills & Rule Packs (3-Tier Catalog)
spechatch organizes AI agent skills and rule packs into three opt-in tiers so repositories stay lean while getting immediate day-1 guardrails:
Tier | Contents | Localization & Behavior |
Core | Skills: | Parameterized from |
Tier 1 — Methodology | Skills: | Stack-agnostic, timeless engineering practices; localized across all 5 BCP 47 locales ( |
Tier 2 — Tooling | Rules: | Suggested by |
Tier 3 — Custom / Team | Repo-local | Drop skills at |
# Browse all bundled + custom packs by tier
spechatch agents catalog
spechatch agents catalog --tier tooling
spechatch agents catalog --tier custom
# Enable packs in spechatch.project.yml and sync across all targets
spechatch agents add spechatch-code-review tdd-first python-uv --sync
# Disable a pack
spechatch agents remove tdd-first
# Discover, pre-install security-scan, install, and update public skills from GitHub or JSON indexes
spechatch agents market list anthropics/skills
spechatch agents market search "pdf" --source anthropics/skills
spechatch agents market install anthropics/skills pdf --sync
spechatch agents market update --syncConfiguration (spechatch.project.yml)
Generated by spechatch init [--scan] and validated via Pydantic (src/spechatch/config.py):
schema_version: 1
project: my-project
secret_prefix: MY_PROJECT # Uppercase env-var namespace for global secrets
locale: en-US # Template & roadmap locale (en-US, es-ES, it-IT, fr-FR, de-DE)
mode: strict # advisory (warn + exit 0) | strict (block + exit 1)
paths:
specs_dir: specs
constitution_file: specs/constitution.md
roadmap_file: specs/ROADMAP.md
templates_dir: .spechatch/templates
kinds:
epic: epics
spec: "."
bugfix: bugfixes
hotfix: hotfixes
brainstorm: brainstorms
nice-to-have: nice-to-have
code-review: reviews
artifacts:
epic: [EPIC.md]
spec: [specification.md, plan.md, tasks.md]
bugfix: [single]
hotfix: [single]
brainstorm: [single]
nice-to-have: [single]
code-review: [single]
counters:
global: { prefix: "", start: 1, pad: 6, step: 1 }
epic: { counter: epic, prefix: "E-", start: 1, pad: 4, step: 1 }
spec: { counter: global }
bugfix: { counter: bugfix, prefix: "BUG-", start: 1, pad: 4, step: 1 }
hotfix: { counter: hotfix, prefix: "HF-", start: 1, pad: 4, step: 1 }
tests:
required: [epic, spec, bugfix, hotfix, code-review]
optional: [brainstorm, nice-to-have]
runners:
pytest:
command: "uv run pytest {targets} --junitxml={report}"
hooks:
before-spec: [] # Optional executable commands receiving JSON payload on stdin
after-spec: [] # Each entry supports optional `kinds: [hotfix, ...]` filter
agents:
targets: [antigravity, cursor] # Supports: antigravity, cursor, claude, codex, copilot
skills: [spechatch-driven-development, spechatch-context, spechatch-sync-cursor]
rule_packs: [spechatch-core]
pack_dirs: [.spechatch/packs] # Optional repo-local or shared team skill/rule pack dirs
commands:
strict: true
entrypoints:
- name: make
file: Makefile
invoke: "make {target}"
forbid_raw: [pytest, ruff, mypy]
targets:
check: { description: "Run full quality gate", require_confirmation: true }Secrets & Environment Variables (SPECHATCH_*)
All runtime configuration is loaded through SpechatchSettings (pydantic-settings in src/spechatch/settings.py) with strict layer precedence:
Process environment variables (highest — CI/CD, Docker)
Repo-local
.spechatch/.env(spechatch secret ... --local, auto-gitignored)Repo root
.envUser-global
~/.config/spechatch/.env(defaultspechatch secret ...)
Within each layer, project-prefixed SPECHATCH_<SECRET_PREFIX>_<KEY> overrides shared SPECHATCH_<KEY>. When running inside a project directory, load_settings() automatically detects secret_prefix from spechatch.project.yml.
See .env.example for a ready-to-copy template.
Variable | Default | Description |
|
| Base URL of the incubator server used by CLI commands. |
|
| Default path to project configuration file. |
| (unset; falls back to project | BCP 47 locale override for generated templates and roadmap ( |
| (unset) | Default author handle auto-populated into frontmatter |
|
| Set |
| (unset) | Bearer API key ( |
| (unset) | Legacy alias for |
|
| PostgreSQL/Neon ( |
|
| Table name prefix applied to all SQLModel tables and Alembic's |
|
| Set |
| (unset) | Initial superuser username bootstrapped on server startup. |
| (unset) | Initial superuser password (hashed with Argon2id on startup). |
| (unset) | Optional deterministic initial |
Incubator HTTP & SSE API
All endpoints live under /api/spechatch/v1.
Auth, RBAC & Open Mode
Global Roles:
superuser(creates projects, users, and memberships),member.Project Roles:
owner>maintainer>developer>viewer.API Keys (
Authorization: Bearer shk_...): Stored only as SHA-256 hash + prefix; carryactor_type(human|agent|ci). WhenSPECHATCH_AUTH_ENABLED=true,POST /specs/{id}/approvalsrequiresmaintainer+ANDactor_type == "human".Solo Open Mode: With
SPECHATCH_AUTH_ENABLED=false(default), all endpoints execute as an anonymous principal with zero auth friction.
Onboarding a New Developer (Users, Memberships & API Keys)
Using your superuser shk_* API key configured via spechatch secret put API_KEY (or interactively via Swagger UI at http://127.0.0.1:8787/docs → Authorize):
# 1. Create the user (role: member | superuser)
spechatch incubator user create alice --full-name "Alice Dev" --role member
# 2. Assign the user to a project (role: owner | maintainer | developer | viewer)
spechatch incubator member add spechatch alice --role developer
# 3. Issue a personal API key for the user (actor_type: human | agent | ci)
spechatch incubator key create alice --name alice-laptop --actor-type humanThe developer then stores the returned shk_* key on their machine with spechatch secret put API_KEY.
Endpoints Reference
Group | Method & Path | Min Role | Purpose |
Health |
| Public | Live |
Auth & Users |
| Authenticated | Inspect active principal, scopes, and memberships. |
|
| Create, list, update, or deactivate users (Argon2id hashing; blocks demoting/deactivating last active superuser). | |
|
| Issue (one-time plaintext), list, and revoke | |
|
| Query immutable | |
Projects |
|
| Create, list, inspect, update, or archive/reactivate projects. |
|
| Manage project memberships & roles. | |
|
| Read or update DB-authoritative project governance settings (enforcement mode, human approvals, lease TTL caps, constitution hash). | |
|
| Read or atomically bump monotonic SemVer/CalVer project version ( | |
Ledger |
|
| Atomic monotonic ID allocation (requires |
|
| Upsert (with DAG cycle detection) or list live roadmap rows. | |
|
| Record a spec test run bound to | |
|
| Mark a spec | |
|
| Idempotently seed counters & ledger rows from an existing repo. | |
Coordination |
|
| Record/list human checkpoint approvals bound to |
|
| Increment | |
|
| Acquire/renew ( | |
|
| Dynamic epic progress roll-up & unblocked, unleased child queue. | |
|
| Agent orientation context (active specs, leases, regressed specs, epic/upstream deps). | |
|
| Typed Server-Sent Events ( | |
CI & Webhooks |
|
| Ingest JUnit attribution results, update live |
|
| Register ( |
Docker Deployment
The included stateless, non-root Dockerfile connects directly to Neon PostgreSQL, any external PostgreSQL 15+, or MySQL 8+/MariaDB 10.6+ (with [mysql] extra) via SPECHATCH_DATABASE_URL. For external projects, you can scaffold a PyPI-based Dockerfile + .dockerignore in one command with spechatch incubator init:
# Build locally (from this repo or after `spechatch incubator init`)
docker build --load -t spechatch-incubator .
# Run with inline env vars (or `--env-file ~/.config/spechatch/.env`)
docker run --rm -p 8787:8787 \
-e SPECHATCH_DATABASE_URL="postgresql://user:pass@ep-example.neon.tech/neondb?sslmode=require" \
-e SPECHATCH_AUTH_ENABLED="true" \
-e SPECHATCH_ADMIN_USERNAME="admin" \
-e SPECHATCH_ADMIN_PASSWORD="change-me-strong-password" \
spechatch-incubatorContributing & Roadmap
For local development setup, quality gates (
Makefile/uv), and contribution guidelines, see CONTRIBUTING.md.For the live, auto-generated list of all completed and in-progress specs, see specs/ROADMAP.md.
Available Tools
19 toolsspechatch_claimC
Acquire, renew, or release a soft advisory TTL lease on the Incubator.
Inputs: spec_id (required), force, release, ttl_seconds. Returns: object
spechatch_clarifyC
Audit a spec for ambiguities, optionally resolve numbered [NEEDS CLARIFICATION] markers, and promote to clarified.
Inputs: spec_id (required), remote, answers, mark_clarified. Returns: object
spechatch_contextC
Get SDD project orientation context, constitution hash, and active specs.
Inputs: remote, spec_id. Returns: object
spechatch_doctorC
Run a single-command health and configuration audit of this spechatch workspace.
Inputs: strict, timeout, skip_remote. Returns: object
spechatch_epic_nextA
List unblocked, unleased child specs ready for parallel dispatch under an epic.
Inputs: epic_id (required). Returns: object
spechatch_epic_statusC
Query live roll-up progress for an epic from the Incubator.
Inputs: epic_id (required). Returns: object
spechatch_healthcheckB
Check Incubator server & DB health (or ping SPECHATCH_DATABASE_URL directly).
Inputs: db_only, timeout. Returns: object
spechatch_inspectC
Inspect one or all specs for structural conformance against configured templates.
Inputs: kind, locale, strict, spec_id, +1 more. Returns: object
spechatch_list_specsB
List local specifications, optionally filtered by kind or status.
Inputs: kind, status. Returns: object
spechatch_new_specC
Scaffold a new specification using configured counters and templates.
Inputs: kind (required), title (required), author, locale, +5 more. Returns: object
spechatch_promoteC
Promote a brainstorm (BS-) or nice-to-have (NTH-) spec to a full spec or epic.
Inputs: spec_id (required), force, title, author, +5 more. Returns: object
spechatch_reviseC
Open a living revision with a Change Delta on the Incubator.
Inputs: spec_id (required), summary (required), added, removed, +2 more. Returns: object
spechatch_roadmap_syncC
Sync deterministic specs/ROADMAP.md, optionally upsert specs, and prune orphaned remote rows.
Inputs: prune, locale, remote, dry_run. Returns: object
spechatch_security_auditC
Run deterministic Layer 1 SDD & AI-agent security audit (secrets, ai-rules, workspace, ci).
Inputs: fail_on, category. Returns: object
spechatch_security_scanC
Run Layer 2 configured external security scanners from spechatch.project.yml.
Inputs: fail_on, scanners, allow_missing, include_audit. Returns: object
spechatch_stepB
Report tasks.md progress for a spec and optionally sync to the Incubator.
Inputs: spec_id (required), remote. Returns: object
spechatch_test_runC
Run configured test runners, attribute JUnit results to specs, and optionally ingest health.
Inputs: branch, commit, remote, runner. Returns: object
spechatch_verifyC
Validate specs, roadmap drift, and optional staged spec-implementation drift.
Inputs: staged, run_linked, check_roadmap. Returns: object
spechatch_versionC
Inspect or bump the project's version across manifests (locally or atomically via Incubator).
Inputs: pre, files, action, remote, +4 more. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 19 tools
Most tools target distinct actions across a well-structured SDD lifecycle (new_spec, clarify, revise, promote, claim, step). A few pairs could be confused: spechatch_doctor vs spechatch_healthcheck, and spechatch_inspect vs spechatch_verify, while spechatch_security_scan (Layer 2 external scanners) vs spechatch_security_audit (Layer 1 deterministic) relies on the descriptions to separate them.
All tools share the spechatch_ prefix and snake_case, which is highly predictable. There are minor style deviations (noun-style entries like context, version, doctor, healthcheck alongside verb-style verify, promote, new_spec), but readability remains high.
19 tools is on the heavy side for a spec-driven development workflow. The domain is genuinely broad (specs, roadmap, epics, leases, tests, security, versions), but a few tools look mergeable (doctor/healthcheck, security_scan/security_audit).
The surface covers a full lifecycle: scaffold, list, inspect, clarify, revise, promote, verify, roadmap sync, epic dispatch/status, leases, testing, versioning, and two security layers. Minor gaps exist around explicit spec deletion/archival and fetching a single full spec body, but agents can work around these via inspect/list_specs and roadmap pruning.
Maintenance
Related MCP Connectors
AI-native git hosting — repos, PRs, issues, CI gates, and AI code review over MCP (60 tools).
Generate a typed SDK, CLI, and MCP server from any OpenAPI or GraphQL spec, and keep them current.
Spec-driven delivery: plans, solutions, ADRs, UX docs, tasks, rules and skills for AI agents.
Agent-native notes, tasks, dev-docs, vaults, sync & handoffs. MCP + OpenAPI dual surface.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables spec-driven development workflows with AI assistants, providing tools for managing specification lifecycles, task dependencies, code navigation, testing, and automated reviews through a unified CLI and MCP interface.4MIT
- AlicenseCqualityBmaintenanceAn MCP server implementing Spec-Driven Development workflows for AI-agent CLIs and IDEs like Claude Code and Cursor, enabling spec-first development with automated workflow guidance and quality checks.17333 npm56MIT
- AlicenseNot gradedqualityBmaintenanceAutonomous spec-to-product coding-agent CLI. Its MCP server exposes 34 tools over stdio: project state and task-queue ops, memory retrieve/store, code search, quality and verification reports, repo hotspots/co-changes, and structured findings/learnings.16,790 npm1,129Business Source 1.1
- AlicenseAqualityDmaintenanceMCP server that integrates GitHub Spec-Kit with AI coding agents to manage Spec-Driven Development workflows, including specification authoring, planning, task generation, and consistency analysis.131MIT