docx-longform-layout-qa
БесплатноБез исполняемых скриптовНе проверенUse when generated DOCX pages have layout defects.
от jiayaoqijia★ 81 звезда на GitHubОб этом скилле
Long-form DOCX layout QA
When to Use
Use when a generated Word article, report, or thesis shows orphan captions, large white gaps, tables jumping pages, landscape figures that overflow, or a title breaking mid-phrase. Also run it as the final pass before delivering any generated long-form docx.
Generator scripts (python-docx) produce correct text with wrong layout. Diagnose by measuring the rendered PDF, not by eyeballing pages.
Loop
- Build docx, convert:
soffice --headless -env:UserInstallation=file:///home/ubuntu/.cache/lo_profile --convert-to pdf --outdir . file.docx - Measure fill per page with PyMuPDF:
import pymupdf
d = pymupdf.open('out.pdf')
for i in range(d.page_count):
p = d[i]
bl = [b for b in p.get_text('blocks') if b[3] < 790] # drop footer page number
gap = round((790 - max(b[3] for b in bl)) / 28.35, 1) if bl else 0
print(i + 1, 'L' if p.rect.width > p.rect.height else 'P', gap)
Gap > 4 cm on a body page is a defect; a gap before a landscape section or at the end of references is normal. 3. Render only suspect pages at 115–120 dpi and check with vision (caption adjacency, header repeat, clipping).
Causes and fixes
- Caption orphaned from figure/table: put
keep_with_nexton the paragraph before the caption (the picture paragraph, or the last row/paragraph of the table). - Long table jumping pages, half-empty page before it:
keep_with_nexton every row forces the table to stay whole. Apply only whenlen(rows) <= 15; above that let rows split. - Mid-word breaks / table wider than margins:
w:tblLayout type=fixedplus explicit cell widths. - Landscape figure: section break pair (
landscapebefore,portraitafter); caption and source live inside the landscape section, and that page must be measured too. - Title breaking mid-phrase: insert an explicit break (
\nin run text becomes<w:br/>) at a phrase boundary.
Editing generated source safely
Never slice a generator by s.index('token') when token also appears as def token() — it silently eats function definitions. Use unique multi-line anchors, assert the slice, and py_compile before running.
Keep document content in a JSON spec (paragraph text plus size/bold/align/indent, table rows and widths, image path and width) extracted from a known-good docx. Then layout work is spec reordering plus renderer fixes, and numbers never get retyped.
Final content checks before delivery
- Cross-check every β and p quoted in prose against the results JSON; list any value that is not found (a sensitivity run legitimately adds values from a second file).
- Verify every in-text citation has a reference entry and vice versa.
- Confirm hypothesis verdicts agree with their p-values.
- Table and figure numbers must ascend in document order after inserting a new table — renumbering is the most common miss.
Установить docx-longform-layout-qa в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл docx-longform-layout-qa?
Use when generated DOCX pages have layout defects.
Как установить скилл docx-longform-layout-qa?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл docx-longform-layout-qa запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic