law-to-markdown
将法条/规范文件(.txt/.docx/.pdf)转为 Markdown。适用于用户要求“法条转 markdown”“pdf/docx 转 markdown”。处理 .pdf/.docx 时先检查是否已安装 mineru-ocr skill;未安装先引导安装,安装后优先用 mineru-ocr;仅在用户明确同意时再用本地回退方案。
npx skills add pa1nrui1/legal-skills --skill law-to-markdown --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
## 法律工作总控规则(强制) 执行本 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条【条标】`整行为标题不拆) - 款/项/目无标题 - 项、目按标记换行
- 法律工作总控规则(强制)
- 旧规则废止(强制)
- 处理规则
- 二阶段识别参数
- 三阶段参数
- 输出规则
- 常用命令
- 许可证
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
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.
