docs: AGENTS.md + tdx2db-query skill — 面向 LLM agent 的数据使用指南 - #31
Merged
Conversation
- AGENTS.md:CLI 速查、schema、典型查询形态、五个真实事故背书的陷阱、 同步后验证流程、数据契约。内容提炼自内部消费项目的真实查询模式 - .claude/skills/tdx2db-query/SKILL.md:可操作查询手册(SQL 模板、 硬规则、同步问题排查表) - CLAUDE.md 明确面向贡献者并指向 AGENTS.md;README 提及两者 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- config/logger 的 load_dotenv 改为 find_dotenv(usecwd=True): 裸 load_dotenv 从包所在目录向上找,pip 安装用户放在工作目录的 .env 被静默忽略(pip 环境实测复现)。附子进程回归测试 (已验证:两处同时还原为裸调用时测试失败) - AGENTS/README:stock_info.name 占位符实际为 深Asz000001 式 (reader 用带前缀 code 拼接) - SKILL 排查表:单票重同步补 --incremental(否则唯一约束冲突报错) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Owner
Author
|
Review 修复已推送:
|
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
xbfighting
added a commit
that referenced
this pull request
Jul 6, 2026
0.3.0 补丁:pip 安装场景下工作目录 .env 被静默忽略(load_dotenv 默认从 site-packages 向上查找),已改为 usecwd=True(PR #31) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
新增面向 AI agent 的使用文档:仓库根
AGENTS.md(跨工具开放标准)+ Claude Code 项目级 skilltdx2db-query。agent 在本仓库环境下可直接正确同步与查询数据库。Related Issue
Closes #30
What Changed
AGENTS.md:CLI 速查(含 status --json)、schema 与均线列语义、3 种典型查询形态、5 个陷阱(每条有真实事故背书:code 格式静默零匹配、停牌静默错配、name 占位符、不复权、同步不完整算子集)、sync 后验证流程(status + 覆盖度自检 SQL)、数据契约.claude/skills/tdx2db-query/SKILL.md:操作化查询手册——SQL 模板(单票区间/全市场截面/最新交易日/分钟线/周月线聚合/覆盖度自检)、5 条硬规则、同步问题排查表CLAUDE.md定位为贡献者文档并指向 AGENTS.md;README 提及两者Why This Approach
Done Criteria Mapping
How to Test
纯文档改动。在仓库目录下启动 Claude Code,询问"帮我查 600036 最近一个月日线",agent 应使用 6 位纯数字 code 且不查 stock_info。
Risks / Tradeoffs
🤖 Generated with Claude Code