Getting it into your agent
This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.
/plugin marketplace add Esonhugh/ibkr-trade-analyzer/plugin install ibkr-trade-analyzerWrote 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/commands/esonhugh/ibkr-trade-analyzer/china-tax-annual)<a href="https://agentmods.dev/commands/esonhugh/ibkr-trade-analyzer/china-tax-annual"><img src="https://agentmods.dev/badge/commands/esonhugh/ibkr-trade-analyzer/china-tax-annual/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.
<a href="https://agentmods.dev/commands/esonhugh/ibkr-trade-analyzer/china-tax-annual"><img src="https://agentmods.dev/badge/commands/esonhugh/ibkr-trade-analyzer/china-tax-annual.svg" alt="Reviewed on agentmods" width="80" 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.1 | $0.00018 | $0.00858 |
| Opus 5 | $0.00009 | $0.00429 |
| Sonnet 5 | $0.00004 | $0.00172 |
| Haiku 4.5 | $0.00002 | $0.00086 |
Grade A, and why
china-tax-annual 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 12d 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 — 57 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Use the china-tax skill as the primary official-source evidence and calculation workflow reference.
Generate a China resident annual overseas investment tax evidence review and informational calculation. This is not final filing advice.
Workflow
- Consult
skills/china-tax/references/official-tax-rules-and-implementation-plan.mdfor official-source rules, treaty references, foreign tax credit method, RMB conversion caveats, and guardrails. - Determine the tax year from
$ARGUMENTS; if absent, ask one clarifying question. - Confirm or state the user-provided assumption that the calculation is for a China tax resident individual; do not determine residency independently.
- Ensure IBKR data is loaded:
- If the user provided a local file path, call
ibkr_fetch_data(mode="file", source="<path>"). - Otherwise call
ibkr_fetch_data(mode="flex").
- If the user provided a local file path, call
- Filter and reconcile evidence to the selected tax year; mark out-of-year records separately.
- Call
ibkr_china_tax_annual_calc(tax_year=<year>)for the Phase 1 IBKR Flex dividend/withholding estimate using IBKR FX evidence. - If the user explicitly requests STK realized-gain evidence, call
ibkr_china_tax_annual_calc(tax_year=<year>, include_realized_pnl=True, realized_pnl_asset_types=["STK"], china_iit_property_transfer_rate=<rate or 0.20>)and keep realized-gain results separate from dividend/withholding estimates. - Call
ibkr_cost_analysisonly when extra fee, interest, or dividend reconciliation detail is needed. - Call
ibkr_pnl_summaryonly when broader realized P&L context is useful beyond the opt-in STK evidence table. - If official 1042-S reconciliation is needed, mark it as a manual review item outside the Phase 1 automated calculator. Do not invent RMB rates.
- Produce Markdown using the
china-taxoutput templates:
- Evidence Summary
- China IIT Estimate
- Treaty Withholding Sanity Check
- Missing Inputs / Review Required
- Filing Support Checklist
Script Usage
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.
- 12d ago First seen · 57 lines · 18 tokens per session scan A fa7934059913
china-tax-annual is a command published in the GitHub repository Esonhugh/ibkr-trade-analyzer (18 stars, last pushed 3mo ago), licensed MIT. It adds 18 tokens to every session and 858 once invoked, about $0.0001 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-30.
Other commands, from other repositories
tax-review
Tax-filing compliance check — invokes tax-reviewer to produce TM-tax-{slug}.md with MeF e-file schema, Form 8879, PTIN/Circular 230, and IRC §7216 consent gaps.
billing-rate
Gestiona tarifas y facturas de servicios legales. Subcomandos: set (definir tarifa), calculate (calcular honorarios), invoice (generar factura), report (análisis), list (listar tarifas).
filings
Scan recent filings on a company and surface material events (director changes, new charges, capital events, insolvency markers). Works on GB / IE / CA / IS / FI / IM / LI / MX / KR.
monitor
AML transaction monitoring and suspicious activity reporting.
tax-planning
Optimize tax liability or ensure tax compliance.
child-support-calc
A calculator for Japanese child support and marital living costs, using the revised standard calculation method published in 2019. Child support is money paid for a child after divorce; marital living costs are shared living expenses while spouses live apart.