Add document-typography skill: typographic quality control for generated documents#514
Add document-typography skill: typographic quality control for generated documents#514PGTBoos wants to merge 10 commits intoanthropics:mainfrom
Conversation
Added Document Typography skill to ensure typographic quality control for generated documents. Includes guidelines for preventing orphan word wraps, widow paragraphs, and numbering alignment issues, and more
Updated the typographic principles description for clarity.
typographic quality control for generated documents # Pull Request: New Skill — document-typography ## Title (for the PR title field): Add document-typography skill: typographic quality control for generated documents ## Description (copy-paste this into the PR description): ### What this skill does Prevents common typographic problems in AI-generated documents: - **Orphan word wrap**: 1-6 words spilling onto the next line - **Widow paragraphs**: section headers stranded at the bottom of a page with content on the next - **Numbering misalignment**: numbered lists shifting when going from single to double/triple digits These issues affect every document Claude generates — Word files, presentations, PDFs, reports, letters, manuals. Users rarely ask for good typography, but they notice when it's bad. ### How it works The skill introduces a **render-check-fix cycle**: 1. Generate the document 2. Convert to PDF via LibreOffice 3. Render pages as images 4. Visually inspect for layout problems 5. Fix and regenerate It also includes the **M-count method** — a simple formula to determine a guaranteed safe maximum line length: count how many capital M's (the widest character) fit on one line. Any real text will always be narrower, eliminating the orphan danger zone entirely. ### Included scripts - `measure_m_count.py` — Calculates safe character limit per line using font metrics (Pillow) - `check_orphans.py` — Scans text lines and reports which ones are at risk of orphan wrap - `check_layout.sh` — One-command docx → PDF → page images for visual inspection - `measure_line_width.py` — Generates a test document for visual line-width calibration ### Why this matters Every document skill (docx, pptx, pdf) benefits from this. It's the difference between "AI output" and publishable work. The skill is designed to complement the existing document creation skills, not replace them. ### Origin This skill emerged from iterative human-AI collaboration between [@PGTBoos](https://github.com/PGTBoos) and Claude. The user kept pointing out what the AI couldn't see (orphan words, widow paragraphs, layout balance) until the patterns were systematic enough to codify into a reusable skill. The M-count formula was the user's insight: a simple, elegant solution that eliminates the need for visual inspection of line wrapping. ### Checklist - [x] SKILL.md with valid YAML frontmatter (name + description) - [x] Scripts are self-contained - [x] Works with existing docx/pptx/pdf skills - [x] Tested on real document generation (213-rule Dutch chess rulebook)
|
Great skill, thanks. One remark, I'm unsure "typography" is a good name. It sounds like something that looks for what is commonly called "typos" (spelling issues) This skill sounds like a "document layout quality checker. Wording is hard. Mt suggestion might have issues too. But I wanted to raise my concern |
Document safe editing strategies to prevent common failure modes during multi-edit tasks.
|
Well GitHub told me to keep it under 50 words. The "M" test is a quick simple test.
Lines may be shorter as a result which is quite naturally.
It was quite a hard problem for Claude since it doesn't see, we tried whole document reviews which resulted in irritative fixing repeatedly M test was working well. Testing with M is safe testing with 'e' is 90% save too.
Verzonden vanaf Outlook voor Android<https://aka.ms/AAb9ysg>
…________________________________
From: Christophe Colombier ***@***.***>
Sent: Wednesday, March 4, 2026 3:35:06 PM
To: anthropics/skills ***@***.***>
Cc: PGTBoos ***@***.***>; Author ***@***.***>
Subject: Re: [anthropics/skills] Add document-typography skill: typographic quality control for generated documents (PR #514)
@ccoVeille commented on this pull request.
________________________________
On skills/ safe-editing/SKILL.md<#514 (comment)>:
The space in the file name seems unintentional
—
Reply to this email directly, view it on GitHub<#514 (review)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AFQQOG2LILPAZQKIVF4BD2L4PA5JVAVCNFSM6AAAAACWGWTAC2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTQOBZHAYTCMZTGQ>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
|
Nice work overall, especially the origin story - the human-AI iteration loop producing a reusable skill is exactly what this repo is for. This is one of those things where you don't think about it until it's pointed out, and then you can't unsee it. The M-count method is clever as a conservative safe bound. Also, i've noticed a few things -
|
|
I will rename it to document-layout
Bare in mind that i'm Dutch (not native english) and not so easy at working with forks (i mostly work on my own code with GIT)
And as i ran out of claude credits there will be some delay, I will also instead of doing M check do an "P" check.
On average this works fine too, making better use of available space.
…________________________________
Van: Christophe Colombier ***@***.***>
Verzonden: woensdag 4 maart 2026 15:26
Aan: anthropics/skills ***@***.***>
CC: PGTBoos ***@***.***>; Author ***@***.***>
Onderwerp: Re: [anthropics/skills] Add document-typography skill: typographic quality control for generated documents (PR #514)
[https://avatars.githubusercontent.com/u/3875889?s=20&v=4]ccoVeille left a comment (anthropics/skills#514)<#514 (comment)>
Great skill, thanks.
One remark, I'm unsure "typography" is a good name. It sounds like something that looks for what is commonly called "typos" (spelling issues)
This skill sounds like a "document layout quality checker. Wording is hard. Mt suggestion might have issues too.
But I wanted to raise my concern
—
Reply to this email directly, view it on GitHub<#514 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AFQQOG3VPN2D7QEL5BHCNS34PA4KJAVCNFSM6AAAAACWGWTAC2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTSOJXHA4DONJQGE>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
|
No rush on the updates by the way, totally understand the credit limits. Also dont worry about the fork workflow, if you get stuck with the git side of pushing updates just ask I'll be happy to help. Looking forward to the revised version. |
…dress reviewer feedback
|
If all went well it should be updated now, and pushed upwards to the fork.
Once this is accepted i can sync again and have another idea to improve claude's code coding / and document editing.
It was something suggested by claude himself to me, which i fine tuned, but i'm awaiting this first so my fork can be in sync again (and not ahead of your branch), i think you people will like it.
…________________________________
Van: Shiven Garia ***@***.***>
Verzonden: woensdag 4 maart 2026 18:28
Aan: anthropics/skills ***@***.***>
CC: PGTBoos ***@***.***>; Author ***@***.***>
Onderwerp: Re: [anthropics/skills] Add document-typography skill: typographic quality control for generated documents (PR #514)
[https://avatars.githubusercontent.com/u/120889165?s=20&v=4]Shiven0504 left a comment (anthropics/skills#514)<#514 (comment)>
No rush on the updates by the way, totally understand the credit limits.
Also dont worry about the fork workflow, if you get stuck with the git side of pushing updates just ask I'll be happy to help. Looking forward to the revised version.
—
Reply to this email directly, view it on GitHub<#514 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AFQQOGYRNIXGZMS3N3REHX34PBRS7AVCNFSM6AAAAACWGWTAC2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTSOJZGAZDSMJZGI>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Prevents common typographic problems in AI-generated documents: orphan word wrap (1-6 words spilling onto the next line), widow paragraphs (section headers stranded at page bottom), and numbering misalignment.
These issues affect every document Claude generates. Users rarely ask for good typography, but they notice when it's bad.
How it works
The skill introduces a render-check-fix cycle: generate the document, convert to PDF, render pages as images, visually inspect, fix and regenerate. It also includes the M-count method — count how many capital M's (the widest character) fit on one line. Any real text will always be narrower, eliminating orphan wrap entirely.
Included scripts
measure_m_count.py— Safe character limit per line using font metricscheck_orphans.py— Reports lines at risk of orphan wrapcheck_layout.sh— One-command docx → PDF → page imagesmeasure_line_width.py— Visual line-width calibrationOrigin
This skill emerged from iterative human-AI collaboration between @PGTBoos and Claude. The user kept pointing out what the AI couldn't see (orphan words, widow paragraphs, layout balance) until the patterns were systematic enough to codify into a reusable skill. The M-count formula was the user's insight. The user actively wants to make LLMs more human-like, and sees this contribution as a help for both AI and humans writing skills.