From scratch · 5 — Every day#
The short version of a new project, in six commands: Start. This page is the same step in detail, with recorded output.
In this phase
When you finish: the gate on every pull request, and a daily loop short
enough to remember — four verbs: propose, apply, status and archive.
Before you start: phases 1 to 4 are done, and the project is on a Git host with CI (GitHub, GitLab, Azure DevOps or Jenkins).
| Who | Does what in this phase |
|---|---|
| You | Commit the CI file init wrote; then start each day with status |
| Your agent | Follows the same loop — AGENTS.md tells it how |
| CI | Runs specgate check on every pull request |
1. The gate is already in CI#
specgate init wrote it: .github/workflows/spec-gate.yml — or the file for
GitLab, Azure DevOps or Jenkins when the folder shows one. It runs
specgate check on Ubuntu, macOS and Windows, compares the requirement ids
with the base branch, runs the quality checks once you configure them, checks
the packs and keeps the plan. A step whose tool is not configured yet says so
and passes. See what it checks:
specgate ci status$ specgate ci status
◆ specgate · ci status .github/workflows/spec-gate.yml
✔ the specification (validate --strict)
✔ the project's tests (check runs test_cmd)
✔ the architecture check (check runs arch_cmd)
✔ Ubuntu, macOS and Windows
✔ the requirement ids against the base branch (check --base)
✔ the quality checks (quality run)
✔ the pack drift (validate --against-lock)
✔ the pending-work plan (plan --format json)
✔ Everything specgate can check runs in CI.It checks more than less on purpose: every step says in the YAML what it
checks and what to delete to remove it. One Ubuntu job running only
specgate check, with no base branch, no pack drift and no plan (GitHub only):
specgate ci init --provider github --minimal --force. Another provider:
specgate ci init --provider gitlab. Commit the file, and make the job a
required check in your main branch's protection rules: from then on, a pull
request with a red test cannot merge.
2. Where work comes from#
Work arrives in one of three ways. Each opens a change — a folder with the requirements and scenarios being added — and from there the loop is the same.
| The work arrives as… | Open the change with | Guide |
|---|---|---|
| One behaviour, or a feature with a few rules | specgate propose <change-id> | This page, below |
| A Jira story with acceptance criteria | specgate propose --from-ticket <KEY> | From a Jira ticket |
| A new module of the product, from the brief | specgate propose --from-brief <module> | Phase 2 |
A Jira ticket is read, never written to.
specgate propose --from-ticket KAN-13 --check runs its Definition of Ready
(rules T1–T9: acceptance criteria present, measurable, small enough), and the
same command without --check opens the change and pushes its branch,
feature/KAN-13-<slug>.
3. The daily loop#
- Propose — open the change and write its delta: the requirements and scenarios it adds.
- Approve — you read the delta and run
specgate change approve <change-id>in your terminal; an agent cannot, andapplyrefuses a requirement of an unapproved change (change_not_approved). - Build — for each requirement, a test that names it, then the code.
- Apply —
specgate apply REQ-NNN; commit. - Archive —
specgate archive <change-id>once every requirement is applied, on your branch. - Pull request — the specification and the code reach review together.
For a ticket's change, the
alm prcommand opens it — see From a Jira ticket.
specgate propose → change approve → test and code → specgate apply → specgate archive → pull requestTip
Lost? Type specgate on its own. Inside a project it shows status:
where everything stands, and the one command to run next. Every command
ends the same way — a Next block with the command alone on its line, so
you can copy it.
A new requirement that came up in a conversation, not in the brief:
specgate propose free-courts$ specgate propose free-courts
◆ specgate · propose free-courts
✔ Change free-courts created · lite · REQ ids REQ-012…REQ-014 reserved
+ docs/specs/changes/free-courts/change.yaml
+ docs/specs/changes/free-courts/discover.md
+ docs/specs/changes/free-courts/design.md
+ docs/specs/changes/free-courts/tasks.md
+ docs/specs/changes/free-courts/specs/free-courts/spec.md
Next ───────────────────────────────────────────────────
➜ specgate apply
after you write the delta, a test that names each requirement, and the codeReplace the template in the change's delta,
docs/specs/changes/free-courts/specs/free-courts/spec.md, with the
requirement and its scenario, under the ## ADDED Requirements heading the
template has:
# Delta — free-courts
## ADDED Requirements
### Requirement: REQ-012 — A member sees which courts are free on a day
<!-- specgate:trace actor=Member kind=functional -->
The system SHALL list, for a day, the courts that are free at each hour.
#### Scenario: SCN-006 — The centre court is taken on Monday evening
- GIVEN the centre court is booked on Monday evening
- WHEN a member sends GET /api/courts/free?day=monday
- THEN Monday evening lists every court except the centre courtRead the delta, then approve it yourself, at your terminal — apply waits
for it:
specgate change approve free-courtsStart the day with status — it lists the new requirement with the rest,
and names the one command to run next:
specgate status$ specgate status
◆ specgate · status court-bookings
Requirements ░░░░░░░░░░░░░░░ 1 of 4 done
To do ──────────────────────────────────────────────────
○ REQ-003 A court is never booked twice for the same … a test and code
○ REQ-012 A member sees which courts are free on a day a test and code
· REQ-001 Preserve existing behaviour: your test suite holds it on every check.
To close it, name REQ-001 in a test that starts the product.
Waiting for an answer ──────────────────────────────────
○ REQ-004 A member cancels a booking an answer to Q1
Questions: Q1 (docs/specs/changes/draft-bookings/questions.md)
Brief 1 of 1 module(s) drafted docs/brief.md
Next ───────────────────────────────────────────────────
➜ specgate apply REQ-003
free-courts waits for a person to approve it, at their terminal — apply delivers nothing beforeThis recording ran status before the approval, so its last line still says
free-courts waits for a person. Once you have approved it, REQ-012 is
delivered like the others: its test, its code, specgate apply REQ-012.
A requirement that changes goes through a change too, under
## MODIFIED Requirements in its delta, so the review sees the before and
after.
4. When the client answers#
The requirement it blocked rejoins the queue in five steps:
- In the change's
questions.md, write the answer in the question'sAnswercell and set itsStatustoanswered.statusnow lists the requirement under "Answered — update the spec". - Write the value into the requirement's text and its scenario.
- Remove
status="Needs Clarification"from itsspecgate:trace. - Approve the change again, yourself, at your terminal:
specgate change approve <change>. The text is no longer what was approved, soapplyrefuses it (approved_requirement_changed) until then; the client's answer inquestions.mdis the source of the new value. - Write its test, then
specgate apply REQ-…. Until step 3 the harness skips it andapplyrefuses it (done_needs_clarification).
Gato, the cat that keeps the gate#
At the foot of status, on your terminal, sits Gato. You don't feed it by hand:
its state is the project's.
| Gato | Comes from | You look after it with |
|---|---|---|
| Grows: egg, kitten, cat, crowned legend | the share of requirements closed | specgate apply |
| Healthy, or sick | how the last specgate check ended | a green gate |
| Worried | requirements waiting for an answer | answering questions.md |
| Asleep | no check for a week | running check |
| 🔥 streak | days in a row the gate ended green | keeping it green |
Whatever it says ends with the same command status gives you. specgate pet
shows the whole cat and its four needs. It never appears in a pipe, a log or
CI, and specgate config set pet off puts it away. The streak lives in
.specgate/pet.json, which git ignores: the cat is yours, not the team's.
You're done when…#
.github/workflows/spec-gate.yml(or your provider's file) is committed, and the job is a required check.- Your team starts with
specgate statusand ends each change withspecgate archiveand a pull request.
If something goes wrong#
| You see | It means | Do |
|---|---|---|
.github/workflows/spec-gate.yml already exists — refusing to overwrite. | You already have that file | --stdout to print the job and paste it in, or --force to replace |
Unknown provider: circleci | Not supported | github, gitlab, azure or jenkins; or run specgate check from any CI by hand |
status says Next specgate plan | A requirement has no feature file | specgate plan names it |