← Back to Skills Marketplace
fong12368

Lawyer Case Archive Helper - 律师案件归档助手

by Fong12368 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
90
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install fanglawerguidangzhushou
Description
自动识别律师案件图片或PDF,生成民事归档卷宗和办案小结文档,并支持PDF转换与备份功能。
README (SKILL.md)

fanglawerguidangzhushou(律师案件归档助手)\r

\r

概述\r

\r 通用律师案件归档自动化工具,支持OCR识别 + 归档卷宗生成 + 办案小结生成 + PDF转换全流程。\r \r 脱敏说明:本技能已脱敏处理,不含任何个人案件信息、邮箱密码、微信密钥等敏感数据。\r \r

技能文件清单\r

\r | 文件 | 功能 | 说明 |\r |------|------|------|\r | archive_case.py | 主程序:案件归档全流程 | 支持OCR + PDF解析 + 生成归档 |\r | generate_juansong.py | 生成归档卷宗(民事) | 3页模板格式 |\r | generate_xiaojie.py | 生成办案小结 | 4段式结构 |\r | ocr_engine.py | OCR识别模块 | RapidOCR-ONNX |\r | config.py | 配置文件 | 路径/模板/参数 |\r | backup.py | 备份脚本 | 自动备份到指定目录 |\r | SKILL.md | 技能说明文档 | 本文件 |\r \r

依赖\r

\r

