specgate/docs v1.8.0

Qué decirle a tu agente#

Specgate no piensa por tu agente de código, y tampoco necesita que tu agente lo estudie. Le da al agente lo que necesita cada paso: AGENTS.md (el contrato), specgate status (el siguiente paso), DRAFTING.md (el prompt para un módulo del brief) y specgate change instructions <artifact> --json (el formato exacto de cualquier fichero). Lo que tú le das al agente es breve: por dónde empezar y lo que nunca debe hacer.

Necesitas: un proyecto donde se haya ejecutado specgate init o specgate adopt, y los pasos de tu agente instalados con specgate agents init --tool <codex|opencode|claude>.

What each agent gets from Specgate, and which controls hold where A table of four agents against four things Specgate gives them. Claude Code: the rules in AGENTS.md; slash commands such as /specgate:apply in .claude/commands/; the MCP server through the plugin's .mcp.json; and hooks, the guard, from agents init --tool claude-plugin. Codex: AGENTS.md; skills such as $specgate-apply in .agents/skills/; the MCP server through mcp install --client codex; and hooks from --tool codex-hooks, written to .codex/hooks.json. OpenCode: AGENTS.md; commands such as /specgate-apply in .opencode/commands/; the MCP server through mcp install --client opencode; and hooks from --tool opencode-plugin. Any other agent CLI: AGENTS.md and the prompt that specgate status --prompt prints, to paste; the MCP server if it speaks MCP; no hooks, so no guard. Below, which controls hold where. Everywhere: the gate (specgate check), the seals, and approval first. With hooks: the guard, which enforces test first and refuses a person's acts and writes to sealed tests and control files. With a harness or CI: the outside judge, which reads the controls before the agent starts and compares them when it stops. RULES COMMANDS · SKILLS MCP SERVER HOOKS — THE GUARD Claude Code Codex OpenCode Any other agent CLI AGENTS.md the contract /specgate:apply … .claude/commands/ the plugin's .mcp.json --tool claude-plugin the guard AGENTS.md the contract $specgate-apply … .agents/skills/ mcp install --client codex --tool codex-hooks the guard AGENTS.md the contract /specgate-apply … .opencode/commands/ mcp install --client opencode --tool opencode-plugin the guard AGENTS.md the contract paste what status --prompt if it speaks MCP mcp serve no hooks no guard WHICH CONTROLS HOLD WHERE Everywhere the gate — specgate check the seals by hash approval first With hooks: the guard test first a person's acts refused sealed tests, control files refused With a harness or CI the outside judge: reads the controls before the agent starts, compares them when it stops A tool with no hooks has no guard; the gate, the seals and approval first still hold.
Every agent gets the rules and the steps; the hooks add the guard, the gate and the seals hold for all of them, and a harness or CI adds the outside judge.

Obtén el prompt del proyecto#

bash
specgate status --prompt         # the next step, the brief's modules left to draft
specgate status --prompt draft   # the next module of the brief
specgate status --prompt build   # the next requirements, one at a time

Imprime un prompt en inglés, escrito a partir del proyecto tal como está ahora: pégalo en Codex, OpenCode, Claude Code o cualquier otro agente. --json lo da como datos. Las secciones siguientes son los mismos prompts, para leerlos antes de pegar uno.

Cómo llama cada agente a los pasos de specgate#

AgentePasosInstalado por
Codex$specgate-draft, $specgate-apply, $specgate-check… (skills)specgate agents init --tool codex → .agents/skills/
OpenCode/specgate-draft, /specgate-apply, /specgate-check…specgate agents init --tool opencode → .opencode/commands/
Claude Code/specgate:draft, /specgate:apply, /specgate:check…specgate agents init --tool claude → .claude/commands/

El harness ejecuta el agente que nombra agent: en harness.config.yaml. agents init --tool codex pone el de Codex (codex exec -s workspace-write - < {prompt_file}); cámbialo con specgate config set agent "<command>".

Un proyecto nuevo, a partir de un brief#

Escribes docs/brief.md —qué es el producto, sus actores y sus módulos (Escribir el brief)— y después le das al agente:

text
This project uses specgate for spec-driven development. specgate is installed: run it as `specgate`.
Read AGENTS.md first: it is the contract you work under. Do not study specgate's own documentation;
specgate tells you what to do next.

Draft the modules of docs/brief.md, one at a time:
1. Run `specgate propose --from-brief <module>`. It opens the draft and writes DRAFTING.md in it.
2. Follow that DRAFTING.md: it is your prompt.
3. Run `specgate propose --from-brief <module>` again until it says "Ready to review".
4. Stop and say so: a person reviews each draft and answers its questions.

Después una persona revisa el borrador, responde questions.md y lo aprueba (specgate change approve <change> --layer …, o Changes en el studio).

Un proyecto existente#

Después de specgate adopt:

text
This project uses specgate. Read AGENTS.md first.
Write the first requirement from code that already exists: run `specgate propose <change-id>`,
write one requirement — one sentence of what the system SHALL do and a scenario with a real
example, the numbers an existing test already uses — then name it in that test and run
`specgate check`. Stop for a person to review it.

Cada día#

text
This project uses specgate. Read AGENTS.md first.
Build the next requirement:
1. Run `specgate status` and take the next requirement it names.
2. Write its test first, naming the requirement (REQ-NNN); see it fail.
3. Write the code until `specgate check` passes.
4. Run `specgate apply <REQ>`.
Repeat one requirement at a time. Stop when status names a step for a person.

O déjaselo al harness: specgate harness run da cada requisito al agente en su propia rama y conserva solo lo que pasa el gate (El harness).

Lo que el agente nunca hace#

Pon esto debajo de cada prompt; specgate status --prompt lo hace:

text
Rules you never break:
- Write the test first, and name the requirement in it: that mention is the link.
- Run `specgate check` before you say anything is done; only what it passes is done.
- Never edit spec.md, features/ or docs/specs/ to make a test pass.
- Never archive a change, approve a layer or answer a question in questions.md yourself: a person does.
- When a value is missing, ask (`specgate ask`) or record an assumption; never invent one.

Los guards imponen las dos primeras, y el «nunca apruebes» de la cuarta, en Claude Code, OpenCode y Codex, decida lo que decida el agente: el código espera un test que nombre el requisito, un gate en rojo impide que la sesión termine y specgate change approve se rechaza desde la sesión. Aprobar necesita a una persona en un terminal.

Siguiente#