specgate/docs v1.8.0

Command reference#

Every Specgate command, one line each, grouped by the job you are doing. Each row links to the page that explains it in full.

specgate --help lists the daily loop. specgate --help --all lists every command, and specgate <command> --help shows a command's options. To make the full list the default, run specgate config set profile full. The package also installs sgate, a short alias of specgate.

In these tables, a change is a folder under docs/specs/changes/<id>/ that proposes new or changed requirements; the gate is specgate check. See the vocabulary for the other terms.

The loop#

CommandWhat it doesDetails
specgate initAdopts a repository that has code, or scaffolds a new project.Getting started
specgate propose <change-id>Opens a change: a proposal, a delta and a reserved range of REQ ids.Change a shipped requirement
specgate apply [<REQ>]Delivers one requirement: refused until a test names it and the gate passes.Writing specs
specgate statusWhat is left, and the one command to run next.Writing specs
specgate archive <change-id>Merges a change into the specs once every requirement in it is Implemented.Change a shipped requirement
specgate checkThe gate: validate --strict, your architecture check, then your tests.Validating

apply does not commit; commit after it. archive runs on your branch, before the pull request, so the spec and the code are reviewed together.

Where work comes from#

CommandWhat it doesDetails
specgate propose <change-id>One behaviour: you write the delta yourself.Change a shipped requirement
specgate propose --from-briefLists the modules of docs/brief.md and the next one to draft.From a brief
specgate propose --from-brief --new-briefWrites a docs/brief.md for you to fill in. Never overwrites one.Write the brief
specgate propose --from-brief --checkRuns the brief rules (B1–B15) on the brief. Writes nothing.Write the brief
specgate propose --from-brief --agent "<cmd>"Your agent proposes the brief's fields, then a section per module.From a brief
specgate propose --from-brief --formThe brief as a form, each field with its line; --form <file> writes it back.From a brief
specgate propose --from-brief --guide setupPrints the guide an agent follows to propose the front matter; cards, the module sections. Writes nothing.From a brief
specgate propose --from-brief <module>Opens that module's draft change, or checks it once it exists.From a brief
specgate propose --from-ticket <KEY>Opens a change from a Jira ticket, on a new feature/<KEY>-<slug> branch.From a Jira ticket
specgate propose --from-ticket <KEY> --checkThe ticket's Definition of Ready (rules T1–T9). Writes nothing.From a Jira ticket
specgate alm pr <change-id>Pushes the ticket's branch and opens or updates its one pull request on GitHub.From a Jira ticket

More options for --from-ticket: --agent "<cmd>" has your agent draft the change, --capability <name> names the capability when the ticket's epic is not mapped, --no-branch uses the branch you are on (committed and pushed there when its name carries the key), and --no-push creates it without pushing. A ticket can also be a file: --from-ticket KAN-13.json. For --from-brief <module>, --agent "<cmd>" hands the draft to your agent and --reserve <n> sets how many REQ ids it reserves (default 10). On a draft that is already open, it grows the range to n, as long as no later change has reserved the ids after it: open modules one at a time to keep that possible.

Starting a project#

CommandWhat it doesDetails
specgate init --newScaffolds a new project even where code already exists.Getting started
specgate init --forja <name>Generates a whole application with forja, wired for Specgate.forja
specgate init --from-pack <repo>@<tag> --pack <id>Scaffolds and installs a pinned domain pack in one step.Domain packs
specgate init --multi-stack <a,b>One sibling project per stack, sharing one spec.md and features/.specgate init --help
specgate adoptInstalls Specgate in an existing repository. Never overwrites a file.Getting started
specgate onboardProposes the capabilities an existing repository's layout implies. Writes nothing.specgate onboard --help
specgate onboard --tourRuns the whole loop on a temporary copy of your repository, narrated.specgate onboard --help
specgate reverse --modulesLists the modules of an existing system, with stack and file count. No agent.Specify a system that already runs
specgate reverse <module>Your agent drafts one module into a change: Draft requirements citing source=.Specify a system that already runs
specgate add usecase <module/Name>In a forja project: the class, its test and its wiring (also entity, port).specgate add --help

forja is not on the npm registry. init --forja runs npx @rsaglobaltech/forja@1 unless the SPECGATE_FORJA_CMD environment variable names another command. Install forja from its GitHub release tarball, then point Specgate at it:

