TradeGit AGENTS.md

Project-specific instructions for TradeGit, a private GitHub-based trading journal for recording trades and reviewing investment results.

In plain words
What is it for?
Use them to configure the journal, record or import trades, inspect holdings and results, and create Markdown or PDF review reports.
Why use it?
They define the required commands and workflow for storing transactions, importing broker records, and analysing profit and loss.

Instructions file for CodexOpenCode

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.

agentmods
npx agentmods add instructions/rollingsirius/tradegit/agents-md
Clone the repo
git clone --depth 1 https://github.com/rollingSirius/TradeGit

Made for: Codex, OpenCode.

Per session 1,334 This file is loaded in full into every session.
When invoked 1,334 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.01334 $0.01334
Opus 5 $0.00667 $0.00667
Sonnet 5 $0.00267 $0.00267
Haiku 4.5 $0.00133 $0.00133

Measured 2d ago against content hash a9ab29f93a68, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

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.

AGENTS.md · 75 lines

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 CLIWorkbuddy 和其他读 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

必须遵守的流程

  1. 首次使用:先 tradegit status --json。未初始化时,问用户选择 GitHub 私有仓库还是完全本地模式。用户选择本地时执行 tradegit init --local --json, 不需要 GitHub,也不会推送远端。用户选择 GitHub 时,先确认 GitHub 已连接 (gh auth loginGITHUB_TOKEN 环境变量),并在创建仓库前征得用户明确同意, 再执行 tradegit init --json。不要索要或存储 token 内容。
  2. 记录交易时必须有交易理由。用户没给 --why 就主动问一句;顺带问止损价 (有止损才能算 R 倍数)。
  3. 导入必须先 --dry-run,把识别到的券商、新增条数、时间范围、无法解析的行 讲给用户,确认后再真正写入。unparsed 里的行要念给用户,问清楚后手工补录,不要猜。
  4. 多币种不要自己加总。混合币种时 metrics 的金额为 null,真实数字在 by_currency;要合计就问用户汇率再传 --fx,并讲明用了什么汇率。
  5. 不下单、不给投资建议。只记录和统计。用户要求下单时说明工具边界。
  6. 本工具可以生成确定性的 Markdown/PDF 复盘报告,但不生成图表或交互面板。 用户要可视化时,用 analyze --json / roundtrips --json / sql --json 取数,再交给其他组件渲染。
  7. 私有仓库里只放交易记录,不写入任何凭证。

Read the full file on GitHub · 75 lines

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. 2d ago First seen · 75 lines · 1,334 tokens per session scan A a9ab29f93a68

Subscribe to this mod's changes

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.