yd-case-search

yd-case-search is a skill for Claude Code, Codex from ThomasMoreAI/legal-skills-open. It costs 104 tokens per session (1,238 once invoked), scanned A, original, Apache-2.0.

A case-search tool for finding Chinese court cases, similar cases, and notable or authoritative decisions. It supports keyword searches, meaning-based searches, filters, and retrieval of selected case details.

In plain words
What is it for?
It is for searching by legal issue, cause of action, court, region, date, case number, or title, then opening the full text of the most relevant cases.
Why use it?
It reduces the time needed to locate relevant decisions for legal research. It finds cases but does not provide the final legal analysis or conclusion.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: reads .claude/ paths.

Good fit It is for searching by legal issue, cause of action, court, region, date, case number, or title, then opening the full text of the most relevant cases.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/thomasmoreai/legal-skills-open/yd-case-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 yd-case-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 yd-case-search

README.md
[![agentmods](https://agentmods.dev/badge/skills/thomasmoreai/legal-skills-open/yd-case-search/github.svg)](https://agentmods.dev/skills/thomasmoreai/legal-skills-open/yd-case-search)
Your own site
<a href="https://agentmods.dev/skills/thomasmoreai/legal-skills-open/yd-case-search"><img src="https://agentmods.dev/badge/skills/thomasmoreai/legal-skills-open/yd-case-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 yd-case-search

Your own site · 80×15
<a href="https://agentmods.dev/skills/thomasmoreai/legal-skills-open/yd-case-search"><img src="https://agentmods.dev/badge/skills/thomasmoreai/legal-skills-open/yd-case-search.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 104 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,238 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.
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.00104 $0.01238
Opus 5 $0.00052 $0.00619
Sonnet 5 $0.00021 $0.00248
Haiku 4.5 $0.00010 $0.00124

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

Security

Grade A, and why

yd-case-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/litigation/skills/yd-case-search/SKILL.md · 106 lines

How it starts

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

定位

案例检索型 skill,负责把相关案例和类案快速捞出来。

  • 它负责:案例关键词检索、类案语义检索、按法院/地区/案由/时间筛选、案例详情
  • 它不负责:直接替代完整法律分析
  • 与现有 skill 的关系:
    • yd-case-search:找案例(本 skill)
    • yd-law-search:找法条和规范依据
    • cs-china-lawyer-analyst:把案例和法条整合成法律意见
    • legal-research:上层编排技能,按"查法规→查案例→出备忘录"调度上述三者

API Key 配置

yd-law-search 相同,按以下顺序读取:

  1. YD_OPEN_API_KEY
  2. ~/.yd_open_api_key
  3. YD_API_KEY
  4. ~/.yd_api_key
  5. 脚本目录 .api_key

申请入口:https://open.chineselaw.com/

工作流(重要)

  • 默认搜索只返回元数据 + 高亮/要旨片段,不返回全文。
  • 当需要某案例的全文时,使用 case_detail 配合 id 与 type(ptal/qwal)拉取。
  • 不要在搜索后立即对全部命中调用详情接口;先筛 1-3 条最相关的再下钻。
  • --full 开关用于调试或用户明确要求全文展示时使用。

子命令

1. search_al — 案例关键词/筛选检索

适合:已有关键词、案由、法院、案号、标题,要做筛选式案例研究。

路由:

  • authority_only=true → 走 /open/rh_qwal_search(权威/典型案例)
  • 否则 → 走 /open/rh_ptal_search(普通案例)
  • 不主动同时打两边(避免 2× 积分)。如需两边都看,请显式分两次调用。

2. search_al_vector — 案例语义检索

适合:用自然语言描述争议焦点、做类案语义检索。

3. case_detail — 案例详情

按 id 拉单个案例全文。必须传 typeptal(普通)或 qwal(权威)

调用方式

# 1. 关键词检索(普通案例)
echo '{"ay":["买卖合同纠纷"],"xzqh_p":["北京"],"qw":"违约金 逾期","top_k":5}' | \
  python3 ~/.claude/skills/yd-case-search/scripts/yd_case_search.py search_al --stdin

# 2. 关键词检索(权威案例)
echo '{"qw":"人工智能","authority_only":true}' | \
  python3 ~/.claude/skills/yd-case-search/scripts/yd_case_search.py search_al --stdin

# 3. 案例语义检索(带筛选)
echo '{"query":"正当防卫的限度","wenshu_filter":{"ja_start":"2020-01-01","ja_end":"2025-12-31"}}' | \
  python3 ~/.claude/skills/yd-case-search/scripts/yd_case_search.py search_al_vector --stdin

# 4. 案例详情(按 id)
echo '{"id":"183fe9bf6e95f51fab804e383854a51f","type":"ptal"}' | \
  python3 ~/.claude/skills/yd-case-search/scripts/yd_case_search.py case_detail --stdin

通用 flag:

  • --stdin / --full / --raw(同 yd-law-search)

使用规则

  • 「查有没有相关案例」→ 优先 search_al_vector
  • 「精确筛选、限定字段」→ 优先 search_al
  • 用户明确要求"只看权威/典型案例" → authority_only=true
  • 默认 top_k = 8;展示时至少保留:标题、案号、案件类别、经办法院、裁判日期、id(含 type)、链接
  • 如需从案例中抽取裁判规则并论证适用,再交给 cs-china-lawyer-analyst

Read the full file on GitHub · 106 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 · 106 lines · 104 tokens per session scan A 5a07c50615dd

Subscribe to this mod's changes

yd-case-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 104 tokens to every session and 1,238 once invoked, about $0.0005 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.