/thinking-frameworks-skills:portfolio-drift-rebalancerfrom thinking-frameworks-skills
Aggregates investment holdings across taxable brokerage, 401k, and HSA accounts, computes drift from a target allocation, and produces a tax-efficient rebalance proposal that never executes trades. Flags drift over 5 percentage points and missed 401k employer match.
Ships in thinking-frameworks-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
The household may hold multiple investment accounts, including taxable brokerages, retirement accounts, and HSA invested portions. A target allocation is defined at the household level (e.g., 55/20/20/5 US/intl/bonds/cash). This skill rolls up the supplied accounts' holdings, computes drift from target, and proposes specific buys and sells to restore target — preferring eligible tax-advantaged accounts. Account identities and supported investments come from the caller, never from the example below.
It never executes trades. It produces a proposal for the user.
The caller provides:
accounts — array of investment accounts: {id, type, institution, holdings[]} where each holding has {symbol, shares, value_cents, cost_basis_cents, asset_class}.target_allocation — { asset_class: target_pct } summing to 1.0.drift_threshold_pct — default 5 percentage points (5.0). Below threshold, no rebalance proposed.cash_to_deploy_cents — optional new cash being added (e.g., a paycheck deposit).tax_rate_long_term — for cost-comparison estimates (default 15%).account_coverage — the caller's included account IDs, excluded/missing IDs with reasons, snapshot dates, and whether the supplied set covers the requested portfolio. For a standalone call, ask for confirmation of scope when this is absent; do not assume that a three-account example is the household catalog.Validate inputs before aggregation. IDs must be unique and each account must contain actual holdings objects, not just an ID to look up implicitly. Missing snapshots/values/classes, unknown account treatment, an invalid target (negative weights or sum other than 1.0), or unresolved scope returns status: needs_input with the account/field in missing_inputs, null unavailable metrics, and no trades. A confirmed empty account may have holdings: []; missing holdings cannot be converted to that value. Keep all held asset classes in the calculation; obtain a target for any absent class, including an explicit zero if intended. If total portfolio value is zero, return status: no_portfolio_value, null allocation/drift, and no trades instead of dividing by zero. Missing shares/cost basis blocks the relevant trade/tax estimate without invalidating otherwise complete value-based allocation.
Carry account_coverage into output. Incomplete coverage may support a labeled subset allocation only, never an unqualified household allocation or rebalance recommendation. For complete coverage, use status: complete; a blocked trade estimate makes the result partial with its missing inputs. Neither status claims execution of a trade.
Drift / Rebalance Progress:
- [ ] Step 1: Aggregate holdings by asset_class across all accounts
- [ ] Step 2: Compute current allocation percentages
- [ ] Step 3: Compute drift vs target
- [ ] Step 4: Check drift threshold; if all classes within threshold, return no-op
- [ ] Step 5: If new cash, allocate it preferentially to under-target classes
- [ ] Step 6: For remaining drift, plan trades
- [ ] Step 7: Order trades by tax cost (advantaged-account first)
- [ ] Step 8: Verify proposal nets to zero cash impact (or matches new-cash deposit)
- [ ] Step 9: Emit proposal with per-trade rationale
For each asset_class in target, sum value_cents across all holdings of all accounts. Include cash positions in the brokerage (typically asset_class cash).
current_pct[class] = total_value[class] / total_value_all, as a fraction like the target weights. Retain calculation precision; round only displayed percentages after computing drift.
drift_pp[class] = 100 × (current_pct[class] − target_allocation[class]) in percentage points. For example, current weight 0.625 and target 0.55 yield 7.5 percentage points, which exceeds the default 5.0-point threshold.
If max(|drift_pp|) < drift_threshold_pct, emit rebalance_needed: false and stop. Surface drift values for context but propose no trades.
If cash_to_deploy_cents > 0, allocate to under-target classes first. Each dollar of new cash to under-target classes reduces the trade volume needed in step 6.
Allocation order: largest negative drift_pp first.
After cash deployment, residual drift calls for trades. For each over-target class, compute excess_cents; for each under-target class, compute shortfall_cents. Match by greedy pairing (largest excess to largest shortfall), producing a list of (sell_class, buy_class, amount_cents) swaps.
Within each swap, choose specific holdings:
Sell side priority (most preferred to least):
401k or hsa (any sale is tax-free).tax-loss-harvest-scanner).Buy side priority:
401k or hsa of the desired asset class (no transaction-tax friction).For each proposed sell from a taxable account, compute and surface the estimated tax cost: (value − cost_basis) × tax_rate_long_term. The user can decide whether the rebalance benefit exceeds the tax cost.
The proposal must satisfy: Σ buys = Σ sells + cash_to_deploy_cents. If not, the planning has a bug — emit a proposal_invalid warning and stop.
Per-trade output includes: account, symbol, action (buy/sell), shares, dollar amount, asset_class change, estimated tax cost, rationale (under-target / over-target / new cash deploy).
| Account | Sale tax cost | Notes |
|---|---|---|
| 401k | $0 | All sales tax-free |
| HSA (invested) | $0 | All sales tax-free |
| Brokerage (long-term gain) | 15% × gain | Hold > 1 year |
| Brokerage (short-term gain) | marginal income tax × gain | Hold < 1 year — usually avoid |
| Brokerage (loss) | savings (TLH benefit) | Coordinate with tax-loss-harvest-scanner |
Wash-sale awareness. If a sell is paired with a buy of substantially identical security within 30 days (in any account, including the spouse's), the loss is disallowed. When a rebalance proposes selling an ETF in taxable for a loss, the buy side must use a different but similar ETF (e.g., sell VTI, buy ITOT). Document the wash-sale guard on each trade.
Free-money flags — emit even when no rebalance is needed:
free_money_alert: missed_employer_match.free_money_alert: idle_hsa_cash.Include status, missing_inputs, and account_coverage with the result. The values and IDs below illustrate a complete synthetic portfolio; replace them with the supplied accounts, never use them as defaults.
{
"as_of": "2026-04-25",
"totals": {
"portfolio_value_cents": 49250000,
"by_account": {
"acc_inv_fid_001": 18750000,
"acc_401k_001": 22500000,
"acc_hsa_001": 8000000
}
},
"current_allocation": {
"us_equity": 0.625,
"intl_equity": 0.155,
"us_bond": 0.180,
"cash": 0.040
},
"target_allocation": {
"us_equity": 0.55,
"intl_equity": 0.20,
"us_bond": 0.20,
"cash": 0.05
},
"drift_pp": {
"us_equity": 7.5,
"intl_equity": -4.5,
"us_bond": -2.0,
"cash": -1.0
},
"rebalance_needed": true,
"max_drift_pp": 7.5,
"trades": [
{
"account_id": "acc_401k_001",
"action": "sell",
"symbol": "FXAIX",
"asset_class": "us_equity",
"value_cents": 1850000,
"shares": 18.5,
"tax_cost_cents": 0,
"rationale": "Reduce US equity overweight using tax-advantaged account"
},
{
"account_id": "acc_401k_001",
"action": "buy",
"symbol": "FSPSX",
"asset_class": "intl_equity",
"value_cents": 1850000,
"shares": 41.0,
"tax_cost_cents": 0,
"rationale": "Increase intl equity to target via tax-advantaged account"
}
],
"alerts": [],
"free_money": [
{
"type": "missed_employer_match",
"account_id": "acc_401k_001",
"current_contribution_pct": 3,
"match_cap_pct": 4,
"annual_dollars_left_cents": 200000,
"action": "increase 401k contribution from 3% to 4%"
}
]
}
What SKILL.md sets; muted values are Claude Code's defaults
270 skills in this plugin
/abstraction-concrete-examplesBuilds structured abstraction ladders that translate high-level principles into concrete, actionable examples across 3-5 levels. Bridges communication gaps, reveals hidden assumptions, and tests whether abstract ideas work in practice. Use when explaining concepts at different expertise levels, moving between abstract principles and concrete implementation, identifying edge cases by testing ideas against scenarios, designing layered documentation, decomposing complex problems into actionable steps, or bridging strategy-execution gaps./academic-letter-architectGuides the creation of evidence-based academic recommendation letters, reference letters, and award nominations that combine concrete examples, meaningful comparisons, and genuine enthusiasm. Use when writing recommendation letters for students, postdocs, or colleagues, or when user mentions recommendation letter, reference, nomination, letter of support, endorsement, or needs help with strong advocacy and comparative statements./adr-architectureDocuments significant architectural and technical decisions with full context, alternatives considered, trade-offs analyzed, and consequences understood. Creates a decision trail that helps teams understand why decisions were made. Use when choosing between technology options, making infrastructure decisions, establishing standards, migrating systems, or when user mentions ADR, architecture decision, technical decision record, or decision documentation./adverse-selection-priorProduces a Bayesian prior probability that an offered transaction is +EV for the recipient, given that the counterparty chose to propose it. Applies Akerlof market-for-lemons logic -- if they offered it, they believe it is +EV for them, so the prior that it is +EV for us is materially below 50%. Reusable across trade evaluation, waiver drops (another team dropping a player is also adverse selection), job-offer analysis, M&A, and any "someone offered me this" situation. Use when you receive an unsolicited trade/offer/proposal, analyzing incoming trade prior, evaluating why a counterparty proposed a deal, or when user mentions adverse selection, market for lemons, why did they offer this, incoming trade prior, they proposed it, Bayesian adjustment on received offer./advisory-editA strict advisory-only editing discipline for a writer who dictates ("speaks out") essays and wants help WITHOUT having their voice changed. The editor directs structure, flags grammar, and suggests strategic language — but never modifies the writer's text unless the writer explicitly says "apply" / "make that change" / "rewrite this." Produces a line-referenced, suggestion-only critique where every item is marked the writer's call. Four passes — structural, line (grammar/clarity), voice, pre-publish. Use when reviewing a draft, critiquing a spoken-out article, or doing a pre-publish check. The companion to learning-in-public-voice and the operating manual for the biostat-editor agent./alignment-values-north-starCreates actionable alignment frameworks that give teams a shared North Star (direction), values (guardrails), and decision tenets (behavioral standards). Enables autonomous decision-making while maintaining organizational coherence. Use when starting new teams, scaling organizations, defining culture, establishing product vision, resolving misalignment, creating strategic clarity, or when user mentions North Star, team values, mission, principles, guardrails, decision framework, or cultural alignment.npx claudepluginhub lyndonkl/claude --plugin thinking-frameworks-skillsOther plugins' skills for the same job