specgate/docs v1.8.0

Existing project · 5 — Every day#

The short version of an existing project, in six commands: Start. This page is the same step in detail, with recorded output.

In this phase

When you finish: a daily loop in which the specification grows with the work you were doing anyway — one change per bug fix, story or module — instead of as a project of its own.

Before you start: phases 1 to 4 are done — the gate runs on every pull request.

WhoDoes what
YouStart with status; open a change whenever work arrives
Your agentFollows the same loop — AGENTS.md tells it how
CIHolds every applied requirement on every pull request

Start the day with status#

bash
specgate status
Terminal
$ specgate status
  ◆ specgate · status   invoicing
 
  Requirements  ████████████████████  1 of 1 done
 
  ·  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.
 
  Next ───────────────────────────────────────────────────
  ➜  specgate new "<a behaviour you rely on>"
     every requirement written so far is delivered — add the next behaviour you rely on

specgate on its own does the same. Every command ends with a Next block: the one command to run next, alone on its line so you can copy it. On your terminal, status also shows Gato, the cat that keeps the gate: it grows as requirements are applied and falls sick when check is red — what it means. specgate config set pet off puts it away.

Where work comes from#

Work arrives in one of three ways. Each opens a change, and from there the loop is the same.

The work arrives as…Open the change withGuide
A bug fix, a small feature, a rule you touchspecgate propose <change-id>Phase 2
A Jira story with acceptance criteriaspecgate propose --from-ticket <KEY>From a Jira ticket
A new product area, described in a planspecgate propose --from-brief <module>Write the brief

A change you describe is the common case: you, or your agent, write its delta.

A Jira ticket is read, never written to. Run the ticket check first:

bash
specgate propose --from-ticket KAN-13 --check
specgate propose --from-ticket KAN-13

--check runs the ticket's Definition of Ready — rules T1 to T9, such as "every acceptance criterion can be measured". The second command opens the change from the story, with its text in ticket.md, and creates and pushes the branch feature/KAN-13-<slug>. From a Jira ticket covers the one-time setup.

A brief — docs/brief.md — is for a large area: it is drafted one module at a time, each module its own change.

The loop#

  1. Propose. Open the change, from one of the three sources above, and write or review its delta.
  2. Approve. A person reads the delta and runs specgate change approve <change-id> at a terminal. An agent cannot, and apply refuses a requirement of an unapproved change (change_not_approved).
  3. Build. For each requirement, write the test first and name the requirement in it (REQ-007), then the code — by hand, with your agent, or with the harness.
  4. Apply. specgate apply REQ-007 runs the gate and marks the requirement Implemented. Commit; for ticket work, start the commit message with the ticket key.
  5. Archive. Once every requirement of the change is applied, specgate archive <change-id> merges it into the specification — on your branch.
  6. Pull request. The specification and the code reach review together, and CI runs the gate. For a ticket's change, the alm pr command opens its one pull request on GitHub — see From a Jira ticket.
text
specgate propose  →  change approve  →  test and code  →  specgate apply  →  specgate archive  →  pull request

Three habits that make adoption stick#

  1. Every bug fix gets a requirement. Before fixing it, open a change for the behaviour that broke, write the scenario that reproduces it, and name it in the test. The fix applies it. Your specification fills up where the risk actually was.
  2. One module at a time. When a module matters — billing, permissions, anything regulated — describe it as a change, as in phase 2. Its area in docs/specs/adoption.md is only a map: adoption wrote no requirement for it to replace.
  3. New features start as requirements. A feature request becomes a change, a ticket's change or a brief's module before it becomes code.

Let the agent take requirements off the list#

Once a requirement has a real scenario, the harness — Specgate's runner for unattended work — can build it: one git worktree per requirement, your agent writing the code, your gate as the judge. It is useful for the backlog of small, well-specified behaviours. See the harness.

Next#

← Back to the start