Agent skill

Legal OCR

by cat-xierluo in cat-xierluo/legal-skills

本技能应在用户需要 OCR、扫描识别、图片文字识别、文档识别,或将 PDF、图片、Office 文档、URL 转换为 Markdown 时使用。检测到法律材料时可进行保守的法律术语与文书结构优化。不要用于法律事实判断、补写缺失内容、语义改写、印章深度识别或图表实体分析。

MITAuto-check: notesDocuments & Office

Install Legal OCR

skills CLI
$ npx skills add cat-xierluo/legal-skills --skill legal-ocr -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install cat-xierluo/legal-skills legal-ocr --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/cat-xierluo/legal-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/legal-ocr .claude/skills/legal-ocr && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
legal-ocr
GitHub stars
720
Token cost
~2.3k tokens
SKILL.md length
677 words
Files
24 (incl. scripts, references)
Skills in repo
62
Repo updated
First seen
Licence
MIT

At a glance

本技能应在用户需要 OCR、扫描识别、图片文字识别、文档识别,或将 PDF、图片、Office 文档、URL 转换为 Markdown 时使用。检测到法律材料时可进行保守的法律术语与文书结构优化。不要用于法律事实判断、补写缺失内容、语义改写、印章深度识别或图表实体分析。

  • Works in 4 steps: 仅本地 .pdf 触发;图片、Office、URL 不参与。 → 用 pypdfium2 逐页抽取文字,计算 4 个指标:文本页覆盖率、平均… → 全部阈值达标 → 直接转 Markdown,复用既有… → …
  • Tasks that involve PDF
  • SKILL.md covers 何时使用, 依赖, 首次配置 and 常用命令, plus 9 more sections
  • Runs Python and JavaScript scripts from its folder; calls uv, pip and osascript; needs PADDLEOCR_ACCESS_TOKEN and MINERU_API_TOKEN

What it does

Legal OCR is an agent skill from cat-xierluo/legal-skills. 本技能应在用户需要 OCR、扫描识别、图片文字识别、文档识别,或将 PDF、图片、Office 文档、URL 转换为 Markdown 时使用。检测到法律材料时可进行保守的法律术语与文书结构优化。不要用于法律事实判断、补写缺失内容、语义改写、印章深度识别或图表实体分析。

Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 27 other files, including scripts and reference files (for example `CHANGELOG.md`, `config/legal_terms.example.json` and `references/legal_terms.md`).

It sits in Documents & Office, covering PDF. It works with Python and ONNX. The licence is MIT.

When your agent uses it

  • Tasks that involve PDF

Example prompts

  • “/legal-ocr”

Requirements

  • Python 3
  • Node.js
  • A credential in PADDLEOCR_ACCESS_TOKEN
  • A credential in MINERU_API_TOKEN

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. 仅本地 .pdf 触发;图片、Office、URL 不参与。
  2. 用 pypdfium2 逐页抽取文字,计算 4 个指标:文本页覆盖率、平均 CJK / 页、乱码比例(PUA + 替换字符 + 非常见字符)、总字符数。
  3. 全部阈值达标 → 直接转 Markdown,复用既有 post-process(法律术语 → 硬换行整理 → 基础清理)。
  4. 任一不达标 → 落回原有 OCR 候选(PaddleOCR → MinerU),完全兼容旧工作流。

What it can do on your machine

Read from SKILL.md and the folder at commit db2c58c. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 8 files in scripts/ (Python and JavaScript, from the files we listed), which the agent can run.

    Shell commands in SKILL.md call:

    • uv
    • pip
    • osascript
    • brew
    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use uv and pip, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • PADDLEOCR_ACCESS_TOKEN
    • MINERU_API_TOKEN
    • PADDLE_OCR_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Legal OCR loads about 2.3k tokens when it runs, and up to ~6.6k if it reads all its reference files. Until then it costs about 36 tokens; SKILL.md has 677 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~36
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~6.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:72
    cp .env.example .env
  • NoteMentions a .env fileSKILL.md:73
    nano .env

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from cat-xierluo/legal-skills at commit db2c58c, republished under its MIT licence (© cat-xierluo). 677 words, ~2,305 tokens.

