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#
| Command | What it does | Details |
|---|---|---|
specgate init | Adopts 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 status | What 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 check | The 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#
| Command | What it does | Details |
|---|---|---|
specgate propose <change-id> | One behaviour: you write the delta yourself. | Change a shipped requirement |
specgate propose --from-brief | Lists the modules of docs/brief.md and the next one to draft. | From a brief |
specgate propose --from-brief --new-brief | Writes a docs/brief.md for you to fill in. Never overwrites one. | Write the brief |
specgate propose --from-brief --check | Runs 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 --form | The brief as a form, each field with its line; --form <file> writes it back. | From a brief |
specgate propose --from-brief --guide setup | Prints 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> --check | The 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#
| Command | What it does | Details |
|---|---|---|
specgate init --new | Scaffolds 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 adopt | Installs Specgate in an existing repository. Never overwrites a file. | Getting started |
specgate onboard | Proposes the capabilities an existing repository's layout implies. Writes nothing. | specgate onboard --help |
specgate onboard --tour | Runs the whole loop on a temporary copy of your repository, narrated. | specgate onboard --help |
specgate reverse --modules | Lists 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:
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 shopinit --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#
| Command | What it does | Details |
|---|---|---|
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 list | Lists requirements and their status. | specgate req --help |
specgate plan | Requirements 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 questions | Everything 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 matrix | Regenerates the traceability matrix from spec.md, tags and tests. | A matrix nobody edits |
specgate fix | Applies the repairs validate suggests. --dry-run previews. | specgate fix --help |
specgate validate . --strict | Checks specs, scenarios, links and coverage, without running tests. | Validating |
Changes#
| Command | What it does | Details |
|---|---|---|
specgate change list | Open 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 acceptance | Seals 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)#
| Command | What it does | Details |
|---|---|---|
specgate alm sync | Mirror mode: creates an issue per requirement and closes it when the requirement is done. | Jira and Azure Boards |
specgate alm pull | Opens 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 status | The 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#
| Command | What it does | Details |
|---|---|---|
specgate harness init | Writes harness.config.yaml and the prompt prefix. Leaves the agent unset. | The harness |
specgate harness run | Delivers 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 report | First-attempt rate, time and cost per delivered requirement; --capability. | What the harness has cost |
specgate harness doctor | Which 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 trust | Each 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> / --list | Examines a skill on fixed tasks; --list: every exam, its texts, history and runs. | specgate eval --help |
specgate harness events --from claude | Turns Claude Code's stream into events for the live view. | The harness |
specgate harness stop --after-current | Asks the running harness to stop after the requirement in progress. | Drive the harness |
specgate studio | The visual app, from an empty folder to the report; /live: the harness. | specgate studio --help |
specgate ci init | Writes the CI job for GitHub, GitLab, Azure or Jenkins. | Validating |
specgate ci status | What 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 list | The 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 baseline | Records 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 init | Names the repositories of one product in specgate.workspace.yaml. | Workspace |
specgate workspace status | Each repository's requirements, branch and gate, and each story. | Workspace |
specgate workspace check | Every 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 live | Every repository's harness and every story, live, with their cost. | Workspace |
specgate workspace harness run | One 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 check | Contracts against requirements: uncited operations, missing ones. | Validating |
specgate check --ci | The gate in CI: also the ci checks, and a check that cannot run fails. | Validating |
specgate check --baseline | Records today's findings in docs/specs/gate-baseline.json: only new ones fail. | Specify a system that already runs |
specgate check --last | The last gate result, its commit and stages, without running the gate. | Validating |
specgate check --affected | Only the tests of what changed since the base; the whole suite when it cannot say. --no-cache. | A faster gate |
specgate verify | For OpenSpec projects: fails while a done scenario has no test naming it. | Already on OpenSpec |
specgate report | A spec-coverage dashboard as one HTML file; --format json, --capability. | specgate report --help |
specgate doctor | Diagnoses 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-release | For Specgate's maintainers: the compatibility exam of each agent tool at each level. | specgate compat --help |
specgate compat attack two-function | For Specgate's maintainers: replays the recorded attack on a sealed step file, with no model. | specgate compat --help |
Agents#
| Command | What it does | Details |
|---|---|---|
specgate propose <id> --kind bug|enhancement | Records 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 list | Every ADR with its number, title and status. | Decisions |
specgate stack | Writes docs/specs/stack.md: each layer's technology and evidence, and the commands. | Decisions |
specgate studio --team | The 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 init | Slash commands and instruction files for your agent tools. | Agents |
specgate agents init --format skills | The same steps as Agent Skills folders, in .agents/skills/ and each tool's own. | Agents |
specgate agents install --global | The agent guards for every project: OpenCode's plugin, Claude Code's. | Agents |
specgate agents init --tool codex-hooks | Codex's guards for this project, in .codex/hooks.json. | Agents |
specgate update | Refreshes 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 plans | The open plans, and which are stale. | Ask your agent |
specgate mcp install --client claude | Writes the MCP server configuration for Claude Desktop or Cursor. | The MCP server |
specgate mcp serve | Runs the MCP server over stdio. The client starts it; you do not. | The MCP server |
Domain packs#
| Command | What it does | Details |
|---|---|---|
specgate specops add | Installs a pack at a pinned tag and records it in .specops.lock. | Domain packs |
specgate specops remove | Drops a pack from .specops.lock. | Domain packs |
specgate specops sync | Re-renders the installed packs, keeping your local edits. | Domain packs |
specgate specops diff | Previews a version bump; --as-change turns it into a change. | Domain packs |
specgate specops contribute | Sends a local change back to the pack. Never pushes. | Domain packs |
specgate pack init | Scaffolds a new pack. | Domain packs |
specgate pack lint | Checks a pack before anyone installs it. | Domain packs |
specgate pack infer | Proposes a pack.yaml from a .feature file. | Domain packs |
specgate pack bundle | Exports a pack repository as one file for offline networks. | Supply chain |
specgate expand | Low-level pack rendering. Prefer specops add. | Domain packs |
Customising#
| Command | What it does | Details |
|---|---|---|
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 full | Makes --help list every command (core lists the loop). | specgate config set --help |
specgate config set language es | The 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 keys | Every setting: its values, default, current value and the file it lives in. | specgate config set --help |
specgate config init | Writes a starter project.yaml. | specgate config init --help |
specgate schema which | Shows which artefact graph a change follows (also init, fork, validate). | specgate schema --help |
specgate completion zsh | Prints shell completion for bash, zsh or fish. | specgate completion --help |
The small things#
| Command | What it does | Details |
|---|---|---|
specgate pet | Gato, the cat that keeps the gate: the project's health as a pet. | specgate pet --help |
specgate config set pet off | Hides 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.
| Code | Meaning |
|---|---|
0 | Success, including advisory warnings |
1 | Failure, or a gate that found something |
2 | Usage error: an unknown flag or a missing argument |
3 | A 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 name | Use instead |
|---|---|
specgate draft | specgate propose --from-brief |
specgate done | specgate apply |
specgate change new | specgate propose |
specgate change archive | specgate archive |