ascii-circuit-diagram-creator

Create and validate ASCII circuit diagrams with automatic rule checking and iterative refinement. Use when the user requests circuit diagrams in ASCII/text format, or when creating technical documentation with embedded schematics. Ensures golden rules (no line crossings without junctions, no lines crossing labels, proper component connections, correct polarity). Includes preview validation using monospace rendering.

6 stars

Best use case

ascii-circuit-diagram-creator is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Create and validate ASCII circuit diagrams with automatic rule checking and iterative refinement. Use when the user requests circuit diagrams in ASCII/text format, or when creating technical documentation with embedded schematics. Ensures golden rules (no line crossings without junctions, no lines crossing labels, proper component connections, correct polarity). Includes preview validation using monospace rendering.

Teams using ascii-circuit-diagram-creator should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/ascii-circuit-diagram-creator/SKILL.md --create-dirs "https://raw.githubusercontent.com/Takazudo/claude-resources/main/skills/ascii-circuit-diagram-creator/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/ascii-circuit-diagram-creator/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How ascii-circuit-diagram-creator Compares

Feature / Agentascii-circuit-diagram-creatorStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Create and validate ASCII circuit diagrams with automatic rule checking and iterative refinement. Use when the user requests circuit diagrams in ASCII/text format, or when creating technical documentation with embedded schematics. Ensures golden rules (no line crossings without junctions, no lines crossing labels, proper component connections, correct polarity). Includes preview validation using monospace rendering.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# ASCII Circuit Diagram Creator

Creates clear, unambiguous ASCII circuit diagrams through an iterative generate-validate-fix workflow.

## Quick Start Workflow

**A. Create connection list** - Write explicit text connections (which pin → which pin)
**B. Generate ASCII diagram** - Create circuit that satisfies ALL connections
**C. Preview** - Render in monospace font, capture as image
**D. Confirm** - Check for rule violations

- If violations found: **Return to B** with fixes
- If clean: **Proceed to E**

**E. Complete** - Deliver both connection list AND ASCII diagram

## Core Principles

**Start with connections, not the diagram** - The connection list is the specification. The ASCII diagram must satisfy every connection in the list.

**Connection list is a deliverable** - Always provide both:

1. Connection list (explicit, unambiguous)
2. ASCII diagram (visual representation)

**Preview is mandatory** - Label crossings and alignment issues are invisible in plain text but obvious in monospace rendering.

**Follow the golden rules** - See `references/golden-rules.md` for complete list:

1. Never cross lines without junctions
2. Never cross lines over text labels
3. Use label notation for distant connections - **Use "GND" labels frequently** to avoid cluttered diagrams (many components connect to GND)
4. Show parallel components as vertical drops
5. Maintain consistent column alignment
6. **Use Unicode characters** - `┌ ┐ └ ┘ ├ ┤ ┬ ┴ ─ │` for lines/junctions, `→ ←` for arrows
7. **Use boxes to identify components** - Each component gets its own box with proper padding (at least 1 space on each side)
8. **Separate complicated layouts** - When circuit details get complex, create a separate diagram block
9. **Avoid ambiguous ASCII** - Don't use `+` for junctions (ambiguous direction)
10. **No flying lines** - Vertical lines must maintain exact column alignment throughout
11. **Preview AND analyze carefully** - Looking at screenshots without tracing signal paths is worthless

## Step-by-Step Process

### Step A: Create Connection List

Write explicit text connections showing which pin connects to which:

**Format:**

```
Connections:
- Component1 pin X → Component2 pin Y
- Component2 pin Z → Component3
- Component3 → GND (parallel capacitor)
```

**Example (Buck Converter):**

```
Connections:
- +15V input → U2 (LM2596S) pin 5 (VIN)
- +15V input → C5 (100µF) → GND
- U2 pin 3 (ON) → +15V (always enabled)
- U2 pin 4 (VOUT) → Switching node
- Switching node → L1 (100µH) → +13.5V Output
- Switching node → D1 (SS34 Schottky cathode)
- D1 (SS34 Schottky anode) → GND
- +13.5V Output → R1 (10kΩ) → Tap point
- Tap point → R2 (1kΩ) → GND
- U2 pin 2 (FB) → Tap point
- +13.5V Output → C3 (470µF) → GND
- U2 pin 1 (GND) → GND
```

**Key points:**

