[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6CT8B4GHZ35E7JG9TY1FT7M":3,"skill-same:01M6CT8B4GHZ35E7JG9TY1FT7M":66},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":45,"commitSha":46,"skillDirectory":47,"forksCount":48,"repositoryHtmlUrl":49,"repositoryHomepageUrl":6,"ownerHtmlUrl":50,"ownerBlogUrl":6,"ownerDescription":51,"updatedAt":52,"install":53,"resources":65},"01M6CT8B4GHZ35E7JG9TY1FT7M","excalidraw",null,"Draws architecture, data flow, database (ERD) and system diagrams as Mermaid text and Excalidraw files. Use when a design doc or threat model needs a diagram.","vibbs\u002Fcompany-os","vibbs","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F7379149?v=4","01M6CT6M03CAS1H7RA89F3965B","Vibbs Dod","01M6CT6M4MY60C9FFQ3AAR2RSK",6,"MIT","https:\u002F\u002Fgithub.com\u002Fvibbs\u002Fcompany-os\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fexcalidraw\u002FSKILL.md",[],[5,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"system","journey","files","diagrams","threat","use","overview","model","text","design doc","design","doc","data","flow","database","threat model","mermaid","diagram","architecture","2026-11-10 10:12:30",false,"---\nname: excalidraw\ndescription: Draws architecture, data flow, database (ERD) and system diagrams as Mermaid text and Excalidraw files. Use when a design doc or threat model needs a diagram.\nuser-invocable: true\nargument-hint: \"[architecture | data-flow | erd | sequence | journey | system-overview]\"\n---\n\n# Excalidraw — Technical Diagramming\n\n## Reference\n- **ID**: S-ENG-17\n- **Category**: Engineering\n- **Inputs**: RFC draft, PRD, company.config.yaml, codebase structure, threat model\n- **Outputs**: Mermaid code blocks (inline in artifacts) + `.excalidraw` JSON files (`artifacts\u002Fdiagrams\u002F`)\n- **Used by**: Engineering Agent (primary), Ops & Risk Agent (DFDs for threat models), Product Agent (user journeys)\n- **Tool scripts**: `.\u002Ftools\u002Fartifact\u002Fvalidate.sh`, `.\u002Ftools\u002Fartifact\u002Flink.sh`\n\n## Purpose\n\nFill the diagramming gap across Company OS workflows. Three skills reference diagrams as required outputs but nothing produces them:\n- `architecture-draft` RFC template has `[Diagram + description]` placeholder\n- `ai-engineering` requires an \"Architecture Diagram — showing data flow through the AI pipeline\"\n- `threat-modeling` lists \"data flow diagrams\" as a required input\n\nThis skill provides the procedure, templates, and format references for producing structured diagrams in two formats.\n\n## When to Use\n\n- Creating or updating an RFC that needs system boundary diagrams\n- Producing a data flow diagram for threat modeling\n- Documenting entity relationships for a data model\n- Creating user journey maps for PRDs or UX research\n- Generating system overview diagrams for README or onboarding docs\n- Any time a user runs `\u002Fexcalidraw \u003Ctype>`\n\n## Diagram Types\n\n| Type | Keyword | Mermaid Syntax | Excalidraw | Primary Consumer |\n|------|---------|---------------|------------|-----------------|\n| System architecture | `architecture` | `graph TD` | Yes | RFC \"System Boundaries\" |\n| Data flow diagram | `data-flow` | `flowchart LR` | Yes | Threat model DFD |\n| Entity-relationship | `erd` | `erDiagram` | Yes | RFC \"Data Model\" |\n| Sequence diagram | `sequence` | `sequenceDiagram` | Mermaid only | RFC \"API Surface\" |\n| User journey | `journey` | `journey` | Yes | PRD \u002F UX research |\n| System overview | `system-overview` | `graph TD` | Yes | README \u002F onboarding |\n\n## Output Format Decision\n\n| Context | Format | Reason |\n|---------|--------|--------|\n| Embedded in an artifact (RFC, threat model, PRD) | **Mermaid** code fence | Agents can read\u002Fvalidate; renders in GitHub, Notion, Obsidian |\n| Standalone documentation or deep architecture visual | **Excalidraw** JSON file | Richer layout, color, grouping; opened in Excalidraw\u002FVS Code |\n| User explicitly requests a format | Respect the request | — |\n| Both are useful | Produce both | Mermaid inline + Excalidraw file |\n\n## Procedure\n\n### Step 0: Determine Scope\n\n1. **If invoked via `\u002Fexcalidraw \u003Ctype>`**: use the keyword to select diagram type\n2. **If invoked by another skill** (architecture-draft, threat-modeling): auto-detect type from context\n3. **If no keyword**: scan the source artifact for clues:\n   - RFC with `[Diagram + description]` → `architecture`\n   - Threat model → `data-flow`\n   - PRD with user flows → `journey`\n   - Data model section → `erd`\n\n### Step 1: Read Context\n\n1. **Read `company.config.yaml`** — tech stack, architecture patterns, database choice\n2. **Read the source artifact** (PRD\u002FRFC\u002Fthreat model) to understand what needs diagramming\n3. **Scan existing code structure** — look at real directories, modules, services to ground the diagram in reality\n4. **Check `artifacts\u002Fdiagrams\u002F`** for existing diagrams that may need updating rather than creating from scratch\n\n### Step 2: Produce Mermaid Diagram\n\nSelect the appropriate Mermaid syntax for the diagram type. Follow the templates below.\n\n**After writing Mermaid**: verify syntax by checking:\n- All node IDs are unique within the diagram\n- All edges reference existing node IDs\n- No unclosed brackets or quotes\n- Subgraph blocks are properly closed\n\n### Step 3: Produce Excalidraw Diagram (if applicable)\n\nIf the diagram warrants a standalone Excalidraw file (architecture, data-flow, erd, journey, system-overview):\n\n1. Use the Excalidraw JSON format reference below\n2. Apply the Company OS color palette\n3. Write to `artifacts\u002Fdiagrams\u002F{artifact-id}-{type}.excalidraw`\n4. Reference `docs\u002Fdiagrams\u002Fgenerate.js` for element factory patterns\n\n**Skip Excalidraw** for sequence diagrams (Mermaid handles these better) and for simple diagrams with fewer than 5 nodes (Mermaid is sufficient).\n\n### Step 4: Embed or Save\n\n- **Mermaid**: replace the `[Diagram + description]` placeholder in the artifact with the fenced code block\n- **Excalidraw**: write the JSON file and add a reference link in the artifact: `See [architecture diagram](artifacts\u002Fdiagrams\u002F{id}.excalidraw)`\n\n### Step 5: Cross-reference\n\nIf the diagram is saved as a standalone file in `artifacts\u002Fdiagrams\u002F`:\n1. Add YAML frontmatter with `type: diagram`\n2. Set `depends_on` to the parent artifact (RFC, PRD, etc.)\n3. Run `.\u002Ftools\u002Fartifact\u002Fvalidate.sh` on the diagram file\n4. Run `.\u002Ftools\u002Fartifact\u002Flink.sh` to wire parent\u002Fchild if needed\n\n---\n\n## Mermaid Templates\n\n### Architecture Diagram (`graph TD`)\n\n```mermaid\ngraph TD\n    subgraph Client[\"Client Layer\"]\n        WEB[Web App]\n        MOB[Mobile App]\n    end\n\n    subgraph API[\"API Layer\"]\n        GW[API Gateway]\n        AUTH[Auth Middleware]\n    end\n\n    subgraph Services[\"Service Layer\"]\n        SVC1[User Service]\n        SVC2[Order Service]\n        SVC3[Notification Service]\n    end\n\n    subgraph Data[\"Data Layer\"]\n        DB[(PostgreSQL)]\n        CACHE[(Redis)]\n        QUEUE[Job Queue]\n    end\n\n    WEB --> GW\n    MOB --> GW\n    GW --> AUTH\n    AUTH --> SVC1\n    AUTH --> SVC2\n    SVC2 --> SVC3\n    SVC1 --> DB\n    SVC2 --> DB\n    SVC1 --> CACHE\n    SVC3 --> QUEUE\n\n    style Client fill:#e8f4fd,stroke:#1971c2\n    style API fill:#fff4e6,stroke:#d9480f\n    style Services fill:#e6fcf5,stroke:#087f5b\n    style Data fill:#f3f0ff,stroke:#6741d9\n```\n\n### Data Flow Diagram (`flowchart LR`)\n\nUsed for threat modeling. Show trust boundaries as subgraphs, data stores as cylinders, processes as rectangles, external entities as rounded boxes.\n\n```mermaid\nflowchart LR\n    subgraph TB1[\"Trust Boundary: Internet\"]\n        USER([User Browser])\n    end\n\n    subgraph TB2[\"Trust Boundary: DMZ\"]\n        CDN[CDN \u002F WAF]\n        LB[Load Balancer]\n    end\n\n    subgraph TB3[\"Trust Boundary: Application\"]\n        API[API Server]\n        WORKER[Background Worker]\n    end\n\n    subgraph TB4[\"Trust Boundary: Data\"]\n        DB[(Database)]\n        S3[(Object Store)]\n    end\n\n    USER -->|HTTPS| CDN\n    CDN --> LB\n    LB --> API\n    API -->|SQL\u002FTLS| DB\n    API -->|Enqueue| WORKER\n    WORKER -->|S3 API| S3\n\n    style TB1 fill:#fff5f5,stroke:#c92a2a,stroke-dasharray: 5 5\n    style TB2 fill:#fff9db,stroke:#e67700,stroke-dasharray: 5 5\n    style TB3 fill:#e6fcf5,stroke:#087f5b,stroke-dasharray: 5 5\n    style TB4 fill:#f3f0ff,stroke:#6741d9,stroke-dasharray: 5 5\n```\n\n### Entity-Relationship Diagram (`erDiagram`)\n\n```mermaid\nerDiagram\n    USER {\n        uuid id PK\n        string email UK\n        string name\n        timestamp created_at\n    }\n    ORGANIZATION {\n        uuid id PK\n        string name\n        string plan\n    }\n    MEMBERSHIP {\n        uuid id PK\n        uuid user_id FK\n        uuid org_id FK\n        string role\n    }\n\n    USER ||--o{ MEMBERSHIP : \"has\"\n    ORGANIZATION ||--o{ MEMBERSHIP : \"has\"\n```\n\n### Sequence Diagram (`sequenceDiagram`)\n\n```mermaid\nsequenceDiagram\n    actor User\n    participant Client\n    participant API\n    participant Auth\n    participant DB\n\n    User->>Client: Submit login form\n    Client->>API: POST \u002Fauth\u002Flogin\n    API->>Auth: Validate credentials\n    Auth->>DB: Query user record\n    DB-->>Auth: User data\n    Auth-->>API: JWT token\n    API-->>Client: 200 + token\n    Client-->>User: Redirect to dashboard\n```\n\n### User Journey (`journey`)\n\n```mermaid\njourney\n    title New User Onboarding\n    section Sign Up\n        Visit landing page: 5: User\n        Click \"Get Started\": 4: User\n        Fill registration form: 3: User\n        Verify email: 2: User\n    section First Value\n        Complete onboarding wizard: 3: User\n        Create first project: 4: User\n        Invite team member: 3: User\n    section Aha Moment\n        See first results: 5: User\n        Share with team: 4: User\n```\n\n---\n\n## Excalidraw JSON Format Reference\n\n### File Envelope\n\nEvery `.excalidraw` file is UTF-8 JSON:\n\n```json\n{\n  \"type\": \"excalidraw\",\n  \"version\": 2,\n  \"source\": \"https:\u002F\u002Fexcalidraw.com\",\n  \"elements\": [],\n  \"appState\": { \"viewBackgroundColor\": \"#ffffff\", \"gridSize\": null },\n  \"files\": {}\n}\n```\n\n### Element Base Properties\n\nEvery element requires ALL of these fields:\n\n```json\n{\n  \"id\": \"unique-string\",\n  \"type\": \"rectangle\",\n  \"x\": 100, \"y\": 200,\n  \"width\": 160, \"height\": 80,\n  \"angle\": 0,\n  \"strokeColor\": \"#1e1e1e\",\n  \"backgroundColor\": \"transparent\",\n  \"fillStyle\": \"solid\",\n  \"strokeWidth\": 2,\n  \"strokeStyle\": \"solid\",\n  \"roughness\": 0,\n  \"opacity\": 100,\n  \"roundness\": { \"type\": 3 },\n  \"seed\": 1234567,\n  \"version\": 1,\n  \"versionNonce\": 7654321,\n  \"isDeleted\": false,\n  \"groupIds\": [],\n  \"frameId\": null,\n  \"boundElements\": [],\n  \"updated\": 1709424000000,\n  \"link\": null,\n  \"locked\": false\n}\n```\n\n### Element Types\n\n| Type | Key Properties | Notes |\n|------|---------------|-------|\n| `rectangle` | `roundness: { type: 3 }` for rounded corners | Main building block |\n| `diamond` | `roundness: { type: 2 }` | Decision nodes, gates |\n| `ellipse` | `roundness: { type: 2 }` | Start\u002Fend nodes |\n| `text` | `text`, `fontSize`, `fontFamily`, `textAlign`, `verticalAlign`, `containerId`, `originalText`, `autoResize: true`, `lineHeight: 1.25` | `fontFamily`: 1=hand-drawn, 2=Helvetica, 3=monospace |\n| `arrow` | `points: [[0,0],[dx,dy]]`, `startBinding`, `endBinding`, `startArrowhead`, `endArrowhead` | Bindings are bidirectional |\n| `line` | `points` array | Non-directional, no bindings |\n| `frame` | `name` field | Children set `frameId` on themselves |\n\n### Arrow Binding Rules (Critical)\n\nBindings MUST be bidirectional. When connecting arrow A from shape S1 to shape S2:\n\n1. Arrow A gets: `startBinding: { elementId: \"S1-id\", focus: 0, gap: 6 }` and `endBinding: { elementId: \"S2-id\", focus: 0, gap: 6 }`\n2. Shape S1 gets: `boundElements: [{ id: \"A-id\", type: \"arrow\" }]`\n3. Shape S2 gets: `boundElements: [{ id: \"A-id\", type: \"arrow\" }]`\n\n### Text Inside Shapes (Label Binding)\n\nTo place text T inside rectangle R:\n1. Text T gets: `containerId: \"R-id\"`, `textAlign: \"center\"`, `verticalAlign: \"middle\"`\n2. Rectangle R gets: `boundElements: [{ id: \"T-id\", type: \"text\" }]`\n3. Position text at center: `x = R.x + (R.width - T.width) \u002F 2`, `y = R.y + (R.height - T.height) \u002F 2`\n\n### Company OS Color Palette\n\nUse these colors consistently across all diagrams:\n\n| Domain | Background | Stroke |\n|--------|-----------|--------|\n| Orchestrator | `#e8f4fd` | `#1971c2` |\n| Product | `#f3f0ff` | `#6741d9` |\n| Engineering | `#e6fcf5` | `#087f5b` |\n| Backend | `#d3f9d8` | `#2b8a3e` |\n| Frontend | `#fff0f6` | `#a61e4d` |\n| DevOps | `#fff9db` | `#e67700` |\n| QA & Release | `#fff4e6` | `#d9480f` |\n| Growth | `#f8f0fc` | `#862e9c` |\n| Ops & Risk | `#fff5f5` | `#c92a2a` |\n| Gates \u002F warnings | `#fff3bf` | `#e67700` |\n| Muted \u002F disabled | `#f1f3f5` | `#adb5bd` |\n| Status: draft | `#f8f9fa` | `#868e96` |\n| Status: review | `#fff9db` | `#e67700` |\n| Status: approved | `#ebfbee` | `#2b8a3e` |\n| Text primary | — | `#1e1e1e` |\n| Text secondary | — | `#495057` |\n| Text muted | — | `#868e96` |\n\n### Design Conventions\n\n- **roughness: 0** — clean, professional lines (not hand-drawn)\n- **fontFamily: 2** — Helvetica for all text\n- **fontSize: 16** — default for labels inside shapes\n- **fontSize: 12-13** — for sub-labels and annotations\n- **fontSize: 20-24** — for titles and major section headers\n- **strokeWidth: 2** — default for all shapes and arrows\n- **strokeWidth: 1** — for pills, minor elements, and dense layouts\n- **gap: 6** — standard arrow binding gap\n- **Element ordering**: z-order follows array position (index 0 = back). Background zones first, then shapes, then arrows, then text annotations.\n- **Frame children** must appear BEFORE the frame element in the elements array.\n\n### Reference Implementation\n\nSee `docs\u002Fdiagrams\u002Fgenerate.js` for a complete Node.js generator that demonstrates:\n- Element factory functions (`rect()`, `textEl()`, `arrow()`, `labeledBox()`, `connect()`)\n- Bidirectional binding management\n- Deterministic ID generation for clean git diffs\n- Layout helpers and text width estimation\n- All 6 Company OS architecture diagrams as working examples\n\n---\n\n## Cross-References\n\n- **architecture-draft** (S-ENG-01): Use this skill at Step 3 \"Define System Boundaries\" to produce the architecture diagram\n- **threat-modeling** (S-RISK-01): Use this skill at Step 2 \"Draw the DFD\" to produce the data flow diagram\n- **ai-engineering** (S-ENG-16): Use this skill for the \"Architecture Diagram — showing data flow through the AI pipeline\"\n- **seed-data** (S-ENG-11): Use the ERD template for entity-relationship diagrams\n- **user-docs** (S-ENG-10): Reference Excalidraw diagrams as visual aids in user documentation\n\n## Quality Checklist\n\n- [ ] Diagram reflects the actual codebase structure (not aspirational architecture)\n- [ ] All nodes have clear, concise labels\n- [ ] Arrows show data\u002Fcontrol flow direction correctly\n- [ ] Color palette matches Company OS domain colors\n- [ ] Mermaid syntax validates (no broken references or unclosed blocks)\n- [ ] Excalidraw JSON is valid (all bindings bidirectional, all IDs unique)\n- [ ] Diagram has a title and brief description\n- [ ] Linked to parent artifact via `depends_on` (for standalone files)\n- [ ] No sensitive information (API keys, credentials) in diagram labels\n","# Excalidraw — Technical Diagramming\n\n## Reference\n- **ID**: S-ENG-17\n- **Category**: Engineering\n- **Inputs**: RFC draft, PRD, company.config.yaml, codebase structure, threat model\n- **Outputs**: Mermaid code blocks (inline in artifacts) + `.excalidraw` JSON files (`artifacts\u002Fdiagrams\u002F`)\n- **Used by**: Engineering Agent (primary), Ops & Risk Agent (DFDs for threat models), Product Agent (user journeys)\n- **Tool scripts**: `.\u002Ftools\u002Fartifact\u002Fvalidate.sh`, `.\u002Ftools\u002Fartifact\u002Flink.sh`\n\n## Purpose\n\nFill the diagramming gap across Company OS workflows. Three skills reference diagrams as required outputs but nothing produces them:\n- `architecture-draft` RFC template has `[Diagram + description]` placeholder\n- `ai-engineering` requires an \"Architecture Diagram — showing data flow through the AI pipeline\"\n- `threat-modeling` lists \"data flow diagrams\" as a required input\n\nThis skill provides the procedure, templates, and format references for producing structured diagrams in two formats.\n\n## When to Use\n\n- Creating or updating an RFC that needs system boundary diagrams\n- Producing a data flow diagram for threat modeling\n- Documenting entity relationships for a data model\n- Creating user journey maps for PRDs or UX research\n- Generating system overview diagrams for README or onboarding docs\n- Any time a user runs `\u002Fexcalidraw \u003Ctype>`\n\n## Diagram Types\n\n| Type | Keyword | Mermaid Syntax | Excalidraw | Primary Consumer |\n|------|---------|---------------|------------|-----------------|\n| System architecture | `architecture` | `graph TD` | Yes | RFC \"System Boundaries\" |\n| Data flow diagram | `data-flow` | `flowchart LR` | Yes | Threat model DFD |\n| Entity-relationship | `erd` | `erDiagram` | Yes | RFC \"Data Model\" |\n| Sequence diagram | `sequence` | `sequenceDiagram` | Mermaid only | RFC \"API Surface\" |\n| User journey | `journey` | `journey` | Yes | PRD \u002F UX research |\n| System overview | `system-overview` | `graph TD` | Yes | README \u002F onboarding |\n\n## Output Format Decision\n\n| Context | Format | Reason |\n|---------|--------|--------|\n| Embedded in an artifact (RFC, threat model, PRD) | **Mermaid** code fence | Agents can read\u002Fvalidate; renders in GitHub, Notion, Obsidian |\n| Standalone documentation or deep architecture visual | **Excalidraw** JSON file | Richer layout, color, grouping; opened in Excalidraw\u002FVS Code |\n| User explicitly requests a format | Respect the request | — |\n| Both are useful | Produce both | Mermaid inline + Excalidraw file |\n\n## Procedure\n\n### Step 0: Determine Scope\n\n1. **If invoked via `\u002Fexcalidraw \u003Ctype>`**: use the keyword to select diagram type\n2. **If invoked by another skill** (architecture-draft, threat-modeling): auto-detect type from context\n3. **If no keyword**: scan the source artifact for clues:\n   - RFC with `[Diagram + description]` → `architecture`\n   - Threat model → `data-flow`\n   - PRD with user flows → `journey`\n   - Data model section → `erd`\n\n### Step 1: Read Context\n\n1. **Read `company.config.yaml`** — tech stack, architecture patterns, database choice\n2. **Read the source artifact** (PRD\u002FRFC\u002Fthreat model) to understand what needs diagramming\n3. **Scan existing code structure** — look at real directories, modules, services to ground the diagram in reality\n4. **Check `artifacts\u002Fdiagrams\u002F`** for existing diagrams that may need updating rather than creating from scratch\n\n### Step 2: Produce Mermaid Diagram\n\nSelect the appropriate Mermaid syntax for the diagram type. Follow the templates below.\n\n**After writing Mermaid**: verify syntax by checking:\n- All node IDs are unique within the diagram\n- All edges reference existing node IDs\n- No unclosed brackets or quotes\n- Subgraph blocks are properly closed\n\n### Step 3: Produce Excalidraw Diagram (if applicable)\n\nIf the diagram warrants a standalone Excalidraw file (architecture, data-flow, erd, journey, system-overview):\n\n1. Use the Excalidraw JSON format reference below\n2. Apply the Company OS color palette\n3. Write to `artifacts\u002Fdiagrams\u002F{artifact-id}-{type}.excalidraw`\n4. Reference `docs\u002Fdiagrams\u002Fgenerate.js` for element factory patterns\n\n**Skip Excalidraw** for sequence diagrams (Mermaid handles these better) and for simple diagrams with fewer than 5 nodes (Mermaid is sufficient).\n\n### Step 4: Embed or Save\n\n- **Mermaid**: replace the `[Diagram + description]` placeholder in the artifact with the fenced code block\n- **Excalidraw**: write the JSON file and add a reference link in the artifact: `See [architecture diagram](artifacts\u002Fdiagrams\u002F{id}.excalidraw)`\n\n### Step 5: Cross-reference\n\nIf the diagram is saved as a standalone file in `artifacts\u002Fdiagrams\u002F`:\n1. Add YAML frontmatter with `type: diagram`\n2. Set `depends_on` to the parent artifact (RFC, PRD, etc.)\n3. Run `.\u002Ftools\u002Fartifact\u002Fvalidate.sh` on the diagram file\n4. Run `.\u002Ftools\u002Fartifact\u002Flink.sh` to wire parent\u002Fchild if needed\n\n---\n\n## Mermaid Templates\n\n### Architecture Diagram (`graph TD`)\n\n```mermaid\ngraph TD\n    subgraph Client[\"Client Layer\"]\n        WEB[Web App]\n        MOB[Mobile App]\n    end\n\n    subgraph API[\"API Layer\"]\n        GW[API Gateway]\n        AUTH[Auth Middleware]\n    end\n\n    subgraph Services[\"Service Layer\"]\n        SVC1[User Service]\n        SVC2[Order Service]\n        SVC3[Notification Service]\n    end\n\n    subgraph Data[\"Data Layer\"]\n        DB[(PostgreSQL)]\n        CACHE[(Redis)]\n        QUEUE[Job Queue]\n    end\n\n    WEB --> GW\n    MOB --> GW\n    GW --> AUTH\n    AUTH --> SVC1\n    AUTH --> SVC2\n    SVC2 --> SVC3\n    SVC1 --> DB\n    SVC2 --> DB\n    SVC1 --> CACHE\n    SVC3 --> QUEUE\n\n    style Client fill:#e8f4fd,stroke:#1971c2\n    style API fill:#fff4e6,stroke:#d9480f\n    style Services fill:#e6fcf5,stroke:#087f5b\n    style Data fill:#f3f0ff,stroke:#6741d9\n```\n\n### Data Flow Diagram (`flowchart LR`)\n\nUsed for threat modeling. Show trust boundaries as subgraphs, data stores as cylinders, processes as rectangles, external entities as rounded boxes.\n\n```mermaid\nflowchart LR\n    subgraph TB1[\"Trust Boundary: Internet\"]\n        USER([User Browser])\n    end\n\n    subgraph TB2[\"Trust Boundary: DMZ\"]\n        CDN[CDN \u002F WAF]\n        LB[Load Balancer]\n    end\n\n    subgraph TB3[\"Trust Boundary: Application\"]\n        API[API Server]\n        WORKER[Background Worker]\n    end\n\n    subgraph TB4[\"Trust Boundary: Data\"]\n        DB[(Database)]\n        S3[(Object Store)]\n    end\n\n    USER -->|HTTPS| CDN\n    CDN --> LB\n    LB --> API\n    API -->|SQL\u002FTLS| DB\n    API -->|Enqueue| WORKER\n    WORKER -->|S3 API| S3\n\n    style TB1 fill:#fff5f5,stroke:#c92a2a,stroke-dasharray: 5 5\n    style TB2 fill:#fff9db,stroke:#e67700,stroke-dasharray: 5 5\n    style TB3 fill:#e6fcf5,stroke:#087f5b,stroke-dasharray: 5 5\n    style TB4 fill:#f3f0ff,stroke:#6741d9,stroke-dasharray: 5 5\n```\n\n### Entity-Relationship Diagram (`erDiagram`)\n\n```mermaid\nerDiagram\n    USER {\n        uuid id PK\n        string email UK\n        string name\n        timestamp created_at\n    }\n    ORGANIZATION {\n        uuid id PK\n        string name\n        string plan\n    }\n    MEMBERSHIP {\n        uuid id PK\n        uuid user_id FK\n        uuid org_id FK\n        string role\n    }\n\n    USER ||--o{ MEMBERSHIP : \"has\"\n    ORGANIZATION ||--o{ MEMBERSHIP : \"has\"\n```\n\n### Sequence Diagram (`sequenceDiagram`)\n\n```mermaid\nsequenceDiagram\n    actor User\n    participant Client\n    participant API\n    participant Auth\n    participant DB\n\n    User->>Client: Submit login form\n    Client->>API: POST \u002Fauth\u002Flogin\n    API->>Auth: Validate credentials\n    Auth->>DB: Query user record\n    DB-->>Auth: User data\n    Auth-->>API: JWT token\n    API-->>Client: 200 + token\n    Client-->>User: Redirect to dashboard\n```\n\n### User Journey (`journey`)\n\n```mermaid\njourney\n    title New User Onboarding\n    section Sign Up\n        Visit landing page: 5: User\n        Click \"Get Started\": 4: User\n        Fill registration form: 3: User\n        Verify email: 2: User\n    section First Value\n        Complete onboarding wizard: 3: User\n        Create first project: 4: User\n        Invite team member: 3: User\n    section Aha Moment\n        See first results: 5: User\n        Share with team: 4: User\n```\n\n---\n\n## Excalidraw JSON Format Reference\n\n### File Envelope\n\nEvery `.excalidraw` file is UTF-8 JSON:\n\n```json\n{\n  \"type\": \"excalidraw\",\n  \"version\": 2,\n  \"source\": \"https:\u002F\u002Fexcalidraw.com\",\n  \"elements\": [],\n  \"appState\": { \"viewBackgroundColor\": \"#ffffff\", \"gridSize\": null },\n  \"files\": {}\n}\n```\n\n### Element Base Properties\n\nEvery element requires ALL of these fields:\n\n```json\n{\n  \"id\": \"unique-string\",\n  \"type\": \"rectangle\",\n  \"x\": 100, \"y\": 200,\n  \"width\": 160, \"height\": 80,\n  \"angle\": 0,\n  \"strokeColor\": \"#1e1e1e\",\n  \"backgroundColor\": \"transparent\",\n  \"fillStyle\": \"solid\",\n  \"strokeWidth\": 2,\n  \"strokeStyle\": \"solid\",\n  \"roughness\": 0,\n  \"opacity\": 100,\n  \"roundness\": { \"type\": 3 },\n  \"seed\": 1234567,\n  \"version\": 1,\n  \"versionNonce\": 7654321,\n  \"isDeleted\": false,\n  \"groupIds\": [],\n  \"frameId\": null,\n  \"boundElements\": [],\n  \"updated\": 1709424000000,\n  \"link\": null,\n  \"locked\": false\n}\n```\n\n### Element Types\n\n| Type | Key Properties | Notes |\n|------|---------------|-------|\n| `rectangle` | `roundness: { type: 3 }` for rounded corners | Main building block |\n| `diamond` | `roundness: { type: 2 }` | Decision nodes, gates |\n| `ellipse` | `roundness: { type: 2 }` | Start\u002Fend nodes |\n| `text` | `text`, `fontSize`, `fontFamily`, `textAlign`, `verticalAlign`, `containerId`, `originalText`, `autoResize: true`, `lineHeight: 1.25` | `fontFamily`: 1=hand-drawn, 2=Helvetica, 3=monospace |\n| `arrow` | `points: [[0,0],[dx,dy]]`, `startBinding`, `endBinding`, `startArrowhead`, `endArrowhead` | Bindings are bidirectional |\n| `line` | `points` array | Non-directional, no bindings |\n| `frame` | `name` field | Children set `frameId` on themselves |\n\n### Arrow Binding Rules (Critical)\n\nBindings MUST be bidirectional. When connecting arrow A from shape S1 to shape S2:\n\n1. Arrow A gets: `startBinding: { elementId: \"S1-id\", focus: 0, gap: 6 }` and `endBinding: { elementId: \"S2-id\", focus: 0, gap: 6 }`\n2. Shape S1 gets: `boundElements: [{ id: \"A-id\", type: \"arrow\" }]`\n3. Shape S2 gets: `boundElements: [{ id: \"A-id\", type: \"arrow\" }]`\n\n### Text Inside Shapes (Label Binding)\n\nTo place text T inside rectangle R:\n1. Text T gets: `containerId: \"R-id\"`, `textAlign: \"center\"`, `verticalAlign: \"middle\"`\n2. Rectangle R gets: `boundElements: [{ id: \"T-id\", type: \"text\" }]`\n3. Position text at center: `x = R.x + (R.width - T.width) \u002F 2`, `y = R.y + (R.height - T.height) \u002F 2`\n\n### Company OS Color Palette\n\nUse these colors consistently across all diagrams:\n\n| Domain | Background | Stroke |\n|--------|-----------|--------|\n| Orchestrator | `#e8f4fd` | `#1971c2` |\n| Product | `#f3f0ff` | `#6741d9` |\n| Engineering | `#e6fcf5` | `#087f5b` |\n| Backend | `#d3f9d8` | `#2b8a3e` |\n| Frontend | `#fff0f6` | `#a61e4d` |\n| DevOps | `#fff9db` | `#e67700` |\n| QA & Release | `#fff4e6` | `#d9480f` |\n| Growth | `#f8f0fc` | `#862e9c` |\n| Ops & Risk | `#fff5f5` | `#c92a2a` |\n| Gates \u002F warnings | `#fff3bf` | `#e67700` |\n| Muted \u002F disabled | `#f1f3f5` | `#adb5bd` |\n| Status: draft | `#f8f9fa` | `#868e96` |\n| Status: review | `#fff9db` | `#e67700` |\n| Status: approved | `#ebfbee` | `#2b8a3e` |\n| Text primary | — | `#1e1e1e` |\n| Text secondary | — | `#495057` |\n| Text muted | — | `#868e96` |\n\n### Design Conventions\n\n- **roughness: 0** — clean, professional lines (not hand-drawn)\n- **fontFamily: 2** — Helvetica for all text\n- **fontSize: 16** — default for labels inside shapes\n- **fontSize: 12-13** — for sub-labels and annotations\n- **fontSize: 20-24** — for titles and major section headers\n- **strokeWidth: 2** — default for all shapes and arrows\n- **strokeWidth: 1** — for pills, minor elements, and dense layouts\n- **gap: 6** — standard arrow binding gap\n- **Element ordering**: z-order follows array position (index 0 = back). Background zones first, then shapes, then arrows, then text annotations.\n- **Frame children** must appear BEFORE the frame element in the elements array.\n\n### Reference Implementation\n\nSee `docs\u002Fdiagrams\u002Fgenerate.js` for a complete Node.js generator that demonstrates:\n- Element factory functions (`rect()`, `textEl()`, `arrow()`, `labeledBox()`, `connect()`)\n- Bidirectional binding management\n- Deterministic ID generation for clean git diffs\n- Layout helpers and text width estimation\n- All 6 Company OS architecture diagrams as working examples\n\n---\n\n## Cross-References\n\n- **architecture-draft** (S-ENG-01): Use this skill at Step 3 \"Define System Boundaries\" to produce the architecture diagram\n- **threat-modeling** (S-RISK-01): Use this skill at Step 2 \"Draw the DFD\" to produce the data flow diagram\n- **ai-engineering** (S-ENG-16): Use this skill for the \"Architecture Diagram — showing data flow through the AI pipeline\"\n- **seed-data** (S-ENG-11): Use the ERD template for entity-relationship diagrams\n- **user-docs** (S-ENG-10): Reference Excalidraw diagrams as visual aids in user documentation\n\n## Quality Checklist\n\n- [ ] Diagram reflects the actual codebase structure (not aspirational architecture)\n- [ ] All nodes have clear, concise labels\n- [ ] Arrows show data\u002Fcontrol flow direction correctly\n- [ ] Color palette matches Company OS domain colors\n- [ ] Mermaid syntax validates (no broken references or unclosed blocks)\n- [ ] Excalidraw JSON is valid (all bindings bidirectional, all IDs unique)\n- [ ] Diagram has a title and brief description\n- [ ] Linked to parent artifact via `depends_on` (for standalone files)\n- [ ] No sensitive information (API keys, credentials) in diagram labels\n",{"name":5,"description":7,"argument-hint":43,"user-invocable":44},"[architecture | data-flow | erd | sequence | journey | system-overview]",true,"main","e842fb6d0e04360c47db78bc2e2e2987314d64d4",".claude\u002Fskills\u002Fexcalidraw",2,"https:\u002F\u002Fgithub.com\u002Fvibbs\u002Fcompany-os","https:\u002F\u002Fgithub.com\u002Fvibbs","Principal Engineer · Applied AI · building ArcAI @ GrowthArc","2026-10-21 02:08:08",{"source":8,"skillName":5,"commands":54,"prompt":64,"zipAvailable":44},[55,58,61],{"tool":56,"command":57},"npx","npx skills add vibbs\u002Fcompany-os --skill excalidraw",{"tool":59,"command":60},"bunx","bunx skills add vibbs\u002Fcompany-os --skill excalidraw",{"tool":62,"command":63},"pnpm","pnpm dlx skills add vibbs\u002Fcompany-os --skill excalidraw","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fvibbs\u002Fcompany-os\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fexcalidraw\u002FSKILL.md",[],[67,76,84,94,110,123],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":38},"01M6CTHBW1E64ECYGD105N4S5E","typo-field","Fixture skill with a misspelled top-level field.","https:\u002F\u002Fgithub.com\u002Fvibbs\u002Fcompany-os\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskills\u002Ftypo-field\u002FSKILL.md",[],[74,75],"typo field","fixture skill",{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":38},"01M6CTHABTV8FKVDHFMMKPAV51","spaced-comments","Fixture skill with comments and spaces after block keys.","https:\u002F\u002Fgithub.com\u002Fvibbs\u002Fcompany-os\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskills\u002Fspaced-comments\u002FSKILL.md",[],[83,75],"spaced comments",{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":38},"01M6CTH8MHC14KB65ZDHYBJW1N","crlf-comments","Fixture skill with Windows line endings.","https:\u002F\u002Fgithub.com\u002Fvibbs\u002Fcompany-os\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskills\u002Fcrlf-comments\u002FSKILL.md",[],[91,92,93,75],"crlf comments","CRLF","windows",{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":38},"01M6CTH6TBKTDP9G8QB1Z2K0TY","claude-fields","Fixture skill using top-level fields Claude Code documents.","https:\u002F\u002Fgithub.com\u002Fvibbs\u002Fcompany-os\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskills\u002Fclaude-fields\u002FSKILL.md",[],[101,102,103,104,105,106,75,107,108,109],"claude fields","explore","documents","src","grep","read","Bash","code","testing",{"skillNo":111,"name":112,"nameZh":6,"description":113,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":114,"categories":115,"keywords":116,"publishedAt":38},"01M6CTH46BGKXH80RWS876Y2CW","workflow-router","Maps an objective to the artifacts, stages and agents it needs. Use when deciding what happens next or which agents to involve.","https:\u002F\u002Fgithub.com\u002Fvibbs\u002Fcompany-os\u002Fblob\u002Fmain\u002Fos\u002Fskills\u002Fworkflow-router\u002FSKILL.md",[],[117,118,119,120,121,24,122],"workflow","router","workflow router","next","maps","artifacts",{"skillNo":124,"name":125,"nameZh":6,"description":126,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":127,"categories":128,"keywords":129,"publishedAt":38},"01M6CTH27653SRVP2FMEQN3J5B","weekly-review","Summarizes your week: what shipped, AI spend, support themes, security health and next priorities. Use at the end of each week.","https:\u002F\u002Fgithub.com\u002Fvibbs\u002Fcompany-os\u002Fblob\u002Fmain\u002Fos\u002Fskills\u002Fweekly-review\u002FSKILL.md",[],[130,131,132,120,24,133,134,135,136],"weekly review","review","priorities","health","save","support","security"]