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.
npx agentmods add instructions/tingdeliu/quant.ai/agents-mdgit clone --depth 1 https://github.com/TingdeLiu/quant.aiWhat 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 | $0.00844 | $0.00844 |
| Opus 5 | $0.00422 | $0.00422 |
| Sonnet 5 | $0.00169 | $0.00169 |
| Haiku 4.5 | $0.00084 | $0.00084 |
Grade A, and why
quant.ai 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 yesterday.
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 — 29 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md
quant.ai:接入 Codex/Codex(MCP)的美股量化研究助手。Research only —— 永远不下单、不审批、不接券商;持仓是用户口述的记账数据,仅作研究上下文。
常用命令
python -m pytest # 全部测试(离线,无网络)
python -m ruff check quant_agent tests conftest.py
python -m quant_agent.mcp_server # MCP server(stdio)
quant-ai market-report # 每日报告(默认 configs/my.yaml,存在时)
架构速览
config.py— frozen dataclass 体系;parse_config(raw, base);路径一律_resolve_path(base, ...)解析。portfolio_path默认data/portfolio.json。data.py— 滚动价格数据库:按 universe 哈希键控的 CSV(data/cache/prices_{n}_{hash}.csv),每日至多刷新一次、≤10 年、按标的增量追加;universe 变化时从旧缓存播种(_seed_from_sibling_caches),不整库重下。holdings.py— 聊天管理的自选/持仓存储(data/portfolio.json,原子写;损坏 JSON 必须报错而非返回空,防止后续保存毁数据);apply_portfolio_universe把用户标的叠加进 universe;build_holdings_snapshot算盈亏(实时价尽力取、降级最新收盘)。market_intel.py— 每日报告:build_market_report(payload)+ 三个渲染器render_markdown/render_html(整页,允许网络字体)/render_artifact_html(自包含片段,零外链,明暗双主题)。三者共享_html_*section 构建器;持仓段永远排第一。mcp_server.py— FastMCP,10 个quant_*工具。约定:pydantic 输入模型继承_Base(extra="forbid")、async +asyncio.to_thread、异常统一_err()返回{"error": ...};_load()统一叠加 portfolio universe。
项目约定
- 项目不调用任何 LLM API。服务端只产出可核对的事实:量化统计、规则评级、第三方一致预期、手写归纳。综合、叙述、对话交给挂载 MCP 的宿主客户端。没有
llm.py、没有LLMConfig、没有/api/chat,也不要加回来。 - 测试必须离线:
data.source=csv+tests/_helpers._synthetic_prices();market_intel: {news_feeds: [], social_enabled: false, symbol_news_count: 0};实时价用注入/monkeypatch(quant_agent.holdings.fetch_live_quotes)。无 pytest-asyncio,MCP 工具测试用asyncio.run()直调。 - 双语:面向用户的字符串用
tr(en, zh, lang)(i18n.py),英中并排书写。 - 报告即 artifact:生成报告后按 MCP instructions 呈现 —— 有文件访问时直接发布
artifact_html_path;否则quant_read_report('market_intel_artifact.html')取 HTML;最后才用report_markdown。免责声明必须保留。 data/portfolio.json只经holdings.py/ 两个 MCP 管理工具读写;它是叠加层,refresh-universe重新生成my_universe.csv不影响它。
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.
- yesterday First seen · 29 lines · 844 tokens per session scan A 7a804da8ab62
quant.ai AGENTS.md is an instructions file published in the GitHub repository TingdeLiu/quant.ai (2 stars, last pushed 18d ago), licensed MIT. It adds 844 tokens to every session, about $0.0042 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-08-31.
Other instructions, from other repositories
martex-quant CLAUDE.md
Instructions for martex-dev/martex-quant, covering session start — read these first, project instructions, ai trading bot project - master instructions, role and project objective.
tiingo-mcp AGENTS.md
Instructions for major7apps/tiingo-mcp, covering agents.md, project map, public contract, operating rules and commands.
open-stocks-mcp CLAUDE.md
Instructions for Open-Agent-Tools/open-stocks-mcp, covering claude.md, project overview, quick reference, development setup and testing.
keel-trade AGENTS.md
AGENTS.md instructions for keel-trade/keel-trade, covering keel agent sdk, choosing a surface, install, first contact and authentication.
aifolimizer CLAUDE.md
Instructions for tusharagg1/aifolimizer, covering aifolimizer - project context, session startup (read every new session), what this is, architecture and how to start.
darwinia AGENTS.md
Instructions for 0xSanei/darwinia, covering darwinia — instructions for ai agents, what is darwinia?, quick commands, install and run evolution (default: 50 gens, 50 agents, btc 1h data).