specgate/docs v1.8.0

Frequently asked questions#

The questions teams ask in the first week, with the short answer and where the long one lives.

Adopting it#

Does it work on a repository that already exists?#

Yes, and that is the common case. specgate init sees the code (pom.xml, package.json, go.mod, pyproject.toml, Cargo.toml, …), adopts the repository in place and touches no source file. The gate is green the same day because a Draft requirement owes nothing yet. → Getting started

Which languages and build tools?#

Any. Specgate reads markdown, Gherkin and file names; the link between a requirement and a test is a mention of REQ-NNN, which any language can carry in a comment or a test name. Your own test command runs your suite.

Do I need Node.js?#

Node.js 22 or later for the CLI. Without it: the Docker image (ghcr.io/rsaglobaltech/specgate), or the Maven and Gradle plugins on a JVM build agent.

Do I have to use DDD, hexagonal architecture or CQRS?#

No. Patterns are optional; principles are not (ADR-0022). The matrix has columns for use cases, commands, aggregates and events; leave them as - if your system has none.

Do I need Cucumber?#

No. Scenarios are written in Gherkin so they can be executed and so the gate can check them, but the gate links a requirement to whatever test mentions it. If you do run Cucumber, the gate reads its message protocol and refuses a scenario that ran zero steps.

How do we stop using it?#

Delete spec.md, features/, docs/specs/ and the CI job. Adoption never touched your code, so nothing else depends on it.

Where work comes from#

Can work start from a Jira ticket?#

Yes. specgate propose --from-ticket KAN-13 reads the story from Jira and opens a change from its description and acceptance criteria, on a branch named after the ticket. --check first tests the ticket against the Definition of Ready (rules T1 to T9). You build and archive the change as usual, then specgate alm pr <change-id> opens one pull request per ticket on GitHub. Jira is only read. → From a Jira ticket

A brief, a ticket, or neither?#

You haveUse
One behaviour to add or changeNeither: specgate propose <change-id>
A feature with a few rules (two to six)Neither: specgate propose <change-id>, the rules in the delta
A new product, or a large area of oneA brief: docs/brief.md, then specgate propose --from-brief
A Jira story with acceptance criteriaThe ticket: specgate propose --from-ticket <KEY>

All three open the same kind of change and follow the same lifecycle. → Every day: where work comes from

Day to day#

Does every pull request need a new requirement?#

No. A bugfix or a refactor that does not change contracted behaviour adds none, and the gate only asks for what delivered requirements owe. → Your team's first pull request

When is a change archived — before or after the code?#

After. specgate propose opens it, its requirements count while it is open (status lists them, apply delivers them), and specgate archive merges it only once every requirement it adds or modifies is Implemented. Until then it refuses with archive_requirements_pending and the specgate apply to run; --force does not skip that. The spec and the code land in the same pull request (ADR-0035). → Change a shipped requirement

Which old command names still work?#

All of them, as aliases: specgate draft is propose --from-brief, specgate done is apply, specgate change new is propose and specgate change archive is archive. The guides use the new names only. → Old names

specgate new is not an old name: it adds one requirement straight to spec.md, without a change, which suits a small project. The short help shows only init, the four verbs and check; specgate --help --all shows the rest.

Who edits the traceability matrix?#

Nobody. It is generated from spec.md, the scenario tags and the files that mention each requirement. Commit what specgate check regenerates; CI fails with matrix_stale when you forget. → How Specgate thinks

Two branches both changed the matrix and now it conflicts.#

A generated matrix is declared merge=union in .gitattributes, so git keeps both sides' rows and specgate check regenerates it. On an older setup, take either side and run specgate matrix: it is regenerated from the merged sources, so the conflict resolves itself. → The harness

Two branches took the same requirement id.#

