tdx-dev-guide

tdx-dev-guide is a skill for Claude Code, Codex from Grid0723/skills. It costs 51 tokens per session (1,003 once invoked), scanned A, original, MIT.

A complete development process for adding a new TDX data fetcher. A fetcher retrieves data, while a cleaner converts it into the format used by the database.

In plain words
What is it for?
Use it to add a new market-data task, define its database table and field mappings, implement batch retrieval, connect it to the command-line scheduler, and validate dry-run output.
Why use it?
It gives developers a defined path through API research, database design, data cleaning, fetching, command registration, and verification, reducing the chance of missing a required integration step.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to add a new market-data task, define its database table and field mappings, implement batch retrieval, connect it to the command-line scheduler, and validate dry-run output.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/grid0723/skills/tdx-dev-guide
Install

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.

Any agent
npx skills add Grid0723/skills --skill tdx-dev-guide
Clone the repo
git clone --depth 1 https://github.com/Grid0723/skills

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for tdx-dev-guide

README.md
[![agentmods](https://agentmods.dev/badge/skills/grid0723/skills/tdx-dev-guide/github.svg)](https://agentmods.dev/skills/grid0723/skills/tdx-dev-guide)
Your own site
<a href="https://agentmods.dev/skills/grid0723/skills/tdx-dev-guide"><img src="https://agentmods.dev/badge/skills/grid0723/skills/tdx-dev-guide/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.

agentmods 80×15 button for tdx-dev-guide

Your own site · 80×15
<a href="https://agentmods.dev/skills/grid0723/skills/tdx-dev-guide"><img src="https://agentmods.dev/badge/skills/grid0723/skills/tdx-dev-guide.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,003 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00051 $0.01003
Opus 5.5 $0.00020 $0.00401
Sonnet 5.5 $0.00010 $0.00201
Haiku 4.5 $0.00005 $0.00100

Measured 1mo ago against content hash 9b81762cc3d4, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

tdx-dev-guide 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 1mo 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.

tdx/tdx-dev-guide/SKILL.md · 101 lines

What it actually says

tdx-dev-guide

新增一个 TDX 数据获取器的端到端开发流程。每一步有明确的交付物和验证点。

Leading Words

术语 定义
Cleaner → Fetcher 流水线 数据获取分两层:Cleaner(清洗+格式转换)→ Fetcher(调用 TQ API + 批量逻辑)
field_maps 单一事实源 字段分组只存 db/field_maps.py,CLI 和 Fetcher 都从此获取
注册制 新功能通过 @register_wizard 装饰器注册,无需修改 dispatch 逻辑

步骤

1. 分析 API 返回值

查阅 tdx-quant-docs skill 中的对应 API 文档,确认:

  • 参数格式(股票代码格式、日期格式)
  • 返回值类型和数据结构
  • 是否有批量上限(99 只)
  • 完成标准:能列出 API 的完整输入输出契约

2. 设计数据表

在 prisma/schema.prisma 中定义 model。遵守:

  • 金额字段用 DECIMAL(36,18)
  • 日期字段用 DateTime 或 Int(按 TQ API 约定)
  • 复合主键:(stock_code, date) 模式
  • 完成标准:schema 通过 prisma validate
  • 然后执行 prisma migrate dev 生成迁移

3. 编写 Cleaner

继承 WideTableCleaner(DataFrame 宽表路径)或独立 Cleaner:

  • 定义字段映射(原始字段名 → 数据库列名)
  • 实现数据清洗逻辑(类型转换、空值处理)
  • 单值函数注册在 cleaners/ 下
  • 完成标准:能用示例数据运行并产出正确格式

4. 编写 Fetcher

继承 BaseFetcher:

  • 实现 fetch() 方法——调用 TQ API
  • 实现 fetch_batch()——处理 99 只分片
  • 绑定 Cleaner 属性
  • 设置 task_type 用于 CLI 调度
  • 完成标准:dry_run=True 模式下能输出数据预览

5. 注册字段映射

在 src/db/field_maps.py 中注册新获取器的字段分组。CLI 层通过此获取可选的字段子集。

  • 完成标准:字段分组可被 CLI 的 interactive 模块读取

6. 注册到调度器

在 scheduler.py 中添加新任务类型:

  • 常驻模式(tdx run):注册为定时任务
  • 独立模式(tdx fetch):添加任务分支
  • 完成标准:CLI help 中出现新任务类型

7. 注册交互参数

在 src/interactive/ 中注册参数采集向导:

  • 添加 @register_wizard(task_type="xxx") 装饰器
  • 定义参数步骤(股票范围、日期范围、字段筛选)
  • 完成标准:tdx init 的交互菜单中出现新选项

8. 更新配置

若需要新的 config.yaml 节,在 Config dataclass 中添加字段。

  • 完成标准:配置加载无报错

9. 文档

  • 更新 docs/04-API/内部接口契约.md(新增 API 契约)
  • 更新 docs/03-Database/数据字典.md(新增表字段说明)
  • 更新 docs/CHANGELOG.md
  • 完成标准:文档与实现一致

10. 测试

按 tdx-test-spec 规范执行集成验证:

  • CLI 参数采集
  • dry_run 数据预览
  • 实际数据获取
  • 数据库写入验证
  • 完成标准:全部验收子项通过

约束

  • TQ SDK 是同步 API,Prisma 是异步——用 asyncio.to_thread() 桥接
  • 所有数据库写入走 batch_upsert
  • 日志用 loguru,遵循 loguru skill 规范
Changes

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.

  1. 1mo ago First seen · 101 lines · 51 tokens per session scan A 9b81762cc3d4

Subscribe to this mod's changes

tdx-dev-guide is a skill published in the GitHub repository Grid0723/skills (2 stars, last pushed 2mo ago), licensed MIT. It adds 51 tokens to every session and 1,003 once invoked, about $0.0002 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-31.