law-to-markdown

Convert legal documents from TXT, DOCX, and PDF into structured Markdown.

159|20|Updated Jan 10, 2026
One-click install
npx skills add https://github.com/zh-xx/legal-assistant-skills --skill law-to-markdown-zh-xx
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: law-to-markdown
Source: https://github.com/zh-xx/legal-assistant-skills/tree/main/law-to-markdown
Command: npx skills add https://github.com/zh-xx/legal-assistant-skills --skill law-to-markdown-zh-xx

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill automates the conversion of legal documents in various formats (.txt, .docx, .pdf) into structured Markdown, ensuring accuracy and preserving the original text.

Core Features & Use Cases

  • Format Conversion: Transforms .txt, .docx, and .pdf files into clean Markdown.
  • OCR Integration: Leverages the mineru-ocr skill for PDF/DOCX processing when available, with a fallback to local libraries.
  • Structure Enforcement: Applies specific Markdown heading levels and formatting rules for legal documents.
  • Use Case: Convert a scanned PDF of a government regulation into a well-formatted Markdown document for easier reading, searching, and integration into other systems.

Quick Start

Use the law-to-markdown skill to convert the file 'regulation.pdf' into Markdown.

Frequently Asked Questions about law-to-markdown

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

FAQPage Schema
How do I convert legal PDF documents to Markdown?

To convert legal PDF documents to Markdown, this skill processes files using the `mineru-ocr` skill by default, falling back to local `pdfplumber` libraries. It applies specific heading structures and content validation to ensure fidelity.

What is the best way to extract text from scanned PDF regulations into structured formats?

The best way to extract scanned PDF regulations into structured formats is using automated conversion with `mineru-ocr` integration. It preserves original text fidelity and enforces specific Markdown heading levels tailored for legal documents.

Does this document conversion tool support .docx and .txt legal files?

Yes, this document conversion tool supports .docx and .txt legal files. It transforms .txt, .docx, and .pdf formats into clean Markdown, leveraging `mineru-ocr` for DOCX processing with `python-docx` as a local fallback.

How does OCR integration work for legal document conversion?

OCR integration for legal document conversion works by prioritizing the `mineru-ocr` skill for PDF and DOCX processing. If unavailable, it falls back to local Python libraries like `pdfplumber` and `python-docx` to extract text.

Can I use local Python libraries for PDF conversion when OCR is unavailable?

Yes, you can use local Python libraries for PDF conversion when OCR is unavailable. The skill uses `pdfplumber` and `python-docx` as fallbacks to parse documents and apply Markdown formatting rules.

Why does my converted legal Markdown lose original formatting?

Converted legal Markdown may lose formatting if local fallbacks are used instead of `mineru-ocr`. The skill enforces specific Markdown heading structures and performs content validation to prevent fidelity loss during document conversion.