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 skills/grid0723/skills/tdx-dev-guidenpx skills add Grid0723/skills --skill tdx-dev-guidegit clone --depth 1 https://github.com/Grid0723/skillsWrote 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/skills/grid0723/skills/tdx-dev-guide)<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="Measured on agentmods" 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 | $0.00051 | $0.01003 |
| Opus 5 | $0.00026 | $0.00502 |
| Sonnet 5 | $0.00010 | $0.00201 |
| Haiku 4.5 | $0.00005 | $0.00100 |
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 4d 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.
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,遵循loguruskill 规范
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.
- 4d ago First seen · 101 lines · 51 tokens per session scan A 9b81762cc3d4
tdx-dev-guide is a skill published in the GitHub repository Grid0723/skills (2 stars, last pushed 12d ago), licensed MIT. It adds 51 tokens to every session and 1,003 once invoked, about $0.0003 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 skills, from other repositories
jpa-patterns
JPA/Hibernate patterns and common pitfalls (N+1, lazy loading, transactions, queries). Use when user has JPA performance issues, LazyInitializationException, or asks about entity relationships and fetching strategies.
api-patterns
API route implementation patterns with RLS, validation, and error handling. Use when creating API routes, implementing CRUD endpoints, adding server-side validation, handling webhooks, or implementing error handling patterns. Do NOT use for frontend-only changes or database migrations without API involvement.
rls-patterns
Row Level Security patterns for database operations. Use when writing any database query, creating API routes that access data, implementing webhooks that write to the database, or working with user data. Enforces withUserContext, withAdminContext, or withSystemContext helpers. NEVER use direct ORM/DB calls without…
migration-patterns
Database migration creation with mandatory RLS policies and ARCHitect approval workflow. Use when creating migrations, adding tables with RLS, updating ORM schema, adding GRANT statements, or planning data migrations. Do NOT use for application code changes without schema impact.
ghcrawl-cluster-operator
Use when inspecting a ghcrawl SQLite store, pulling GitHub issue/PR data, refreshing summaries, embeddings, and clusters, or extracting one cluster and its evidence through the ghcrawl CLI.
pattern-discovery
Pattern library discovery for pattern-first development. Use BEFORE implementing any new feature, creating components, writing API routes, or adding database operations. Ensures existing patterns are checked first.