Generate a self-contained HTML task dependency graph from .autopilot/spec.md. Color-coded by status. No CDN. Includes phase markers and re-entry context note.
Invocations:
/visual-plan — reads the current .autopilot/spec.md and progress.json/visual-plan <description> — generates a graph from the provided descriptionGenerates a self-contained HTML visualization of the current build plan as a dependency graph. Each task is a node, dependencies are arrows, and tasks are color-coded by status.
Writes to: ~/.agent/diagrams/visual-plan-{timestamp}.html
~/.agent/diagrams/ is created if it does not existYYYYMMDD-HHmmssWhen invoked without arguments (spec mode):
.autopilot/spec.md — extract all tasks:
[depends:N,M] annotations for dependency edges[phase_end] annotations for phase boundary markers.autopilot/progress.json (optional) — get task statuses:
PENDING, IN_PROGRESS, DONE, BLOCKEDWhen invoked with a description:
Parse the description to extract a task list. Generate simple sequential edges unless the description explicitly mentions dependencies. Treat all tasks as PENDING.
Fallback:
If .autopilot/spec.md does not exist when invoked without arguments, generate a simple
text summary of any description provided rather than an empty graph.
Scan each task line for the pattern [depends:N] or [depends:N,M,...]:
Task 5 — Do something [depends:3,4]
This means task 5 has edges from task 3 and task 4.
Tasks with no [depends:...] annotation are independent — connect them to the phase
start node (a small diamond node at the start of each phase), not left floating.
Cycle detection: If A depends on B and B depends on A, render both nodes with an orange dashed border and add a warning label: "⚠ Circular dependency detected." Do not silently collapse cycles.
All CSS must be inline. Use SVG or HTML+CSS for the graph — no external charting libraries (no D3, no Mermaid CDN, no Cytoscape CDN).
1. Header
2. Dependency Graph
Render as an SVG embedded directly in the HTML:
#6c757d) = PENDING#ffc107) = IN_PROGRESS#28a745) = DONE#dc3545) = BLOCKED<line> or <path> elements with arrowhead markersphase_end annotation in the specLayout approach (when no layout library is available):
3. Legend
4. Task List (fallback table)
5. Re-entry Context Note
/* Suggested inline style skeleton */
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
margin: 0; padding: 20px; background: #f5f5f5; color: #333; }
.header { background: #2c3e50; color: white; padding: 20px; border-radius: 8px; margin-bottom: 20px; }
svg { background: white; border: 1px solid #ddd; border-radius: 8px; display: block; width: 100%; }
.legend { display: flex; gap: 16px; margin: 12px 0; font-size: 14px; }
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-swatch { width: 16px; height: 16px; border-radius: 3px; }
table { width: 100%; border-collapse: collapse; background: white; }
th, td { border: 1px solid #ddd; padding: 8px 12px; text-align: left; }
th { background: #ecf0f1; }
.reentry { background: #e8f4f8; border-left: 4px solid #3498db;
padding: 16px; margin-top: 20px; border-radius: 4px; }
.autopilot/spec.md does not exist and no description is given, output a text
message: "No spec found. Run /plan first or invoke /visual-plan <description>."progress.json does not exist, treat all tasks as PENDING (gray).[depends:N] referencing a non-existent task number should show a dashed
border and note "dependency not found" in the table row./visual-plan
/visual-plan Auth service: task 1 setup DB, task 2 login endpoint [depends:1], task 3 logout [depends:2]
/visual-plan Phase 1: scaffold; Phase 2: implement; Phase 3: test