A workflow on tempergraph Plugin: temperspec-tgraph

Specs that stay true. Code that proves it.

temperspec takes a task from its acceptance criteria to tested code and a draft pull request, writing the specs the task needs on the way. What "done" means is fixed before any code is written, and the gate runs the proof itself.

This repository is built by running temperspec on its own issues. Its live checks and real-run results are kept in the package's live-checks plan.

The truth ranking When two sources disagree, the higher one wins and the lower one is the defect: first the task's acceptance criteria, then specs and decision records, then the plan, then the code. WHEN TWO SOURCES DISAGREE, THE HIGHER ONE WINS 1Acceptance criteriawhat the task asks for, numbered 2Specs and decision recordsbehaviours the system has now 3The planphases and the proof table 4The codeand the tests that carry each criterion A code change that makes a spec false changes the spec in the same change.
The problem with spec-driven development by agents

Writing specs first is easy. Keeping them honest is the hard part.

Spec-driven development with coding agents promises reviewable intent before code. In practice, the agent that wrote the code also decides whether it matches the spec, and the specs pay for every change twice.

1

"Done" is decided after coding

The agent reports success, and the report is taken as proof. Nobody fixed beforehand which test proves which criterion.

2

Specs drift from code

Specs disagree with each other, miss behaviours, or describe the change instead of the system. Soon nobody trusts code because of a spec.

3

Docs cost too much

Versions, change logs and "who links to me" lists turn a two-spec change into ten edited files.

4

Every task gets the same ceremony

A one-line fix walks the same long path as a redesign, or a redesign gets the shortcut meant for a fix.

How temperspec answers

Rules for documents, a gate after every step, and proof fixed in the plan.

Proof before code

The plan ends with a proof table: for each acceptance criterion, the test file that will prove it and the command that runs it. The code gate runs those commands itself, whatever the step reported, and checks that a test carries the criterion's id and is not skipped.

A gate after every step

A model-free check first, then a read-only judge. A gate that finds the defect in an earlier step's output sends the run back there by itself. The engine commits after every step.

An independent reader

After the code step, a read-only reviewer is given the change, the task's criteria and the repository, and never the plan, the notes or any earlier judgement. A blocking finding sends the run back.

Specs without cascades

No version, date, status or change log in a spec. A link names an id, never a section number. An index is generated. A spec is edited only where a behaviour or criterion changes.

The right lane for the task

A small fix takes the quick lane, an ordinary change the standard one, and a large plan is expanded into phases. The engine's switch decides from measured facts, and a run never moves to a lighter lane.

A pull request that says what to read

Written with no model: the criteria, the behaviours that changed in each spec, the decisions and open questions, the deviations, and the assumptions to confirm.

What a run does

From a task to a draft pull request.

Start with tempergraph run temperspec "<the task and its acceptance criteria>". Add "docs only" to stop after the specs. The way forward reads left to right; every dashed line is a trip back a gate can order.

The temperspec flow Prepare, a script, sets up the repository. Triage writes the triage note and picks the route: a small fix goes straight to code in the quick lane. Otherwise read-only reading sessions, three at a time, read each gap; one optional pause asks the owner; discovery writes the specs, decision records and research notes; plan writes the plan with its proof table. The switch code_mode picks single, straight to code, or phases, through expand and one session per phase. Then regeneration, a script; the independent review; the outcome gate; and the draft pull request. A blocking review finding sends the run back to code; the outcome gate sends it back to the step that serves an unmet criterion. preparescript triagegaps, route read a gapread-only, ×3 ask ownerif needed discoveryspecs, records plan+ proof table code_mode a docs-only run ends here single: the whole plan in one session phases: a plan over the complexity limits quick lane expandtask rows phasetests first, commit codetests first regenerationscript independentreview, read-only outcomegate draft PR blocking finding: back to code unmet criterion: back to the step that serves it
Redrawn from the engine's tempergraph graph temperspec output. The quick lane takes a small fix that changes no spec straight from triage to code. Not shown: first-time repository setup, the short discovery visit, and every trip back. Brown boxes are model steps, grey dashed boxes are scripts, diamonds are gates.
Three lanes

A fix doesn't pay for a redesign.

Triage proposes the lane. The code gate measures the change afterwards: a spec edited, a file the note does not name, more than two code files or more than 200 changed lines sends a quick-lane run back to triage, which then plans it. A run never moves to a lighter lane.

Between standard and full, the engine's complexity switch code_mode reads the facts the plan check recorded, not the plan's own word. You can name the arm yourself with --arm code_mode=single or phases.

