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/rollingsirius/tradegit/agents-mdgit clone --depth 1 https://github.com/rollingSirius/TradeGitWhat 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.01334 | $0.01334 |
| Opus 5 | $0.00667 | $0.00667 |
| Sonnet 5 | $0.00267 | $0.00267 |
| Haiku 4.5 | $0.00133 | $0.00133 |
Grade A, and why
TradeGit 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 2d 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 — 75 lines — stays where its author put it; the contents beside it link to each section on GitHub.
TradeGit — GitHub 私有仓库交易日志(Codex / Workbuddy / 通用 agent 入口)
这份文件是给 Codex CLI、Workbuddy 和其他读
AGENTS.md的 agent 用的。 Claude Code / Claude Desktop / claude.ai / Workbuddy 读同目录下的SKILL.md,内容等价。
当用户要求记录一笔交易、导入券商流水、复盘/分析历史盈亏、查看持仓, 或首次要求配置交易日志时,使用本工具。
工具
只有一个零依赖 CLI(python3 + git 即可),所有命令都支持 --json:
<TRADEGIT_DIR>/scripts/tradegit <command> --json
安装脚本会尝试把它软链到 ~/.local/bin/tradegit。始终加 --json 并解析结果,
再用自然语言回复用户。
命令速查
| 目的 | 命令 |
|---|---|
| 环境/同步状态 | tradegit status --json |
| 首次连接 GitHub 并建私有仓库 | tradegit init --json |
| 首次创建完全本地账本 | tradegit init --local --json |
| 记录一笔交易 | tradegit log --symbol AAPL --side BUY --qty 100 --price 213.45 --why "理由" --stop 205 --json |
| 导入券商流水(先预览) | tradegit import --file <path> --dry-run --json |
| 导入券商流水(写入) | tradegit import --file <path> --json |
| 盈亏总览 | tradegit analyze --since 90d --json |
| Markdown 复盘报告 | tradegit report --since 90d --markdown --json |
| PDF 复盘报告 | tradegit report --since 180d --pdf --output report.pdf --json |
| 分组统计 | tradegit analyze --since ytd --group-by symbol --json |
| 亏损最重的平仓交易 | tradegit roundtrips --sort pnl --limit 10 --json |
| 当前持仓 | tradegit positions --mark AAPL=213.4 --json |
| 多币种折算 | tradegit analyze --fx HKD=0.128 --base-currency USD --json |
任意只读 SQL(表名 trades) |
tradegit sql "SELECT ..." --json |
| 检查远端是否有变动 | tradegit check --json(不同步时退出码 1) |
| 更正 / 作废记录 | tradegit amend <id> --review "..." --json / tradegit void <id> --json |
| 环境自检 | tradegit doctor --json |
时间参数支持 30d / 90d / 180d / 360d / 3m / 1y / ytd / mtd / 2026-01-01。
必须遵守的流程
- 首次使用:先
tradegit status --json。未初始化时,问用户选择 GitHub 私有仓库还是完全本地模式。用户选择本地时执行tradegit init --local --json, 不需要 GitHub,也不会推送远端。用户选择 GitHub 时,先确认 GitHub 已连接 (gh auth login或GITHUB_TOKEN环境变量),并在创建仓库前征得用户明确同意, 再执行tradegit init --json。不要索要或存储 token 内容。 - 记录交易时必须有交易理由。用户没给
--why就主动问一句;顺带问止损价 (有止损才能算 R 倍数)。 - 导入必须先
--dry-run,把识别到的券商、新增条数、时间范围、无法解析的行 讲给用户,确认后再真正写入。unparsed里的行要念给用户,问清楚后手工补录,不要猜。 - 多币种不要自己加总。混合币种时
metrics的金额为null,真实数字在by_currency;要合计就问用户汇率再传--fx,并讲明用了什么汇率。 - 不下单、不给投资建议。只记录和统计。用户要求下单时说明工具边界。
- 本工具可以生成确定性的 Markdown/PDF 复盘报告,但不生成图表或交互面板。
用户要可视化时,用
analyze --json/roundtrips --json/sql --json取数,再交给其他组件渲染。 - 私有仓库里只放交易记录,不写入任何凭证。
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.
- 2d ago First seen · 75 lines · 1,334 tokens per session scan A a9ab29f93a68
TradeGit AGENTS.md is an instructions file published in the GitHub repository rollingSirius/TradeGit (10 stars, last pushed 1mo ago), licensed MIT. It adds 1,334 tokens to every session, about $0.0067 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
tasty-agent AGENTS.md
Instructions for ferdousbhai/tasty-agent, covering tasty-agent, delivery, rules, index and commands.
investment-council CLAUDE.md
Instructions for vikd1000/investment-council, covering investment council workspace — identity file, what this workspace does, folder structure, your behavior in this workspace and critical rules.
robinhood-mcp AGENTS.md
Instructions for verygoodplugins/robinhood-mcp, covering agents.md, project overview, read-only is a hard invariant, build & development and install with dev dependencies (editable).
ib-mcp copilot-instructions.md
Instructions for Hellek1/ib-mcp, covering copilot instructions for ib-mcp, project overview, architecture, core components and mcp tools pattern.
claude-multi-agent-investing CLAUDE.md
Instructions for haiiibin/claude-multi-agent-investing, covering fa -- financial assistant, operating principles, position-size philosophy, account routing rules (canadian tax) and ⚠️ known data quirks.
market-sages CLAUDE.md
Instructions for hyhmrright/market-sages, covering market sages, 项目性质, 安装命令, 安装到 claude code and 验证安装.