specgate/docs v1.8.0

Empezar#

Dos caminos, unos pocos comandos cada uno. Elige el que corresponde a tu carpeta.

Necesitas: Node.js 22 o posterior, git y el test runner que tu proyecto ya usa.

Two ways to start: existing code, or a new project — both end at the gate in CI Two lanes side by side, six steps each. Existing code: one, install Specgate in the project with npm i -D @rsaglobaltech/specgate. Two, adopt it, touching no code: npx specgate adopt. Three, set up your agent: npx specgate agents init --tool claude. Four, write down one behaviour you rely on: npx specgate new with that behaviour. Five, name its id, REQ-002, in a test that proves it, then deliver it: npx specgate apply REQ-002. Six, before each pull request: npx specgate check. A new project: one, create it with npx @rsaglobaltech/specgate@latest init, then set up your agent with npx specgate agents init --tool claude. Two, save the plan as docs/brief.md and turn one module into a draft: npx specgate propose --from-brief. Three, a person reads the draft and approves it at a terminal, which an agent cannot do: npx specgate change approve with the change id. Four, write a test that names REQ-002, then the code, and deliver it: npx specgate apply REQ-002. Five, once every requirement of the change is applied, archive it: npx specgate archive with the change id. Six, before each pull request: npx specgate check. Both lanes end at the same place: the gate in CI on every pull request, the same specgate check you run on your machine. EXISTING CODE — CODE THAT ALREADY WORKS A NEW PROJECT — AN EMPTY FOLDER PERSON 1Install it in the project npm i -D @rsaglobaltech/specgate 2Adopt it, touching no code npx specgate adopt 3Set up your agent npx specgate agents init --tool claude 4Write down one behaviour you rely on npx specgate new "<a behaviour you rely on>" 5Name REQ-002 in a test, then deliver it npx specgate apply REQ-002 6Before each pull request npx specgate check 1Create it, then set up your agent npx @rsaglobaltech/specgate@latest init npx specgate agents init --tool claude 2Save docs/brief.md, draft one module npx specgate propose --from-brief 3Read the draft, approve it yourself npx specgate change approve <change-id> 4A test names REQ-002, then the code npx specgate apply REQ-002 5Every requirement applied: archive npx specgate archive <change-id> 6Before each pull request npx specgate check The gate in CI on every pull request the same specgate check you run on your machine
Existing code and a new project start differently, and both end at the same gate on every pull request.

Un proyecto existente#

Un repositorio local cuyo código ya funciona.

  1. Instala Specgate en el proyecto: npm i -D @rsaglobaltech/specgate
  2. Adóptalo sin tocar código: npx specgate adopt — guarda el comando de tests que detecta, configura tu agente si hay uno instalado (preguntando antes; sin terminal —ejecutado por un agente o un script— no pregunta y pone claude --permission-mode acceptEdits), escribe las áreas que encontró en docs/specs/adoption.md en lugar de inventar requisitos y termina con una lista de lo que está listo. ¿Prefieres una app? npx specgate studio y pulsa Adopt en su pantalla de inicio.
  3. Configura tu agente con un solo comando, sus comandos y el agente de Build: npx specgate agents init --tool claude
  4. Escribe un comportamiento del que dependes, elegido de docs/specs/adoption.md cuando la adopción lo haya escrito: npx specgate new "<a behaviour you rely on>" — después sustituye la frase que escribió en spec.md y los <placeholders> de su escenario en features/ por los reales
  5. Nombra el nuevo id (REQ-002) en un test que lo demuestre — sirve uno que ya tengas — y entrégalo a través del gate: npx specgate apply REQ-002
  6. Antes de cada pull request, ejecuta el gate que también ejecuta CI: npx specgate check

Un proyecto nuevo#

Una carpeta vacía, quizá con el brief de un cliente.

  1. Crea el proyecto respondiendo unas pocas preguntas — npx @rsaglobaltech/specgate@latest init — y, en su carpeta, configura tu agente: npx specgate agents init --tool claude
  2. Guarda el plan como docs/brief.md y convierte un módulo en un borrador que revisa una persona: npx specgate propose --from-brief
  3. Cuando hayas leído el borrador, apruébalo tú, en tu terminal — un agente no puede, y apply lo espera: npx specgate change approve <change-id>
  4. Escribe un test que nombre un requisito del borrador — sus ids empiezan en REQ-002; REQ-001 es la línea base que escribió init — escribe el código y entrégalo: npx specgate apply REQ-002
  5. Cuando todos los requisitos del change estén aplicados, haz merge en la especificación: npx specgate archive <change-id>
  6. Antes de cada pull request, ejecuta el gate que también ejecuta CI: npx specgate check

Siguiente#