A full-process legal retrieval automation tool for lawyers, judge assistants, and legal affairs personnel. With one sentence of input, it automatically completes legal and regulatory retrieval → case verification → similar case analysis → report generation.
What it can do
- 📜 Legal and regulatory retrieval: Describe a legal issue in natural language, and automatically retrieve relevant legal provisions (including timeliness, level of authority, and original text of legal articles)
- 🔍 Case verification: Retrieve judgment documents by case number or keywords, and obtain the original text of authoritative precedents
- 📊 Similar case analysis: Find similar cases based on semantic retrieval, and compare judgment points, sentencing differences, and legal application
- 📄 Visualized report: Generate an interactive HTML report, including original legal texts, case summaries, similar case comparison tables, and extraction of judicial viewpoints
Data sources
This Skill supports dual data sources:
| Data source | Coverage | Access method | Price |
|---|---|---|---|
| PKULaw MCP | 5 million+ regulations, 160 million+ cases, 42.5 million+ enforcement documents | MCP Streamable HTTP | Free for 1 month for new users, pay-as-you-go |
| Yuandian Open Platform | 4 million+ regulations, 150 million+ judgment documents, enterprise litigation involvement | MCP / REST API | 50,000 points per month (April-July 2026) |
Recommended: Prioritize the Yuandian Open Platform (sufficient free quota during the promotional period), with PKULaw as a supplement (more authoritative data).
Quick start
Method 1: MCP direct connection (recommended, most complete data)
1. Configure Yuandian MCP (free quota, priority)
# 1. 访问 https://open.chineselaw.com/ 注册获取 API Key
# 2. 将以下配置添加到 WorkBuddy MCP 配置
# 配置示例:
{
"mcpServers": {
"yuandian-mcp-server": {
"command": "npx",
"args": ["-y", "yuandian-mcp-server"],
"env": {
"YUANDIAN_API_KEY": "你的_api_key"
}
}
}
}
2. Configure PKULaw MCP (authoritative supplement)
# 1. 访问 https://mcp.pkulaw.com/ 注册获取 Access Token
# 2. 在控制台购买需要的MCP服务
# 3. 将以下配置添加到 WorkBuddy MCP 配置
{
"mcpServers": {
"pkulaw-law-search": {
"type": "streamable-http",
"streamable": true,
"url": "https://apim-gateway.pkulaw.com/mcp-law-search-service",
"headers": {
"Authorization": "Bearer 你的_token"
}
}
}
}
After configuration, you need to click "Trust" on the WorkBuddy connector management page to enable it.
Method 2: Experience demo mode (no configuration required)
No API Key is required; use the built-in legal knowledge base to generate a demo report:
python ~/.workbuddy/skills/legal-search/scripts/demo.py "劳动合同纠纷"
Use cases
Scenario 1: Legal and regulatory retrieval
The user inputs a legal issue in natural language, and relevant legal provisions are automatically retrieved.
用户:查一下关于"网络侵权责任认定"的法律规定
The Skill automatically executes:
- Call Yuandian
yuandian_law_vector_searchsemantic retrieval - Filter by timeliness (prioritize currently effective)
- Return the original text of legal provisions + regulation name + level of authority
- Organize into structured results
Scenario 2: Judicial case verification
The user provides a case number or case keywords, and relevant judgment documents are retrieved.
用户:查案号"(2024)京0105民初12345号"的判决情况
The Skill automatically executes:
- Call PKULaw "Case Number Identification and Tracing" to precisely locate the case
- Obtain the original text of the judgment document
- Extract the trial court, judgment date, and judgment result
- Output a case summary
Scenario 3: Similar case analysis report
The user describes the case situation, and a similar case analysis report is automatically generated.
用户:分析"外卖骑手与平台之间的劳动关系认定"相关类案
The Skill automatically executes:
- Legal and regulatory retrieval: Retrieve relevant provisions of the Labor Contract Law
- Case retrieval: Semantically retrieve relevant judgment documents
- Similar case analysis: extract key judicial points, compare views of different courts
- Report generation: output an HTML report containing the original legal provisions, a case comparison table, and a distillation of judicial views
Workflow
用户输入法律问题/案号/案情描述
│
├─ 阶段1:法规检索
│ ├─ 元典语义检索 → 相关法条
│ ├─ 北大法宝关键词检索 → 补充法规
│ └─ 法条溯源验证 → 确认有效性
│
├─ 阶段2:案例查证
│ ├─ 有案号 → 北大法宝案号溯源
│ ├─ 无案号 → 元典/北大法宝语义案例检索
│ └─ 获取裁判文书摘要
│
├─ 阶段3:类案分析
│ ├─ 相似案例聚类(按案由/法院层级/裁判年份)
│ ├─ 裁判观点提炼与对比
│ └─ 法律适用差异分析
│
├─ 阶段4:报告生成
│ ├─ 合成结构化数据
│ ├─ 渲染HTML可视化报告
│ └─ 输出报告文件
│
└─ 输出:legal_report_{timestamp}.html
Agent Execution Instructions
When a user triggers a legal retrieval request, the Agent should execute the following steps:
Step 1: Parse user intent
Extract from user input:
- Retrieval type: legal provision retrieval / case verification / similar case analysis / comprehensive
- Query keywords: description of the core legal issue
- Known information: case number, legal provision name, court, time range, etc.
- Output format preference: brief result / detailed report
Step 2: Data retrieval (select based on intent)
Pure legal provision retrieval scenario:
优先使用元典 yuandian_law_vector_search
备选使用北大法宝 "检索法律法规-语义"
Case verification scenario:
有案号 → 北大法宝 "案号识别与溯源" → "检索司法案例-关键词"
无案号 → 元典案例语义检索 → 北大法宝 "检索司法案例-语义"
Similar case analysis scenario:
1. 先做法规检索(了解法律依据)
2. 再做案例检索(多组关键词,覆盖不同角度)
3. 最后做类案聚类分析
Step 3: AI analysis and integration
Perform the following on the retrieval results:
- Legal provision analysis: arrange by level of legal effect, mark timeliness, and extract the provisions most relevant to the case
- Case summary: extract the trial court, case number, judgment date, disputed issues, and judgment result
- Similar case comparison: create a comparison table of judicial views, marking consensus and disagreements
- Risk alerts: based on similar case results, indicate litigation risks and key evidence requirements
Step 4: Generate HTML report
Call scripts/report_generator.py to generate an interactive HTML report:
python ~/.workbuddy/skills/legal-search/scripts/report_generator.py \
--input <search_results.json> \
--output <report.html> \
--title "报告标题"
The report includes:
- Retrieval overview: retrieval conditions, data sources, result statistics
- Laws and regulations: original text of relevant legal provisions, level of legal effect, timeliness labels
- Case list: case summary cards (case number, court, judgment date, result)
- Similar case comparison: comparison table of judicial views + visualization charts
- Analysis recommendations: legal analysis recommendations based on similar cases
Technical architecture
用户输入
↓
[意图解析] → 识别检索类型与关键信息
↓
[MCP调用层] → 元典/北大法宝 API
↓
[数据整合] → 结构化法律数据
↓
[AI分析] → 类案聚类 + 观点提炼
↓
[报告生成] → scripts/report_generator.py
↓
HTML交互式报告
Notes
- 🔑 MCP configuration: first-time use requires registration and configuration of at least one data source (Yuandian free quota is sufficient)
- 📊 Number of results returned: case retrieval is recommended to be kept within 20-50 items to avoid an overly long report
- ⚖️ Timeliness: legal provision retrieval filters out invalid provisions by default and prioritizes currently effective provisions
- 💰 Cost control: Yuandian provides 50,000 free points per month; PKULaw is free for new users in the first month
- 🏛️ Data limitations: updates on China Judgments Online have narrowed since 2025; cross-validation with multiple data sources is recommended
- 📝 AI analysis: similar case analysis depends on AI model capabilities; it is recommended to refer to the original case texts for final judgment
Demo mode
Experience the full functionality without any API Key:
# 生成演示报告
python ~/.workbuddy/skills/legal-search/scripts/demo.py "外卖骑手劳动关系认定"
# 输出:legal_report_demo.html
The demo report is based on a built-in legal knowledge base and includes authentic original legal provisions and simulated case data.
Changelog
- v1.0.0 (2026-06-20): Initial version
- Supports Yuandian Open Platform MCP integration (semantic retrieval of laws and regulations + case retrieval)
- Supports PKULAW MCP integration (statute/case/case number tracing)
- Three major scenarios: statute search, case verification, similar-case analysis reports
- Interactive HTML visualization report output
- Built-in demo mode (experience it without an API Key)
Related Skills
contract-review: Contract Review Assistant (works with this skill to review contracts after searching relevant statutes)tender-analyzer: Bid Document Analysis (search for the legal basis of bidding and tendering regulations)fifteen-five-plan: 15th Five-Year Plan Interpretation (policy and regulation analysis)
Author: WorkBuddy Skill Creator Feedback: If you encounter any issues or have suggestions for improvement, please provide feedback in WorkBuddy