The JSON is the truth.
The documents are a deterministic projection of the model. Nothing exists only in Markdown.
spec-loop is for product owners who build with a coding agent: the agent maintains one JSON model per feature, projected into Markdown documents you read and edit, and every edit comes back to it over MCP.
Works the same with Gemini CLI, Claude Code and Codex.
The loop
You answer in the chat, or you edit a rendered document. The MCP server is the only writer of the model: it validates every change against the schema, renders the documents, and reconciles your edits back into the JSON.
reconcile
Six phases
A phase is left only when the schema says it is complete, and never while an owner edit is waiting to be reconciled.
Intent, actors, scope in and out, constraints, open questions.
One EARS sentence per behaviour, with facet and priority.
Given/When/Then criteria, at least one per requirement.
The file and symbol that will realise each requirement.
One declared test per criterion, status from the runner.
Every test passing or justified, no open question left.
Principles
They are why a rendered document can be trusted, and why your edits are never lost.
The documents are a deterministic projection of the model. Nothing exists only in Markdown.
Phases, their order, required fields and coverage rules live in one JSON Schema. The code names no phase.
Each edit is applied, or reported with its reason and kept as an open question. None is overwritten unread.
Install
Run the lines for your agent from your project folder. They register the server and copy the seven skills.
# Gemini CLI
gemini mcp add -s project -e SPEC_LOOP_ROOT="$PWD" spec-loop -- npx -y mcp-spec-loop@0.1.0
mkdir -p .agents/skills && cp -R /path/to/spec-loop/skills/* .agents/skills/
# Claude Code
claude mcp add --scope project spec-loop -- npx -y mcp-spec-loop@0.1.0
mkdir -p .agents/skills && cp -R /path/to/spec-loop/skills/* .agents/skills/ && mkdir -p .claude && ln -s ../.agents/skills .claude/skills
# Codex
codex mcp add spec-loop --env SPEC_LOOP_ROOT="$PWD" -- npx -y mcp-spec-loop@0.1.0
mkdir -p .agents/skills && cp -R /path/to/spec-loop/skills/* .agents/skills/
The npm package is not published yet. Until it is, clone the repository, run npm install, and replace npx -y mcp-spec-loop@0.1.0 with node /path/to/spec-loop/dist/mcp.js.