draw-io
draw.io diagram creation, editing, and review. Use for .drawio XML editing, PNG conversion, layout adjustment, and AWS icon usage.
What this skill does
# draw.io Diagram Skill
## 1. Basic Rules
- Edit only `.drawio` files
- Do not directly edit `.drawio.png` files
- Use auto-generated `.drawio.png` by pre-commit hook in slides
## 2. Font Settings
For diagrams used in Quarto slides,
specify `defaultFontFamily` in mxGraphModel tag:
```xml
<mxGraphModel defaultFontFamily="Noto Sans JP" ...>
```
Also explicitly specify `fontFamily` in each text element's style attribute:
```xml
style="text;html=1;fontSize=27;fontFamily=Noto Sans JP;"
```
## 3. Conversion Commands
See conversion script at [scripts/convert-drawio-to-png.sh](scripts/convert-drawio-to-png.sh).
```sh
# Convert all .drawio files
mise exec -- pre-commit run --all-files
# Convert specific .drawio file
mise exec -- pre-commit run convert-drawio-to-png --files assets/my-diagram.drawio
# Run script directly (using skill's script)
bash ~/.claude/skills/draw-io/scripts/convert-drawio-to-png.sh assets/diagram1.drawio
```
Internal command used:
```sh
drawio -x -f png -s 2 -t -o output.drawio.png input.drawio
```
| Option | Description |
|--------|-------------|
| `-x` | Export mode |
| `-f png` | PNG format output |
| `-s 2` | 2x scale (high resolution) |
| `-t` | Transparent background |
| `-o` | Output file path |
## 4. Layout Adjustment
### 4.1. Coordinate Adjustment Steps
1. Open `.drawio` file in text editor (plain XML format)
2. Find `mxCell` for element to adjust (search by `value` attribute for text)
3. Adjust coordinates in `mxGeometry` tag
- `x`: Position from left
- `y`: Position from top
- `width`: Width
- `height`: Height
4. Run conversion and verify
### 4.2. Coordinate Calculation
- Element center coordinate = `y + (height / 2)`
- To align multiple elements, calculate and match center coordinates
## 5. Design Principles
### 5.1. Basic Principles
- Clarity: Create simple, visually clean diagrams
- Consistency: Unify colors, fonts, icon sizes, line thickness
- Accuracy: Do not sacrifice accuracy for simplification
### 5.2. Element Rules
- Label all elements
- Use arrows to indicate direction
(prefer 2 unidirectional arrows over bidirectional)
- Use latest official icons
- Add legend to explain custom symbols
### 5.3. Accessibility
- Ensure sufficient color contrast
- Use patterns in addition to colors
### 5.4. Progressive Disclosure
Separate complex systems into staged diagrams:
| Diagram Type | Purpose |
|--------------|---------|
| Context Diagram | System overview from external perspective |
| System Diagram | Main components and relationships |
| Component Diagram | Technical details and integration points |
| Deployment Diagram | Infrastructure configuration |
| Data Flow Diagram | Data flow and transformation |
| Sequence Diagram | Time-series interactions |
### 5.5. Metadata
Include title, description, last updated, author, and version in diagrams.
## 6. Best Practices
### 6.1. Background Color
- Remove `background="#ffffff"`
- Transparent background adapts to various themes
### 6.2. Font Size
- Use 1.5x standard font size (around 18px) for PDF readability
### 6.3. Japanese Text Width
- Allow 30-40px per character
- Insufficient width causes unintended line breaks
```xml
<!-- For 10-character text, allow 300-400px -->
<mxGeometry x="140" y="60" width="400" height="40" />
```
### 6.4. Arrow Placement
- Always place arrows at back (position in XML right after Title)
- Position arrows to avoid overlapping with labels
- Keep arrow start/end at least 20px from label bottom edge
```xml
<!-- Title -->
<mxCell id="title" value="..." .../>
<!-- Arrows (back layer) -->
<mxCell id="arrow1" style="edgeStyle=..." .../>
<!-- Other elements (front layer) -->
<mxCell id="box1" .../>
```
### 6.5. Arrow Connection to Text Labels
For text elements, exitX/exitY don't work, so use explicit coordinates:
```xml
<!-- Good: Explicit coordinates with sourcePoint/targetPoint -->
<mxCell id="arrow" style="..." edge="1" parent="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="1279" y="500" as="sourcePoint"/>
<mxPoint x="119" y="500" as="targetPoint"/>
<Array as="points">
<mxPoint x="1279" y="560"/>
<mxPoint x="119" y="560"/>
</Array>
</mxGeometry>
</mxCell>
```
### 6.6. edgeLabel Offset Adjustment
Adjust offset attribute to distance arrow labels from arrows:
```xml
<!-- Place above arrow (negative value to distance) -->
<mxPoint x="0" y="-40" as="offset"/>
<!-- Place below arrow (positive value to distance) -->
<mxPoint x="0" y="40" as="offset"/>
```
### 6.7. Remove Unnecessary Elements
- Remove decorative icons irrelevant to context
- Example: If ECR exists, separate Docker icon is unnecessary
### 6.8. Labels and Headings
- Service name only: 1 line
- Service name + supplementary info: 2 lines with line break
- Redundant notation (e.g., ECR Container Registry): shorten to 1 line
- Use `<br>` tag for line breaks
### 6.9. Background Frame and Internal Element Placement
When placing elements inside background frames (grouping boxes),
ensure sufficient margin.
- YOU MUST: Internal elements must have at least 30px margin from frame boundary
- YOU MUST: Account for rounded corners (`rounded=1`) and stroke width
- YOU MUST: Always visually verify PNG output for overflow
Coordinate calculation verification:
```text
Background frame: y=20, height=400 -> range is y=20-420
Internal element top: frame y + 30 or more (e.g., y=50)
Internal element bottom: frame y + height - 30 or less (e.g., up to y=390)
```
Bad example (may overflow):
```xml
<!-- Background frame -->
<mxCell id="bg" style="rounded=1;strokeWidth=3;...">
<mxGeometry x="500" y="20" width="560" height="400" />
</mxCell>
<!-- Text: y=30 is too close to frame top (y=20) -->
<mxCell id="label" value="Title" style="text;...">
<mxGeometry x="510" y="30" width="540" height="35" />
</mxCell>
```
Good example (sufficient margin):
```xml
<!-- Background frame -->
<mxCell id="bg" style="rounded=1;strokeWidth=3;...">
<mxGeometry x="500" y="20" width="560" height="430" />
</mxCell>
<!-- Text: y=50 is 30px from frame top (y=20) -->
<mxCell id="label" value="Title" style="text;...">
<mxGeometry x="510" y="50" width="540" height="35" />
</mxCell>
```
## 7. Reference
- [Layout Guidelines](references/layout-guidelines.md)
- [AWS Icons](references/aws-icons.md)
- [AWS Icon Search Script](scripts/find_aws_icon.py)
AWS icon search examples:
```sh
python ~/.claude/skills/draw-io/scripts/find_aws_icon.py ec2
python ~/.claude/skills/draw-io/scripts/find_aws_icon.py lambda
```
## 8. Checklist
- [ ] No background color set (page="0")
- [ ] Font size appropriate (larger recommended)
- [ ] Arrows placed at back layer
- [ ] Arrows not overlapping labels (verify in PNG)
- [ ] Arrow start/end sufficiently distant from labels (at least 20px)
- [ ] Arrows not penetrating boxes or icons (verify in PNG)
- [ ] Internal elements not overflowing background frame (verify in PNG)
- [ ] 30px+ margin between background frame and internal elements
- [ ] AWS service names are official names/correct abbreviations
- [ ] AWS icons are latest version (mxgraph.aws4.*)
- [ ] No unnecessary elements remaining
- [ ] Visually verified PNG conversion
## 9. Image Display in reveal.js Slides
Add `auto-stretch: false` to YAML header:
```yaml
---
title: "Your Presentation"
format:
revealjs:
auto-stretch: false
---
```
This ensures correct image display on mobile devices.
Related in Ads & Marketing
ads
IncludedMulti-platform paid advertising audit and optimization skill. Analyzes Google, Meta, YouTube, LinkedIn, TikTok, Microsoft, and Apple Ads. 250+ checks with scoring, parallel agents, industry templates, and AI creative generation.
banana
IncludedAI image generation Creative Director powered by Google Gemini Nano Banana models. Use this skill for ANY request involving image creation, editing, visual asset production, or creative direction. Triggers on: generate an image, create a photo, edit this picture, design a logo, make a banner, visual for my anything, and all /banana commands. Handles text-to-image, image editing, multi-turn creative sessions, batch workflows, and brand presets.
rpg-migration-analyzer
IncludedAnalyzes legacy RPG (Report Program Generator) programs from AS/400 and IBM i systems for migration to modern Java applications. Extracts business logic from RPG III/IV/ILE source code, identifies data structures (D-specs), file operations (F-specs), program dependencies (CALLB/CALLP), and converts RPG constructs to Java equivalents. Generates migration reports, complexity estimates, and Java implementation strategies with POJO classes, JPA entities, and service methods. Use when modernizing AS/400 or IBM i legacy systems, analyzing RPG source files (.rpg, .rpgle, .RPGLE), converting RPG to Java, mapping data specifications to Java classes, planning legacy system migration, or when user mentions RPG analysis, Report Program Generator, RPG III/IV/ILE, AS/400 modernization, IBM i migration, packed decimal conversion, or mainframe application rewrite.
brand-library-architect
IncludedBuild a complete brand library for a product — visual asset render pipeline, brand documentation set (BRAND, COPY, MANIFESTO, BIOS, FAQ, GLOSSARY, TONE, PRICING), open-source convention files (README, CONTRIBUTING, SECURITY, CODE_OF_CONDUCT), and a self-contained press kit. This skill should be used when the user asks to "build a brand library / brand kit / press kit / brand assets" for a product, "set up a brand library workflow," "create a positioning manifesto plus visual identity," or any combination of brand documentation + visual asset pipeline. Apply phase-by-phase or run end-to-end. Templates are product-agnostic and use {{TOKEN}} placeholders the skill prompts the user to fill.
writing-tech-post
IncludedAuthors engineering blog posts end-to-end: launch deep-dives, incident postmortems, architecture migrations, performance case studies, tutorials, AI/agent system writeups, security disclosures, and research-to-product translations. Picks the correct archetype, plans the abstraction ladder, enforces an evidence cadence (diagrams, benchmarks, profiles, traces, code, ablations), tunes voice against publisher house styles (Datadog, Vercel, GitHub, AWS, Meta, Cloudflare, Jane Street), and runs a pre-publish gate for narrative momentum and disclosure ethics. Use when drafting a new engineering post, restructuring a draft that feels flat, deciding which evidence form belongs where, validating that depth and product context are balanced, or preparing a postmortem, migration, or performance narrative for external publication. Do not use for API reference documentation, README authoring, marketing copy, release notes, generic SEO content, ghost-written executive thought leadership, or non-engineering long-form essays.
blog-google
IncludedGoogle API integration for blog performance: PageSpeed Insights, CrUX Core Web Vitals with 25-week history, Search Console performance, URL Inspection, Indexing API, GA4 organic traffic, NLP entity analysis for E-E-A-T, YouTube video search for embedding, and Google Ads Keyword Planner. Progressive feature availability based on credential tier (API key, OAuth/service account, GA4, Ads). Shares config with claude-seo at ~/.config/claude-seo/google-api.json. Use when user says "google data", "page speed", "core web vitals", "search console", "indexation", "GA4", "keyword research", "nlp entities", "blog performance", "youtube search", "google api setup".