yuandian-law-search

yuandian-law-search is a skill for Claude Code, Codex from ThomasMoreAI/legal-skills-open. It costs 41 tokens per session (7,543 once invoked), scanned A, original, Apache-2.0.

A search tool for Chinese legal provisions and court cases using the Yuandian open platform. It archives search results locally for later review.

In plain words
What is it for?
Use it to search Chinese laws, regulations, legal articles, and related cases when researching a legal question.
Why use it?
It provides source material for legal analysis and makes previous searches easier to revisit.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Codex.

Good fit Use it to search Chinese laws, regulations, legal articles, and related cases when researching a legal question.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/thomasmoreai/legal-skills-open/yuandian-law-search
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ThomasMoreAI/legal-skills-open --skill yuandian-law-search
Clone the repo
git clone --depth 1 https://github.com/ThomasMoreAI/legal-skills-open

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for yuandian-law-search

README.md
[![agentmods](https://agentmods.dev/badge/skills/thomasmoreai/legal-skills-open/yuandian-law-search/github.svg)](https://agentmods.dev/skills/thomasmoreai/legal-skills-open/yuandian-law-search)
Your own site
<a href="https://agentmods.dev/skills/thomasmoreai/legal-skills-open/yuandian-law-search"><img src="https://agentmods.dev/badge/skills/thomasmoreai/legal-skills-open/yuandian-law-search/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for yuandian-law-search

Your own site · 80×15
<a href="https://agentmods.dev/skills/thomasmoreai/legal-skills-open/yuandian-law-search"><img src="https://agentmods.dev/badge/skills/thomasmoreai/legal-skills-open/yuandian-law-search.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 7,543 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 6 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Privilege Escalation · line 36
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
  • high Privilege Escalation · line 51
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
  • high Privilege Escalation · line 53
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
  • high Privilege Escalation · line 60
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
  • high Privilege Escalation · line 64
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
  • high Privilege Escalation · line 52
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00041 $0.07543
Opus 5 $0.00020 $0.03771
Sonnet 5 $0.00008 $0.01509
Haiku 4.5 $0.00004 $0.00754

Measured 9d ago against content hash 485f4d9ba3b1, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

yuandian-law-search scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

cn/general/skills/yuandian-law-search/SKILL.md · 587 lines

How it starts

The opening of the file, as written. The whole thing — 587 lines — stays where its author put it; the contents beside it link to each section on GitHub.

元典法条与案例检索

通过元典开放平台 API 检索中国法律法规条文和案例。每次 API 调用消耗 1-50 积分(视接口而定)。所有检索结果会自动归档到本地,方便后续回溯。

前置要求(每次调用前自动检测)

每次使用本技能前,必须先执行以下检测流程,确认 API Key 已就绪:

检测步骤

  1. 检测 .env 文件:检查 scripts/.env 是否存在
  2. 检测 API Key:读取文件中 YD_API_KEY 的值,确认非空且不是占位符 your-api-key-here
  3. 若检测失败,向用户提示以下引导信息并终止:
⚠️ 元典 API Key 未配置。请按以下步骤获取并配置:

1. 注册/登录:访问 https://open.chineselaw.com ,使用手机号注册
2. 创建 API Key:登录后在个人中心创建 Key
3. 配置密钥:将 Key 填入以下文件

   scripts/.env
   ─────────────
   YD_API_KEY=sk-你的密钥
   # YD_STRATEGY=balanced
   ─────────────

每次调用消耗 10 积分,需在平台充值。
配置完成后重新发起检索即可。
  1. 若检测通过,继续执行用户请求的检索命令

检测命令

# 检测 .env 文件和 API Key
if [ -f "scripts/.env" ]; then
  KEY=$(grep '^YD_API_KEY=' scripts/.env | cut -d'=' -f2)
  if [ -n "$KEY" ] && [ "$KEY" != "your-api-key-here" ]; then
    echo "API Key 已就绪"
  else
    echo "API Key 未配置"
  fi
else
  echo ".env 文件不存在"
fi

# 读取检索策略
STRATEGY=$(grep '^YD_STRATEGY=' scripts/.env 2>/dev/null | cut -d'=' -f2)
echo "当前策略:${STRATEGY:-balanced}"

网络环境与推荐调用入口

默认使用 scripts/yd-run 执行检索,而不是直接调用底层 yd_search.pyyd-run 会以干净环境启动 Python:清除 Codex/代理相关环境变量,保留 HOMEPATH、语言环境、YD_API_KEYYD_STRATEGY,并继续读取 scripts/.envarchive/ 缓存。

scripts/yd-run search "正当防卫的限度" --sxx 现行有效

若遇到 nodename nor servname provided, or not known 或其他网络错误,先执行无积分消耗的网络检查:

scripts/yd-run --network-check

注意:yd-run 只能避免 Codex 进程环境变量、代理变量和 PATH 漂移造成的影响;如果 Codex 本身以网络沙箱启动,或系统代理/VPN 接管 DNS,子进程仍会受到系统级网络策略影响。终端 Codex 应使用 --sandbox danger-full-access --ask-for-approval never 启动。

接口速查

本技能共 35 个接口,分为四层。选择规则:

  1. 用户问"XX法怎么规定的" → 先用 search 语义检索
  2. 用户问"关于XX的法律条文" → 用 keyword 关键词检索
  3. 用户问"民法典第XX条" → 用 detail 精确获取
  4. 用户问"有没有XX相关的案例" → 用 case 关键词检索(默认普通案例)
  5. 用户问"类似XX的案件怎么判的" → 用 case-semantic 语义检索
  6. 用户要求更深入了解某案例 → 提醒用户将消耗积分,确认后用 case-detail
  7. 用户要求企业背景调查 → 先用 enterprise-search 定位,再用 enterprise-base/enterprise-summary 获取详情
  8. 用户要求查询企业分项信息(涉诉、商标、专利等) → 用 enterprise-list --type TYPE
  9. 用户要求检测文本中法规/案例是否准确 → 用 hall-detect

Read the full file on GitHub · 587 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 587 lines · 41 tokens per session scan A 485f4d9ba3b1

Subscribe to this mod's changes

yuandian-law-search is a skill published in the GitHub repository ThomasMoreAI/legal-skills-open (72 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 41 tokens to every session and 7,543 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.