Recipes
Workflow is the medium — a runnable portable graph. Recipe is a workflow packaged as a job: outcome first, contract explicit, guards on by default.
Examples teach one mechanic each (knot, ply, tripwire…). Recipes finish real work against your repository or session.
threadle recipesthreadle run repo-brief --dir ~/code/some-repoIn the app: Workflows → recipes → use (same catalog as examples/recipes/ in the repo). Teaching graphs sit in the examples table below.
| Examples | Recipes | |
|---|---|---|
| Question | How does this mechanic work? | What do I get when this finishes? |
| Catalog | threadle templates · examples/workflows/ | threadle recipes · examples/recipes/ |
| UI | Workflows → examples | Workflows → recipes |
| Success | You understand the wire | You have a verdict, brief, triage list, … |
Every recipe is a workflow (kind: "workflow"). Not every workflow is a recipe.
The contract
Section titled “The contract”Every recipe states what you must supply before ▶ will succeed:
| You supply | Meaning |
|---|---|
| model | Pick a model on each agent node (readiness blocks until you do) |
--dir | Working directory for agents that read or run tools in a repo |
| session slot | Drag a session onto the empty ❝ context node and wire it in |
| Id | Outcome | Contract |
|---|---|---|
diff-review-panel | Three-lens review → one verdict | model ×3 · --dir · scope |
second-opinion | Cross-provider review of finished work | model · --dir · session slot · concern |
handover-brief | Brief in the context library | session slot · audience (0 agent nodes — distill is the model call) |
test-triage | Failures → root causes in one session | model · --dir · failures |
repo-brief | One onboarding page | model ×3 · --dir · focus |
Machine-readable catalog: examples/recipes/catalog.json in the repo. API: GET /api/graphs/recipes, POST /api/graphs/recipes/:id.
Diff review panel
Section titled “Diff review panel”Three reviewers, three lenses (correctness, security, performance), one synthesize knot. Agents read the diff with git — point --dir at the repo.
Guards: content tripwire parks under 200 characters, approval before accept, $2 spend ceiling, ply 3.
threadle run diff-review-panel \ --dir ~/code/my-project \ --param scope="the staged changes (git diff --staged)" \ --approve-allThe interesting variant: point each labeled agent at a different provider.
Second opinion
Section titled “Second opinion”Distill a finished session, frame it as another engineer’s work, hand it to an agent on a different provider — no sunk cost in the reasoning.
Default agent is Claude. If the session under review was already Claude, swap the node to Cursor or opencode.
# Clone in the UI, wire the session into ❝, pick a model, then ▶# or:threadle run second-opinion --dir ~/code/my-projectSession slots cannot be filled from the CLI alone — wire them on the canvas (or import, wire, then run).
Handover brief
Section titled “Handover brief”Four hours of session → a page someone can act on. No agent node — distilling is the model call (cheapest recipe). Output lands in the library for re-inject or another workflow.
Wire the finished session into ❝. Thin-brief tripwire (400 chars) + approval/splice.
threadle run handover-brief \ --param audience="a teammate picking this up tomorrow morning with no context"Test triage
Section titled “Test triage”Paste failing output; get causes. An iterator splits on blank lines; a framing convert tells the agent to diagnose each failure in one accumulating session so later items can cite shared roots.
threadle run test-triage \ --dir ~/code/my-project \ --param failures="$(npm test 2>&1 | tail -60)" \ --approve-allCapped at 8 items and $3.
Repo brief
Section titled “Repo brief”Three labeled explorers (architecture, build & test, risks) under ply 3 → synthesize → one onboarding page. Prefer read-only / ask agents.
threadle run repo-brief \ --dir ~/code/unfamiliar-project \ --param focus="the whole repository" \ --approve-allHabits every recipe keeps
Section titled “Habits every recipe keeps”Spend ceiling · approval before accept · content tripwire when empty output means “found nothing” · note that leads with outcome + contract · ply only for true parallel branches · role labels on parallel agents.
Adapt freely. Keep the habits.
Related
Section titled “Related”- Examples — teaching set
- Portable graphs — how these files travel
- Running — readiness, params, Issues
- CLI —
threadle recipes/threadle run <id> - Costs & billing — what a three-agent panel costs