Ib portfolio analyst
Skill luyangkk/ib-suite/skills/ib-suite/ib-portfolio-analyst
Read-only Interactive Brokers (IBKR) diagnostics as portable AI-agent skills: account health, positions, daily P&L, trade history, dividends, options Greeks, and a P0–P3 graded portfolio report. Never places orders.
npx -y skills add luyangkk/ib-suite --skill ib-portfolio-analystAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 17 days oldThe repository was created 17 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Read-only IB diagnostics: account health, concentration, P&L attribution, trade review, portfolio risk, pre-trade check — a P0-P3 findings report with charts.
SKILL.md
2.9 KB, 665 tokens by cl100k_base, as published. Nobody here has run it
ib-portfolio-analyst
Turns the local data lake (populated by ib-gateway) into a structured
P0–P3 diagnostic report. Never contacts IB and never places orders — it
reads snapshots, bars and executions that were already synced.
Prerequisite
Config and the shared venv are owned by the ib-suite index skill (see its
first-run setup). Run ib-gateway's /ib-sync first so a snapshot exists under
data/snapshots/.
v1 input note:
/ib-synccurrently lands only the account snapshot and positions. Daily bars, executions and dividends are optional JSON inputs you supply directly (arrays matching theDailyBar/Execution/Dividendschema — e.g. exported from a Flex report). Landing them into the lake as a/ib-syncstep is deferred to a later iteration.
/ib-analyze — run all diagnostics
{baseDir}/../.venv/bin/python {baseDir}/scripts/analyze.py \
--config .ib-suite/config.yaml \
--snapshot data/snapshots/<account>/<ts>.json \
--bars bars.json \
--executions executions.json \
--out data/runs/$(date +%Y%m%dT%H%M%S)
Produces report.md plus interactive .html and static .png charts in the
output directory. --bars/--executions are optional JSON arrays; the risk
and trade-review sections appear only when their data is supplied.
Dividends
Pass Flex-sourced dividend history (a JSON array of Dividend rows) to include
income diagnostics:
{baseDir}/../.venv/bin/python {baseDir}/scripts/analyze.py \
--config .ib-suite/config.yaml \
--snapshot data/snapshots/<account>/<ts>.json \
--dividends dividends.json \
--out data/runs/$(date +%Y%m%dT%H%M%S)
Adds Yield-on-Cost and withholding-tax findings plus an income-by-symbol chart.
Withholding-tax note (v1): the Flex parser does not yet extract the separate withholding-tax cash rows, so
taxdefaults to0unless you set it in the supplied JSON. The withholding-drag finding therefore reads 0% against unedited Flex output until tax parsing lands in a later iteration.
Findings
Each finding carries: priority (P0–P3), dimension, finding, evidence, impact, suggestion, trigger condition, confidence, and data limitations. Findings are diagnostic and directional only — never return promises.
Notes
- All thresholds live in
config.yamlunderthresholds:(see ib-common'sconfig.example.yaml). - Pre-trade check is a separate local simulation (
ib_analyst.pretrade_check.simulate), not part of the/ib-analyzeauto report — it estimates post-trade weight/leverage for a hypothetical order. A real IB WhatIf margin check is planned for v2.
What ships with it: 30 files
57.4 KB alongside SKILL.md, 26 of them executable
ib_analyst/
- account_health.pyruns2.3 KB
- concentration.pyruns3.4 KB
- dividend_analysis.pyruns3.7 KB
- dividend_report.pyruns988 B
- dividend_store.pyruns1.1 KB
- findings.pyruns1.4 KB
- __init__.pyruns0 B
- pnl_attribution.pyruns3.3 KB
- portfolio_risk.pyruns3.4 KB
- pretrade_check.pyruns2.8 KB
- report.pyruns2.7 KB
- trade_review.pyruns2.0 KB
scripts/
- analyze.pyruns3.5 KB
tests/
- fixtures/daily_bars_multi.json1.3 KB
- fixtures/dividends_sample.json360 B
- fixtures/executions_sample.json408 B
- fixtures/snapshot_diag.json664 B
- test_account_health.pyruns1.9 KB
- test_analyze_dividends.pyruns2.0 KB
- test_analyze_e2e.pyruns1.6 KB
- test_concentration.pyruns3.3 KB
- test_dividend_analysis.pyruns2.2 KB
- test_dividend_report.pyruns1.1 KB
- test_dividend_store.pyruns960 B
- test_findings.pyruns1.3 KB
- test_pnl_attribution.pyruns3.9 KB
- test_portfolio_risk.pyruns2.7 KB
- test_pretrade_check.pyruns1010 B
- test_report.pyruns1.6 KB
- test_trade_review.pyruns846 B