diagram — community diagram, nano-banana, community, ide skills, Claude Code, Cursor, Windsurf

v1.0.0
GitHub

About this Skill

Perfect for Technical Writing Agents needing advanced diagram generation capabilities for documentation and presentation. 🍌 AI-powered image and diagram generation for Claude Code using Nano Banana Pro

flight505 flight505
[0]
[0]
Updated: 3/5/2026

Agent Capability Analysis

The diagram skill by flight505 is an open-source community AI agent skill for Claude Code and other IDE workflows, helping agents execute tasks with better context, repeatability, and domain-specific guidance.

Ideal Agent Persona

Perfect for Technical Writing Agents needing advanced diagram generation capabilities for documentation and presentation.

Core Value

Empowers agents to generate publication-quality diagrams using natural language descriptions, leveraging AI quality review and smart iteration for optimized API calls, while supporting various document types and quality standards.

Capabilities Granted for diagram

Generating technical diagrams for software architecture documentation
Automating the creation of flowcharts for business process analysis
Creating illustrative diagrams for data visualization and reporting

! Prerequisites & Limits

  • Requires Nano Banana Pro for diagram generation
  • Dependent on AI quality review for professional standards
  • May require adjustments for different document types and quality thresholds
Labs Demo

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

diagram

Install diagram, an AI agent skill for AI agent workflows and automation. Works with Claude Code, Cursor, and Windsurf with one-command setup.

SKILL.md
Readonly

Nano Banana - Diagram Generation

Overview

Generate any technical diagram by describing it in natural language. Nano Banana Pro automatically creates publication-quality diagrams with intelligent quality review.

Key Features:

  • 🍌 Smart Iteration: Only regenerates if quality is below threshold (saves API calls)
  • 🎯 Document-Type Aware: Different quality standards for different document types
  • 🔍 AI Quality Review: Gemini 3 Pro reviews each generation for professional standards
  • 📊 Publication-Ready: High contrast, readable fonts, colorblind-friendly

When to Use This Skill

Use this skill when you need:

  • Architecture Diagrams: System designs, microservices, C4 models
  • Flowcharts: Process flows, decision trees, user journeys
  • Data Models: ERD diagrams, schema visualizations
  • Sequence Diagrams: API interactions, message flows
  • Infrastructure Diagrams: Cloud architecture, deployment topologies
  • Pipeline Diagrams: CI/CD, data pipelines, ML workflows
  • Any Technical Visualization: Describe it, Nano Banana creates it

Quick Start

bash
1# Generate an architecture diagram 2python3 skills/diagram/scripts/generate_diagram.py "Microservices architecture with API gateway, auth service, and database" -o architecture.png --doc-type architecture 3 4# Generate a flowchart for a presentation 5python3 skills/diagram/scripts/generate_diagram.py "User authentication flow with OAuth2" -o auth_flow.png --doc-type presentation 6 7# Generate with higher resolution 8python3 skills/diagram/scripts/generate_diagram.py "Complex system diagram" -o system.png --resolution 2K 9 10# Generate with verbose output 11python3 skills/diagram/scripts/generate_diagram.py "Database schema for e-commerce" -o schema.png -v

Editing Existing Diagrams

Use /nano-banana:edit to modify an existing diagram, or call the script directly:

bash
1# Edit via command (recommended) 2/nano-banana:edit architecture.png "Add a Redis cache layer between the API and database" 3 4# Edit via script directly 5python3 skills/diagram/scripts/generate_diagram_ai.py "Add Redis cache layer" --input architecture.png -o architecture_edit1.png --doc-type architecture

When to edit vs. regenerate:

  • Edit when the diagram structure is correct but needs additions or modifications
  • Regenerate when the layout or overall approach needs rethinking

Document Types & Quality Thresholds

Different documents have different quality requirements. Nano Banana automatically adjusts:

Document TypeThresholdBest For
specification8.5/10Technical specs, PRDs
architecture8.0/10Architecture documents
proposal8.0/10Business proposals
journal8.5/10Academic publications
conference8.0/10Conference papers
thesis8.0/10Dissertations
grant8.0/10Grant proposals
sprint7.5/10Sprint planning
report7.5/10Technical reports
preprint7.5/10arXiv, bioRxiv
readme7.0/10README files
poster7.0/10Academic posters
presentation6.5/10Slides, talks
default7.5/10General purpose

Smart Iteration: If the first generation scores above the threshold, no second iteration is performed. This saves time and API costs.

Diagram Examples

System Architecture

bash
1python3 generate_diagram.py "Three-tier web application architecture with: 2- React frontend 3- Node.js API layer with load balancer 4- PostgreSQL database with read replicas 5- Redis cache layer 6- CDN for static assets" -o three_tier.png --doc-type architecture

Sequence Diagram

bash
1python3 generate_diagram.py "Sequence diagram showing OAuth2 authorization code flow: 21. User clicks login 32. App redirects to auth server 43. User authenticates 54. Auth server returns code 65. App exchanges code for token 76. App accesses protected resource" -o oauth_flow.png --doc-type specification

Data Flow

bash
1python3 generate_diagram.py "Data pipeline showing: 2- Data ingestion from multiple sources (API, files, streaming) 3- ETL processing with Apache Spark 4- Data warehouse (Snowflake) 5- BI dashboards and ML model training" -o pipeline.png --doc-type report

C4 Model - Container Diagram

