Diagram Gen
by DennisToma
Generate architecture, sequence, state, and ERD diagrams for code understanding. Use when user wants to visualize code structure or document systems.
Skill Details
Repository Files
2 files in this skill directory
name: diagram-gen description: Generate architecture, sequence, state, and ERD diagrams for code understanding. Use when user wants to visualize code structure or document systems. allowed-tools: "Read,Grep,Glob,Write" version: 1.0.0
Diagram Generator
Generate Mermaid diagrams to understand and document code.
Diagram Types
| Type | Best For |
|---|---|
| Architecture | System overview, onboarding |
| Sequence | Request flows, workflows |
| State Machine | Object lifecycle |
| ERD | Database structure |
| Flowchart | Algorithm logic |
| Class | OOP structure |
Instructions
- Scope - What specific part needs visualization?
- Gather - Read entry points, key functions, data models
- Generate - Use Mermaid syntax (see
{baseDir}/references/mermaid-templates.md) - Save - Write to
docs/diagrams/[name].md
Output Format
# [Name] Diagram
[1-2 sentence description]
\`\`\`mermaid
[diagram]
\`\`\`
| Component | Purpose |
|-----------|---------|
| [Name] | [Role] |
Guidelines
- Focus on one aspect per diagram
- Match names to actual code
- Show happy path; add errors only if relevant
- Link to source files when helpful
Resources
Templates: {baseDir}/references/mermaid-templates.md
Related Skills
Dbt Transformation Patterns
Master dbt (data build tool) for analytics engineering with model organization, testing, documentation, and incremental strategies. Use when building data transformations, creating data models, or implementing analytics engineering best practices.
Clinical Decision Support
Generate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug develo
Scientific Schematics
Create publication-quality scientific diagrams using Nano Banana Pro AI with smart iterative refinement. Uses Gemini 3 Pro for quality review. Only regenerates if quality is below threshold for your document type. Specialized in neural network architectures, system diagrams, flowcharts, biological pathways, and complex scientific visualizations.
Mermaid Diagrams
Comprehensive guide for creating software diagrams using Mermaid syntax. Use when users need to create, visualize, or document software through diagrams including class diagrams (domain modeling, object-oriented design), sequence diagrams (application flows, API interactions, code execution), flowcharts (processes, algorithms, user journeys), entity relationship diagrams (database schemas), C4 architecture diagrams (system context, containers, components), state diagrams, git graphs, pie charts,
Diagram Generation
Mermaid diagram generation for architecture visualization, data flow diagrams, and component relationships. Use for documentation, PR descriptions, and architectural analysis.
Matlab
MATLAB and GNU Octave numerical computing for matrix operations, data analysis, visualization, and scientific computing. Use when writing MATLAB/Octave scripts for linear algebra, signal processing, image processing, differential equations, optimization, statistics, or creating scientific visualizations. Also use when the user needs help with MATLAB syntax, functions, or wants to convert between MATLAB and Python code. Scripts can be executed with MATLAB or the open-source GNU Octave interpreter
Dask
Distributed computing for larger-than-RAM pandas/NumPy workflows. Use when you need to scale existing pandas/NumPy code beyond memory or across clusters. Best for parallel file processing, distributed ML, integration with existing pandas code. For out-of-core analytics on single machine use vaex; for in-memory speed use polars.
Scientific Schematics
Create publication-quality scientific diagrams using Nano Banana Pro AI with smart iterative refinement. Uses Gemini 3 Pro for quality review. Only regenerates if quality is below threshold for your document type. Specialized in neural network architectures, system diagrams, flowcharts, biological pathways, and complex scientific visualizations.
Clinical Decision Support
Generate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug develo
Materialize Docs
Materialize documentation for SQL syntax, data ingestion, concepts, and best practices. Use when users ask about Materialize queries, sources, sinks, views, or clusters.
