trader-rebalance
Agent skill fromJakeschincariol/trader-skill
Rebalancer. Brings the portfolio back to its target weights when it drifts: values every holding at current prices, works out each stock's drift from its target in percentage points, trades only the stocks outside a band (default 5 points), keeps the cash buffer and the per-stock cap, skips tiny trades, lists sells before buys, and writes the trades to trader/orders.json as proposals. Use when the user says "rebalance", "my portfolio drifted", "bring it back to the targets", "I added money", "the new 13F changed the weights", "am I overweight", or on a schedule (monthly or quarterly) after /trader-copycat updates the targets.
How to install trader-rebalance
npx skills add Jakeschincariol/trader-skill# or add only this skill to Claude Code: copy the folder
trader-rebalance/
# into
~/.claude/skills/trader-rebalance/ (all projects)
.claude/skills/trader-rebalance/ (one project)
1# trader-rebalance23The Rebalancer keeps the portfolio looking like the plan. Prices move, new4money arrives and a new 13F changes the weights; this skill finds the stocks5that drifted too far and proposes the trades that bring them back. It writes6proposals only: trader-risk checks them and trader-broker asks the user yes7or no for each one.89`${CLAUDE_SKILL_DIR}` below is this skill's folder (where this SKILL.md lives).1011```bash12python3 "${CLAUDE_SKILL_DIR}/rebalance.py" # the drift table, no files written13python3 "${CLAUDE_SKILL_DIR}/rebalance.py" --band 5 --write # proposals -> trader/orders.json14python3 "${CLAUDE_SKILL_DIR}/rebalance.py" --sell-untracked # also sell holdings not in the targets15python3 "${CLAUDE_SKILL_DIR}/rebalance.py" --json16```1718## What it reads and writes1920| file | what |21| --- | --- |22| `trader/portfolio.json` | cash and positions (shares); same shape as trader-tax's `portfolio.example.json` |23| `trader/prices.json` | a price for every holding and every target (trader-alerts writes it) |24| `trader/targets.json` | the target weights (trader-copycat writes it) |25| `trader/config.json` | cash buffer, cap, min and max order, `rebalance_band_pct` |26| `trader/orders.json` | the proposals it writes with `--write`, sells first |2728## How it decides2930- **Account value** = cash + every holding at its price.31- **Targets**: the weights renormalised over the stock sleeve (account minus32…
Excerpt shown under the repository's MIT license.