specgate check compares ids with the base branch (--base, or origin's default) and fails with id_taken_on_base when the same id has another title there — before the merge, naming the next id free on both sides.

apply refuses. Can I force it?#

First read the code. apply_no_test means no test mentions the requirement: name it in the test, that is the fix. For a gate failure, specgate apply REQ-NNN --no-check writes the status without the gate. Use it when the gate is wrong, say so in the pull request — and open an issue, because a wrong gate is a bug.

check says it checked the specification, not the code.#

No test command is configured, so nothing ran your tests. Run specgate config set test_cmd "npm test" once, or pass --test-cmd "npm test". Until then a green check means the specification is consistent, nothing more.

What does a reviewer look at?#

The requirement, its scenario and the test that mentions it — not the matrix. The one thing the gate cannot catch is a test that names a requirement and does not test it. → Your team's first pull request

Agents#

Which AI agent does it need?#

None. Every command works by hand. specgate init installs the slash commands for the agents it finds in your project (CLAUDE.md, .cursor/, …); specgate agents init writes them for any other, with slash commands and rules for Claude Code, Cursor, Copilot, Windsurf, Aider, Gemini, Cline, Codex, OpenCode or Antigravity. → Agent tools

Can an agent rewrite the spec to make its own test pass?#

Not quietly. Each layer closes a different door:

  • Approval is a person's. specgate change approve refuses a session with no terminal, so an agent cannot approve its own change, and apply refuses an unapproved one. Approval seals each requirement by its hash: one changed afterwards fails the gate (approved_requirement_changed).
  • Sealed acceptance tests. Tests a person approved with --layer acceptance are sealed by hash; changed, they fail the gate (acceptance_not_sealed).
  • Guard hooks in Claude Code, OpenCode and Codex refuse code before a test, writes to sealed tests and control files, and the person's own commands.
  • Over MCP, tools that write the specification refuse unless a change is open or the team set mcpAllowContractEdits. There is no approve tool.
  • The outside judge. In the harness, touching spec.md, features/** or the rules fails the attempt, and so does any change to the controls (controls_changed_by_session). Without a harness or CI, this check is absent.

→ Agents · The MCP server · The harness

Will the harness merge its work?#

Not by default. It leaves one branch per requirement and stops. Merging is a judgement, and a tool that merges its own work removes the last place a person reviews it. When you ask for it with specgate harness run --chain, it runs the requirements one at a time, each cut from the previous merge, merges a green one with a merge commit into the branch you are on, runs the gate again on the merge, and stops at the first failure. → The harness

Can I watch what the agent is doing?#

Yes: specgate studio, then open /live. It shows each requirement's attempt, phase, files, tests and steps as the harness runs, bound to this machine unless --host says otherwise. → Command reference

Can I use it without the terminal?#

Yes: specgate studio is the whole path as an app — create the project, write the brief, draft, answer, approve, build and read the report — and each action runs the command you would have typed. → The studio

Does it replace SonarQube, Snyk or SpotBugs?#

No: it runs them. A quality check is your team's tool in its Docker image, judged so that only what a change adds fails; SonarQube Community runs locally without an account.

What does a harness run cost?#

Whatever your agent costs. The harness measures wall-clock time; a profile may declare a cost hint, and specgate harness report multiplies it out and says the figure is declared, not measured.

Security and operations#

Does the CLI send telemetry?#

No. It makes network calls only when you ask for something remote:

  • specgate propose --from-ticket <KEY> reads the ticket from Jira, and pushes the new branch with your git credentials;
  • specgate alm pr pushes the ticket's branch and calls GitHub's API to open or update its pull request;
  • specgate alm sync writes to Jira (or Azure Boards, or GitHub Issues): it creates and closes issues;
  • specgate alm pull reads labelled issues;
  • a pack fetched from a git URL, and npx downloading the package itself.

Can it run air-gapped?#

Yes. Use the Docker image or a vendored package, and install packs from a git bundle (specgate pack bundle). → Supply chain

What does it install?#

One package with zero runtime dependencies. Every release ships a CycloneDX SBOM, and its licence policy is a build gate. → Supply chain

How do we pin the version in CI?#

specgate ci init writes the job with the version that generated it (npx @rsaglobaltech/specgate@<version>), so CI does not change behaviour the day a new release is published.

Compared with others#

How is this different from OpenSpec or Spec Kit?#

Mostly in what happens after the specification is written: a matrix CI enforces, Gherkin a runner can execute, versioned domain packs and an unattended harness. The daily loop has the same shape as OpenSpec's — propose, apply, archive — but apply needs a test that names the requirement and a green gate, and archive refuses work that is not done. OpenSpec is smaller, and if you only want the change loop without a gate it is the better fit. → Comparisons

Next#