bash
npm install -g https://github.com/rsaglobaltech/forja/releases/download/v1.0.0/rsaglobaltech-forja-1.0.0.tgz
SPECGATE_FORJA_CMD=forja specgate init --forja shop

init --from-pack has a known issue: it fails on a requirement with two scenarios. Until it is fixed, run specgate init and then specgate specops add.

Requirements#

CommandWhat it doesDetails
specgate new "<title>"Adds one requirement straight to spec.md, without a change. A shortcut for small projects.Writing specs
specgate req add "<title>"Adds a Draft requirement and its matrix row.specgate req --help
specgate req link <REQ> --test <path>Records a link (--feature, --test, --code, …) for a requirement.specgate req --help
specgate req rm <REQ>Removes a requirement's row and prose. --force past Draft.Writing specs
specgate req listLists requirements and their status.specgate req --help
specgate planRequirements that still need a test, code or a status change.Writing specs
specgate explore ["<question>"]A snapshot of the project to think with, before a change exists. Writes nothing.specgate explore --help
specgate questionsEverything waiting for an answer: open questions, what they block, requirements waiting.specgate questions --help
specgate answer <Q> "<answer>"Writes the answer and an assumption to review; --reviewed once the spec reflects it.specgate answer --help
specgate ask <REQ> "<question>"Asks instead of guessing: the requirement waits. The harness agent can run it too.specgate ask --help
specgate brief add <module> "<text>"A new requirement for a module the brief covers, archived or not, quoting the text.specgate brief add --help
specgate matrixRegenerates the traceability matrix from spec.md, tags and tests.A matrix nobody edits
specgate fixApplies the repairs validate suggests. --dry-run previews.specgate fix --help
specgate validate . --strictChecks specs, scenarios, links and coverage, without running tests.Validating

Changes#

CommandWhat it doesDetails
specgate change listOpen changes and their task progress.Change a shipped requirement
specgate change show <id>A change's proposal, deltas and what they touch.Change a shipped requirement
specgate change status [<id>]Which file of the change to write next.Change a shipped requirement
specgate change instructions <artifact>The template and rules for one file of a change, for you or an agent.Agents
specgate change author <id>Has an agent write one file of a change, confined to the change folder.Change a shipped requirement
specgate change validate [<id>]Checks the deltas. specgate validate runs it too.Change a shipped requirement
specgate change new <id> --modify <REQ>Opens a change with the requirement copied into a MODIFIED delta, Draft.Change a shipped requirement
specgate change impact <REQ|id>Spec, features, tests, files and requirements a change to it touches.Change a shipped requirement
specgate change approve <id> [--layer <layer>]A person, at a terminal: approves the layers you own (--layer discover|design|tasks); apply and the harness wait for it.Change a shipped requirement
specgate change approve <id> --layer acceptanceSeals the change's listed acceptance tests by hash, once it is approved.Sealed acceptance tests
specgate change note <id> "<text>"Asks the draft for a change in your words, kept in review.md (--req REQ).Change a shipped requirement
specgate propose <id> --from-value-drift <REQ:id>Opens a change that updates a declared value the code disagrees with.Validating

Jira and other trackers (ALM)#

CommandWhat it doesDetails
specgate alm syncMirror mode: creates an issue per requirement and closes it when the requirement is done.Jira and Azure Boards
specgate alm pullOpens a change for each issue with a label (--label <name>).Jira and Azure Boards
specgate alm link <REQ> <issue>Maps an existing issue to a requirement.Jira and Azure Boards
specgate alm statusThe requirement-to-issue mapping, without network access.Jira and Azure Boards
specgate alm pr <change-id>One pull request per ticket on GitHub. --no-push, --no-check.From a Jira ticket

All of these read alm.config.yaml at the project root. It names environment variables that hold the tokens, never the tokens themselves. Jira has two modes — a ticket as the source of a change, or a mirror of your requirements — and you pick one per project: see From a Jira ticket and Jira and Azure Boards.

Automation and CI#

