Logotipo de Cn Law Hub

Cn Law Hub

Comunidad
ZongziForu
cn-law-hub

用于查询、检索、核验、下载、导出、批量采集中国官方法律法规、规章、条约和具体法条。Use this skill aggressively when the user asks to 查法律、查法规、查条例、查规章、查条约、查法条、查第几条、找法律依据、引用法律依据、核验现行有效、判断是否废止/已修改/尚未生效、下载法规全文、导出法规目录、批量下载法规文件、按关键词检索具体法条、展开法条分析,或在中国法律咨询、案例分析、合规审查、合同审查、劳动争议、行政法分析、公司合规、数据合规、政策研究中需要调用、核验或引用中国现行有效法律法规原文作为依据。Trigger also when phrases such as 依法、依规、依照法律规定、法律法规 imply a need to verify specific statutory authority or article-level text. Covers 国家法律法规数据库 (flk.npc.gov.cn), 国家规章库 (gov.cn), 外交条约库 (treaty.mfa.gov.cn), 国务院政策文件库 (sousuo.www.gov.cn), 司法部行政法规库 (xzfg.moj.gov.cn), 党内法规库 (12371.cn), 国防部法规文库 (mod.gov.cn), 税务法规库 (fgk.chinatax.gov.cn), 生态环境部法规规章 (mee.gov.cn), and 最高人民法院发布栏目 (court.gov.cn). Supports 标题/正文检索, 精确/模糊检索, 时效性过滤, 分类过滤, 分页, 排序, 单篇下载, 批量下载, 法条级抽取, 地区/制定机关分类, and browser fallback. Trigger when the answer may depend on current effective Chinese statutes, regulations, rules, treaties, article text, official document status, or official source attribution. Do not use for purely general legal theory, generic writing, or legal reasoning that does not require retrieving or verifying official Chinese legal documents.

Descripción general

EditorZongziForu
Repositoriocn-law-hub
Nombre de la habilidadcn-law-hub
Estrellas
90
Forks
16
Archivos incluidos
56
LicenciaApache-2.0
Enlaces
  • Instrucciones en Markdown

    Un archivo SKILL.md que el modelo carga cuando lo necesita, de modo que solo consume tokens cuando la petición encaja con la habilidad.

  • Funciona con cualquier LLM

    Las habilidades de IA están en Markdown, no en código específico de un proveedor, por lo que funcionan con GPT, Claude, Gemini, Grok o un modelo local.

  • Archivos incluidos: 56

    Scripts, plantillas y referencias que el modelo puede leer mientras trabaja. Los archivos son de solo lectura y nunca se ejecutan.

  • Código abierto

    Publicada por ZongziForu en GitHub. Revisa el contenido original antes de instalarla.

Instalación

Instala la habilidad de IA Cn Law Hub en TypingMind para usarla con cualquier LLM, o añádela a otro agente que lea SKILL.md.

1

Instalar en TypingMind

TypingMind instala una habilidad directamente desde su carpeta de GitHub: lee SKILL.md, empaqueta los archivos de recursos y guarda el resultado localmente.

  1. Abre la aplicación y ve a Plugins → Habilidades.
  2. Elige «Instalar desde GitHub».
  3. Pega la URL de la carpeta de la habilidad que se muestra a continuación y confirma.
    https://github.com/ZongziForu/cn-law-hub/tree/main
  4. Activa la habilidad en cada chat en el que quieras tenerla disponible.
Plugins → Habilidades → Añadir habilidad → URL de GitHub; después, pega la URL de la carpeta y pulsa Continuar.
2

Instalar en otro agente

Cualquier agente que lea el formato Agent Skills puede usar esta habilidad: copia la carpeta en el directorio de habilidades de ese agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ZongziForu/cn-law-hub.git \
  .claude/skills/cn-law-hub
Reinicia Claude Code después de copiarla para que detecte la nueva habilidad.

Úsala en TypingMind

Activa Cn Law Hub en cualquier chat de TypingMind y el modelo se encargará del resto. Su nombre y descripción se incluyen en el prompt del sistema y, en cuanto una petición encaja con la habilidad, el modelo carga las instrucciones completas por sí solo. No tienes que invocarla manualmente y no consume tokens hasta que se utiliza.

