Tiramisu
Turn a step-by-step plan into a functional dependency graph that can be delegated to subagents.
Reference
Canonical Example (Imperative Recipe)
Use this as a default example for parsing imperative plans:
Ingredients:
4 large egg yolks
1/2 cup granulated sugar (plus 2 tsp for espresso)
1/2 cup sweet Marsala wine
16 oz mascarpone cheese
1 cup heavy cream
about 40 ladyfingers
12 oz prepared espresso
2 tbsp cocoa powder
Steps:
- Dissolve
2 tsp sugar into 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
output to consumer inputs.
- 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:
12 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
```text block so the alignment survives rendering.
- For very large graphs, or when the harness renders it, a Mermaid
flowchart LR is an acceptable fallback:
flowchart LR
A0["input_a"] --> B1["task_b"]
A1["input_b"] --> B1
B1 --> C2["task_c"]
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.
1---2name: grim-dev-tiramisu-task-decomp3description: (grim:dev:tiramisu-task-decomp): (Tiramisu): Convert an imperative plan into a functional dependency diagram (DAG) and subagent-ready task packets. Use when the user wants to decompose a plan into parallelizable, dependency-safe execution steps.4---5# Tiramisu67Turn a step-by-step plan into a functional dependency graph that can be delegated to subagents.89## Reference10- Functional framing source: [What’s Functional Programming All About?](https://www.lihaoyi.com/post/WhatsFunctionalProgrammingAllAbout.html)11- Canonical recipe example: Michael Chu's Classic Tiramisu (as described in the article)1213## Canonical Example (Imperative Recipe)14Use this as a default example for parsing imperative plans:1516Ingredients:17- `4 large egg yolks`18- `1/2 cup granulated sugar` (plus `2 tsp` for espresso)19- `1/2 cup sweet Marsala wine`20- `16 oz mascarpone cheese`21- `1 cup heavy cream`22- `about 40 ladyfingers`23- `12 oz prepared espresso`24- `2 tbsp cocoa powder`2526Steps:271. Dissolve `2 tsp sugar` into espresso and chill.282. Whisk egg yolks.293. Add sugar and Marsala wine; blend.304. Whisk mixture over steam until thick/smooth.315. Beat mascarpone until creamy.326. Whip heavy cream to soft peaks.337. Combine custard with mascarpone; beat smooth.348. Fold in whipped cream.359. Soak ladyfingers briefly in espresso.3610. Assemble layers: soaked ladyfingers, cream, soaked ladyfingers, cream.3711. Sift cocoa on top.3812. Refrigerate for `4 hours`.3940Expected dependency shape:41- Custard branch: yolks + sugar + wine -> whisk over steam42- Cream branch: heavy cream -> whip43- Cheese branch: mascarpone -> beat44- Espresso branch: espresso + sugar -> soak ladyfingers45- Merge: custard + mascarpone + whipped cream -> cream filling46- Final: assemble + sift cocoa -> refrigerate4748## Input49- A plan, checklist, or strategy text.50- Optional: available subagents/roles, deadlines, constraints.5152## Workflow531. Extract atomic tasks as functions: `output = action(inputs)`.542. Name each intermediate artifact/output explicitly.553. Build a DAG:56- Node fields: `id`, `function`, `inputs`, `output`, `depends_on`, `definition_of_done`, `agent_hint`.57- Edge rule: connect producer `output` to consumer `inputs`.584. Topologically sort into parallel lanes & waves for delegation.595. Create handoff packets per node with required inputs and acceptance checks.606. Add reintegration requirements anywhere parallel branches could diverge on the same concept, API, naming, UX, or abstraction.617. List missing dependencies, assumptions, and blockers.6263## Output Format6465Always show an arrow-based dependency diagram.66The diagram and a short explanation are sufficient by default.67Node tables, delegation waves, and detailed handoff packets are optional.6869### Functional Graph Template (Lane Diagram)70Draw the DAG as left-to-right lanes merging with box-drawing characters, one lane per line:7172```text7312 oz espresso + 2 tsp sugar -> dissolve -> chill ──────────────────────────────────────────┐74~40 ladyfingers ────────────────────────────────────────────────────────────────────────────┴─ soak 1 sec each ─────────────┐754 egg yolks -> whisk -> + 1/2 cup sugar & Marsala -> whisk over steam ────────┐ │7616 oz mascarpone -> beat until creamy ────────────────────────────────────────┴─ combine ───────┐ │771 cup heavy cream -> whip to soft peaks ────────────────────────────────────────────────────────┴─ fold ────────────────────┤78 └─ assemble 2x layers -> sift cocoa -> refrigerate 4 hrs -> Tiramisu79```8081Formatting rules:82- One lane per line, flowing left to right; use `->` for steps **within** a lane.83- Use box-drawing characters only for joins: `┐` turn down, `┘` turn up, `┴`/`┤`/`┼` side merge, `│` pass-through, `└` emit the merged step, `─` horizontal fill.84- Pad lanes with `─` so every join character in the same merge sits in the same column; verify the columns line up before returning.85- 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.86- Keep it in a fenced ` ```text ` block so the alignment survives rendering.87- For very large graphs, or when the harness renders it, a Mermaid `flowchart LR` is an acceptable fallback:8889```mermaid90flowchart LR91 A0["input_a"] --> B1["task_b"]92 A1["input_b"] --> B193 B1 --> C2["task_c"]94```9596### Node Registry Template97| id | function | inputs | output | depends_on | agent |98| --- | --- | --- | --- | --- | --- |99| N1 | `brief = writeBrief(research)` | `research` | `brief` | `-` | `subagent-research` |100101### Subagent Waves Template102- Wave 0: `N1`, `N2`103- Wave 1: `N3`104- Wave 2: `N4`105106### Handoff Packet Template107- `N3`108- Objective: one sentence goal109- Inputs required: explicit artifacts110- Deliverable: output schema/path111- Acceptance checks: testable done criteria112113## Heuristics114- Prefer real data dependencies over chronological ordering words.115- Split overloaded steps into smaller pure transformations.116- If a cycle appears, identify the missing artifact or boundary and break the cycle.117- Keep node outputs concrete so another agent can execute without extra clarification.118- Add explicit synthesis nodes when two branches may evolve the same concept differently.119- Plan merges semantically: the reintegration step should unify intent, concepts, naming, abstractions, and project behavior, not just produce conflict-free files.120- When the user needs that reintegration work executed, do a dedicated semantic merge pass.