GOAL Create a Mermaid flowchart implementation plan for delegating a single burn to a sub-agent. The plan must include clear decision points with "exit ramps" - paths where the sub-agent should STOP and report back to the captain rather than attempting to solve unexpected issues on its own.
IMPORTANT: The sub-agent (pilot) does NOT know about orbit, waypoints, or burns. Your diagram must use plain implementation language only. Describe what to do, not which burn it is.
WHEN TO USE
- Before delegating a burn to the pilot agent
- For any burn that has potential failure modes or requires specific conditions to be met
- When you want the sub-agent to abort early if assumptions don't hold
SCOPE CHECK - BEFORE BUILDING THE DIAGRAM
One burn = one narrow behavior slice with 3-8 action steps.
When in doubt, make the burn smaller. A too-small burn has zero cost. A too-large burn causes repeated aborts and wasted cycles.
A burn should do one thing — e.g., extract one piece of shared logic, migrate one caller, add tests for one behavior, or fix one defect — not combinations of these.
If the description uses "and" between independent actions, split it.
Each implementation burn follows TDD: write tests before the code they test, not after. A burn may contain multiple red → green cycles. Tests and the implementation they verify must be in the same burn — never split across separate burns.
MERMAID SYNTAX
flowchart TD
Start[Start: Brief description of what to implement] --> Step1[First action step]
Step1 --> Check1{Step 1 successful?}
Check1 -->|yes| Step2[Second action step]
Check1 -->|no| Abort1[[ABORT: Report - step 1 failed because X]]
Step2 --> Check2{Step 2 successful?}
Check2 -->|yes| Step3[Third action step]
Check2 -->|no| Abort2[[ABORT: Report - step 2 failed because Y]]
Step3 --> Check3{Step 3 successful?}
Check3 -->|yes| End[End: Expected outcome]
Check3 -->|no| Abort3[[ABORT: Report - step 3 failed because Z]]
NODE SHAPES
- Actions/steps: [square brackets]
- Decisions/conditions: {curly braces}
- ABORT points: [[double brackets]] - sub-agent must stop and report back
- End states: [square brackets]
CRITICAL RULES
-
EVERY action step MUST be followed by a decision diamond with success/failure paths
- BAD:
Step1 --> Step2 --> Step3(no verification) - GOOD:
Step1 --> Check1{OK?} --> Step2 --> Check2{OK?} --> Step3
- BAD:
-
Every decision diamond has two paths:
-->|yes|continues to next step-->|no|leads to[[ABORT: Report - <specific reason>]]
-
NO orbit terminology in the diagram (no "burn", "waypoint", "orbit", "trajectory")
- Use plain implementation language: "step", "action", "task"
OUTPUT FORMAT After creating the mermaid diagram, schedule the burn by passing the diagram via stdin using heredoc syntax (do NOT save to a file first):
orbit burn schedule <orbit-id> <waypoint> <description> <instructions> [--context "..."] <<'EOF'
[your diagram]
EOF
Where <description> is a concise summary (1-2 sentences), <instructions> are detailed steps, or a bulleted list for the implementation, and --context should contain e.g. related files, files to create, rationales, background.
Then delegate to the pilot agent with YAML front-matter only:
---
orbit-id: MED-7620
burn-number: 3
---
The pilot will automatically fetch the burn plan and mark it as initiated using orbit burn initiate.
AFTER DELEGATION
When the sub-agent returns:
- On success:
orbit burn complete - On abort: analyze reason, then
orbit burn abortand schedule a corrected burn, or consult user if fundamental
EXAMPLE - Adding an API endpoint
flowchart TD
Start[Start: Add CSV export endpoint to PatientController] --> S1[Find existing controller and identify endpoint patterns]
S1 --> C1{Controller found with consistent patterns?}
C1 -->|yes| S2[Write integration test for GET /patients/export endpoint]
C1 -->|no| Abort1[[ABORT: Report - controller not found or inconsistent patterns]]
S2 --> C2{Test written and fails as expected?}
C2 -->|yes| S3[Implement export endpoint following existing patterns]
C2 -->|no| Abort2[[ABORT: Report - test does not compile or does not fail as expected]]
S3 --> C3{Test passes?}
C3 -->|yes| S4[Run full test suite to verify no regressions]
C3 -->|no| Abort3[[ABORT: Report - implementation does not make test pass, describe errors]]
S4 --> C4{All tests pass?}
C4 -->|yes| End[End: Export endpoint added with passing test]
C4 -->|no| Abort4[[ABORT: Report - existing tests failing, describe failures]]