Excalidraw diagram generator: produces visual maps of account structure — opportunities, milestones, deal-team roles, MCEM stage positions, and role-specific prioritized views. Assembles CRM + vault data into a renderable .excalidraw.md file. Chains with mcem-stage-identification and role-orchestration for enriched stage/role context. Triggers: diagram, visualize account, draw structure, Excalidraw, account map, opportunity map, visual overview, show me the account, structural view, customer map, portfolio visualization. DO NOT USE FOR: architecture feasibility reviews or technical POC planning — use architecture-feasibility-check.
Generates an Excalidraw diagram that visually represents a customer's account structure — accounts, opportunities, milestones, deal-team members, MCEM stage positions, and status health — so account teams gain a single-glance structural overview.
Medium — Layout heuristics and grouping are context-dependent; the Excalidraw JSON structure is exact.
Scope — Identify the customer. Use one of:
oil:get_customer_context({ customer }) for vault-first prefetch (account IDs, known opportunity GUIDs).msx-crm:list_accounts_by_tpid({ tpid }) if TPID is provided.msx-crm:get_my_active_opportunities({ customerKeyword }) to discover opportunities by name.Gather structural data — For each opportunity in scope:
msx-crm:get_milestones({ opportunityIds: [...], includeTasks: true }) — batch milestones with inline tasks, status, commitment, owners, dates. Or use customerKeyword for customer-scoped retrieval in one call.oil:get_vault_context() — stakeholder map, risk flags, relationship notes (skip if unavailable).Classify MCEM stage — For each opportunity, determine functional stage using mcem-stage-identification Decision Logic (or reuse if already in context). Tag each opportunity node with its stage.
Apply role lens (if role specified) — Prioritize and highlight elements relevant to the user's role:
| Role | Prioritized view |
|---|---|
| Specialist | Pipeline health, Stage 2–3 opportunities, close-date proximity, forecast gaps |
| SE | Technical proof milestones, task ownership, blocker status |
| CSA | Architecture milestones, commitment readiness, delivery guardrails |
| CSAM | Full account breadth, adoption milestones, Stage 4–5 health, governance items |
Generate Excalidraw diagram — Produce a valid .excalidraw.md code block using the layout and element specs below.
Output — Return the diagram as a fenced code block (```excalidraw) that can be pasted into an Obsidian note or saved as a .excalidraw file in the vault (see shared-patterns.instructions.md § Artifact Output Directory).
Account (top-level container)
├── Opportunity 1 (grouped by MCEM stage)
│ ├── Milestone A (color-coded by status)
│ │ └── Tasks (collapsed unless blockers)
│ └── Milestone B
├── Opportunity 2
│ └── ...
└── Deal Team (side panel)
├── Role: Person
└── ...
| Element | Shape | Color | Border |
|---|---|---|---|
| Account | Rectangle, rounded | #f0f0f0 fill | 2px solid #333 |
| Opportunity (On Track) | Rectangle | #d4edda fill | 1px #28a745 |
| Opportunity (At Risk) | Rectangle | #fff3cd fill | 2px #ffc107 |
| Opportunity (Blocked) | Rectangle | #f8d7da fill | 2px #dc3545 |
| Milestone (Committed) | Rounded rect | #cce5ff fill | 1px #004085 |
| Milestone (Uncommitted) | Rounded rect | #e2e3e5 fill | 1px #6c757d |
| Milestone (Completed) | Rounded rect | #d4edda fill | 1px dashed #155724 |
| MCEM Stage label | Text badge | Stage color gradient | — |
| Deal Team member | Ellipse | Role-based color | 1px #666 |
| Arrow (parent→child) | Arrow | #666 | — |
| Risk flag | Diamond | #dc3545 fill | 2px #721c24 |
| Stage | Color | Label |
|---|---|---|
| Stage 1: Listen & Consult | #e8d5f5 | S1 |
| Stage 2: Inspire & Design | #d5e8f5 | S2 |
| Stage 3: Empower & Achieve | #d5f5e8 | S3 |
| Stage 4: Realize Value | #f5ead5 | S4 |
| Stage 5: Manage & Optimize | #f5d5d5 | S5 |
| Role | Color |
|---|---|
| Specialist | #6f42c1 |
| SE | #20c997 |
| CSA | #fd7e14 |
| CSAM | #0d6efd |
| Partner | #6c757d |
Generate a valid Excalidraw JSON scene wrapped in an Obsidian-compatible code block. The structure must follow Excalidraw v2 schema:
{
"type": "excalidraw",
"version": 2,
"source": "mcaps-iq",
"elements": [
{
"type": "rectangle",
"id": "<unique-id>",
"x": 0, "y": 0,
"width": 300, "height": 60,
"backgroundColor": "<fill>",
"strokeColor": "<border>",
"strokeWidth": 2,
"roundness": { "type": 3 },
"boundElements": [{ "type": "text", "id": "<text-id>" }]
},
{
"type": "text",
"id": "<text-id>",
"x": 10, "y": 15,
"text": "<label>",
"fontSize": 16,
"containerId": "<parent-rect-id>"
},
{
"type": "arrow",
"id": "<arrow-id>",
"startBinding": { "elementId": "<from>", "focus": 0, "gap": 5 },
"endBinding": { "elementId": "<to>", "focus": 0, "gap": 5 }
}
],
"appState": { "gridSize": null, "viewBackgroundColor": "#ffffff" }
}
msp_milestonedate.Use deterministic IDs derived from CRM entity IDs: acc-{accountid}, opp-{opportunityid}, ms-{milestoneid}, role-{systemuserid}.
msp_salesplay) into collapsible clusters; show counts per cluster. Expand only At Risk / Blocked opportunities by default.mcem-stage-identification): add a warning badge on the opportunity node showing CRM: Stage X → Functional: Stage Y.diagram: Excalidraw JSON scene in ```excalidraw code blocksummary: one-paragraph natural language description of the account structurehealth_snapshot: counts by status (on_track, at_risk, blocked, completed)stage_distribution: opportunity count per MCEM stagerole_coverage: deal team members mapped to their owned milestonesnext_action: suggests follow-up skill based on findings — e.g., pipeline-hygiene-triage if stale items detected, risk-surfacing if At Risk milestones found, milestone-health-review for governance prepconnect_hook_hint: Impact Area(s): Customer Impact, Culture & Collaboration — "Generated account structure diagram for {customer}: {n} opportunities across Stages {stages}, {health_snapshot}"