cn-law-hub

Search, verify, and download Chinese laws and regulations from ten official government databases.

71|15|Updated Jun 25, 2026
One-click install
npx skills add https://github.com/ZongziForu/cn-law-hub --skill cn-law-hub-zongziforu
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: cn-law-hub
Source: https://github.com/ZongziForu/cn-law-hub
Command: npx skills add https://github.com/ZongziForu/cn-law-hub --skill cn-law-hub-zongziforu

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires requests, urllib3, beautifulsoup4, cryptography, and includes scripts (resource) and references (resource) components.

What problem does it solve? Finding and verifying current Chinese statutes, regulations, rules, treaties, and specific legal articles requires manually searching multiple official government databases, each with different interfaces, and confirming whether a document is still in force. This Skill lets an AI agent query ten official PRC legal sources directly, filter by validity status, extract individual articles, and download official full texts. ## Core Features & Use Cases - Multi-source legal search: Query the NPC national laws database, State Council rules and policy libraries, MFA treaty database, Ministry of Justice regulations, Party regulations, tax, environmental, defense, and Supreme People's Court sources with title/full-text, exact/fuzzy, and validity-status filters. - Article-level retrieval: Preview a law's structure, pull a single article by number (Chinese or Arabic numerals), grep keywords within one law, or run cross-law article searches to locate every provision containing a term like "违约金". - Download and batch collection: Download official DOCX/PDF originals, export signed URLs, classify regulations by province/city, and run rate-limited batch collection of 200-300 documents with local caching. - Use Case: Ask the agent to find Article 38 of the Labor Contract Law in its currently effective version, or to list all effective local regulations on property management with official source URLs. ## Quick Start Ask the agent to look up Article 38 of the Labor Contract Law of China and cite the currently effective official version.

Frequently Asked Questions about cn-law-hub

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I search Chinese laws and regulations from official sources?▼

Run the included Python scripts with a keyword, for example scripts/download.py --search "物业管理条例" --exact --status 3 to query the NPC national laws database. Nine other crawlers cover the State Council, ministries, treaties, and the Supreme People's Court.

How can I find a specific article in a Chinese law?▼

Use scripts/download.py --article <bbbs_id> "第三十八条" to pull one article, accepting Chinese numerals, Arabic numbers, or bare digits. For keyword search across many laws, use scripts/article_search.py with --max-laws and --context options.

Does it filter for currently effective laws only?▼

Yes, the NPC database supports status codes where --status 3 returns only currently effective laws, and the Ministry of Justice source accepts --status effective. The Skill instructs agents to state validity only when the official page explicitly provides it.

Can I use this with Claude Code or other AI agents via MCP?▼

Yes, an optional MCP server (scripts/mcp_server.py) exposes five tools including search_laws and article_search to any MCP-compatible agent. It requires pip install "mcp>=2.0.0"; Claude Code reads the included .mcp.json automatically.

Why do some sources not support keyword search?▼

Several official sites like the Party regulations, defense, and environmental databases publish static HTML without a search API. For those, the scripts fetch category list pages and filter titles client-side, so only title matching is available.

What are the limitations of batch downloading regulations?▼

Batch collection of 200-300 documents works through the search and download APIs with adaptive rate limiting to avoid HTTP 429 errors. Signed download URLs expire, PDF format is unavailable for some laws, and Gov Rules authentication may need a restart on 401/403 errors.