- Every component connection must be listed
- Show pin numbers for ICs
- Indicate parallel vs. series connections
- Specify component values
- This list serves as the specification for the diagram

### Step B: Generate ASCII Diagram

Create the ASCII diagram that satisfies ALL connections from Step A:

**Layout strategy:**

- **Separate functional blocks** - Break complex circuits into labeled sections (IC, switching node, input caps, feedback network)
- **Branch right, then down** - Use `└───` to create branches that extend right first, then go vertical
- **Main flow horizontal, branches vertical** - Keep signal flow left-to-right, use vertical lines for branches to GND or parallel components
- Place IC in center of its section
- Input components on left or in separate section
- Output components on right or in separate section
- Route flyback diodes UPWARD to avoid label crossings (or use separate section)
- **Use Unicode characters throughout**: `├ ┤ ┬ ┴ ─ │ ┌ ┐ └ ┘` for lines/junctions, `→ ←` for arrows
- **Avoid ASCII `+` for junctions** - it's ambiguous about connection direction
- Apply label notation for distant connections (`FB ├2─→ Tap`)
- Ensure vertical lines maintain exact column alignment (no flying lines)

**Component representation:**

- ICs: Show pin numbers and names
- Passives: Include values (10µF, 5.1kΩ)
- Voltages: Label at each stage
- Parallel components: Draw as vertical drops to GND

**Best practice: Parallel capacitors (filter pairs):**

```
Power ──┬────────────────┬─── To IC
        │                │
       C1               C2
      100nF            470µF
     ceramic        electrolytic
     (CLOSE!)        (farther)
        │                │
       GND              GND
```

- T-junction (┬) at TOP on power rail
- Capacitor labels in middle of vertical lines
- Clear vertical drops to GND
- **Left-to-right order**: Ceramic (CLOSE to IC) on LEFT, electrolytic (farther) on RIGHT
- Shows physical placement hints

**Separated section example (recommended for complex circuits):**

```
IC Section:
                    ┌──────────────┐
Input ──────────────┤1 VIN     OUT 2├───── Signal Node
                    │              │
                 ┌──┤3 GND      FB 4├──── FB Tap
                 │  └──────────────┘
                GND

Switching Node Section:
                                 ┌─────────────┐
Signal Node ────────┬────────────┤ L1 (100µH)  ├──────────── Output
                    │            └─────────────┘
                    │
                    └─── D1 (Schottky)
                         Cathode
                            │
                         Anode
                            │
                           GND

Input Filter Section:
Input ───┬─── To IC
         │
         ├─ C1 (100µF)
         │    │
         │   GND
         │
         └─ C2 (100nF)
              │
             GND
```

**Key benefits of separated sections:**

- No line crossings between different functional blocks
- Crystal clear component grouping
- Easy to trace signal paths
- Simple to add/modify individual sections
- Branches use `└───` (right first, then down) or `┬` (split, then vertical)

**Critical**: Verify every connection from Step A is represented in the diagram.

### Step C: Preview

Run the preview script to render in monospace font and capture as image:

```bash
bash $HOME/.claude/skills/ascii-circuit-diagram-creator/scripts/preview_diagram.sh <diagram-text-or-file>
```

The preview creates an "almost empty HTML" with monospace font styling and captures the result using headless browser. This reveals issues invisible in plain text:

- Lines crossing labels
- Ambiguous junctions
- Incorrect component leg counts
- Junction topology errors

### Step D: Confirm

**CRITICAL**: Check the preview image for rule violations by **tracing each signal path** and **inspecting vertical line alignment**.

Simply looking at the screenshot is not enough - you must:

1. **Trace each signal** from source to destination
2. **Verify junctions** - does each `├ ┤ ┬ ┴` connect the correct signals?
3. **Check for false junctions** - do any signals appear connected that shouldn't be?
4. **Verify topology** matches the connection list from Step A
5. **Inspect vertical line alignment** - Look for "broken" or "floating" lines where alignment is off by even 1 character

If ANY violations found, **return to Step B** with fixes.

**Preview phase is critical for detecting:**

- Lines crossing labels (invisible in plain text, obvious in preview)
- False junctions where signals appear connected but shouldn't be
- Box padding issues where text touches borders
- Incorrect component leg counts

**Check against golden rules** (see `references/golden-rules.md`):

**Rule 1: Line crossings without junctions**