LanePath
quicktriage → code → regeneration
no gap, at most 3 criteria, at most 2 code files beside their tests
standardtriage → discovery → plan → code → regeneration → independent review
a change of ordinary size
fulltriage → discovery → plan → expand → phase → code → regeneration → independent review
a plan over a limit of the plan rule's complexity table
plan: proof table
| Criterion | Test file                      | Command                          |
|-----------|--------------------------------|----------------------------------|
| AC 1      | tests/test_session_expiry.py   | python -m pytest tests/test_session_expiry.py |
| AC 2      | tests/test_session_expiry.py   | python -m pytest tests/test_session_expiry.py |
| SES-AC3   | tests/test_token_storage.py    | python -m pytest tests/test_token_storage.py  |
What "done" means is fixed before coding

The gate runs the proof. The step's word is not enough.

The code gate runs every command in the proof table itself and checks that a test in the named file carries the criterion and is not skipped. A command that fails is compared with the run's base commit: a failure that was already there ends the run in an escalation instead of burning retries.

The outcome gate applies the same rule to every criterion the run added or reworded in a spec. The illustration on the left is made up; the format is the plan rule's.

Asking the owner

One batched pause, or none at all.

Triage sorts every gap into one the code, the documents or a public source can answer, and one only the owner can. For each owner decision it writes the question, two to four options, a default and the cost of a wrong default. The conversation setting says how much a run may ask.

0

never

No step stops to ask. Discovery closes each decision on its default, and the pull request lists every default under "Assumptions to confirm". For pipelines and overnight runs.

1

blocking (default)

One pause after the reading sessions, with one question per owner decision and per blocking question the reading could not answer. A run with neither pauses nowhere.

+

always

The same pause, plus a check of the reading of each findable gap. A reading answered "wrong" keeps the pause open until it is put right.

A pause holds at most 20 questions and has a deadline; after it, the run goes on with the answers given and the default of each open question. The answer skill walks the owner through them.

Measured

What its criteria are, and what 21 runs cost.

The workflow's good outcome is written down in outcome.json, criterion by criterion, each with its verifier. The run figures come from the same 21-run batch shown on the tempergraph page.

126
criteria written into the workflow: 12 for the final outcome, 114 for its steps
100
of them verified by a script, exactly and for free
26
verified by an independent judge, for what rules cannot express
$18.11
reported spend of the median run, from triage to the last stage

Where the spend went, by step

  • discovery$171.29
  • phase$79.61
  • code$42.44
  • read a gap$35.41
  • plan$28.73
  • expand$25.42
  • review$12.26
  • triage$7.38
  • outcome$1.71

Each step's own sessions, retries and judges together; $404.24 in all. Source: stats/sessions/2026-11.jsonl on the stats branch.

Reading the numbers

Discovery, which reads the code and writes the specs, takes 42% of the spend. The code step holds 61% of session time for about 10% of the spend: it waits on the test suite. Judges, the whole independent grading layer, take 13%.

State of verification

  • The model-free rungs of author verify pass; the judge-seed rung graded every seed as expected, and two capped trial runs reached the outcome gate with verdict met.
  • Real runs on this repository finished with every gate passed and pushed their branch.
  • Opening the draft pull request at the end of a real run has not been shown yet.
  • The quick lane's limits are first values, with no measured run behind them.
Run it

Install the package, write the task, start the run.

temperspec is a workflow package for the tempergraph engine. Install the engine first (quick start), then add temperspec from the same marketplace.

shell
claude plugin install temperspec-tgraph@tempergraph

# check first, with no spend; then start
tempergraph run temperspec --check "Add session expiry. AC 1: ..."
tempergraph run temperspec "Add session expiry. AC 1: ..."

# work in its own worktree, so your checkout stays free
tempergraph run temperspec tasks/i42.md --worktree --worktree-base head
SkillFor your own session
taskGet a task into shape, with numbered acceptance criteria, and start the run
answerWalk through a paused run's questions and resume it
setupInstall or update the document rules, per repository or per machine
extractWrite a spec for existing code that no spec describes
groomBring old specs up to the rules without losing a requirement
reviewA second look at a plan, or at a finished change against its specs

The rule files (spec, plan, decision, research, task-notes, documents, extraction) are installed into the repository the first time a run meets it, and the checks read the same formats. Everything else is in the package README; features it still wants are issues labelled area: temperspec.

The engine underneath

Build your own workflow the same way.

temperspec uses tempergraph like any other package: through its API, its manifests and its settings. The engine names no workflow, so what temperspec needed became capabilities every workflow can use.

Explore tempergraph →