Fix ragged right edges in LLM-generated ASCII/Unicode box diagrams
Project description
raggedy
Fix ragged right edges in LLM-generated ASCII/Unicode box diagrams.
LLMs consistently generate ASCII box diagrams with inconsistent right borders — missing corners, short rules, content lines without closing borders. raggedy autodetects these diagrams inside markdown fenced code blocks and fixes them.
Install & Run
# Run directly with uvx (no install needed)
uvx raggedy file.md
# Or install with pip/uv
pip install raggedy
raggedy file.md
Usage
raggedy [OPTIONS] FILE [FILE...]
Options:
-b, --backup Create .bak backup before editing
--check Exit 1 if changes needed (no modification; for CI)
--diff Show diff without modifying
-h, --help Show help
What It Fixes
Given a markdown file containing:
```
┌──────────────────┐
│ Header │
├──────────────────┤
│ Row 1
│ Row 2 is longer content
│ Short
└──────────────────┘
```
Running raggedy file.md produces:
```
┌────────────────────────┐
│ Header │
├────────────────────────┤
│ Row 1 │
│ Row 2 is longer content│
│ Short │
└────────────────────────┘
```
Supports both Unicode (┌│├└) and ASCII (+|-) box-drawing styles.
CI Usage
Use --check in CI to enforce clean diagrams:
raggedy --check docs/**/*.md
Local Development
When running raggedy from the working tree via uvx, use --no-cache so
the latest local code is rebuilt and executed:
uvx --from . --no-cache raggedy -b mantissa.md
AGENTS/Skills Usage
If you drive raggedy via an AGENTS.md entry or a skills file, use uvx
to run the local working tree explicitly. Example prompt:
Issue `uvx raggedy <file>` to fix ragged diagram edges in markdown.
See the full example in skills.md.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file raggedy-0.1.2.tar.gz.
File metadata
- Download URL: raggedy-0.1.2.tar.gz
- Upload date:
- Size: 18.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fde179532ff0000891f32f2a3052d0a64014b51daa522efcfc38b63223c02152
|
|
| MD5 |
d661f519b04011f307f2cc0994de2f71
|
|
| BLAKE2b-256 |
ce8bf20deb365d61b216c08afab454606106d7df24a487f2bd84533ef71eab04
|
File details
Details for the file raggedy-0.1.2-py3-none-any.whl.
File metadata
- Download URL: raggedy-0.1.2-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
609a9e40066a48702278d0e4e90b5934f7249a066cb0914f2324a1b9ccd7474e
|
|
| MD5 |
efef7378565c451cac03ca2b675dbc0b
|
|
| BLAKE2b-256 |
31061605a07e189af590e1e3212513b6926ae87d1f8047733a27295b0f3a61e4
|