specgate/docs v1.8.0

Start#

Two paths, a few commands each. Pick the one that matches your folder.

You need: Node.js 22 or later, git, and the test runner your project already uses.

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.

An existing project#

A local repository whose code already works.

  1. Install Specgate in the project: npm i -D @rsaglobaltech/specgate
  2. Adopt it, touching no code: npx specgate adopt — it saves the test command it detects, sets your agent when one is installed (asking first; with no terminal — run by an agent or a script — it does not ask and sets claude --permission-mode acceptEdits), writes the areas it found to docs/specs/adoption.md instead of inventing requirements, and ends with a list of what is ready. Prefer an app? npx specgate studio and press Adopt on its start screen.
  3. Set up your agent with one command, its commands and Build's agent: npx specgate agents init --tool claude
  4. Write down one behaviour you rely on, picked from docs/specs/adoption.md when adoption wrote one: npx specgate new "<a behaviour you rely on>" — then replace the sentence it wrote in spec.md and the <placeholders> of its scenario under features/ with the real ones
  5. Name the new id (REQ-002) in a test that proves it — one you already have will do — then deliver it through the gate: npx specgate apply REQ-002
  6. Before each pull request, run the gate CI runs too: npx specgate check

A new project#

An empty folder, maybe with a client's brief.

  1. Create the project, answering a few questions — npx @rsaglobaltech/specgate@latest init — then, in its folder, set up your agent: npx specgate agents init --tool claude
  2. Save the plan as docs/brief.md and turn one module into a draft a person reviews: npx specgate propose --from-brief
  3. Once you have read the draft, approve it yourself, at your terminal — an agent cannot, and apply waits for it: npx specgate change approve <change-id>
  4. Write a test that names a requirement of the draft — its ids start at REQ-002; REQ-001 is the baseline init wrote — write the code, and deliver it: npx specgate apply REQ-002
  5. Once every requirement of the change is applied, merge it into the specification: npx specgate archive <change-id>
  6. Before each pull request, run the gate CI runs too: npx specgate check

Next#