El modelo carga Cn Law Hub automáticamente en cuanto una petición es relevante para esa habilidad.

Funciona con cualquier modelo de IA

Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que Cn Law Hub no está vinculada al modelo para el que se creó. Instálala una sola vez en TypingMind y úsala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modelo local que ejecutes tú, todo con tus propias claves API.

  • Se carga solo cuando se necesita

    El prompt del sistema solo incluye el nombre y la descripción. Las instrucciones se cargan con la primera petición que encaja con la habilidad, por lo que una habilidad que no se usa no supone ningún coste.

  • Cambia de modelo durante el chat

    Como la habilidad contiene instrucciones y no código, cambiar de modelo no impide que funcione: el nuevo modelo lee el mismo archivo SKILL.md.

Instrucciones de la habilidad

Este es el contenido de SKILL.md que carga el modelo. Léelo antes de instalar la habilidad: contiene instrucciones que tu modelo seguirá.

Data Sources

#DatabaseScriptSourceType
1国家法律法规数据库 (NPC)scripts/download.pyflk.npc.gov.cnJSON API
2国家规章库 (Gov Rules)scripts/gov_rules_crawler.pygov.cn/zhengce/xxgk/gjgzkAthena API + HTML
3外交条约库 (Treaty)scripts/treaty_crawler.pytreaty.mfa.gov.cnHTML
4国务院政策文件库scripts/gov_policy_library.pysousuo.www.gov.cnREST API (GET)
5司法部行政法规库scripts/moj_law_crawler.pyxzfg.moj.gov.cnHTML
6党内法规库scripts/party_law_crawler.pywww.12371.cnHTML
7国防部法规文库scripts/mod_law_crawler.pywww.mod.gov.cnHTTP
8税务法规库scripts/tax_law_crawler.pyfgk.chinatax.gov.cnREST API (POST)
9生态环境部法规规章scripts/mee_law_crawler.pymee.gov.cnHTML
10最高人民法院发布栏目scripts/court_law_crawler.pycourt.gov.cnHTML

All scripts share --search, --info, --size, --output, --rate-limit, --no-cache, --cache-stats, --cache-clear. Run python <script> --help for full parameter lists.


Core Rules

Search Strategy (applies to ALL data sources)

Decide before calling the script — never default to fuzzy for everything:

  • Known title (e.g. "物业管理条例", "北京市生活垃圾管理条例"): use --exact to reduce noise.
  • Broad topic (e.g. "出租车", "环境保护"): use fuzzy search (default).
  • Full-text match: add --range content when you need documents where the keyword appears in the body, not just the title.
  • Ambiguous: ask the user, or run both exact+fuzzy and compare.

Status Filtering

NPC status codes (sxx / --status):

CodeMeaning
1已废止
2已修改
3现行有效
4尚未生效

Other sources use their own status values (e.g. --status effective for MoJ). Check --help per script.

Article-Level Queries (NPC)

For individual articles instead of full documents:

CommandWhenOutput
--preview <id>Understand structure firstTitle, article count, TOC
--article <id> "第X条"Know the article numberSingle article text
--article <id> --grep "kw"Find articles by keyword in one lawAll matching articles

Supports Chinese numerals (第三十八条), Arabic (第38条), or bare numbers (38).

For cross-law article search, use scripts/article_search.py <keyword> --max-laws N.

Rate Limiting

Auto mode picks by estimated requests: OFF (≤10), FIXED 5 req/s (11–100), ADAPTIVE 1–8 req/s with 429 backoff (>100). Override: --rate-limit {off|fixed|adaptive}.

Caching

Local file cache enabled (~/.cache/ per namespace). Search results: 1h TTL. Detail metadata: 24h. DOCX: 7 days. Use --no-cache to bypass, --cache-stats to inspect.