bash
1python3 generate_diagram.py "C4 Container diagram for e-commerce platform: 2- Web App (React SPA) 3- Mobile App (React Native) 4- API Gateway (Kong) 5- Order Service (Python) 6- Payment Service (Go) 7- Inventory Service (Java) 8- PostgreSQL Database 9- Redis Cache 10- RabbitMQ Message Queue" -o c4_container.png --doc-type architecture

How It Works

  1. Initial Generation: Nano Banana Pro (gemini-3-pro-image-preview) generates the diagram
  2. Quality Review: Gemini 3 Pro evaluates on 5 criteria:
    • Technical Accuracy (0-2 pts)
    • Clarity and Readability (0-2 pts)
    • Label Quality (0-2 pts)
    • Layout and Composition (0-2 pts)
    • Professional Appearance (0-2 pts)
  3. Decision: If score ≥ threshold → Done! If score < threshold → Iterate
  4. Improvement: Feedback is incorporated into an improved prompt
  5. Regeneration: New diagram generated with improvements (max 2 iterations)

Output Files

For an output path of diagram.png, you'll get:

  • diagram_v1.png - First iteration
  • diagram_v2.png - Second iteration (if needed)
  • diagram.png - Final version (copy of best iteration)
  • diagram_review_log.json - Quality scores and review details

Configuration

bash
1export GEMINI_API_KEY='your_gemini_key_here'

Get a key at https://aistudio.google.com/apikey (free tier available).

Option 2: OpenRouter (Alternative)

bash
1export OPENROUTER_API_KEY='your_api_key_here'

Get a key at https://openrouter.ai/keys. Required for non-Google models.

.env File

Create a .env file in your project with either key:

GEMINI_API_KEY=your_gemini_key_here

Auto-detection: When both keys are set, the Google direct API is preferred. Use --provider openrouter to force OpenRouter.

Tips for Better Diagrams

Be Specific

bash
1# ❌ Too vague 2"System diagram" 3 4# ✅ Specific and detailed 5"Microservices architecture diagram showing user service, order service, and payment service communicating via REST APIs, with a shared PostgreSQL database and Redis cache"

Include Relationships

bash
1# ✅ Good - describes connections 2"Data flow diagram showing: 3- User uploads file to S3 4- Lambda triggered on upload 5- Lambda processes and stores metadata in DynamoDB 6- SNS notifies downstream services"

Specify Style When Needed

bash
1# ✅ Style hints 2"Flowchart with decision diamonds for the loan approval process, using green for approved paths and red for rejected paths"

Python API

python
1from skills.diagram.scripts.generate_diagram_ai import NanoBananaGenerator 2 3generator = NanoBananaGenerator(verbose=True) 4results = generator.generate_iterative( 5 user_prompt="Kubernetes cluster architecture with ingress, services, and pods", 6 output_path="k8s_arch.png", 7 iterations=2, 8 doc_type="architecture" 9) 10 11print(f"Final Score: {results['final_score']}/10") 12print(f"Early Stop: {results['early_stop']}")

Integration with Other Skills

  • Use with sprint planning to visualize user story workflows
  • Use with architecture research to diagram ADR decisions
  • Use with building blocks to visualize component relationships
  • Use with competitive analysis to create comparison diagrams

Troubleshooting

"OPENROUTER_API_KEY not found"

Set the environment variable or create a .env file. See Configuration section.

Low Quality Scores

  • Add more detail to your prompt
  • Specify relationships between components
  • Use a higher threshold document type to force more iterations

Generation Timeout

Complex diagrams may take up to 2 minutes. The timeout is set to 120 seconds per API call.

Cost Considerations

  • Gemini 3 Pro Image: ~$2/M input, ~$12/M output tokens
  • Simple diagram (1 iteration): ~$0.05-0.15
  • Complex diagram (2 iterations): ~$0.10-0.30
  • Smart iteration saves costs by stopping early when quality is sufficient

FAQ & Installation Steps

These questions and steps mirror the structured data on this page for better search understanding.

? Frequently Asked Questions

What is diagram?

Perfect for Technical Writing Agents needing advanced diagram generation capabilities for documentation and presentation. 🍌 AI-powered image and diagram generation for Claude Code using Nano Banana Pro

How do I install diagram?

Run the command: npx killer-skills add flight505/nano-banana/diagram. It works with Cursor, Windsurf, VS Code, Claude Code, and 19+ other IDEs.

What are the use cases for diagram?

Key use cases include: Generating technical diagrams for software architecture documentation, Automating the creation of flowcharts for business process analysis, Creating illustrative diagrams for data visualization and reporting.

Which IDEs are compatible with diagram?

This skill is compatible with Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer. Use the Killer-Skills CLI for universal one-command installation.

Are there any limitations for diagram?

Requires Nano Banana Pro for diagram generation. Dependent on AI quality review for professional standards. May require adjustments for different document types and quality thresholds.

How To Install

  1. 1. Open your terminal

    Open the terminal or command line in your project directory.

  2. 2. Run the install command

    Run: npx killer-skills add flight505/nano-banana/diagram. The CLI will automatically detect your IDE or AI agent and configure the skill.

  3. 3. Start using the skill

    The skill is now active. Your AI agent can use diagram immediately in the current project.

Related Skills

Looking for an alternative to diagram or another community skill for your workflow? Explore these related open-source skills.

View All

widget-generator

Logo of f
f

f.k.a. Awesome ChatGPT Prompts. Share, discover, and collect prompts from the community. Free and open source — self-host for your organization with complete privacy.

149.6k
0
AI

flags

Logo of vercel
vercel

flags is a Next.js feature management skill that enables developers to efficiently add or modify framework feature flags, streamlining React application development.

138.4k
0
Browser

zustand

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
AI

data-fetching

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
AI