Docs · Guides

Authoring workflows

A tempergraph workflow starts from what a good result is, not from the steps. You describe the outcome, the engine helps you work backwards to the steps and to how each one is verified, and then it writes the package for you.

Start#

In Claude Code, say what you want to automate and what you bring:

Turn our release checklist into a tempergraph workflow. Here's the script we use today: scripts/release.sh.

The author skill leads an interview. It drafts every answer from your material and asks you to confirm, at most three questions at a time. You decide; it never writes a package file by hand.

There are three ways in. You can mix them, and add sources at any time.

You bringPathFirst drafts come from
Something that already does the job: a script, a prompt chain, a runbook, a skill, past outputssolutionIts stages, its tests and assertions, its outputs
Templates, good and bad examples, checklists, a Definition of Done, style guides, ticketssourcesHeadings, rules and checklists; bad examples become must-fail fixtures
Only an ideachatYour answers, then two contrasting sample outputs for you to grade

A good candidate is done again and again, ends in something a check or a judge can grade, and splits into two to six steps. If nobody can yet say what good looks like, the skill says the workflow is not a fit yet and keeps the session for later.

The nine phases#

PhaseYou agree on
1 IntakeThe process played back in six bullets or fewer, and whether it fits
2 Final outcomeThe statement, the deliverables and the final criteria
3 Work backwardsWhat each step must produce for the final criteria to hold
4 VerificationsHow each criterion is verified: a deterministic check, an independent judge, a person, or openly unverified
5 StepsEach step's kind (script or model), inputs, outputs, check, judge and limits
6 Start and routingThe inputs a run asks for, examples, and how requests are routed to this workflow
7 ApprovalOne yes on the diagram, the outcome table and the verification table together
8 ScaffoldThe package is written to a folder you choose
9 VerifyThe package is checked rung by rung, registered and stamped

Some rules hold throughout:

  • A deterministic check beats a judge, and a judge beats nothing. A criterion nobody can verify is flagged, never hidden.
  • A script that asserts its own success, or a prompt that asks the model whether it succeeded, is a claim, not a verification.
  • When you choose against a draft, the choice is recorded as a decision and becomes a decision record in the workflow's docs.
  • Nothing outside the authoring session's folder is written before your approval in phase 7.

Verify#

Phase 9 runs tempergraph author verify <folder>, which stops at the first failing rung:

RungChecks
1The package loads and validates
2The workflow matches the approved blueprint
3No literals copied from one example (ticket ids, URLs, paths)
4The generated tests pass
5Every final criterion is covered, and every blocker is verified
6The audit has no errors
7The workflow registers
8Each judge grades its seed examples consistently (spends)
9A first trial run on a real case (spends, capped at $5 by default)
10The package is stamped

Rungs 8 and 9 cost money, so the skill tells you the number of sessions and the cap and waits for your yes. After the trial you grade the output criterion by criterion yourself, before you see the verifiers' grades. Each disagreement points at the likeliest weak spot in the outcome or its verification.

Passing means "ready to run and be measured", not "trusted". The workflow starts in dev mode; moving it to stable is your call once its judges are calibrated (see Improving workflows).

What a package looks like#

A workflow is a Claude Code plugin whose name ends in -tgraph, with a Python part. The two examples in this repository are the best reference: release-notes-tgraph is the smallest package, and doc-refresh-tgraph adds a script, a route on a value, a trip back, an approval and a finalizer.

PathHolds
.claude-plugin/plugin.jsonThe plugin manifest, named <workflow>-tgraph
tempergraph.jsonThe workflow manifest
outcome.jsonThe good outcome: final and intermediate criteria and how each is verified
workflow/<name>/__init__.pyThe declaration: steps, gates and flow, in typed Python builders
workflow/<name>/checks.pyDeterministic checks
prompts/, judges/Step prompts and judge briefs, kept as text files
evals/Cases, check fixtures and judge calibration seeds
docs/The workflow's own specs and decision records
blueprint.json, authoring.jsonThe approved design and the authoring record

The CLI underneath#

shell
tempergraph author start <name> --from solution|sources|chat [<path>…]
tempergraph author intake <id> <path>…      # add sources
tempergraph author check <id>               # lint the drafts
tempergraph author approve <id> <phase>
tempergraph scaffold <id> --out <folder>
tempergraph author verify <folder> --json
tempergraph workflows register <folder>
tempergraph author list | show <id>         # pick up unfinished sessions

Spend more only on evidence#

A step names one model and one effort, and says why in sizing. Three declarations let a run spend more where it is earned, and none of them reacts to just any failure:

DeclarationWhat it doesWhen it acts
effort_ladder=["medium", "high"] on a stepRetries at the next effortOnly after a judge you have calibrated repeats the same blocker
escalation=Escalation(to="large") on a stepOne attempt on the next model tierThe same evidence; in a new workflow it is offered to you at a pause, not taken
risk=Risk(...) on a judgeA stronger judge for a riskier attemptA model-free rule: paths touched, lines changed, a check's fact

A list of models in model is no longer accepted; tempergraph upgrade <workflow> rewrites it.

Route by size#

A complexity switch picks a short path for a small task and the detailed path for a large one, from measures that cost nothing (a count in an earlier step's output, an input, a setting) and a rules file in the package. The detailed path is the safe arm: any doubt takes it, and a short path that turns out too small moves up once, never down. tempergraph report --switch <workflow>/<switch> shows how each arm did.

Ask, wait and work side by side#

Ask puts typed questions to a person and hands the answers to later steps. Wait holds the run until an outside value arrives that its check accepts. Parallel runs read-only steps side by side and goes on when all have passed. A step with self_check=True may run its gate's check before it ends, up to three times, so it can fix what the check would find.

Revise a workflow#

To change an existing workflow's outcome, ask Claude to revise it, or run tempergraph outcome candidates <workflow> and then tempergraph author start <workflow> --revise. A revision that weakens a criterion needs your explicit yes.

To check a workflow you already have:

shell
tempergraph validate <workflow>
tempergraph audit <workflow>      # advisory, no model call

Edit this page on GitHub · engine 0.9.0