Validity Rules — MANDATORY

  1. Only state 现行有效, 已废止, 已修改, or 尚未生效 when the official page or API response explicitly provides that status.
  2. If the source has no explicit validity field, say: "官方页面未明确标注效力状态".
  3. Do not infer validity from file accessibility or recency of publication date.
  4. Always return: official URL, file type, issuing authority, publication date, and retrieval date — even when status is absent.
  5. For same-name / multi-version documents, flag the ambiguity and verify amendment, repeal, and effective-date information.
  6. Distinguish document types: 法律, 行政法规, 地方性法规, 规章, 司法解释, 司法文件, 党内法规, 政策文件, 通知, 案例, 条约. Do not conflate.
  7. Never write "现行法律" as a generic label for all official publications.

Document Type Attribution

When reporting results, always identify the document type and source database explicitly. Use the format:

来源: [数据库名称] ([URL])
文件类型: [法律/行政法规/规章/司法解释/党内法规/政策文件/通知/...]
发布机关: [authority]
发布日期: [date]
效力状态: [现行有效/已废止/...] 或 "官方页面未明确标注效力状态"


Script Routing Summary

ScriptPurposeKey flagsOutput dir
scripts/download.pyNPC search, download, article, preview--search, --exact, --range, --status, --download, --article, --preview, --urls-onlystdout, files
scripts/article_search.pyCross-law article-level searchkeyword, --law, --range, --max-laws, --context, --json, --offset, --resumestdout
scripts/gov_rules_crawler.pyGov.cn rules--search, --categories, --download, --infogov_rules_output/
scripts/treaty_crawler.pyMFA treaties--search, --collections, --download, --infotreaty_output/
scripts/gov_policy_library.pyState Council policies--search, --range, --category, --yeargov_policy_output/
scripts/moj_law_crawler.pyMoJ admin regulations--search, --range, --statusmoj_law_output/
scripts/party_law_crawler.pyParty regulations (12371.cn)--search, --categoryparty_law_output/
scripts/mod_law_crawler.pyMOD law library--search, --categorymod_law_output/
scripts/tax_law_crawler.pyTax regulations (chinatax)--search, --categorytax_law_output/
scripts/mee_law_crawler.pyMEE env regulations--search, --categorymee_law_output/
scripts/court_law_crawler.pySPC announcements--search, --categorycourt_law_output/
scripts/region_classifier.pyProvince/city classification--classify, --matrixJSON/CSV

Each script has --help. Run it for detailed parameter lists.


Reference Files

Read these on demand, not proactively:

FileRead when...
references/setup.mdFirst run, dependency issues, or switching agent environments
references/api_reference.mdNeed full NPC API payloads, field mappings, auth, or pagination details
references/gov_rules_api_reference.mdGov Rules auth issues (401/403) or response field parsing
references/gov_policy_api_reference.mdNeed State Council API parameter details beyond --help
references/treaty_api_reference.mdTreaty HTML structure or field extraction patterns
references/page_structure.mdBrowser automation — page layout, selectors, UI-only search flow
references/kimi_bridge_adapter.mdRunning on Kimi Agent or Claude Code + kimi-webbridge
references/codex_adapter.mdRunning on Codex
references/batch_collection.mdLarge-scale collection (200+ items), batch download workflows

Browser fallback: only when the API/script fails or UI-only search is required. Read references/page_structure.md first.


Key Notes by Data Source

  • NPC: ossFile paths from detail API are not directly downloadable — always use --download. bbbs = unique law ID.
  • Gov Rules: Requires dynamic RSA auth from the frontend JS bundle; may expire during long runs. Restart on 401/403.
  • Treaty: Pure HTML, no API. Collections: 全部, 双边, 多边.
  • Party Law (12371.cn): No search API; keyword filtering is client-side on titles only.
  • MOD: Static HTML, no search API. Client-side title filtering.
  • Tax: POST API, requires session cookie (auto-managed). Channel ID auto-discovered.
  • MEE: Static HTML, categories pre-loaded in page. No search API. Standards (环保标准) excluded.
  • Court: List pages paginated (/fabu/gengduo/{id}.html → {id}_{n}.html). No search API.

Archivos incluidos

El modelo los lee según los necesita mientras la habilidad está cargada. Son archivos de solo lectura y nunca se ejecutan.

Preguntas frecuentes

