Borrowing it
Nothing to install: this file belongs to rollysys/use_cninfo. 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/rollysys/use_cninfo/main/CLAUDE.mdgit clone --depth 1 https://github.com/rollysys/use_cninfoWrote 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/rollysys/use_cninfo/claude-md)<a href="https://agentmods.dev/instructions/rollysys/use_cninfo/claude-md"><img src="https://agentmods.dev/badge/instructions/rollysys/use_cninfo/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/rollysys/use_cninfo/claude-md"><img src="https://agentmods.dev/badge/instructions/rollysys/use_cninfo/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.01791 | $0.01791 |
| Opus 5.5 | $0.00716 | $0.00716 |
| Sonnet 5.5 | $0.00358 | $0.00358 |
| Haiku 4.5 | $0.00179 | $0.00179 |
Grade A, and why
use_cninfo CLAUDE.md 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 2mo 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.
How it starts
The opening of the file, as written. The whole thing — 110 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
这个 repo 是什么
cninfo-cli — 一个按需召唤型的 A 股公告抓取工具:CLI + Python 包,顺带给 Claude Code 提供一个 skill 入口。从巨潮资讯网(cninfo.com.cn)拉公告 PDF + PyMuPDF 提取的 md 全文,落本地缓存,二次访问秒级。
不是后台调度系统,不是数据池,不做增量同步 — 全是一次性命令,跑完即停。
常用命令
# 开发环境
uv venv --python 3.10
uv pip install -e ".[dev]"
# 跑测试(离线,32 个)
uv run pytest # 全跑
uv run pytest tests/test_api.py # 单文件
uv run pytest -k "cache_hit" # 按名字过滤
# Lint
uv run ruff check src tests
uv run ruff check --fix src tests # 自动修
# 真机 smoke test(联网)
CNINFO_ALLOW_NETWORK=1 cninfo fetch-report 600519 --year 2024 --kind annual
# 重生成 fixture PDF(几乎不用)
python tests/fixtures/_make_pdf.py
架构关键点
单向依赖(从底到顶):
api.py ← 纯函数,cninfo HTTP 客户端 + 时区/标题清洗
parser.py ← PyMuPDF 包装
cache.py ← ~/.cache/cninfo/ 三件套读写 + orgid_map
orgid.py ← secCode→orgId(走 cninfo topSearch),用 cache.py 持久化
classify.py ← argus_legal 薄包装(动态 import,缺失时抛 ClassifierUnavailable)
fetcher.py ← 把上面拼起来:fetch_announcement / iter_* / find_periodic_report
cli.py ← argparse,6 个子命令
测试隔离:conftest.py autouse fixture 默认禁用真实网络(requests.{get,post} 抛错),要联网测时设 CNINFO_ALLOW_NETWORK=1 或在测试里 mock。
缓存命中策略:pdf + md + meta 三件齐全才算命中;任一缺失走未命中路径。--force 跳过命中检查。
接口约束(继承自 cninfo,不要尝试"修复")
详见 docs/gotchas.md 14 条。最关键的 4 条:
pageSize服务端硬限 30 — 必须翻页(api.py:query_all已处理)stock必须<6位>,<orgId>— 仅传 6 位返 0 条;本仓库通过topSearch拉 orgId(orgid.py),首次发现的 orgId 也会顺带缓存进orgid_map.jsonannouncementTime是 UTC epoch ms — 必须按北京时区转(api.py:epoch_ms_to_ann_date),否则跨日公告 ann_date 差一天- 同一公告可能有 2 条记录 — announcementId 不同 PDF 内容相同;
is_periodic_report_body已排除摘要/审计/内控,但全市场场景下用户需自行去重
改动指引
修接口参数 / 加 category / 加新场景:
- 改
api.py(常量 / 函数)→ 同步更新docs/api_reference.md那张表 - 加 fixture(
tests/fixtures/) → 加单测
新增 CLI 子命令:
cli.py的build_parser()加子 parser,cmd_xxx写动作,默认 JSON 优先 + 表格可选- 一定要在
tests/test_cli.py加一个走main([...])的覆盖(可只看返回码 / stderr)
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.
- 2mo ago First seen · 110 lines · 1,791 tokens per session scan A af9823648f6a
use_cninfo CLAUDE.md is an instructions file published in the GitHub repository rollysys/use_cninfo (33 stars, last pushed 6mo ago), licensed MIT. It adds 1,791 tokens to every session, about $0.0072 per session on Opus 5.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-08-30.
use_cninfo CLAUDE.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| use_cninfo CLAUDE.mdrollysys/use_cninfo | Instructions file | 33 | 6mo ago | MIT | A | 1,791 | Claude Code |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | yesterday | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | yesterday | MIT | A | 4,680 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 5,516 | GitHub Copilot |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |