skills/export-diagrams/SKILL.md
Extract and render all Mermaid diagrams from architecture blueprints to PNG images. Creates a diagrams/ folder with high-quality images ready for presentations and documentation.
npx skillsauth add navraj007in/architecture-cowork-plugin export-diagramsInstall 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.
Convert all Mermaid diagrams in your architecture blueprint to presentation-quality PNG images.
Perfect for: Stakeholder presentations, documentation, design reviews, Confluence/Notion embedding
Use this skill when you need to:
Input: Architecture blueprint (markdown file with Mermaid diagrams)
Output: diagrams/ folder with PNG files
The tool extracts and renders these diagram types from blueprints:
File naming: architecture-container.png, architecture-component.png, deployment.png
File naming: database-erd.png, multi-tenancy.png
File naming: sequence-auth.png, sequence-api.png, sequence-realtime.png, sequence-payment.png
File naming: flow-user-journey.png, flow-data.png
Extract all code blocks with mermaid language identifier:
```mermaid
graph TD
A[User] --> B[Frontend]
B --> C[Backend]
C --> D[Database]
### Step 2: Categorize Diagrams
Identify diagram type based on:
- Section context (Architecture Diagram vs Database Schema vs Security)
- Mermaid syntax (graph, sequenceDiagram, erDiagram, C4Context, etc.)
- Content analysis (keywords like "auth", "payment", "user journey")
### Step 3: Render to PNG
Use **Mermaid CLI** or **Kroki API** to render:
#### Option A: Mermaid CLI (Local Rendering)
```bash
# Install mermaid-cli if not present
npm install -g @mermaid-js/mermaid-cli
# Render each diagram
mmdc -i diagram.mmd -o diagrams/architecture-container.png -w 1600 -H 1200 -b transparent
Rendering settings:
If mermaid-cli not available, use Kroki public API:
# Encode diagram to base64
DIAGRAM=$(echo 'graph TD; A-->B' | base64)
# Fetch PNG from Kroki
curl https://kroki.io/mermaid/png/$DIAGRAM -o diagram.png
Fallback strategy: Try Mermaid CLI first, fallback to Kroki if CLI not installed.
diagrams/
├── architecture-container.png # Main C4 diagram
├── architecture-component.png # Component details (if exists)
├── deployment.png # Hosting architecture
├── database-erd.png # Entity relationships
├── multi-tenancy.png # Tenant isolation (B2B only)
├── sequence-auth.png # Authentication flow
├── sequence-api.png # API request/response
├── sequence-realtime.png # Real-time updates (if exists)
├── sequence-payment.png # Payment flow (e-commerce only)
├── flow-user-journey.png # User journey (if exists)
└── flow-data.png # Data flow (if exists)
Create diagrams/README.md with:
# Architecture Diagrams
Generated from blueprint on [Date]
## High-Level Architecture

*System components and how they connect*
## Database Schema

*Data model and relationships*
## Authentication Flow

*How users authenticate and authorize*
## API Request Flow

*Typical API request lifecycle*
[... additional diagrams ...]
---
**Note**: All diagrams are exported at 1600px width for presentation quality.
To re-generate, run `/architect:export-diagrams` in the project root.
When invoked, generate:
📊 Extracting diagrams from blueprint...
✅ Found 8 Mermaid diagrams in blueprint
✅ Categorized diagrams by type
🎨 Rendering diagrams to PNG...
✅ architecture-container.png (1600x890px)
✅ database-erd.png (1600x1120px)
✅ sequence-auth.png (1600x780px)
✅ sequence-api.png (1600x650px)
✅ deployment.png (1600x720px)
✅ multi-tenancy.png (1600x580px)
⚠️ sequence-realtime.png (skipped - no real-time diagram in blueprint)
⚠️ sequence-payment.png (skipped - no payment diagram in blueprint)
📁 Created diagrams/ folder with 6 PNG files
📄 Created diagrams/README.md index
Ready for presentations and documentation!
Next steps:
- Use diagrams in stakeholder presentations, docs, or exported artifacts
- Embed in Confluence/Notion
- Add to pitch decks or investor updates
Optional parameters (ask user if they want to customize):
Default behavior: PNG, 1600px width, default theme, transparent background.
All exported diagrams must meet these standards:
/architect:blueprint first?"Run /architect:export-diagrams first to generate PNGs that downstream documentation can embed.
Run /architect:export-diagrams to create diagrams for the exported document.
/architect:blueprint:Run /architect:export-diagrams to generate visual assets immediately.
# After generating blueprint
/architect:export-diagrams
# Output:
# ✅ Created diagrams/ with 6 PNG files
# Ready for presentations!
/architect:export-diagrams --format=svg --width=2000 --theme=dark
# Output:
# ✅ Created diagrams/ with 6 SVG files (2000px, dark theme)
/architect:export-diagrams --dpi=300 --background=white
# Output:
# ✅ Created diagrams/ with 6 PNG files (300 DPI, print-ready)
#!/bin/bash
# Extract Mermaid blocks from blueprint and render each
BLUEPRINT="blueprint.md"
OUTPUT_DIR="diagrams"
mkdir -p "$OUTPUT_DIR"
# Extract each mermaid block and render
# (Actual implementation would parse markdown and extract blocks)
# Example rendering command:
mmdc -i temp-diagram.mmd \
-o "$OUTPUT_DIR/architecture-container.png" \
-w 1600 \
-b transparent \
-t default
#!/bin/bash
# Encode diagram and fetch from Kroki
DIAGRAM_CODE="graph TD; A-->B"
ENCODED=$(echo "$DIAGRAM_CODE" | base64 -w 0)
curl "https://kroki.io/mermaid/png/$ENCODED" \
-o "diagrams/diagram.png" \
--silent \
--fail
// Pseudocode for extracting diagrams from blueprint
function extractDiagrams(blueprint: string) {
const diagrams = [];
// Parse markdown, extract code blocks with ```mermaid
const mermaidBlocks = extractMermaidCodeBlocks(blueprint);
for (const block of mermaidBlocks) {
const context = getSectionContext(block); // "Architecture Diagram", "Database Schema", etc.
const type = detectDiagramType(block.code); // graph, sequenceDiagram, erDiagram, etc.
const filename = generateFilename(context, type); // "architecture-container.png"
diagrams.push({
code: block.code,
filename: filename,
context: context,
type: type
});
}
return diagrams;
}
A successful diagram export should:
diagrams/
├── README.md # Index with embedded images
├── architecture-container.png
├── architecture-component.png # (optional)
├── deployment.png
├── database-erd.png
├── multi-tenancy.png # (if B2B)
├── sequence-auth.png
├── sequence-api.png
├── sequence-realtime.png # (if real-time features)
├── sequence-payment.png # (if e-commerce)
├── flow-user-journey.png # (optional)
└── flow-data.png # (optional)
Total size: Typically 1-5 MB for all diagrams combined.
development
# Trade-Off Analysis Skill Quantifies exact trade-offs when switching between architecture options. Shows users precisely what they gain and lose when choosing Option A over Option B. ## When to Use Use this skill to help users decide between options by showing: 1. **Cost difference** — how much more/less per month? 2. **Performance difference** — how much faster/slower? 3. **Complexity difference** — how much harder to build/maintain? 4. **Scalability difference** — when does this option hit
testing
# Stage Detection Skill Detects the current project stage (concept → mvp → growth → enterprise) based on `_state.json` field presence and completeness. Used by `/architect:next-steps`, `/architect:check-state`, and roadmap commands. ## When to Use Invoke this skill when you need to determine what stage a project is at based on its state file. Stage detection drives: - Command recommendations (what to run next) - Required fields validation (what should exist at this stage) - Risk assessment (w
development
# Stack Swap Simulator Skill Estimates cost and effort to switch from one tech stack to another. Helps answer: "Can we migrate later if needed?" ## When to Use Use this skill to understand: 1. **Cost of switching stacks** — engineer weeks + downtime risk 2. **Timeline to switch** — how long is the project? 3. **Risk of switching** — what can go wrong? 4. **ROI of switching** — does it save money long-term? 5. **Backwards compatibility** — can we do a gradual migration? ## Input Provide sour
tools
# Stack Compatibility Skill Verifies that chosen technologies integrate well together. Prevents "I picked these tools and they don't work well together" regrets. ## When to Use Use this skill to verify: 1. **Chosen tools work together** — React + Node + MongoDB = good? 2. **No hidden incompatibilities** — will I hit issues in production? 3. **Team can support it** — do we have expertise for this combo? 4. **Licenses compatible** — can we use these together commercially? 5. **Performance assum