CommandWhat it doesDetails
specgate harness initWrites harness.config.yaml and the prompt prefix. Leaves the agent unset.The harness
specgate harness runDelivers pending requirements with an agent; --profile picks which one.The harness
specgate harness prompt <REQ>Prints the prompt an agent would get. Runs nothing.Choosing your agent
specgate harness reportFirst-attempt rate, time and cost per delivered requirement; --capability.What the harness has cost
specgate harness doctorWhich agent each requirement gets, and whether each one is installed and answers.The harness
specgate harness sandboxes [--prune]Each sandbox the harness made and the hosts it may reach; --prune the leftovers.The harness
specgate trustEach module's trust level, its streak and its bugs; promote raises one.specgate trust --help
specgate map [<REQ>]Where each requirement lives: use case, route, feature, code, tests.specgate map --help
specgate reproduce <change>Opens a bug that must be seen red before it is fixed.specgate reproduce --help
specgate evidence before <REQ>Keeps a requirement's scenarios, run before its code, as its before: log, screenshots, video.specgate evidence --help
specgate learn [promote <L>]Review notes and failures that keep coming back, turned into a rule.specgate learn --help
specgate eval <skill> / --listExamines a skill on fixed tasks; --list: every exam, its texts, history and runs.specgate eval --help
specgate harness events --from claudeTurns Claude Code's stream into events for the live view.The harness
specgate harness stop --after-currentAsks the running harness to stop after the requirement in progress.Drive the harness
specgate studioThe visual app, from an empty folder to the report; /live: the harness.specgate studio --help
specgate ci initWrites the CI job for GitHub, GitLab, Azure or Jenkins.Validating
specgate ci statusWhat the CI gate checks, and what it lacks.Validating
specgate quality init [--level]Writes the checks of basic or strict for the stack, all in Docker.specgate quality --help
specgate quality listThe quality checks of the gate: stage, gate or advise, how each runs here.specgate quality --help
specgate quality doctor [--pull]The same, with what is missing; --pull fetches the Docker images now.specgate quality --help
specgate quality run [--stage]Runs the checks of a stage: attempt, end or ci.specgate quality --help
specgate quality baselineRecords today's SARIF findings as debt: only new ones fail from then on.specgate quality --help
specgate migrate 1.0 [--dry-run]Moves a 0.27 project to 1.0: open changes into three layers, and a report.Migrating to 1.0
specgate workspace initNames the repositories of one product in specgate.workspace.yaml.Workspace
specgate workspace statusEach repository's requirements, branch and gate, and each story.Workspace
specgate workspace checkEvery repository's gate, qualified ids and cross-repository dependencies.Workspace
specgate workspace draft [<story>]The client's brief, its stories, and one story drafted by an agent.Workspace
specgate workspace propose <story>A business story, and a change for it in each repository named.Workspace
specgate workspace liveEvery repository's harness and every story, live, with their cost.Workspace
specgate workspace harness runOne harness per repository with a part of a story, in dependency order.Workspace
specgate drift [--base]Commits since the base that change code and name no requirement.Validating
specgate contract checkContracts against requirements: uncited operations, missing ones.Validating
specgate check --ciThe gate in CI: also the ci checks, and a check that cannot run fails.Validating
specgate check --baselineRecords today's findings in docs/specs/gate-baseline.json: only new ones fail.Specify a system that already runs
specgate check --lastThe last gate result, its commit and stages, without running the gate.Validating
specgate check --affectedOnly the tests of what changed since the base; the whole suite when it cannot say. --no-cache.A faster gate
specgate verifyFor OpenSpec projects: fails while a done scenario has no test naming it.Already on OpenSpec
specgate reportA spec-coverage dashboard as one HTML file; --format json, --capability.specgate report --help
specgate doctorDiagnoses the project and the environment, with a fix per finding.Troubleshooting
specgate check --base <branch>Also names what the branch changes in the controls (controls_changed_on_branch, a warning by default).Agents
specgate compat run | report | check-releaseFor Specgate's maintainers: the compatibility exam of each agent tool at each level.specgate compat --help
specgate compat attack two-functionFor Specgate's maintainers: replays the recorded attack on a sealed step file, with no model.specgate compat --help

Agents#