- Look for `┼` symbols (usually wrong)
- Check if non-connected lines cross

**Rule 2: Lines crossing labels**

- Look for vertical/horizontal lines passing over text
- Most common issue: switching node line crossing "Tap" or "GND" labels

**Rule 3: Disconnected components**

- Verify all components connect to appropriate nodes
- Check input capacitors connect to power rails
- Ensure feedback networks connect to correct pins

**Rule 4: Incorrect polarity**

- Diodes: Cathode to higher potential, anode to lower
- Buck converter: Flyback diode cathode to switching node, anode to GND

**Rule 5: Unclear parallel/series connections**

- Filter capacitors should be vertical drops to GND
- Should NOT appear in series with signal path

**Common fixes:**

**Fix: Line crossing label**

- **Solution A**: Route in opposite direction (if going down crosses labels, route up)
- **Solution B**: Remove intermediate label
- **Solution C**: Use wider spacing to route around

Example:

```
Before (crosses labels):    After (routes upward):
VOUT ├4───┬─→ L1            D1 ← Routes UP
          │                    │
          │ (crosses)      VOUT ├4───┴─→ L1
       D1 ↓
```

**Fix: Disconnected component**

- Add connection using appropriate junction (`┬ ├ ┤ ┴`)
- Ensure vertical line from power rail reaches component

**Fix: Inverted polarity**

- Swap component orientation
- For diodes: cathode (top) to higher potential, anode (bottom) to GND

**Fix: Ambiguous parallel/series**

- Redraw parallel components as vertical drops
- Use `├─→` to branch from main signal path

**Iteration**: Repeat B → C → D until all rules satisfied. Usually 2-3 iterations sufficient.

### Step E: Complete

Once all rules satisfied, deliver both:

1. **Connection list** (from Step A)
2. **ASCII diagram** (final validated version)

Optionally explain key connections or design choices if complex.

## Common Patterns

See `references/examples.md` for detailed examples of:

- Buck converter (LM2596S-ADJ)
- Common mistakes and fixes
- Before/after comparisons

## Validation Checklist

Before finalizing, verify:

- [ ] No line crossings without explicit junctions
- [ ] No lines crossing over text labels
- [ ] All components properly connected (no floating components)
- [ ] Parallel components shown as vertical drops to GND
- [ ] Diode polarity correct (cathode/anode orientation)
- [ ] **ASCII-only characters used** (no Unicode box-drawing or arrows)
- [ ] **No flying/disconnected lines** (vertical lines maintain column alignment)
- [ ] Consistent column alignment (no sliding vertical bars)
- [ ] Label notation used for distant connections
- [ ] Preview verified in monospace rendering

## When to Use This Skill

Use this skill when:

- User requests ASCII/text-format circuit diagrams
- Creating technical documentation with embedded circuits
- Need to ensure diagram clarity and correctness
- Converting schematic to ASCII representation
- Building circuit diagrams for code comments or markdown docs

**Key indicator**: User mentions "ASCII circuit," "text diagram," "schematic in text," or shows existing ASCII circuit that needs fixing.

## Tool Integration

**Preview tool**: Uses headless-browser skill to render diagrams in monospace font and capture screenshots for validation. This is **critical** for catching issues before finalizing.

**References**:

- `references/golden-rules.md` - Complete rule specification
- `references/examples.md` - Good/bad examples and fixes

Related Skills

subagent-creator

6
from Takazudo/claude-resources

Create new Claude Code custom agents (subagents). Use when: (1) User wants to create a new custom agent, (2) User says 'create agent', 'new agent', 'make subagent', (3) User wants a specialized agent for delegation. Covers agent file format, YAML frontmatter, tool restrictions, model selection, permission modes, persistent memory, placement.

skill-creator

6
from Takazudo/claude-resources

Guide for creating new Claude Code skills AND tweaking/fixing existing ones. Use when: (1) User wants to create a new skill, (2) User wants to improve, fix, or tweak an existing skill, (3) User says 'create skill', 'new skill', 'fix skill', 'update skill', 'tweak skill', 'skill not working', or 'skill triggers too often'. Covers skill anatomy (SKILL.md, scripts/, references/, assets/), progressive disclosure, frontmatter, bundled resources, init_skill.py, diagnosing trigger/behavior issues, and iteration.

schemdraw-circuit-generator

6
from Takazudo/claude-resources

