Consolidate IBRK trade CSV files from a directory into a summary report. Groups trades by symbol, underlying, date, strike, buy/sell, and open/close. Outputs both markdown and CSV.
SkillScore86Maintained
Automatic
◆Finance & Accounting pack
Last verified 8/23/2026
What it changes
Passed 16 of 19 test cases with the skill, and 10 of 19 without it.
Without skill55%
With skill86%
Checks it passed that the model alone missed
Specifies auto-probing port 7496 first.
Identifies `sandbox/` as the default output directory.
Identifies the position classification as CLOSE_SHORT.
and 5 more in the full report
7 fixed12 passed either way3 still failing0 broke
Pass-rate lift
+32 pp
Tokens
-14%
Agent turns
0%
Response time
-55%
Model gemini-3.6-flashMeasured 8/23/2026v119 of 22 cases passed with skill · 19 comparable
Tokens, turns and time describe resource use, not a dollar price.
See it in action
One of 7 test cases the skill fixed. Same model, same prompt, with and without the skill.
1 of 7
Prompt
When a trade has a Buy direction and a Close indicator (closing an existing option short position), what string value is assigned to the Position column?
What was checked, without and with the skill
Checked
Without skill
With skill
Identifies the position classification as CLOSE_SHORT.
Missed
Passed
case-11 · gemini-3.6-flash · 8/23/2026 · answers are capped and redacted
What's inside
The instructions your model reads when the skill loads.
SKILL.md57 lines2 filesincludes scripts
IB Create Consolidated Report
Reads all CSV files from a given directory (excluding subdirectories), consolidates trade data by key fields, and generates both markdown and CSV reports.
Instructions
uv run python scripts/consolidate.py <directory> [--port PORT] [--output-dir OUTPUT_DIR]
Arguments
directory - Path to directory containing IBRK trade CSV files
--port - IB port to fetch unrealized P&L (7497=paper, 7496=live). If not specified, auto-probes both ports (tries 7496 first, then 7497). Defaults to the IB_PORT env var when set (--port still overrides).
--output-dir - Output directory for reports (default: sandbox/)
Consolidation Logic
Groups trades by:
UnderlyingSymbol - The underlying ticker (e.g., GOOG, CAT)
Symbol - Full option symbol
TradeDate - Date of the trade
Strike - Strike price
Put/Call - Option type (C or P)
Buy/Sell - Trade direction
Open/CloseIndicator - Whether opening or closing
Aggregates:
Quantity - Sum of quantities
Proceeds - Sum of proceeds
NetCash - Sum of net cash
IBCommission - Sum of commissions
FifoPnlRealized - Sum of realized P&L
Adds column:
Position - SHORT (Sell+Open), LONG (Buy+Open), CLOSE_SHORT (Buy+Close), CLOSE_LONG (Sell+Close)