一键导入
ascii-art-diagrams
Rules for creating ASCII art diagrams with Unicode box-drawing characters. Covers boxes, trees, flow charts, and visual representations.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Rules for creating ASCII art diagrams with Unicode box-drawing characters. Covers boxes, trees, flow charts, and visual representations.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Fast symbol lookup for large codebases. Use BEFORE reading files or spawning search agents to locate where a class/function/method is defined and what references it. Backed by an incremental SQLite + universal-ctags index, scoped per project. Answers "where is X?" in milliseconds instead of reading thousands of files.
Safer alternative to sed -i / perl -i / awk -i inplace for mass file edits. Use whenever you need to find-and-replace across multiple files, rename a symbol project-wide, bump a version string, or apply a regex transform to many files. A PreToolUse hook automatically blocks in-place sed/perl/awk to prevent accidental file corruption — use this skill instead.
AI-powered context persistence for Claude Code — manages user memories, notes, reminders, and conversation summaries via local LLM hooks and SQLite. Use whenever the user mentions remembering/forgetting facts, taking notes, setting reminders, or asks recall questions ("recuerda que...", "olvida que...", "anota...", "borra la nota...", "avísame...", "recuérdame...", "cancela el recordatorio...", "qué recuerdas?", "muestra mis notas", "show my reminders", "remember that...", "forget...", "take note...", "remind me...", "do you remember...?"). Runs entirely in background via hooks; this skill defines the behavior rules and recall commands Claude must follow when interacting with it.
Verification-first coding practices. Read before edit, grep before assume, verify API names, safe refactoring with reference checks. Never blame external factors.
Auto-generates and maintains project API documentation. Extracts classes, functions, exports from code. Self-healing, auto-installing.
Auto-generates and maintains project structure documentation. Self-healing, auto-installing. Query structure anytime without manual updates.
| name | ascii-art-diagrams |
| description | Rules for creating ASCII art diagrams with Unicode box-drawing characters. Covers boxes, trees, flow charts, and visual representations. |
| license | MIT |
| compatibility | opencode |
| metadata | {"type":"formatting","font":"Fira Code"} |
This skill requires no installation. It's a formatting guide, not a system.
To activate: Load this skill when you need to create diagrams:
skill({ name: "ascii-art-diagrams" })
When to load automatically:
Use this skill when creating:
For Unicode block characters and box-drawing characters to render correctly with monospace alignment:
/* Google Fonts - Fira Code */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;700&display=swap');
/* Apply to code blocks */
pre, code, .ascii-art {
font-family: 'Fira Code', Menlo, Monaco, Consolas, 'Courier New', monospace;
}
Use line-height 1 for ASCII diagrams (no extra spacing needed):
.ascii-art {
line-height: 1;
}
Every line in a box MUST have identical character count. Pad shorter lines with spaces.
WRONG (unequal line lengths)
┌───────────────┐
│ short │
│ this is longer text │
└───────────────┘
CORRECT (all lines equal)
┌─────────────────────┐
│ short │
│ this is longer text │
└─────────────────────┘
With line-height 1, content is compact. NO empty lines needed between text lines:
CORRECT (compact, no spacers)
┌───────────────────────────────────────────────────────┐
│ Modifying state DURING iteration loop │
│ causes concurrent modification exception │
│ -> collect changes, apply after loop completes │
└───────────────────────────────────────────────────────┘
Always have at least 1-2 spaces between content and border:
CORRECT (2 space padding)
┌───────────────────────────────────────────────────────┐
│ │
│ During batch processing: │
│ │
│ - Items are processed sequentially │
│ - Cache is NOT invalidated │
│ - Previous results may be stale │
│ │
└───────────────────────────────────────────────────────┘
Note: Empty lines at TOP and BOTTOM of box content are optional but recommended for readability.
In pseudocode blocks, use underline characters for title underlines:
CORRECT
FULL BUILD
___________________________________________________
1. CLEAN output directory
2. SORT dependencies by priority
Key points:
For minor subsections within boxes, use thin horizontal lines:
MODE 1: Single Result (default)
- Returns first matching item
- Uses: findFirst()
- Best performance
MODE 2: All Results
- Returns array of ALL matching items
Numbered steps with tree branches for sub-steps:
1. LOAD configuration file
2. SORT tasks by priority (low -> high)
3. FOR EACH task (sorted):
│
├── EXECUTE task
│
└── IF task.hasCallback AND task.succeeded:
│
└── IF callback.isAsync:
│
└── QUEUE callback for later
4. PROCESS callbacks:
│
├── IF pending_callbacks.length > 0:
│ │
│ └── RUN each callback
│
└── IF errors.length > 0:
│
└── LOG errors to file
│ for vertical continuation├── for branch with more siblings below└── for last branch (no more siblings)│ When More Siblings FollowCORRECT
├── Child with nested content
│ │
│ └── Nested item
│
└── Last sibling
Each step gets a box. Use │ and ▼ between boxes:
┌───────────────────────┐
│ │
│ processRequest() │
│ │
└───────────────────────┘
│
│
▼
┌───────────────────────┐
│ │
│ validateInput │
│ │
└───────────────────────┘
│
│
▼
┌───────────────────────┐
│ │
│ needsAuth? │
│ │
└───────────────────────┘
Use side branches with YES/NO labels and return lines:
┌───────────────────────┐
│ │ YES
│ needsAuth? │──▶───────────┐
│ │ │
└───────────────────────┘ │
│ │
│ NO │
│ │
▼ │
┌───────────────────────┐ │
│ │ │
│ Apply rate limits │ │
│ │ │
└───────────────────────┘ │
│ │
│ │
▼ ▼
┌───────────────────────┐ ┌────────┴──────────┐
│ │ YES │ │
│ cache.isValid? │──▶──┤ returnCached() │──▶─┐
│ │ │ │ │
│ │ └───────────────────┘ │
└───────────────────────┘ │
│ │
│ NO │
│ │
▼ │
Use < for return flow:
│ │
│ ◀─────────────────────────────────────────┘
│
▼
┌──────────────────────┐
│ │
│ DONE │
│ │
└──────────────────────┘
When content is visual/graphical, NO empty lines between rows:
┌────────────────────────┐
│░░░░░░░░░░░░░░░░░░░░░░░░│
│░░░░░░░░░░░░░░░░░░░░░░░░│
│░░░░░░░░░░░░░░░░░░░░░░░░│
│░░░░░░████░░░░░░░░░░░░░░│
│░░░░░░████░░░░░░░░░░░░░░│
│░░░░░░████░░░░░░░░░░░░░░│
│░░░░░░░░░░░░░░░░░░░░░░░░│
└────────────────────────┘
█ = Full block (solid, primary)
▓ = Dark shade (highlighted)
▒ = Medium shade
░ = Light shade (background, secondary)
= Empty/cleared area
┌────────┬───────────────────────────────────────────────────┐
│ │ Cache is NOT invalidated during │
│ NOTE │ batch operations! │
│ │ Results may be stale until refresh. │
└────────┴───────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────┐
│ │
│ Step N: Received event │
│ │ │
│ │ │
│ └── QUEUE change (don't apply yet) │
│ │
│ pendingChanges = { │
│ toRemove: previousItem, │
│ toAdd: newItem │
│ } │
│ │
└─────────────────────────────────────────────────────────┘
PROBLEM:
┌─────────────────────────────────────────────────────────┐
│ Modifying collection DURING iteration loop │
│ causes ConcurrentModificationException │
│ -> collect changes, apply after loop ends │
└─────────────────────────────────────────────────────────┘
SOLUTION:
┌─────────────────────────────────────────────────────────┐
│ ...content... │
└─────────────────────────────────────────────────────────┘
Rules:
NEVER use ├──, └──, or │ as tree connectors mixed with text inside box content lines. These characters render with inconsistent visual width in GitHub's monospace font, causing columns to misalign even when character counts match.
WRONG (tree chars mixed with text inside box)
┌───────────────────────────────────────────┐
│ Server (localhost:8899) │
│ ├── Qwen3.5-4B-MLX-8bit │
│ ├── TurboQuant KV cache │
│ └── Tool calling │
└───────────────────────────────────────────┘
CORRECT (nested box with separators)
┌───────────────────────────────────────────┐
│ ┌───────────────────────────────────┐ │
│ │ Server (localhost:8899) │ │
│ │ Qwen3.5-4B-MLX-8bit │ │
│ │ TurboQuant KV cache │ │
│ │ Tool calling │ │
│ └───────────────────────────────────┘ │
└───────────────────────────────────────────┘
CORRECT (plain indented text, no tree chars)
┌───────────────────────────────────────────┐
│ Server (localhost:8899) │
│ Qwen3.5-4B-MLX-8bit │
│ TurboQuant KV cache │
│ Tool calling │
└───────────────────────────────────────────┘
CORRECT (bullet lists)
┌───────────────────────────────────────────┐
│ Server (localhost:8899) │
│ - Qwen3.5-4B-MLX-8bit │
│ - TurboQuant KV cache │
│ - Tool calling │
└───────────────────────────────────────────┘
Exception: Tree characters ARE fine in standalone trees (Rule 3) that are NOT inside a │...│ box border. They are also fine in Rule 6.2 (Info Box with Tree Inside) when the tree connectors are on their own lines with only │ spacers, not mixed with descriptive text.
After generating ANY box diagram, you MUST run the verification command below before presenting it to the user. Do NOT rely on visual counting — LLMs consistently miscount characters. Use real tooling instead.
Write the diagram as you normally would following Rules 1-8.
CRITICAL: you MUST count REAL Unicode characters, never bytes. Unicode chars like ─ │ ┌ ┐ └ ┘ ├ ┤ ──▶ ◀── take multiple bytes but ONE visual column. Counting bytes gives false mismatches and leads to breaking correctly-aligned boxes.
DO NOT use these (they count bytes, not characters):
wc -c — counts bytesawk '{print length}' — counts bytes on most systems${#var} in bash without LC_ALL=en_US.UTF-8 and locale-aware toolingUSE ONE of these (real character counting):
Option A — wc -m (bash, simplest):
echo '┌─────────────────────────┐
│ your content here │
│ more content │
└─────────────────────────┘' | while IFS= read -r line; do printf "%d: %s\n" "$(echo -n "$line" | wc -m)" "$line"; done
Option B — Python (MOST RELIABLE, use when in doubt):
python3 -c "
import sys
for ln in sys.stdin:
ln = ln.rstrip('\n')
print(f'{len(ln):3d}: {ln}')
" <<'EOF'
┌─────────────────────────┐
│ your content here │
│ more content │
└─────────────────────────┘
EOF
Or directly on a file range:
python3 -c "
with open('/path/to/file.md') as f:
for i, ln in enumerate(f.readlines()[START:END], START+1):
ln = ln.rstrip('\n')
print(f'L{i} chars={len(ln):3d} |{ln}|')"
All lines of a box MUST show the same number. Example output:
27: ┌─────────────────────────┐
27: │ your content here │
27: │ more content │
27: └─────────────────────────┘
If any line shows a different count:
27: ┌─────────────────────────┐
27: │ your content here │
28: │ more content │ ← 28 ≠ 27, extra space
27: └─────────────────────────┘
│ to match the target widthwc -c, awk '{print length}', and ${#var} (without proper locale) count bytes and will give you wrong results on Unicode diagrams.wc -m (bash) or len() in Python — both count Unicode characters correctly.█ ░ ▒ ▓ ─ │ ┌ ┐ └ ┘ ├ ┤ ┬ ┴ ▼ ▲ ◀ ▶ counts as 1 character.──▶ count as 3 characters (two ─ + one ▶), not 5 or 6 bytes.NEVER use +, -, | for box borders. Always use Unicode box-drawing:
Corners: ┌ ┐ └ ┘
Lines: ─ │
T-joins: ┬ ┴ ├ ┤
Cross: ┼
Double: ═ ║ ╔ ╗ ╚ ╝ ╠ ╣ ╦ ╩ ╬
Example:
┌───────────────────────┐
│ Content here │
├───────────────────────┤
│ More content │
└───────────────────────┘
░ = Light shade (partial, secondary)
▒ = Medium shade
▓ = Dark shade
█ = Full block (solid, primary)
= Empty (space)
Down: ▼ (or v in text flow)
Up: ▲ (or ^ in text flow)
Left: ◀ (or <)
Right: ▶ (or >)
Flow: → ← (in text)
Branch: ──▶── (horizontal connector)
Bullets: - *
Check: [x] [ ]
TITLE WITH UNDERLINE
____________________
1. Step one
2. Step two:
│
├── Sub-step A
│
└── Sub-step B
┌───────────────────────┐
│ │
│ Box content │
│ More content │
│ │
└───────────────────────┘
┌────────┬──────────────┐
│ LABEL │ Content │
└────────┴──────────────┘
│
│
▼
┌───────────────────────┐
│ Next step │
└───────────────────────┘
│
│ ◀──────────┐ (return line)
│
▼