law-to-markdown

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

5.0k|479|Updated Feb 2, 2026
One-click install
npx skills add https://github.com/anbeime/skill --skill law-to-markdown
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: law-to-markdown
Source: https://github.com/anbeime/skill/tree/main/skills/legal-assistant-skills-main/law-to-markdown
Command: npx skills add https://github.com/anbeime/skill --skill law-to-markdown

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill automates the conversion of legal and regulatory documents from various formats (.txt, .docx, .pdf) into clean, structured Markdown, making them easier to read, search, and integrate into digital workflows.

Core Features & Use Cases

  • Multi-format Input: Handles plain text, Word documents, and PDFs.
  • Intelligent Conversion: Leverages the mineru-ocr skill for accurate PDF/DOCX processing, with a fallback to local libraries if needed and approved.
  • Automated Formatting: Applies Markdown headings (H1-H5) based on legal document structure (Parts, Chapters, Sections, Articles) and cleans up whitespace.
  • Validation: Includes a robust Stage 3 check to ensure content accuracy and structural integrity post-conversion.
  • Use Case: Quickly transform a lengthy PDF of a new regulation into a searchable Markdown document for your team's knowledge base.

Quick Start

Convert the document 'new_regulation.pdf' into Markdown format.

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 automatically?

To convert legal PDF documents to Markdown, this Skill uses the mineru-ocr skill for accurate extraction, applying multi-stage validation to ensure proper structural formatting. It transforms regulatory PDFs into clean, searchable Markdown text.

What is the best way to format regulatory DOCX files into structured text?

Formatting regulatory DOCX files into structured text involves applying Markdown headings (H1-H5) based on legal document structures like Parts, Chapters, and Articles. This Skill automates that conversion while cleaning up whitespace for digital workflows.

Does the conversion process work without the mineru-ocr skill?

Yes, the conversion process works without the mineru-ocr skill by falling back to local python-docx and pdfplumber libraries. This local processing fallback requires user consent before executing to handle DOCX and PDF inputs.

How do I extract legal document structures like Parts and Articles as Markdown headings?

Extracting legal document structures as Markdown headings requires mapping Parts, Chapters, Sections, and Articles to H1-H5 tags. This Skill detects these regulatory conventions during conversion and applies the correct Markdown hierarchy automatically.

Can I use this tool to process lengthy regulations for a knowledge base?

Yes, you can use this tool to process lengthy regulations for a knowledge base. It converts extensive legal PDF, DOCX, and TXT files into structured Markdown, making them easier to read, search, and integrate into your team's digital workflows.

What are the limitations of using local libraries for legal document conversion?

Limitations of using local libraries like pdfplumber for legal document conversion include potential inaccuracy with complex PDF layouts compared to mineru-ocr. The Skill prioritizes OCR but allows local fallbacks with user consent if OCR is unavailable.