.codex/skills/diagram/SKILL.md
Generate Mermaid diagrams for structure, flow, and relationships
npx skillsauth add washingtonguilhardes/example.hr-module diagramInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Persona: Execute this task as the @architect subagent.
Load the persona characteristics from .rulesync/subagents/architect.md before proceeding.
Generate Mermaid diagrams: structure, flow, relationships.
Discovery: - Diagram type: System Architecture/User Flow/Sequence/ERD/Component/State Machine/Data Flow - Subject: Feature name, file path, system area - Detail: High-level/Detailed/Specific aspect
Generate diagrams: - System Architecture: Client Layer (UI, Server Components, Client Components) → API Layer (tRPC, OpenAPI, Auth) → Business Logic (Procedures, Validation, Rate Limit) → Data Layer (Prisma, SQLite/LibSQL) - User Flow: Start → Auth check → Sign in/Workspace → Channel → Messages → Type/Send → Process → Success/Error → End - Sequence: User → Browser → tRPC → Auth → Prisma → DB (show interactions) - ERD: Analyze Prisma schema, show entities, relationships, fields (PK/FK/UK) - Component: React hierarchy, parent → children relationships - State Machine: States, transitions, conditions - Data Flow: User Input → Validation → tRPC → Auth → Business Logic → DB → Result → UI
Save: - Create: docs/diagrams/ if needed - Save to: docs/diagrams/{name}.md - Include: Title, Type, Created date, Scope, Diagram (mermaid code), Description, Key Components, Notes, Related Documentation
Summary: - Preview diagram, explain components, suggest usage (specs/docs/PRs), ask if updates needed
/diagram "message sending flow" --type sequence - Generates a Mermaid sequence diagram showing User -> Browser -> tRPC -> Auth -> Prisma -> DB interactions for message creation./diagram prisma/schema.prisma --type erd - Generates an entity-relationship diagram from the Prisma schema showing all models, fields, and relationships./diagram app/api/trpc/routers/ --type component --detail high-level - Generates a component diagram showing how routers relate to each other and their shared dependencies./explain - Understand code before diagramming it/spec - Diagrams may inform or accompany spec documents/onboard - Architecture diagrams are valuable onboarding materialtesting
Analyze distributed traces to find blocking queries, N+1 patterns, and missing tRPC encapsulation, then produce prioritized fixes
testing
required reading for all test/spec files or test related queries.
testing
Transform Product Brief into Technical Specification
development
Detect drift between code implementations and specification documents