CommandWhat it doesDetails
specgate propose <id> --kind bug|enhancementRecords the change's kind; release notes group by it.Handing over
specgate release-notes <from>..<to>The changes archived between two refs, by kind, with their requirements.Handing over
specgate acceptance <change>A checklist per scenario; --sign "<name>" moves Implemented to Verified.Handing over
specgate guide [--actor <name>]docs/guide/<actor>.md: each actor's delivered requirements as steps.Handing over
specgate adr new "<title>"Records an architecture decision: the next ADR, Proposed, dated.Decisions
specgate adr supersede <NNNN> "<title>"A new ADR that replaces one; the old one changes only its status.Decisions
specgate adr listEvery ADR with its number, title and status.Decisions
specgate stackWrites docs/specs/stack.md: each layer's technology and evidence, and the commands.Decisions
specgate studio --teamThe studio for a team behind a sign-in proxy: roles, and edits as pull requests.The studio for a team
specgate review <change>The change as one self-contained HTML page for people outside the repo.Review with the business
specgate agents initSlash commands and instruction files for your agent tools.Agents
specgate agents init --format skillsThe same steps as Agent Skills folders, in .agents/skills/ and each tool's own.Agents
specgate agents install --globalThe agent guards for every project: OpenCode's plugin, Claude Code's.Agents
specgate agents init --tool codex-hooksCodex's guards for this project, in .codex/hooks.json.Agents
specgate updateRefreshes those generated files after an upgrade, keeping your edits.Agents
specgate agent ask "<request>"Your agent proposes a spec change as a plan with its diff; nothing is written. @REQ-NNN, @path.Ask your agent
specgate agent apply <plan-id>Writes the plan if its files did not change since, then runs its checks. Never commits.Ask your agent
specgate agent discard <plan-id>Removes a plan.Ask your agent
specgate agent plansThe open plans, and which are stale.Ask your agent
specgate mcp install --client claudeWrites the MCP server configuration for Claude Desktop or Cursor.The MCP server
specgate mcp serveRuns the MCP server over stdio. The client starts it; you do not.The MCP server

Domain packs#

CommandWhat it doesDetails
specgate specops addInstalls a pack at a pinned tag and records it in .specops.lock.Domain packs
specgate specops removeDrops a pack from .specops.lock.Domain packs
specgate specops syncRe-renders the installed packs, keeping your local edits.Domain packs
specgate specops diffPreviews a version bump; --as-change turns it into a change.Domain packs
specgate specops contributeSends a local change back to the pack. Never pushes.Domain packs
specgate pack initScaffolds a new pack.Domain packs
specgate pack lintChecks a pack before anyone installs it.Domain packs
specgate pack inferProposes a pack.yaml from a .feature file.Domain packs
specgate pack bundleExports a pack repository as one file for offline networks.Supply chain
specgate expandLow-level pack rendering. Prefer specops add.Domain packs

Customising#

CommandWhat it doesDetails
specgate config set test_cmd "<cmd>"The tests check and apply run.specgate config set --help
specgate config set arch_cmd "<cmd>"Your architecture check, run by the gate beside the tests.Validating
specgate config set test_cmd_affected "<cmd> {files}"What check --affected and apply run, {files} the selected tests.A faster gate
specgate config set acceptance_cmd "<cmd> {files}"What runs the sealed acceptance tests in check, {files} their paths.Sealed acceptance tests
specgate config set stack "<stack>"The stack AGENTS.md states to the agent, which may not choose one; testing likewise.Troubleshooting
specgate config set profile fullMakes --help list every command (core lists the loop).specgate config set --help
specgate config set language esThe language of generated prose. Keywords stay in English.specgate config set --help
specgate config set profiles.<name>.<field>An agent profile in .harness/profiles.yaml: agent, advisory, cost, prices.Choosing your agent
specgate config set checks.<name>.<field>A quality check in harness.config.yaml; setting its run adds it.Quality checks
specgate config set alm.<key>alm.config.yaml: provider, URL, project; *_env takes a variable's name.Jira and Azure Boards
specgate config keysEvery setting: its values, default, current value and the file it lives in.specgate config set --help
specgate config initWrites a starter project.yaml.specgate config init --help
specgate schema whichShows which artefact graph a change follows (also init, fork, validate).specgate schema --help
specgate completion zshPrints shell completion for bash, zsh or fish.specgate completion --help

The small things#

CommandWhat it doesDetails
specgate petGato, the cat that keeps the gate: the project's health as a pet.specgate pet --help
specgate config set pet offHides Gato from the end of status.specgate config set --help

Output and exit codes#

Many commands take --json and then print one JSON document on standard output; the agent contract lists the format and every diagnostic code. From Node, status, questions, matrix, report and lastCheck are also functions of @rsaglobaltech/specgate/api that answer the same document in-process: Read a project from Node.

CodeMeaning
0Success, including advisory warnings
1Failure, or a gate that found something
2Usage error: an unknown flag or a missing argument
3A required script is missing (a broken installation)

Old names#

These names still work, so older scripts keep running. Use the new name in anything you write.

Old nameUse instead
specgate draftspecgate propose --from-brief
specgate donespecgate apply
specgate change newspecgate propose
specgate change archivespecgate archive