# Python环境(3.10+)\r
# 安装依赖\r
pip install rapidocr-onnxruntime python-docx pdfplumber openpyxl\r
```\r
\r
## 配置(config.py)\r
\r
```python\r
# 模板文件路径\r
TEMPLATE_PATH = "模板目录/归档卷宗模板(民事).docx"\r
\r
# 输出目录(默认与案件目录相同)\r
# 可在 archive_case.py 中通过参数指定\r
\r
# 线程限制(防止CPU爆表)\r
OMP_NUM_THREADS = 2\r
OPENBLAS_NUM_THREADS = 2\r
\r
# 图片预处理\r
MAX_SIDE = 1500  # 最大边长\r
```\r
\r
## 使用方法\r
\r
### 方式1:完整流程(推荐)\r
\r
```bash\r
python archive_case.py \x3C案件文件夹路径>\r
\r
# 示例\r
python archive_case.py "D:\cases\张三案件"\r
python archive_case.py "G:\案件\李四"\r
```\r
\r
### 方式2:分步执行\r
\r
```bash\r
# 1. OCR识别\r
python ocr_engine.py \x3C案件文件夹> -o ocr_result.txt\r
\r
# 2. 生成归档卷宗\r
python generate_juansong.py \x3C案件文件夹> --case-info \x3CJSON>\r
\r
# 3. 生成办案小结\r
python generate_xiaojie.py \x3C案件文件夹> --case-info \x3CJSON>\r
\r
# 4. Word转PDF\r
python docx_to_pdf.py \x3Cdocx文件>\r
```\r
\r
### 方式3:Python调用\r
\r
```python\r
from archive_case import main\r
\r
# 基本调用\r
main("案件文件夹路径")\r
\r
# 传入案件信息(避免OCR)\r
case_info = {\r
    "contract_no": "(202X)XX民代字第X号",\r
    "case_no": "(202X)XX民初XXX号",\r
    "case_type": "民间借贷纠纷",\r
    "client": "张三",\r
    "client_role": "原告",\r
    "opponent": "李四",\r
    "opp_role": "被告",\r
    "lawyer": "您的姓名",\r
    "stage": "1审",\r
    "court": "XX市XX区人民法院",\r
    "sign_date": "202X年X月X日",\r
    "end_date": "202X年X月X日",\r
    "end_way": "调解",\r
    "fee": "10000元",\r
    "pages": "50",\r
}\r
main("案件文件夹", case_info)\r
```\r
\r
## 输入要求\r
\r
案件文件夹应包含以下之一:\r
1. **案件相关图片**(.jpg/.png/.bmp/.tiff)— 将进行OCR识别\r
2. **现有PDF文件**(如已有归档卷宗)— 将提取案件信息\r
\r
## 输出文件\r
\r
程序会在案件文件夹生成:\r
\r
| 文件 | 说明 |\r
|------|------|\r
| `XXX归档卷宗(民事).docx` | 归档卷宗(3页模板格式) |\r
| `XXX归档卷宗(民事).pdf` | PDF版 |\r
| `XXX办案小结.docx` | 办案小结(4段式结构) |\r
| `XXX办案小结.pdf` | PDF版 |\r
| `OCR识别结果.txt` | OCR识别文本(如果运行了OCR) |\r
\r
## 案件信息识别策略\r
\r
1. **优先从现有PDF提取** — 查找文件名含"归档卷宗"的PDF\r
2. **次选OCR识别** — 对图片进行RapidOCR识别\r
3. **手动传入** — 通过case_info参数直接提供\r
\r
### 支持提取的字段\r
\r
- 合同编号、案号、案由\r
- 委托方(原告/被告)\r
- 对方当事人\r
- 受理法院、承办律师、代理阶段\r
- 接案日期、结案日期、结案方式\r
- 律师费、页数\r
\r
## 备份功能\r
\r
```bash\r
# 运行备份\r
python backup.py\r
```\r
\r
备份内容包括:\r
- SKILL.md\r
- archive_case.py\r
- generate_juansong.py\r
- generate_xiaojie.py\r
- ocr_engine.py\r
- config.py\r
- ocr_tool.py(通用OCR工具)\r
\r
## 性能参数(参考)\r
\r
| 项目 | 数值 |\r
|------|------|\r
| RapidOCR初始化 | ~1秒 |\r
| 单张图片识别 | ~10秒(3024×4032) |\r
| CPU占用 | 可控(线程限制) |\r
| 内存占用 | ~200MB |\r
\r
## 常见问题\r
\r
**Q: OCR识别很慢怎么办?**\r
A: 检查线程限制配置,确保设置了 `OMP_NUM_THREADS=2`\r
\r
**Q: 识别结果不准确?**\r
A: 尝试调整图片预处理参数(MAX_SIDE、CLAHE参数)\r
\r
**Q: 如何修改模板?**\r
A: 修改 config.py 中的 TEMPLATE_PATH,指向您的归档卷宗模板\r
\r
---\r
\r
*版本:v1.0*\r
*创建:2026-04-06*\r
*脱敏:已移除所有个人案件信息、邮箱密码、微信密钥*
Usage Guidance
What to check before installing/running: (1) Confirm TEMPLATE_PATH in config.py points to your template file — the tool will look for that DOCX and will fail if missing. (2) Inspect and edit backup.py: it uses a hard-coded Windows backup path (D:\backup-fanglawerguidangzhushou); change it to a location you control or remove the script if you don't want automatic backups. (3) The repo contains example EMAIL_CONFIG and WECHAT_CONFIG entries; do not populate these with real credentials unless you understand how/when the code would send emails or messages. (4) Install the listed Python packages in a virtual environment, and run the tools on non-sensitive test data first to verify outputs. (5) Be aware SKILL.md filenames don't exactly match the manifest (documentation sloppiness) — review archive_case.py and ocr_tool.py to confirm behavior before bulk-processing confidential case files.
Capability Analysis
Type: OpenClaw Skill Name: fanglawerguidangzhushou Version: 1.0.0 The skill bundle provides a legitimate-looking tool for lawyer case archiving, but it contains a significant shell injection vulnerability in 'archive_case.py'. The 'docx_to_pdf' function executes a PowerShell command via 'subprocess.run' using f-strings to insert file paths without sanitization, which could allow arbitrary code execution if a folder name contains malicious characters. Additionally, 'backup.py' uses a hardcoded absolute path ('D:\backup-fanglawerguidangzhushou') for file operations, and 'config.py' includes placeholders for sensitive email and WeChat credentials, which, while currently empty, indicate high-privilege capabilities.
Capability Assessment
Purpose & Capability
The name/description (lawyer case archive, OCR, generate docs, PDF conversion, backup) matches the included Python modules (OCR routines, PDF extraction, document generation, backup). No unrelated credentials or cloud services are required.
Instruction Scope
SKILL.md instructs local processing of images/PDFs and running the provided scripts only. It does not direct the agent to read unrelated system files or transmit data externally. Note: SKILL.md lists some filenames (e.g., generate_juansong.py, generate_xiaojie.py, ocr_engine.py) that are not separate files in the manifest—their functionality appears implemented as functions inside archive_case.py or in ocr_tool.py, which is a documentation / naming inconsistency to be aware of.
Install Mechanism
No install spec is provided (instruction-only install). Dependencies are standard Python packages (rapidocr-onnxruntime, python-docx, pdfplumber, openpyxl). No network downloads or extracted archives are embedded in the skill itself.
Credentials
The skill requests no environment variables or credentials. config.py contains example EMAIL_CONFIG and WECHAT_CONFIG entries (placeholders and disabled flags) — these are not required to run but could tempt users to paste real credentials into the file; exercise caution before adding secrets.
Persistence & Privilege
The skill does not request always:true and is user-invocable only. The backup.py script will copy skill files to a hard-coded absolute path (BACKUP_DIR = 'D:\\backup-fanglawerguidangzhushou'), which is a local write to disk and platform-specific (Windows). This is not inherently malicious but is surprising and should be reviewed/modified before running.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install fanglawerguidangzhushou
  3. After installation, invoke the skill by name or use /fanglawerguidangzhushou
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
v1.0.0: 首次公开发布,已脱敏
Metadata
Slug fanglawerguidangzhushou
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Lawyer Case Archive Helper - 律师案件归档助手?

自动识别律师案件图片或PDF,生成民事归档卷宗和办案小结文档,并支持PDF转换与备份功能。 It is an AI Agent Skill for Claude Code / OpenClaw, with 90 downloads so far.

How do I install Lawyer Case Archive Helper - 律师案件归档助手?

Run "/install fanglawerguidangzhushou" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Lawyer Case Archive Helper - 律师案件归档助手 free?

Yes, Lawyer Case Archive Helper - 律师案件归档助手 is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Lawyer Case Archive Helper - 律师案件归档助手 support?

Lawyer Case Archive Helper - 律师案件归档助手 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Lawyer Case Archive Helper - 律师案件归档助手?

It is built and maintained by Fong12368 (@fong12368); the current version is v1.0.0.

💬 Comments