Download SKILL.mdSave it as .claude/skills/legal-ocr/SKILL.md (or your agent's skills folder). This skill also uses 23 other files; get the full folder from GitHub.
name
legal-ocr
description
本技能应在用户需要 OCR、扫描识别、图片文字识别、文档识别,或将 PDF、图片、Office 文档、URL 转换为 Markdown 时使用。检测到法律材料时可进行保守的法律术语与文书结构优化。不要用于法律事实判断、补写缺失内容、语义改写、印章深度识别或图表实体分析。
version
1.6.0
license
MIT
author
杨卫薪律师(微信ywxlaw)
homepage
https://github.com/cat-xierluo/legal-skills

本技能用于 OCR、扫描识别、图片文字识别、文档识别,以及把 PDF、图片、Office 文档和 URL 转换为可继续编辑、分析和归档的 Markdown。它首先是通用 OCR 入口;当结果被识别为法律材料时,再自动启用保守型法律后处理。默认使用配置优先的自动路由:

  • 本地 PDF 默认先探测原生文本层:法院电子送达判决书、电子合同、政府公文等带可靠文本层的 PDF 直读比 OCR 更准、更快、更省额度。质量达标直接抽文字转 Markdown;不达标才落回 OCR。详见「PDF 文本层双路径」。
  • 只配置 PaddleOCR:PaddleOCR 支持的 PDF / 图片优先走 PaddleOCR;超出能力边界时再提示或改走 MinerU 支持链路。
  • 只配置 MinerU Token:所有 MinerU 支持的输入统一走 MinerU,包含 PDF、图片、Office、远程文档 URL 和网页 URL。
  • 同时配置两套 API:本地 PDF / 图片优先 PaddleOCR,Office / 网页 URL 优先 MinerU;首选后端出现额度、频率、鉴权、网络或服务失败时自动尝试候选后端。
  • 本机已安装 RapidOCR 时,本地 PDF / 图片把本地 RapidOCR 作为云端失败后的最后一级候选。
  • 两套 API 都未配置:本机已装 RapidOCR 时优先本地识别(材料不出本机),MinerU 轻量接口退为兜底;未装 RapidOCR 时使用 MinerU 轻量接口处理小文件,并在超限时提示补充 Token。
  • 敏感材料不允许外传时,显式使用 --backend rapid(本地 onnx 推理,全程不出本机)。

旧的 paddle-ocr 和 mineru-ocr 保持可用;本技能是新的统一入口,目标是覆盖两者的常用 OCR/转换场景。

何时使用

在以下场景使用本技能:

  • 用户明确需要 OCR、扫描识别、图片文字识别或文档识别。
  • 输入可能是 PDF、图片、Office 文档、远程文档 URL 或网页 URL,并希望转成 Markdown。
  • 希望保留 archive,便于复核原文件、后端结果、Markdown 和图片资源。
  • 需要自动选择 OCR 后端,而不是手动判断该用 PaddleOCR 还是 MinerU。
  • 希望非法律材料保持通用 OCR 输出,法律材料再做术语和文书结构优化。

不优先使用本技能的场景:

  • 只需要快速读取一小段清晰文本,且不需要 Markdown 文件和归档。
  • 需要基于上下文改写事实、补充缺失信息、印章深度标注或图表语义分析;这些能力仍在后续计划中。

依赖

系统依赖
依赖安装方式
python3macOS 通常已内置
uvmacOS: brew install uv
Python 包

脚本使用 uv run 执行,依赖写在脚本头部;推荐直接使用 uv run scripts/convert.py,无需单独维护 requirements.txt。

包名用途安装命令
httpx调用 PaddleOCR 与 MinerU APIpip install httpx
pypdfium2读取 PDF 页数与拆分页码范围pip install pypdfium2
rapidocr + onnxruntime可选:本地 RapidOCR 后端(--backend rapid)uv run --with rapidocr --with onnxruntime scripts/convert.py ... 或 pip install rapidocr

如直接用 python scripts/convert.py 运行且缺少依赖,脚本会给出安装提示。

本地 RapidOCR 后端能力边界
  • 只有文字检测+识别,没有版面分析:段落由统一后处理链重建,单栏文书(判决书、合同扫描件等)可靠,多栏版面可能错序。
  • 不提取图片资源:印章、签名、图表不会出现在 Markdown 里。
  • Office 文档与 URL 不支持(仍走 MinerU)。
  • 渲染 DPI 默认 220,可用 LEGAL_OCR_RAPID_DPI 调整;置信度阈值 LEGAL_OCR_RAPID_MIN_SCORE(默认 0.5)。

首次配置

复制配置模板:

bash
cd legal-ocr/config
cp .env.example .env
nano .env

可选配置:

  • PaddleOCR:填写 PADDLEOCR_DOC_PARSING_API_URL 和 PADDLEOCR_ACCESS_TOKEN。
  • MinerU Token:填写 MINERU_API_TOKEN;不填时小文件默认走 MinerU 轻量接口。
  • 自动路由:保持 LEGAL_OCR_BACKEND=auto。
  • 法律术语优化:保持 LEGAL_OCR_LEGAL_TERMS=auto,只在检测到法律材料时启用;如需强制启用可设为 true,如需关闭可设为 false。
  • 通用硬换行优化:保持 LEGAL_OCR_LINE_MERGE=true;如需加载自定义法律术语,设置 LEGAL_OCR_CUSTOM_TERMS_PATH。

本技能也会尝试读取环境变量和 ~/.mineru/config.yaml 中的 MinerU Token。 PaddleOCR 也兼容 pdf-processor 使用的 PADDLE_OCR_API_ENDPOINT / PADDLE_OCR_API_KEY,并支持 /api/v2/ocr/jobs 异步任务接口。

常用命令

在技能根目录运行:

bash
uv run scripts/convert.py "/path/to/file.pdf"
uv run scripts/convert.py "/path/to/file.pdf" --pages "1-20"
uv run scripts/convert.py "/path/to/file.pdf" --backend paddle
uv run scripts/convert.py "/path/to/file.pdf" --backend paddle --paddle-model PaddleOCR-VL-1.5
uv run scripts/convert.py "https://example.com/document.pdf" --backend auto
uv run scripts/convert.py "https://example.com/article" --backend mineru
uv run scripts/convert.py "/path/to/judgment.pdf" --legal-terms always
uv run scripts/convert.py checktoken

敏感材料本地识别(不出本机):

bash
uv run --with rapidocr --with onnxruntime scripts/convert.py "/path/to/scan.pdf" --backend rapid

兼容 JXA 入口:

bash
/usr/bin/osascript -l JavaScript scripts/convert.js "/path/to/file.pdf"

可选参数:

参数说明
`--backend autopaddle
`--text-layer autonever
--output <path>输出 Markdown 路径或目录
--pages <spec>页码范围,如 1-20、1-5,8,10-12
--archive-name <name>自定义 archive 目录名
--no-archive不写入 archive
--no-post-process跳过全部后处理
--no-legal-terms跳过法律术语优化
`--legal-terms autoalways
--no-line-merge跳过 OCR 硬换行整理
`--model pipelinevlm`
`--paddle-model PP-OCRv5PaddleOCR-VL-1.5`
`--paddle-api-protocol autosync
--paddle-api-extra-json <path>合并额外 PaddleOCR optionalPayload

PaddleOCR 同步接口会校验后端实际返回页数。若返回页数少于本地 PDF 批次页数,转换会失败并提示降低 PADDLEOCR_BATCH_PAGES 或使用 --pages 重跑,避免缺页结果被误当作成功。

PDF 文本层双路径

本地 PDF 进入 OCR 后端之前,会先探测是否带可用的原生文本层(v1.5.0+)。这是法律场景里的高频优化:法院电子送达判决书、电子合同、政府公文等 PDF 通常已带可靠文本层,直读比 OCR 更准、更快、不耗 API 额度。

工作流
  1. 仅本地 .pdf 触发;图片、Office、URL 不参与。
  2. 用 pypdfium2 逐页抽取文字,计算 4 个指标:文本页覆盖率、平均 CJK / 页、乱码比例(PUA + 替换字符 + 非常见字符)、总字符数。
  3. 全部阈值达标 → 直接转 Markdown,复用既有 post-process(法律术语 → 硬换行整理 → 基础清理)。
  4. 任一不达标 → 落回原有 OCR 候选(PaddleOCR → MinerU),完全兼容旧工作流。
模式行为
auto(默认)探测后达标走文本层,不达标回退 OCR
never完全禁用文本层,回到旧版纯 OCR 行为
always强制走文本层;不可用时直接 exit=2 失败,便于排障
与 --backend 的优先级
  • --backend auto + --text-layer auto:最优路径,先文本层、不达标再 OCR。
  • --backend paddle|mineru:视为用户显式想要 OCR,跳过文本层分支(除非同时设 --text-layer always 强制覆盖)。
阈值(保守默认,理想值待真实卷宗校准)
env默认含义
LEGAL_OCR_TEXT_LAYER_MIN_COVERAGE0.8文本页占探测页比例下限
LEGAL_OCR_TEXT_LAYER_MIN_CHARS_PER_PAGE50文本页平均 CJK 字符下限
LEGAL_OCR_TEXT_LAYER_MAX_GARBLE_RATIO0.05PUA + 替换字符 + 非常见字符占比上限
LEGAL_OCR_TEXT_LAYER_MIN_TOTAL_CHARS100非空白字符总数下限

阈值默认值的理由见 references/text-layer-detection.md 与 DECISIONS.md。如果你拿到一批真实卷宗发现误判(例如应该走 OCR 的 PDF 走了文本层,或反之),把指标和样本反馈给维护者,再调阈值或加新规则。

Show full SKILL.md (271 more words)Show less
archive 记录

无论是否走文本层,PDF 输入都会在 metadata.json 留下 text_layer 字段:

  • 走了文本层:enabled=true + probe 全量指标(页数、coverage、garbled_ratio、阈值快照)。
  • 没走文本层:enabled=false + probe.reason(如 no_text_layer / high_garbled_ratio),便于复盘为什么回退到 OCR。

自动分流

  • auto 会先看用户实际配置了哪些 API;只配置一套时尽量统一走这一套,减少用户判断成本。
  • 两套 API 都配置时,按材料类型选择首选后端,并把另一个可用后端作为候选。
  • 如果后端返回 429、额度不足、余额不足、频率限制、鉴权失败、网络超时或服务失败,会在 result.json 和 metadata.json 的 route.attempts 中记录失败类别;存在候选后端时自动继续转换。
  • 当前没有接入独立额度预检接口;额度判断来自 API 响应码和错误信息。若服务商提供稳定 quota endpoint,再加入转换前检查。

瞬态错误自动重试

  • 范围:所有 HTTP 调用(同步提交、异步提交、异步轮询、MinerU 上传/轮询/下载、Token 自检)都会被瞬态错误分类与重试包装。
  • 瞬态定义:当前为 httpx.RequestError(DNS 解析失败、连接失败、连接/读取超时、远端关闭连接、协议错误)。HTTP 4xx 仍立即抛出(鉴权、配额、参数错误),HTTP 5xx 和 429 在轮询路径下会被同样的重试包装覆盖。
  • 默认参数:3 次尝试(含首次),首次重试前 1.0 秒,单次重试等待上限 30.0 秒(指数退避 1 → 2 → 4 → 8 → ...)。
  • 配置项:统一用 LEGAL_OCR_RETRY_ATTEMPTS / LEGAL_OCR_RETRY_BASE_DELAY / LEGAL_OCR_RETRY_MAX_DELAY;可用 PADDLEOCR_RETRY_* 与 MINERU_RETRY_* 覆盖单后端。设置为 1 等于关闭重试。
  • 重试前会向 stderr 输出一行 PaddleOCR/MinerU 瞬态错误 … 日志,便于排查真实网络问题。

OCR 与法律增强

  • 非法律材料默认只做通用 Markdown 清理、空行整理和硬换行整理。
  • 法律增强默认处于 auto 模式:先扫描 OCR 原始文本和文件名,只有命中法院、案号、当事人标签、判决/裁定结构等足够信号时,才运行法律术语优化。
  • 检测结果会写入 result.json 和 metadata.json 的 postprocess.legal_context / legal_context 字段。
  • 如用户确认输入一定是法律材料,可使用 --legal-terms always 或 LEGAL_OCR_LEGAL_TERMS=true 强制启用。
  • 如处理非法律材料且希望完全关闭法律替换,可使用 --legal-terms never、--no-legal-terms 或 LEGAL_OCR_LEGAL_TERMS=false。

法律术语优化

  • 默认仅在检测到法律材料时启用保守型法律术语后处理,只处理高置信 OCR 断字和常见误识别,不做事实补全或语义改写。
  • 默认覆盖文书名称、主体标签、诉讼程序、证据材料、法院文书结构词等常见词。
  • 默认整理明显的 OCR 硬换行,只合并同一中文段落内的物理换行;标题、当事人标签、编号、表格、引用和 Markdown 结构会保留。
  • 每次替换会写入 postprocess_log.json,并保留 result_raw.md 供复核。
  • 自定义术语格式见 references/legal_terms.md。

输出

  • Markdown 默认保存在源文件同目录;远程 URL 默认保存在当前目录。
  • 图片资源默认保存在 Markdown 同目录的 <文件名>_images/。
  • archive 默认保存在 legal-ocr/archive/时间戳_文件名/。

输入/输出

输入
  • 必需:本地文件路径、远程 URL,或 checktoken。
  • 可选:--backend、--output、--pages、--archive-name、--model 和 PaddleOCR 相关参数。
输出
  • Markdown 主文件:转换后的可编辑文本。
  • 图片目录:后端返回或 Markdown 引用的图片资源。
  • Archive:默认保存原始结果、最终结果、后端响应、路由记录和后处理日志;输入文件的 path / sha256 / size_bytes(本地)或原始 URL(远程)通过 metadata.json 的 source 字段记录,不再单独复制输入副本。

archive 内包含:

  • output/result.md
  • output/result_raw.md
  • output/result.json
  • backend_result/
  • metadata.json(输入文件的 path / sha256 / size_bytes 或远程 URL 通过 source 字段记录;不单独保存输入副本)
  • 必要时包含图片资源和 postprocess_log.json

详细结构见 references/output_schema.md。

故障排除

问题解决方式
PaddleOCR 未配置补充 PADDLEOCR_DOC_PARSING_API_URL 与 PADDLEOCR_ACCESS_TOKEN,或显式使用 --backend mineru
MinerU 轻量接口超限配置 MINERU_API_TOKEN 后重试,或安装 RapidOCR 走本地识别
敏感材料不允许外传uv run --with rapidocr --with onnxruntime scripts/convert.py <文件> --backend rapid
--backend rapid 提示未安装用 uv run --with rapidocr --with onnxruntime ...,或 pip install rapidocr 后用 python3 直跑
一个 API 额度用尽同时配置另一套 API,并保持 --backend auto;转换时会自动尝试候选后端
网页 URL 失败网页 URL 需要 MinerU Token,不支持轻量模式
DOCX/PPTX 走 PaddleOCR 失败Office 文档只能走 MinerU,使用 --backend auto 或 --backend mineru
PaddleOCR 返回页数不足降低 PADDLEOCR_BATCH_PAGES 或使用 --pages 按较小范围重跑;当前云端接口实测单次稳定返回上限约 100 页
转换质量需复核查看 archive 中的 result_raw.md、result.json 和 backend_result/

维护

修改本技能后,同步更新本目录下的 TASKS.md、DECISIONS.md 和 CHANGELOG.md。

© cat-xierluo, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 23 other files (scripts, references) in skills/legal-ocr of cat-xierluo/legal-skills.

  • SKILL.md
  • CHANGELOG.md
  • LICENSE.txt
  • archive/.gitkeep
  • config/.env.example
  • config/legal_terms.example.json
  • references/legal_terms.md
  • references/output_schema.md
  • references/text-layer-detection.md
  • scripts/base.py
  • scripts/basic_postprocess.py
  • scripts/common.py
  • scripts/convert.js
  • scripts/convert.py
  • scripts/fix_image_paths.py
  • scripts/legal_terms.py
  • scripts/linebreaks.py
  • … and 7 more

Open the folder on GitHubat commit db2c58c

Compare with similar skills

Legal OCR next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Legal OCR compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Legal OCR this skillcat-xierluo/legal-skills720—~2.3kAutomated safety check: NotesMIT
PDF ToolkitXiaomiMiMo/MiMo-Code14k—~1.7kAutomated safety check: PassApache-2.0
PDF Generation, Forms and Extractionpipeshub-ai/pipeshub-ai3.8k—~2.9kAutomated safety check: PassApache-2.0
MineruNebutra/MinerU-Skill123—~1.4kAutomated safety check: PassMIT
Markdown Exporterbowenliang123/markdown-exporter2721 repos~5.3kAutomated safety check: PassApache-2.0
Kimi PDFthvroyal/kimi-skills238—~1.9kAutomated safety check: PassNone

Similar skills

  • PDF Toolkit

    XiaomiMiMo/MiMo-Code

    Reads, transforms, composes and fills PDFs with Python scripts for extraction, merging, watermarking, encryption, OCR and form filling.

    14k GitHub stars~1.7k tokensUpdated 2 days ago
    Documents & OfficeAuto-check passed
  • Picks the right library for generating a new PDF, filling an existing PDF form, or extracting text and tables, defaulting to Node where possible.

    3.8k GitHub stars~2.9k tokensUpdated today
    Documents & OfficeAuto-check passed
  • Mineru

    Nebutra/MinerU-Skill

    An AI-Native skill for parsing PDF / Office / image files into clean Markdown with MinerU — a fast, zero-config document parser for AI agents.

    123 GitHub stars~1.4k tokensUpdated 17 days ago
    Documents & OfficeAuto-check passed
  • Markdown Exporter

    bowenliang123/markdown-exporter

    Convert Markdown text to DOCX, PPTX, XLSX, PDF, PNG, SVG, HTML, IPYNB, MD, CSV, JSON, JSONL, XML files, and extract code blocks in Markdown to Python, Bash,JS and etc files.

    272 GitHub starsUsed in 1 repo~5.3k tokens
    Documents & OfficeAuto-check passed
  • Kimi PDF

    thvroyal/kimi-skills

    Professional PDF solution. An agent skill from thvroyal/kimi-skills.

    238 GitHub stars~1.9k tokensUpdated 6 mo ago
    Documents & OfficeAuto-check passed
  • PDF

    NousResearch/hermes-agent

    PDF files: create, read, merge, fill, OCR, edit text. An agent skill from NousResearch/hermes-agent.

    253k GitHub stars~3.1k tokensUpdated today
    Documents & OfficeAuto-check passed

More from cat-xierluo/legal-skills

All 62 skills in this repo
  • Elements-Style Complaint Generator

    cat-xierluo/legal-skills

    Converts a lawyer's ordinary complaint or a described case into the Supreme People's Court's elements-style Word template, with layout checks on the result.

    721 GitHub stars~2.6k tokensUpdated yesterday
    Auto-check: notes
  • Lecture Performance Review

    cat-xierluo/legal-skills

    Analyzes raw lecture transcripts for verbal tics, pacing, time use and promise follow-through, with optional slide-by-slide comparison and cross-session tracking.

    721 GitHub stars~2.2k tokensUpdated yesterday
    Auto-check passed
  • De-AI Polish for Chinese Articles

    cat-xierluo/legal-skills

    Detects and rewrites machine-sounding patterns in the body text of Chinese articles while keeping the author's facts, headings and legal terms intact.

    721 GitHub stars~2.9k tokensUpdated yesterday
    Auto-check passed
  • GitHub Star Manager

    cat-xierluo/legal-skills

    Finds GitHub projects mentioned in articles or screenshots and stars them, tracks updates to your starred repos, and builds an HTML dashboard to browse them.

    721 GitHub stars~2k tokensUpdated yesterday
    Auto-check: notes
  • Legal Harness Initializer

    cat-xierluo/legal-skills

    Sets up or incrementally updates AGENTS.md and CLAUDE.md for legal professionals, with a minimal safety baseline and a check that a new session loads and follows the rules.

    721 GitHub stars~2.3k tokensUpdated yesterday
    Auto-check passed
  • Moot Court Simulation Builder

    cat-xierluo/legal-skills

    Chinese-language skill that organizes a case file into a multi-role mock trial with judge, parties and clerk, producing a transcript, issue review and a to-strengthen list.

    721 GitHub stars~1.4k tokensUpdated yesterday
    Auto-check passed

Works with

Questions about Legal OCR

What does Legal OCR do?

本技能应在用户需要 OCR、扫描识别、图片文字识别、文档识别,或将 PDF、图片、Office 文档、URL 转换为 Markdown 时使用。检测到法律材料时可进行保守的法律术语与文书结构优化。不要用于法律事实判断、补写缺失内容、语义改写、印章深度识别或图表实体分析。. Legal OCR is an agent skill from cat-xierluo/legal-skills.

When should I use Legal OCR?

Legal OCR fits situations like: tasks that involve PDF.

How do I install Legal OCR in Claude Code?

Run `npx skills add cat-xierluo/legal-skills --skill legal-ocr -a claude-code`. Or copy the skill folder (skills/legal-ocr in cat-xierluo/legal-skills) into .claude/skills/legal-ocr in your project. Claude Code loads it when a task matches its description.

How do I install Legal OCR in Codex?

Run `npx skills add cat-xierluo/legal-skills --skill legal-ocr -a codex`. Or copy the skill folder (skills/legal-ocr in cat-xierluo/legal-skills) into .agents/skills/legal-ocr in your project. Codex loads it when a task matches its description.

Can I use Legal OCR in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add cat-xierluo/legal-skills --skill legal-ocr -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/legal-ocr, .gemini/skills/legal-ocr, .github/skills/legal-ocr and .opencode/skills/legal-ocr in your project.

What does Legal OCR need to run?

Going by SKILL.md and its folder, Legal OCR needs Python and JavaScript for the scripts in its folder, the command-line tools its instructions call (uv, pip, osascript, brew and python) and credentials named PADDLEOCR_ACCESS_TOKEN, MINERU_API_TOKEN and PADDLE_OCR_API_KEY. Our summary lists: Python 3; Node.js; A credential in PADDLEOCR_ACCESS_TOKEN; A credential in MINERU_API_TOKEN.

Does Legal OCR access the network?

SKILL.md contains no URLs. Its commands use uv and pip, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Legal OCR safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Legal OCR use?

Legal OCR is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Legal OCR use?

About 2.3k tokens (SKILL.md is roughly 9.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 4.3k tokens, read only when the agent opens those files.

What are the alternatives to Legal OCR?

Skills that share tags, products or a category with Legal OCR: PDF Toolkit (XiaomiMiMo/MiMo-Code, 14k stars), PDF Generation, Forms and Extraction (pipeshub-ai/pipeshub-ai, 3.8k stars), Mineru (Nebutra/MinerU-Skill, 123 stars) and Markdown Exporter (bowenliang123/markdown-exporter, 272 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Legal OCR?

cat-xierluo (a GitHub user) maintains it in cat-xierluo/legal-skills, which has 720 GitHub stars. The repository holds 62 skills in this directory. The repository was last updated on October 10, 2026.

Source: cat-xierluo/legal-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.