Tiramisu
Turn a step-by-step plan into a functional dependency graph that can be delegated to subagents.
Reference
- Functional framing source: What’s Functional Programming All About?
- Canonical recipe example: Michael Chu's Classic Tiramisu (as described in the article)
Canonical Example (Imperative Recipe)
Use this as a default example for parsing imperative plans:
Ingredients:
4 large egg yolks1/2 cup granulated sugar(plus2 tspfor espresso)1/2 cup sweet Marsala wine16 oz mascarpone cheese1 cup heavy creamabout 40 ladyfingers12 oz prepared espresso2 tbsp cocoa powder
Steps:
- Dissolve
2 tsp sugarinto espresso and chill. - Whisk egg yolks.
- Add sugar and Marsala wine; blend.
- Whisk mixture over steam until thick/smooth.
- Beat mascarpone until creamy.
- Whip heavy cream to soft peaks.
- Combine custard with mascarpone; beat smooth.
- Fold in whipped cream.
- Soak ladyfingers briefly in espresso.
- Assemble layers: soaked ladyfingers, cream, soaked ladyfingers, cream.
- Sift cocoa on top.
- Refrigerate for
4 hours.
Expected dependency shape:
- Custard branch: yolks + sugar + wine -> whisk over steam
- Cream branch: heavy cream -> whip
- Cheese branch: mascarpone -> beat
- Espresso branch: espresso + sugar -> soak ladyfingers
- Merge: custard + mascarpone + whipped cream -> cream filling
- Final: assemble + sift cocoa -> refrigerate
Input
- A plan, checklist, or strategy text.
- Optional: available subagents/roles, deadlines, constraints.
Workflow
- Extract atomic tasks as functions:
output = action(inputs). - Name each intermediate artifact/output explicitly.
- Build a DAG:
- Node fields:
id,function,inputs,output,depends_on,definition_of_done,agent_hint. - Edge rule: connect producer
outputto consumerinputs.
- Topologically sort into parallel lanes & waves for delegation.
- Create handoff packets per node with required inputs and acceptance checks.
- Add reintegration requirements anywhere parallel branches could diverge on the same concept, API, naming, UX, or abstraction.
- List missing dependencies, assumptions, and blockers.
Output Format
Always show an arrow-based dependency diagram. The diagram and a short explanation are sufficient by default. Node tables, delegation waves, and detailed handoff packets are optional.
Functional Graph Template (Lane Diagram)
Draw the DAG as left-to-right lanes merging with box-drawing characters, one lane per line:
text12 oz espresso + 2 tsp sugar -> dissolve -> chill ──────────────────────────────────────────┐ ~40 ladyfingers ────────────────────────────────────────────────────────────────────────────┴─ soak 1 sec each ─────────────┐ 4 egg yolks -> whisk -> + 1/2 cup sugar & Marsala -> whisk over steam ────────┐ │ 16 oz mascarpone -> beat until creamy ────────────────────────────────────────┴─ combine ───────┐ │ 1 cup heavy cream -> whip to soft peaks ────────────────────────────────────────────────────────┴─ fold ────────────────────┤ └─ assemble 2x layers -> sift cocoa -> refrigerate 4 hrs -> Tiramisu
Formatting rules:
- One lane per line, flowing left to right; use
->for steps within a lane. - Use box-drawing characters only for joins:
┐turn down,┘turn up,┴/┤/┼side merge,│pass-through,└emit the merged step,─horizontal fill. - Pad lanes with
─so every join character in the same merge sits in the same column; verify the columns line up before returning. - Order lanes so the diagram reads top-left to bottom-right: earliest-available inputs at the top, and the final merged step on its own junction row at the bottom (
└), never in the middle of the lanes. - Keep it in a fenced
```textblock so the alignment survives rendering. - For very large graphs, or when the harness renders it, a Mermaid
flowchart LRis an acceptable fallback:
Node Registry Template
| id | function | inputs | output | depends_on | agent |
|---|---|---|---|---|---|
| N1 | brief = writeBrief(research) | research | brief | - | subagent-research |
Subagent Waves Template
- Wave 0:
N1,N2 - Wave 1:
N3 - Wave 2:
N4
Handoff Packet Template
N3- Objective: one sentence goal
- Inputs required: explicit artifacts
- Deliverable: output schema/path
- Acceptance checks: testable done criteria
Heuristics
- Prefer real data dependencies over chronological ordering words.
- Split overloaded steps into smaller pure transformations.
- If a cycle appears, identify the missing artifact or boundary and break the cycle.
- Keep node outputs concrete so another agent can execute without extra clarification.
- Add explicit synthesis nodes when two branches may evolve the same concept differently.
- Plan merges semantically: the reintegration step should unify intent, concepts, naming, abstractions, and project behavior, not just produce conflict-free files.
- When the user needs that reintegration work executed, do a dedicated semantic merge pass.