¿Qué hace la habilidad de IA Cn Law Hub?

用于查询、检索、核验、下载、导出、批量采集中国官方法律法规、规章、条约和具体法条。Use this skill aggressively when the user asks to 查法律、查法规、查条例、查规章、查条约、查法条、查第几条、找法律依据、引用法律依据、核验现行有效、判断是否废止/已修改/尚未生效、下载法规全文、导出法规目录、批量下载法规文件、按关键词检索具体法条、展开法条分析,或在中国法律咨询、案例分析、合规审查、合同审查、劳动争议、行政法分析、公司合规、数据合规、政策研究中需要调用、核验或引用中国现行有效法律法规原文作为依据。Trigger also when phrases such as 依法、依规、依照法律规定、法律法规 imply a need to verify specific statutory authority or article-level text. Covers 国家法律法规数据库 (flk.npc.gov.cn), 国家规章库 (gov.cn), 外交条约库 (treaty.mfa.gov.cn), 国务院政策文件库 (sousuo.www.gov.cn), 司法部行政法规库 (xzfg.moj.gov.cn), 党内法规库 (12371.cn), 国防部法规文库 (mod.gov.cn), 税务法规库 (fgk.chinatax....

¿Por qué usar Cn Law Hub en TypingMind?

Porque la instalas una vez y la usas con cualquier modelo. Cn Law Hub está escrita en Markdown, no en código específico de un proveedor, por lo que la misma habilidad funciona con GPT-5, Claude, Gemini, Grok o un modelo local, y puedes cambiar de modelo en mitad del chat sin que deje de funcionar. TypingMind utiliza tus propias claves API, de modo que pagas directamente a los proveedores en lugar de pagar una suscripción por puesto, y tus habilidades y chats permanecen en tu propio almacenamiento.

¿Cómo instalo Cn Law Hub en TypingMind?

Abre Plugins → Habilidades → Instalar desde GitHub en TypingMind y pega https://github.com/ZongziForu/cn-law-hub/tree/main. TypingMind lee el archivo SKILL.md de esa carpeta, empaqueta los archivos de la carpeta e instala el conjunto como una habilidad que puedes activar en cada chat.

¿Qué modelos de IA pueden usar Cn Law Hub?

Cualquier modelo que conectes en TypingMind. Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que GPT, Claude, Gemini, Grok y los modelos locales pueden cargar esta habilidad cuando una solicitud se corresponda con ella.

¿Con cuántos modelos de IA puedo usar Cn Law Hub?

Con tantos como quieras. Siempre que un modelo admita habilidades, puedes usar Cn Law Hub con él: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama y muchos más, todos en TypingMind con tus propias claves API.

¿Es gratuita la habilidad de IA Cn Law Hub?

Sí. ZongziForu la ha publicado en GitHub bajo la licencia Apache-2.0. Solo pagas a tu proveedor de IA por los tokens que utilizas.

¿Qué son las habilidades de IA?

Una habilidad de IA es un conjunto de instrucciones reutilizables que enseña a un modelo de IA a realizar una tarea concreta. Sigue el formato abierto Agent Skills: un archivo SKILL.md con un nombre y una descripción, además de los scripts, plantillas o archivos de referencia que pueda necesitar el modelo. El modelo solo lee las instrucciones cuando tu solicitud se corresponde con la habilidad, por lo que una habilidad instalada no supone ningún coste hasta que se utiliza.

¿En qué se diferencian las habilidades de IA de los plugins o los servidores MCP?

Un plugin o un servidor MCP proporciona al modelo nuevas herramientas que puede invocar: código que se ejecuta en algún lugar y devuelve un resultado. En cambio, una habilidad de IA aporta conocimientos y procedimientos al modelo: cómo abordar una tarea, qué pasos seguir y qué se considera un buen resultado. Las habilidades son instrucciones en Markdown, por lo que no necesitan servidor, clave API ni entorno de ejecución, y funcionan con cualquier modelo.

Ver el directorio

Crea ya tu propio espacio de trabajo con IA

Suscríbete a nuestro boletín para recibir avisos sobre nuevas funciones y próximos sorteos 👇