Generate professional circuit diagrams using schemdraw Python library. Creates vector graphics (SVG/PDF/PNG) from natural language descriptions. Components: resistors, capacitors, inductors, diodes, transistors, opamps, ICs, logic gates, etc. Use when: (1) User requests circuit diagrams or schematics, (2) User wants publication-quality output, (3) User needs SVG/PDF for documentation, (4) Complex circuits with ICs/opamps/digital logic, (5) User mentions schemdraw or wants alternative to ASCII circuits.

mermaid-creator

6
from Takazudo/claude-resources

Use proactively whenever generating Mermaid diagram code in any context (markdown blocks, .md files, docs). Covers flowcharts, sequence, class, state, ER, gantt, pie, mindmaps, timelines, and all Mermaid types. Applies strict syntax rules to prevent rendering errors (HTML tags, style directives, invalid escapes). No explicit request needed — load automatically when Mermaid syntax is being produced.

custom-command-creator

6
from Takazudo/claude-resources

Create and manage custom slash commands in Claude Code. Use when: (1) User wants to create a new slash command, (2) User asks about /commands or custom commands, (3) User wants to automate frequent prompts, (4) User says 'create global command' or 'create local command', (5) User mentions 'command-creator'. Covers creation (global/local), command anatomy, frontmatter, arguments, bash, file references, namespacing, command vs skill comparison.

zudoesa-articlify

6
from Takazudo/claude-resources

Convert conversation context into an esa article via the zudoesa-writer subagent. ONLY invoke when the user explicitly asks — NEVER proactively propose. Triggers: 'write esa article', 'esa記事', 'esaに書いて', 'articlify for esa', or /zudoesa-articlify. Gathers context, creates a writing brief, delegates to the writer subagent.

zudoesa-apply-voice

6
from Takazudo/claude-resources

Apply Takazudo's esa writing voice and vocabulary rules to text. Use when: (1) User wants to write/rewrite text in Takazudo's esa style, (2) User says 'apply voice', 'esa voice', 'esa文体で', 'esa風に書いて', '文体を適用', (3) User provides text to transform to esa style. Reads writing-style.md and vocabulary-rule.md from takazudo-esa-writing repo and applies the rules.

zudocg-articlify

6
from Takazudo/claude-resources

Convert conversation context into a CodeGrid article via the zudocg-writer subagent. ONLY invoke when the user explicitly asks — NEVER proactively propose. Triggers: 'write codegrid article', 'CodeGrid記事', 'codegridに書いて', 'articlify for codegrid', or /zudocg-articlify. Gathers context, creates a writing brief, delegates to the writer subagent.

zudocg-apply-voice

6
from Takazudo/claude-resources

Apply Takazudo's CodeGrid writing voice and vocabulary rules to text. Use when: (1) User wants to write/rewrite text in Takazudo's CodeGrid style, (2) User says 'apply voice', 'codegrid voice', 'codegrid文体で', 'codegrid風に書いて', '文体を適用', (3) User provides text to transform to CodeGrid style. Reads writing-style.md and vocabulary-rule.md from takazudo-codegrid-writing repo and applies the rules.

zpaper-articlify

6
from Takazudo/claude-resources

Convert conversation context into a zpaper blog article via the zpaper-writer subagent. ONLY invoke when the user explicitly asks — NEVER proactively propose. Triggers: 'write zpaper article', 'zpaper記事', 'zpaperに書いて', 'articlify for zpaper', or /zpaper-articlify. Gathers context, creates a writing brief, delegates to the writer subagent.

zpaper-apply-voice

6
from Takazudo/claude-resources

Apply Takazudo's zpaper blog writing voice and vocabulary rules to text. Use when: (1) User wants to write/rewrite text in Takazudo's zpaper style, (2) User says 'apply voice', 'zpaper voice', 'zpaper文体で', 'zpaper風に書いて', 'ブログ文体を適用', (3) User provides text to transform to zpaper style. Reads writing-style.md and vocabulary-rule.md from the zpaper repo and applies the rules.

xlsx

6
from Takazudo/claude-resources

Spreadsheet creation, editing, and analysis. Use when working with .xlsx, .xlsm, .csv, .tsv files for: (1) Creating spreadsheets with formulas and formatting, (2) Reading or analyzing data, (3) Modifying existing spreadsheets while preserving formulas, (4) Data analysis and visualization, (5) Recalculating formulas.