taiwan-legal-document-formatting

Generates Taiwan court, government, and contract documents as DOCX and PDF with formatting QA.

Updated Jul 6, 2026
One-click install
npx skills add https://github.com/Lucien-1127/strata-skill --skill taiwan-legal-document-formatting-lucien-1127
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: taiwan-legal-document-formatting
Source: https://github.com/Lucien-1127/strata-skill/tree/main/legal/taiwan-legal-document-formatting
Command: npx skills add https://github.com/Lucien-1127/strata-skill --skill taiwan-legal-document-formatting-lucien-1127

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires python-docx, pypdf, and includes scripts (resource) and references (resource) components.

What problem does it solve? Producing Taiwan legal documents that comply with court, government, and contract formatting rules is error-prone: wrong fonts, orphan lines, broken page breaks, missing citations, and LibreOffice CJK conversion quirks all cause rejections. This Skill encodes the full formatting rulebook plus a mandatory QA pipeline so every generated document passes review. ## Core Features & Use Cases - Three formatting tracks: court pleadings (cwTeXKai 14pt), government documents (AR PL UKai TW 12pt with binding margin), and commercial contracts (Noto Sans CJK TC 12pt), each with correct margins, line spacing, and clause indentation. - Automated DOCX-to-PDF pipeline: python-docx generation with widow/orphan control, LibreOffice headless conversion, blank-page detection, and font-embedding verification via pdfinfo/pdffonts. - Mandatory QA gates: parallel sub-agent review of layout and legal citations, plus a model-committee audit before delivery. - Use Case: A user asks for a mortgage contract for land-office registration; the Skill generates it in cwTeXKai with a proper signature table, verifies fonts and pagination, audits citations against law.moj.gov.tw, and delivers the PDF. ## Quick Start Generate a Taiwan court complaint document as a PDF using the court formatting track and run the full QA pipeline before sending it to me.

Frequently Asked Questions about taiwan-legal-document-formatting

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

FAQPage Schema
How do I generate a Taiwan court document PDF with python-docx?▼

Use the court track with cwTeXKai font at 14pt, A4 page size, and 2.5cm margins, then convert with LibreOffice headless. Set widow_control and keepLines on every paragraph to prevent orphan headings and mid-paragraph page breaks.

What font should a Taiwan mortgage contract use for land-office registration?▼

Mortgage contracts submitted for land-office registration must use cwTeXKai (DFKai-SB equivalent), not Noto Sans CJK TC. Land offices follow the court convention of Kai-style fonts, and the binding margin should be widened to 2.8cm for the seam seal.

Why does LibreOffice add a blank last page to CJK PDFs?▼

LibreOffice's CJK pagination algorithm sometimes appends an empty trailing page during DOCX-to-PDF conversion. Detect it with pdftotext or pypdf by checking if the last page has under 20 characters, then rewrite the PDF without that page using PdfWriter.

Does LibreOffice convert-to pdf output to the docx directory?▼

Not always. Without --outdir, LibreOffice writes the PDF to the current working directory. Pass --outdir with the docx directory path, or copy the PDF from the working directory after conversion.

How should legal citations be verified in generated Taiwan legal reports?▼

Every statute must be copied verbatim from law.moj.gov.tw rather than from memory, judgments need full case numbers from the Judicial Yuan, and scholarly opinions must cite authors like Wang Zejian or Xie Zaiquan separately from statutory sources.