Agent skill · AI & Agents

law-to-markdown

将法条/规范文件(.txt/.docx/.pdf)转为 Markdown。适用于用户要求“法条转 markdown”“pdf/docx 转 markdown”。处理 .pdf/.docx 时先检查是否已安装 mineru-ocr skill;未安装先引导安装,安装后优先用 mineru-ocr;仅在用户明确同意时再用本地回退方案。

pa1nrui1github.com/pa1nrui1GitHub ↗
claude-codeships scriptsMIT
Install
npx skills add pa1nrui1/legal-skills --skill law-to-markdown --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 6
SKILL.md size: 3 KB
Bundled scripts: yes
Path: skills/legal/law-to-markdown/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 58
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

## 法律工作总控规则(强制) 执行本 Skill 前,必须先遵循: - skills/legal/法律工作总控/references/practice-profile.md - skills/legal/法律工作总控/references/matter-workspace-protocol.md - skills/legal/法律工作总控/references/document-reading-protocol.md - skills/legal/法律工作总控/references/source-boundary-protocol.md - skills/legal/法律工作总控/references/ocr-correction-protocol.md - skills/legal/法律工作总控/references/pkulaw-mcp-legal-verification-protocol.md 本 Skill 只处理本专业任务;案件隔离、来源披露、材料缺口、法规/Wiki 校验、OCR 校正和读取复查按总控规则执行。 ## 旧规则废止(强制) - 旧文中直接写死的客户目录、阶段目录、旧式台账写入、旧本地读取协议均不作为执行规则。 - 事项路径、当前事项、系统记录、业务文件区和复盘台账统一以法律工作总控 `matter-workspace-protocol.md` 为准。 - 不得静默写入复盘台账;确需更新时,先确认属于复盘台账更新并向用户说明。 --- # Law To Markdown ## 处理规则 1. 输入为 `.txt`:直接转存为 `.md`。 2. 输入为 `.pdf` / `.docx`: - 先检查是否已安装 `mineru-ocr` skill。 - 未安装:提示先安装 `mineru-ocr`,安装地址: `https://github.com/cat-xierluo/legal-skills/tree/main/skills/mineru-ocr` - 已安装:优先调用 `mineru-ocr` 处理。 - 调用失败:先提示检查 `mineru-ocr` 配置/Token。 - 仅当用户明确同意时,才使用本地回退(`python-docx` / `pdfplumber`)。 3. 第一阶段完成后默认执行第二阶段格式调整(仅格式,不改原文字符): - 由调用该 skill 的大模型先判断“法律/非法律”,并把结果传给脚本。 - 若调用方未传结果,则脚本使用硬规则自动识别(`--law-decision auto`)。 - 法律名称 `#` - 编/分编 `##` - 章 `###` - 节 `####` - 条 `#####`(仅“第X条”为标题;`第X条【条标】`整行为标题不拆) - 款/项/目无标题 - 项、目按标记换行

What's inside
Steps it walks through
  1. 法律工作总控规则(强制)
  2. 旧规则废止(强制)
  3. 处理规则
  4. 二阶段识别参数
  5. 三阶段参数
  6. 输出规则
  7. 常用命令
  8. 许可证
Ships with 5 files
  • agents/openai.yaml
  • scripts/cn_law_normalizer.py
  • scripts/law_to_markdown.py
  • scripts/requirements.txt
  • scripts/stage3_checker.py
Commands it runs
python3 law-to-markdown/scripts/law_to_markdown.py "input.txt"
python3 law-to-markdown/scripts/law_to_markdown.py "input.docx"
python3 law-to-markdown/scripts/law_to_markdown.py "input.pdf"
python3 law-to-markdown/scripts/law_to_markdown.py "input.docx" --allow-fallback
python3 law-to-markdown/scripts/law_to_markdown.py "input.pdf" --allow-fallback
More from legal-skills
All skills →
法律工作总控legal 文件夹通用入口 Skill。用于法律咨询、案件办理、合同、产品法务、监管合规、诉讼、刑辩、劳动争议、破产、合规、文书、检索等任务的语义路由、案件隔离、来源披露、文件读取复查、法规/Wiki…AI & Agents法律文书模板与导出统一处理法律工作中最终需要输出本地 Word(.docx)的文书、报告、清单、笔录、意见书、函件、合同和正式交付文件。由法律工作总控强制路由调用;业务 Skill 负责正文和法律判断,本 Skill…AI & Agents合同审查基于张海燕四步审查法+何力/常金光三观分析法,对合同进行深度审查。支持企业核验、多语言自动检测、Mermaid业务流程图、二段式审核意见、合同概览、客户可读合同编号、业务摘要、22类合同专项审查、续约…Testing & QA广告合规审核广告合规审核技能,用于审核广告素材是否符合中国广告法及相关法规。适用场景:(1) 用户提交广告文案、广告素材要求合规审核时;(2) 用户提到"广告审核""广告合规""广告法审查"等关键词时;(3)…Other法律文书出稿前审查在法律业务 Skill 生成正文或要素式字段后、法律文书模板与导出生成本地 Word 前触发。用于审查 draft.html/preflight-meta.json 或…Data & Analytics监管合规监测中国境内重点监管动态监测与客户合规影响评估 Skill。用于监管动态、新规更新、政策变化、行业监管、法规政策分级、客户合规缺口核查、政策制度修改建议、整改清单、监管合规简报等任务。适用于用户要求监测某…AI & Agents
About this skill
What does the law-to-markdown skill do?

将法条/规范文件(.txt/.docx/.pdf)转为 Markdown。适用于用户要求“法条转 markdown”“pdf/docx 转 markdown”。处理 .pdf/.docx 时先检查是否已安装 mineru-ocr skill;未安装先引导安装,安装后优先用 mineru-ocr;仅在用户明确同意时再用本地回退方案。

How do I install it?

Run `npx skills add pa1nrui1/legal-skills --skill law-to-markdown --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From pa1nrui1/legal-skills, a repository with 58 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going