skills/ascii-diagram/SKILL.md
Use after generating or editing ASCII art, box diagrams, tables, or any monospace text art to ensure all lines, corners, and boxes are properly aligned.
npx skillsauth add lwlee2608/agent-skills ascii-diagramInstall 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.
ASCII diagrams produced by agents frequently have alignment issues — misaligned corners, uneven borders, broken connectors. LLMs cannot reliably count characters in their head. This skill uses a print-and-inspect loop to catch and fix alignment bugs.
┌, ┐, └, ┘ for corners, ─ for horizontal borders, │ for vertical borders, and ┬, ┴, ├, ┤, ┼ for junctions. Only fall back to plain ASCII (+, -, |) if the user explicitly requests it or the target format cannot render Unicode. Never mix styles in the same diagram.│ lands in the same column on every row.Do NOT try to validate by counting characters in your head. Instead, use the print-and-inspect loop below.
Delegate the entire verification loop to a subagent (via the Agent tool) when the diagram is both (a) >6 lines AND (b) has multiple boxes or nested/connected layouts. The loop produces a lot of ruler output and iteration churn that is not useful to keep in the main context.
For smaller diagrams (a single box, a short table, ≤6 lines), run the loop inline — spawning a subagent is slower than just doing it.
When delegating, hand off with this template (the subagent does not have this skill loaded):
File: <absolute path>
Lines: <start>-<end>
Task: Run the verification loop in skills/ascii-diagram/SKILL.md steps 1-5. Edit the source file in place.
Report: PASS or FAIL, iteration count, and a one-line summary of fixes. Do not paste the diagram back.
After the subagent returns:
Write the diagram to a temp file using the Write tool. Use a unique path like /tmp/diagram-<context>.txt (replace <context> with something specific to this session, e.g., /tmp/diagram-auth-flow.txt) to avoid clobbering other sessions. Use that same path in every command below.
Run this Bash command to display the diagram with column numbers (replace <path> with your temp file path):
awk 'BEGIN{
ruler1=""; ruler2=""
for(i=0;i<120;i++){
ruler1=ruler1 sprintf("%d", int(i/10)%10)
ruler2=ruler2 sprintf("%d", i%10)
}
print " " ruler1
print " " ruler2
}
{printf "%3d: %s\n", NR, $0}' <path>
This prints every line with its row number and a two-row column ruler (tens digit, ones digit) across the top, making it trivial to check whether corners, borders, and connectors land in the right columns. If your diagram is wider than 120 columns, bump the 120 in the loop.
Run these checks to catch issues that are invisible in normal output (replace <path> with your temp file path):
# Tabs (will break alignment silently)
grep -F $'\t' <path> && echo "FAIL: tabs found" || echo "OK: no tabs"
# Trailing whitespace
grep ' $' <path> && echo "FAIL: trailing spaces found" || echo "OK: no trailing whitespace"
Fix any findings before proceeding.
Look at the printed output and check:
│ or ┐/┘) appear in the same column on every row? Read the column number off the ruler.└/┘) sit in the same column as the top corner (┌/┐)?If any issue is found:
Right border off by one. An extra or missing space before │ shifts the right border to a different column than the top/bottom corner. Use the ruler to verify every row ends at the same column.
WRONG: CORRECT:
┌──────────┐ ┌──────────┐
│ hello │ │ hello │
│ world │ ← col 13 │ world │
└──────────┘ ← col 12 └──────────┘
Bottom border width mismatch. The bottom border has fewer or more ─ than the top, so the closing corner lands in the wrong column. Count with the ruler, not by eye.
WRONG: CORRECT:
┌──────────┐ ← col 12 ┌──────────┐
│ content │ │ content │
└─────────┘ ← col 11 └──────────┘
Side-by-side boxes with ragged gap. The gap between adjacent boxes varies across rows, causing the second box to shift. Verify that the second box's corner is in the same column on every row.
WRONG: CORRECT:
┌───────┐ ┌───────┐ ┌───────┐ ┌───────┐
│ box 1 │ │ box 2 │ │ box 1 │ │ box 2 │
└───────┘ └───────┘ ← extra └───────┘ └───────┘
Mixed box-drawing styles. Mixing ASCII (+, -, |) and Unicode (┌, ─, ┐) characters in the same diagram. Pick one style and use it consistently.
WRONG: CORRECT:
┌──────────+ ← ASCII + ┌──────────┐
│ content │ │ content │
└──────────┘ └──────────┘
Connector not touching box border. Arrows or lines that float with a gap between them and the box they should connect to. Every connector must start and end at a border character.
WRONG: CORRECT:
┌───────┐ ┌───────┐ ┌───────┐ ┌───────┐
│ box 1 │ -> │ box 2 │ │ box 1 │──>│ box 2 │
└───────┘ └───────┘ └───────┘ └───────┘
gap ^ ^ gap no gaps
documentation
Use when the user wants to condense the current conversation into a handoff document for another agent to pick up.
development
Use when the user asks to explain or teach a technical concept. Replies in plain language with a simple diagram instead of a wall of jargon.
development
Use when writing or editing a system prompt for any LLM API or SDK (any code passing a `system=` / `system` role parameter, or a `.txt`/`.md` file holding such a prompt). Applies prompt-engineering and prompt-caching best practices.
tools
Use before running any Go toolchain command (`go build`, `go test`, `go run`, `go vet`, `go fmt`, `golangci-lint`). Substitutes make targets when a Makefile is present.