Borrowing it
Nothing to install: this file belongs to WIndFate/legal-ai-agent. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/WIndFate/legal-ai-agent/main/CLAUDE.mdgit clone --depth 1 https://github.com/WIndFate/legal-ai-agentWrote 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.
[](https://agentmods.dev/instructions/windfate/legal-ai-agent/claude-md)<a href="https://agentmods.dev/instructions/windfate/legal-ai-agent/claude-md"><img src="https://agentmods.dev/badge/instructions/windfate/legal-ai-agent/claude-md/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.
<a href="https://agentmods.dev/instructions/windfate/legal-ai-agent/claude-md"><img src="https://agentmods.dev/badge/instructions/windfate/legal-ai-agent/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01990 | $0.01990 |
| Opus 5 | $0.00995 | $0.00995 |
| Sonnet 5 | $0.00398 | $0.00398 |
| Haiku 4.5 | $0.00199 | $0.00199 |
Grade A, and why
legal-ai-agent CLAUDE.md scanned grade A with 1 finding 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.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
curl http://localhost:8000/api/health # 健康检查 How it starts
The opening of the file, as written. The whole thing — 121 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Repository Agent Instructions — 契約チェッカー (ContractGuard)
This file is mirrored in AGENTS.md for tool compatibility. Keep the two files in sync on every edit.
This document contains behavior rules for AI agents working in this repo. Keep implementation details in the README files and source code; do not duplicate long status snapshots here.
开始任务前
先读 README.md 和与任务直接相关的源码 / 测试。CLAUDE.md / AGENTS.md 只写行为规则,不保存产品路线图、进度快照或审计清单。
项目一句话
面向日文合同风险分析场景的开源 AI 工程案例。技术栈:LangGraph + pgvector + FastAPI + React/Vite + Redis + KOMOJU reference implementation。合同分析后立即删除,报告 Redis 缓存 72h。
运行与验证(只用 Docker,严禁直接跑 Python)
docker compose up --build # 启动
docker compose up --build backend # 后端改动后
docker compose logs -f backend # 查日志
curl http://localhost:8000/api/health # 健康检查
Docker 纪律:
- 优先
docker compose exec,避免docker compose run(会留下*-run-*孤儿容器阻塞down)。 - 如必须用
run,加--rm并立即清理。
本地回归脚本(完成一个逻辑单元后自行跑):
scripts/smoke_local_flow.sh # 端到端冒烟
scripts/check_locale_keys.sh # 9 语言 i18n key 一致性
scripts/check_rag_eval.sh # RAG Recall@5 / MRR 基线
scripts/run_backend_pytests.sh # 后端 pytest
Git 提交纪律(强约束)
每完成一个最小逻辑单元立即提交。禁止攒改动。
- 新文件 = 一次提交;同一功能模块的 2–5 个相关文件 = 一次提交。
- Bug 修复、文档更新、依赖/配置变更各自独立提交。
- 提交信息清晰描述做了什么(例:
Add SQLAlchemy Order/Report/Referral models),不要写Update multiple files。 - ❌ 提交消息不得包含
Co-Authored-By或任何 Claude 签名。 - ❌ 提交前不要跳 hook(
--no-verify等)。
文档同步纪律
功能里程碑(完整模块完成)时,同步更新 README.md + README_CN.md + README_JA.md,必要时同步 CLAUDE.md + AGENTS.md。日常微小提交不需要每次都更新全部文档。
分工底线:
- AI 行为规则 → CLAUDE.md + AGENTS.md(镜像)
- 开源项目说明 / 运行方式 / 架构摘要 → README.md + README_CN.md + README_JA.md
架构铁律(Do-Not-Break)
以下约定是刻意的设计,不要"顺手优化回去":
- RAG 在 tool 内部:
analyze_clause_risk(clause_text)直接调用get_store().search()。不要加回retrieve_knowledge节点或search_legal_knowledgetool;不要把 RAG 结果预注入 prompt。 AgentState字段固定:contract_text / clauses / risk_analysis / review_report / messages / target_language。不要加回rag_results或current_clause_index。- 逐条分析,非整合同对话:
analyze_risks对每个 clause 单独跑analyze_clause_risk → gpt-4o 分级 → 仅高/中风险触发 generate_suggestion。不要恢复"整合同一轮大 prompt"模式。 - 合同文本永不入向量库:
legal_knowledge_embeddings只存 e-Gov 法条;用户合同仅查询,分析完即删。 - 报告翻译时保持日文原文:
referenced_law、clause_number必须保留日文;risk_reason / suggestion / summary / risk_level / overall_risk才翻译到目标语言。见_translate_report()。 - ReviewPage 不暴露内部工具名:不要把
analyze_clause_risk这类名字显示给终端用户。 analysis_executor持久化事件流是主链路:HTTP 不再由单次 SSE POST 直接驱动分析。前端通过status + events/?after_seq= + stream?after_seq=恢复。- 失败终止 vs 继续分析:
parse_contract判定非合同时立刻以error_code = non_contract_document终止,不要继续走 risk review。ReviewPage 用error_code而非本地化error_message判断失败类型。 - KOMOJU session 不发送
payment_types:方法由商户账号审核控制;不要在代码里列支付方式白名单。 - 订单 UUID 路径统一走
routers/_helpers.parse_order_id:非法 UUID 返回 404,不要暴露 SQL DataError 500。 - OCR 供应商固定为 Google Cloud Vision:图片和扫描 PDF 统一走
DOCUMENT_TEXT_DETECTION,不要换回 GPT-4o Vision,也不要恢复“付款前低成本 OCR / 付款后正式 OCR”双层路径。遗留的temp_uploads.py、orders.temp_upload_*列及upload_token / upload_name / upload_mime_type请求字段已在迁移 011 中彻底移除,不要恢复。 - 高成本预付费路径必须 fail-closed:OCR / preview 的 Redis 或预算守卫异常必须直接拒绝请求,不要在高成本匿名入口上做 fail-open。
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.
- 9d ago First seen · 121 lines · 1,990 tokens per session scan A a4932850370c
legal-ai-agent CLAUDE.md is an instructions file published in the GitHub repository WIndFate/legal-ai-agent (1 stars, last pushed 4mo ago), licensed MIT. It adds 1,990 tokens to every session, about $0.0100 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other instructions, from other repositories
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
spec-kit AGENTS.md
AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.