box-align

Detect and fix box-drawing alignment issues in markdown ASCII-art diagrams.

Updated May 17, 2026
One-click install
npx skills add https://github.com/irrit-us/agent_misc --skill box-align-irrit-us
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: box-align
Source: https://github.com/irrit-us/agent_misc/tree/main/skills/box-align
Command: npx skills add https://github.com/irrit-us/agent_misc --skill box-align-irrit-us

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? ASCII-art diagrams in markdown files often contain misaligned box corners, off-center arrows, and inconsistent box widths that break visual flow and look unprofessional. Manually finding and fixing these alignment errors across large documentation files is tedious and error-prone. ## Core Features & Use Cases - Nine Alignment Checks: Detects corner-to-wall misalignment, broken T-junctions, off-center arrows, inconsistent connector columns, mismatched stacked box widths, short header underlines, off-center section titles, misaligned header-content zones, and off-center text arrows. - Automatic Fixing: The --fix mode corrects fixable issues iteratively (up to 5 passes), extending borders, shifting arrows, and centering headers while preserving connector chains. - CI Integration: The --check --quiet mode returns exit code 1 when issues are found, making it suitable for pre-commit hooks and CI pipelines. - Use Case: Run the checker across all markdown documentation before a release to catch broken ASCII flowcharts, then auto-fix them in place and verify with the included test suite and fuzz tests. ## Quick Start Ask the assistant to check the markdown file for box-drawing alignment issues and automatically fix any problems found.

Frequently Asked Questions about box-align

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check markdown files for ASCII diagram alignment issues?▼

Run python3 scripts/box_align.py followed by one or more markdown file paths. The tool scans fenced code blocks containing box-drawing characters and reports nine types of alignment issues, exiting with code 1 if any are found.

How to automatically fix misaligned box-drawing characters in markdown?▼

Run the script with the --fix flag, for example python3 scripts/box_align.py --fix file.md. It applies corrections iteratively up to five passes, extending borders, shifting arrows through whitespace, and centering headers in place.

Can box alignment checking run in CI pipelines?▼

Yes, use the --check --quiet flags for CI mode, which suppresses detailed output and communicates results only through the exit code. Exit code 1 indicates alignment issues were found, making it suitable for pre-commit hooks and build gates.

What are the limitations of ASCII diagram auto-fixing?▼

Only fenced code blocks are checked, and T-junction and connector-column issues are detection-only with no auto-fix. Arrows that are part of a vertical connector chain are skipped to avoid breaking the chain, and width fixes extend narrower boxes to match the widest in the group.

Does the checker handle directory tree characters in diagrams?▼

Yes, tree-structure characters such as ├, ┤, and └ used in directory listings are correctly ignored. The box detector distinguishes tree branches from box corners by requiring adjacent horizontal border characters before treating a corner as part of a box.