/data-ml:diagramfrom data-ml
Generates Mermaid architecture diagrams from your codebase: C4 context/container, sequence, ER, and dependency graphs. Useful for visualizing system architecture, database schemas, and key flows.
Ships in data-ml. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are in AUTONOMOUS MODE. Do NOT ask questions. Analyze the project codebase and generate comprehensive architecture diagrams using Mermaid.
INPUT: $ARGUMENTS
Accepted arguments:
c4: generate C4 Context and Container diagrams only.sequence: generate sequence diagrams for key flows only.er: generate ER diagram from database schema only.deps or dependency: generate module dependency graph only.Step 1.1 -- Tech Stack and Architecture Detection
Scan config files to determine: project type (web app, API, mobile, CLI, library, monorepo), primary language/framework, database(s), external services (auth, payment, email, storage), message queues, caching layers, and API gateway config.
Step 1.2 -- Service and Module Mapping
For monorepos/microservices: read docker-compose.yml or K8s manifests for service definitions, map inter-service communication, identify external deps per service.
For monoliths: read directory structure to identify modules/domains, trace import statements to map module dependencies, identify layer boundaries.
Step 1.3 -- Database Schema Extraction
Scan for schema definitions in: schema.prisma, .entity.ts (TypeORM/MikroORM), models/.js (Sequelize), models.py (Django), db/schema.rb (Rails), models/.py (SQLAlchemy), schema.ts (Drizzle), migrations/.sql, *.model.ts (Mongoose).
Extract: table/collection names, columns with types, primary/foreign keys, relationships (1:1, 1:N, M:N), indexes, and enums.
Step 1.4 -- Key Flow Identification
Identify the most important flows to diagram:
For each flow, trace: entry point, middleware, service layer, data access, external calls, and response construction.
Generate Mermaid diagrams. Use C4 syntax for architecture diagrams.
Step 2.1 -- C4 Context Diagram
Show the system in its environment: users/actors, the system boundary, and all
external systems it connects to. Use C4Context with Person, System,
System_Ext, and Rel elements. Keep it high-level -- no internal details.
Step 2.2 -- C4 Container Diagram
Show major containers within the system boundary: web apps, API servers, databases,
caches, workers, message queues. Use C4Container with Container, ContainerDb,
ContainerQueue elements. Show relationships with protocols (HTTPS, SQL, AMQP).
Step 2.3 -- Sequence Diagrams
For each key flow, generate a sequenceDiagram showing participants and
message flow. Always generate auth flow if auth exists. Generate the primary
business flow. Include request/response payloads as notes where helpful.
Step 2.4 -- ER Diagram
Generate from extracted schema using erDiagram syntax. Include all tables with
columns (name, type, PK/FK/UK markers) and relationships with cardinality
notation (||--o{, }o--o{, etc.).
Step 2.5 -- Module Dependency Graph
Generate a graph TD showing how internal modules depend on each other.
Place entry points (routes/controllers) at top, data stores at bottom,
external systems on sides. Flag circular dependencies as warnings.
Use style directives to color-code layers.
Create docs/diagrams/ directory if it does not exist.
Write individual files:
docs/diagrams/c4-context.md -- C4 Context diagramdocs/diagrams/c4-container.md -- C4 Container diagramdocs/diagrams/sequence-auth.md -- Auth sequence (if applicable)docs/diagrams/sequence-[flow].md -- Business flow sequencedocs/diagrams/er-diagram.md -- ER diagram (if database exists)docs/diagrams/dependency-graph.md -- Module dependency graphEach file: heading, brief explanation, Mermaid code block, notes on simplifications. Skip diagram types with no data (no ER if no database).
Generate docs/diagrams/README.md index linking all diagrams with descriptions.
After producing documentation, validate completeness:
IF VALIDATION FAILS:
| Diagram | File | Entities |
|---|---|---|
| C4 Context | docs/diagrams/c4-context.md | N systems |
| C4 Container | docs/diagrams/c4-container.md | N containers |
| Sequence: Auth | docs/diagrams/sequence-auth.md | N participants |
| ER Diagram | docs/diagrams/er-diagram.md | N tables |
| Dependencies | docs/diagrams/dependency-graph.md | N modules |
After producing output, record execution metadata for the /evolve pipeline.
Check if a project memory directory exists:
~/.claude/projects/skill-telemetry.md in that memory directoryEntry format:
### /diagram — {{YYYY-MM-DD}}
- Outcome: {{SUCCESS | PARTIAL | FAILED}}
- Self-healed: {{yes — what was healed | no}}
- Iterations used: {{N}} / {{N max}}
- Bottleneck: {{phase that struggled or "none"}}
- Suggestion: {{one-line improvement idea for /evolve, or "none"}}
Only log if the memory directory exists. Skip silently if not found. Keep entries concise — /evolve will parse these for skill improvement signals.
NEXT STEPS:
After generating diagrams:
/document to check overall documentation health."/adr to create ADRs explaining architectural decisions shown in diagrams."/onboarding to include these diagrams in the developer onboarding guide."What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
28 skills in this plugin
/adpRedpanda's Agentic Data Plane: governance infrastructure for building, running, and governing AI agents and MCP servers, plus a proxying AI Gateway for LLM providers, operated via `rpk ai` and the ADP API. Use when creating or managing AI agents (managed or self-managed) via `rpk ai agent` or `AgentRegistryService`; configuring MCP servers (remote or managed catalog, code mode, auth); setting up LLM providers or querying models via `rpk ai llm`/`rpk ai model` or the AI Gateway proxy; or configuring budgets, guardrails, or Cedar access-control policies through the governance APIs. Also covers reading agent transcripts and spending insights, and wiring OAuth clients or providers to the aigw Authorization Server. For the separate rpk cloud mcp control-plane MCP server, see `/redpanda:rpk-cloud`./ads-mathCalculate and model paid-media CPA, CPL, CPC, CPM, ROAS, MER, break-even targets, contribution margin, LTV:CAC, impression-share opportunity, budgets, forecasts, and experiment economics. Use for PPC math, ad calculator, break-even analysis, ROAS calculator, CPA calculator, budget forecast, LTV CAC, or MER./agentic-kaggle-skillKaggle-first end-to-end competition workflow for scored submissions. Use when Codex must run Kaggle or competitive ML workflows through scored submission, including code competitions, validation, metrics, policy-safe public notebook/discussion intel, tabular/text/image modeling, tuning, ensembling/stacking, proactive multi-notebook architectures, producer notebooks that train models and export private Kaggle artifact datasets, downstream consumer notebooks, Kaggle GPU offload, kagglehub access, hidden-test debugging, and public score retrieval.npx claudepluginhub skillmds/skillmd --plugin data-mlOther plugins' skills for the same job