Borrowing it
Nothing to install: this file belongs to xbfighting/tdx2db. 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/xbfighting/tdx2db/master/AGENTS.mdgit clone --depth 1 https://github.com/xbfighting/tdx2dbWrote 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/xbfighting/tdx2db/agents-md)<a href="https://agentmods.dev/instructions/xbfighting/tdx2db/agents-md"><img src="https://agentmods.dev/badge/instructions/xbfighting/tdx2db/agents-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/xbfighting/tdx2db/agents-md"><img src="https://agentmods.dev/badge/instructions/xbfighting/tdx2db/agents-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.02222 | $0.02222 |
| Opus 5.5 | $0.00889 | $0.00889 |
| Sonnet 5.5 | $0.00444 | $0.00444 |
| Haiku 4.5 | $0.00222 | $0.00222 |
Grade A, and why
tdx2db AGENTS.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 — 117 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md
面向 AI agent 的 tdx2db 使用指南。你(agent)在装有 tdx2db 的环境中同步、查询 A 股行情数据时,本文档是首要参考。贡献代码请另见 CLAUDE.md 与 CONTRIBUTING.md。
这是什么
tdx2db 读取本地通达信(TDX)行情软件的数据文件,增量同步到 PostgreSQL / MySQL / SQLite。产出物是一个可直接 SQL 查询的行情数据库——你不需要通过 tdx2db 读数据,直接查库即可;tdx2db 只负责写入。
通达信盘后数据下载 → tdx2db sync → 数据库 ← 你的 SQL 查询
CLI 速查
tdx2db sync # 日常唯一命令:增量同步日线 + 5/15/30/60 分钟线
tdx2db status # 只读:每表行数/覆盖股票数/日期范围(不需要 TDX_PATH)
tdx2db status --json # 机器可读,优先用这个
tdx2db stock-list --db-only # 同步股票列表
配置经 .env(从当前工作目录向上逐级查找)或全局参数 --tdx-path / --db-type / --db-name 等。密码只能放 .env,无命令行参数。退出码:0 成功,非 0 失败——但退出码 0 不代表数据写入成功,必须用 status 验证(见下"同步后验证")。
数据库 Schema
| 表 | 唯一约束 | 说明 |
|---|---|---|
daily_data |
(code, date) | 日线 OHLCV + 11 条均线 |
minute{5,15,30,60}_data |
(code, datetime) | 分钟线;15/30/60 由 5 分钟重采样 |
stock_info |
code | 股票列表:真实名称、zgb/ltag 总股本/流通A股(万股)、capital_date/list_date |
block_stock_relation |
(block_type, block_name, code) | 板块-个股关系,全量快照;block_type ∈ 行业/概念/指数/地区/风格/特殊 |
- 行情表通用列:
code, market, datetime, date, open, high, low, close, volume, amount, ma5, ma10, ma13, ma21, ma34, ma55, ma60, ma89, ma144, ma233, ma250 - 均线:
ma13/21/34/55/89/144/233是斐波那契窗口(缠论强弱分析主力),ma233常被当作年线;上市天数不足窗口的行为 NULL - 周线/月线没有表,由日线
resample得到 - 收录范围:深市 000/001/002/300/301、沪市 60xxxx/688xxx;无北交所、ETF、指数
典型查询(内部项目验证过的形态)
-- 1. 单票日线区间 + 均线
SELECT date, open, high, low, close, volume, amount,
ma5, ma13, ma21, ma34, ma55, ma89, ma144, ma233
FROM daily_data
WHERE code = '600036' AND date BETWEEN '2026-01-01' AND '2026-07-01'
ORDER BY date;
-- 2. 某日全市场截面(maN IS NOT NULL 兼作"数据成熟"哨兵,排除上市不足 N 日的新股)
SELECT code, close, ma5, ma13, ma233
FROM daily_data
WHERE date = '2026-07-03' AND ma233 IS NOT NULL;
-- 3. 最新交易日探测(加 ma5 条件确保当日指标已计算完成)
SELECT MAX(date) FROM daily_data WHERE ma5 IS NOT NULL;
-- 4. 按板块取成分(行业含一/二/三级;block_level=2 ≈ 通达信导出 CSV 的行业口径)
SELECT code FROM block_stock_relation
WHERE block_type = '行业' AND block_name = '煤炭开采';
SELECT DISTINCT block_name FROM block_stock_relation
WHERE block_type = '行业' AND block_level = 2; -- 全部二级行业(板块强弱迭代口径)
-- 5. 按个股查板块归属
SELECT block_type, block_code, block_name FROM block_stock_relation
WHERE code = '000001';
-- 6. 换手率(%):volume(手) / ltag(万股) 单位差恰好抵消
SELECT d.date, d.volume / s.ltag AS turnover_pct
FROM daily_data d JOIN stock_info s ON RIGHT(s.code, 6) = d.code
WHERE d.code = '000001' ORDER BY d.date DESC LIMIT 20;
-- 注意:股本为当前快照,股本变动点之前的历史换手率失真(精确历史需 gbbq)
-- list_date 上市日期可用于次新股过滤:WHERE s.list_date < CURRENT_DATE - 500
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 · 117 lines · 2,222 tokens per session scan A 4203d683fb9d
tdx2db AGENTS.md is an instructions file published in the GitHub repository xbfighting/tdx2db (177 stars, last pushed 1mo ago), licensed MIT. It adds 2,222 tokens to every session, about $0.0089 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.
tdx2db AGENTS.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| tdx2db AGENTS.mdxbfighting/tdx2db | Instructions file | 177 | 1mo ago | MIT | A | 2,222 | Codex, OpenCode |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | today | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | today | MIT | A | 4,680 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 5,516 | GitHub Copilot |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 275k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |