Cc-skills graph-easy
Create ASCII diagrams for markdown using graph-easy. TRIGGERS - ASCII diagram, graph-easy, architecture diagram, markdown diagram.
git clone https://github.com/terrylica/cc-skills
T=$(mktemp -d) && git clone --depth=1 https://github.com/terrylica/cc-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/plugins/itp/skills/graph-easy" ~/.claude/skills/terrylica-cc-skills-graph-easy && rm -rf "$T"
plugins/itp/skills/graph-easy/SKILL.mdGraph-Easy Diagram Skill
Create ASCII architecture diagrams for any GitHub Flavored Markdown file using graph-easy. Pure text output with automatic layout - no image rendering required.
Self-Evolving Skill: This skill improves through use. If instructions are wrong, parameters drifted, or a workaround was needed — fix this file immediately, don't defer. Only update for real, reproducible issues.
When to Use This Skill
- Adding diagrams to README files
- Design specification documentation
- Any GFM markdown file needing architecture visualization
- Creating flowcharts, pipelines, or system diagrams
- User mentions "diagram", "ASCII diagram", "graph-easy", or "architecture chart"
NOT for ADRs - Use
adr-graph-easy-architect for Architecture Decision Records (includes ADR-specific patterns like 2-diagram requirement and before/after templates).
Preflight Check
Ensure graph-easy is installed and functional before rendering. See Preflight Check for the full layered installation guide (mise-first approach, macOS + Linux).
Quick verify:
echo "[Test] -> [OK]" | graph-easy &>/dev/null && echo "✓ graph-easy ready"
DSL Quick Reference
Full syntax reference: DSL Syntax
Essentials
[Node] -> [Node] # Basic edge [A] -- label --> [B] # Labeled edge [A] <-> [B] # Bidirectional ( Group: [Node A] [Node B] ) # Container [n] { label: "Display Name"; } # Custom label
Mandatory Graph Attributes
graph { label: "Title"; flow: south; } # Top-to-bottom graph { label: "Title"; flow: east; } # Left-to-right
- Every diagram MUST have
with semantic emoji + titlelabel: - Every diagram MUST have explicit
directionflow:
Character Safety
| Location | Graphical Emojis | Unicode Symbols | ASCII Markers |
|---|---|---|---|
| Inside nodes | NEVER | OK | ALWAYS safe |
| Graph label | SAFE | OK | OK |
ASCII markers:
[x] [+] [!] [OK] [>] [*] [~] [?] [=]
Node & Edge Styling
| Style | Syntax | Use For |
|---|---|---|
| Rounded | | Start/end nodes |
| Double border | | Critical/emphasis |
| Bold border | | Important nodes |
| Dotted border | | Optional (GH caution) |
| Solid arrow | / | Normal/happy path |
| Dotted arrow | | Conditional/alternate |
| Bold arrow | | Critical path |
Common Patterns
See Diagram Patterns for full examples (pipeline, multi-component, decision, grouped, bidirectional, layered architecture).
Quick templates:
# Pipeline (left-to-right) graph { label: "Pipeline"; flow: east; } [Input] -> [Process] -> [Output] # Multi-component (top-down) graph { label: "System"; flow: south; } [Gateway] -> [Service A] [Gateway] -> [Service B] [Service A] -> [Database] [Service B] -> [Database]
Rendering
Command (Platform-Aware)
# For GitHub markdown (RECOMMENDED) - renders as solid lines graph-easy --as=ascii << 'EOF' graph { flow: south; } [A] -> [B] -> [C] EOF # For terminal/local viewing - prettier Unicode lines graph-easy --as=boxart << 'EOF' graph { flow: south; } [A] -> [B] -> [C] EOF
Output Modes
| Mode | Command | When to Use |
|---|---|---|
| | GitHub markdown - renders as solid lines everywhere |
| | Terminal only - looks nice locally, dotted on GitHub |
Why ASCII for GitHub? GitHub renders Unicode box-drawing characters (
┌─┐│└─┘) as dotted lines. Pure ASCII (+---+, |) renders correctly everywhere.
Post-Generation Alignment Validation (Recommended)
After embedding, validate with:
Skill(doc-tools:ascii-diagram-validator)
- Catches copy-paste alignment drift and font rendering issues
- Skip if diagram was just generated and not manually edited
Embedding in Markdown
Full guide with GFM collapsible section syntax: Embedding Guide
CRITICAL: Every diagram MUST include a
source block. This is non-negotiable.<details>
## Architecture ``` +----------+ +----------+ +----------+ | Input | --> | Process | --> | Output | +----------+ +----------+ +----------+ ``` <details> <summary>graph-easy source</summary> ``` graph { flow: east; } [Input] -> [Process] -> [Output] ``` </details>
Monospace-Safe Symbols
Full reference: Monospace Symbols
Key markers:
[+] Added | [x] Removed | [*] Changed | [!] Warning | [>] Active
Graph Label (MANDATORY: EVERY diagram MUST have emoji + title)
WARNING: This is the most commonly forgotten requirement. Diagrams without labels are invalid.
Correct Example
graph { label: "Deployment Pipeline"; flow: east; } [Build] -> [Test] -> [Deploy]
Anti-Pattern (INVALID - DO NOT DO THIS)
graph { flow: east; } [Build] -> [Test] -> [Deploy]
Why this is wrong: Missing
label: with emoji. Every diagram needs context at a glance.
Mandatory Checklist (Before Rendering)
Graph-Level (MUST have)
-
- semantic emoji + title (MOST FORGOTTEN - check first!)graph { label: "Title"; } -
orgraph { flow: south; }
- explicit directiongraph { flow: east; } - Command uses
for GitHub markdown (or--as=ascii
for terminal only)--as=boxart
Embedding (MUST have - non-negotiable)
-
block with source - EVERY diagram MUST have collapsible source code block<details> - Never commit a diagram without its reproducible source
Post-Embedding Validation (Recommended)
- Run
on the file after embedding diagramascii-diagram-validator - Especially important if diagram was manually edited after generation
Node & Edge Styling
- Start/end:
| Critical:{ shape: rounded; }
| Optional:{ border: double; }{ border: dotted; } - Main path:
| Conditional:->
| Critical:..>
| Labels: 1-3 words==> - NO graphical emojis inside nodes; emojis ONLY in
graph { label: "..."; }
Structure
- Groups
for 4+ related nodes( Name: ... ) - Node IDs short, labels descriptive:
[db] { label: "PostgreSQL"; } - Max 7-10 nodes per diagram (split if larger)
Success Criteria
Correctness
- Parses without error - graph-easy accepts the DSL
- Renders cleanly - no misaligned boxes or broken lines
- Matches content - all key elements from description represented
- Source preserved (MANDATORY) - EVERY diagram MUST have
block with graph-easy DSL source<details>
Aesthetics
- Platform-appropriate output -
for GitHub,--as=ascii
for terminal--as=boxart - Readable labels - multiline with
, no truncation\n - Clear flow - direction matches natural reading (top-down or left-right)
- Consistent styling - same border style = same semantic meaning throughout
Comprehensiveness
- Edge semantics - solid=normal, dotted=conditional, bold=critical
- Logical grouping - related nodes in
containers( Group: ... )
Troubleshooting
| Issue | Cause | Solution |
|---|---|---|
| graph-easy not installed | Run preflight check |
| Dotted lines on GH | Used | Use for GitHub markdown |
| Box border broken | Graphical emoji in node | Remove emojis, use ASCII markers [x][+] |
| Nodes overlap | Too complex | Split into multiple diagrams (max 7-10 nodes) |
| Edge labels cut off | Label too long | Shorten to 1-3 words |
| No title showing | Wrong syntax | Use |
| Weird layout | No flow direction | Add or |
| Parse error | Special chars in node | Escape or simplify node names |
Resources
Post-Execution Reflection
After this skill completes, check before closing:
- Did the command succeed? — If not, fix the instruction or error table that caused the failure.
- Did parameters or output change? — If the underlying tool's interface drifted, update Usage examples and Parameters table to match.
- Was a workaround needed? — If you had to improvise (different flags, extra steps), update this SKILL.md so the next invocation doesn't need the same workaround.
Only update if the issue is real and reproducible — not speculative.