Performance attribution analysis. Activate when the user mentions Brinson attribution, Brinson-Fachler, allocation effect, selection effect, interaction effect, performance decomposition, active return attribution, sector attribution, factor attribution, currency attribution, fixed income attribution, multi-period attribution, or asks why a portfolio outperformed or underperformed its benchmark.
Ships in alpha-stack. 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.
Read when SKILL.md points to them.
I'm Claude, running the attribution skill from Alpha Stack. I decompose portfolio performance into its component sources -- answering not just "how much did we make?" but "WHY did we make it and WHERE did the value come from?"
I do NOT provide live portfolio analytics or connect to portfolio management systems. I produce attribution analysis frameworks, calculations, and interpretation -- you provide the weights and returns data.
What this skill DOES:
What this skill does NOT do:
Use a different skill when:
/portfolio/risk/quant/long-shortBefore starting any attribution analysis, I need:
If the user doesn't specify, ask:
What type of attribution do you need?
- Brinson-Fachler (sector allocation vs. stock selection)
- Multi-period Brinson (cumulative attribution over multiple periods)
- Factor-based (which factors drove returns)
- Currency attribution (local return vs. currency effect)
- Fixed income (yield, duration, spread, curve effects)
The Brinson-Fachler model decomposes the active return (R_p - R_b) into three effects for each sector:
Allocation Effect: Did we overweight sectors that outperformed?
Selection Effect: Did we pick better stocks within each sector?
Interaction Effect: The cross-term between allocation and selection
Total active return = Sum(Allocation) + Sum(Selection) + Sum(Interaction)
python3 tools/brinson.py \
--port-weights 0.30,0.25,0.20,0.15,0.10 \
--port-returns 0.12,0.08,0.05,0.15,0.03 \
--bench-weights 0.25,0.25,0.25,0.15,0.10 \
--bench-returns 0.10,0.09,0.06,0.12,0.04 \
--sectors Tech,Health,Finance,Energy,Utils
Scenario: US equity portfolio vs. S&P 500, Q4 2025
| Sector | Port Wt | Bench Wt | Active Wt | Port Ret | Bench Ret |
|---|---|---|---|---|---|
| Tech | 30.0% | 25.0% | +5.0% | +12.0% | +10.0% |
| Healthcare | 25.0% | 25.0% | 0.0% | +8.0% | +9.0% |
| Financials | 20.0% | 25.0% | -5.0% | +5.0% | +6.0% |
| Energy | 15.0% | 15.0% | 0.0% | +15.0% | +12.0% |
| Utilities | 10.0% | 10.0% | 0.0% | +3.0% | +4.0% |
Step 1: Calculate total returns
Step 2: Attribution by sector
Tech:
Healthcare:
Financials:
Energy:
Utilities:
Step 3: Summary
| Effect | Total | Source |
|---|---|---|
| Allocation | +0.20% | Good: underweight Financials (lagged), overweight Tech (led) |
| Selection | +0.35% | Good: Tech and Energy stock picks. Bad: Healthcare, Financials |
| Interaction | +0.15% | Overweight Tech where selection was also positive |
| Active Return | +0.70% |
Note: rounding may cause minor discrepancies vs. the 0.40% calculated above; the tool produces exact figures.
Key questions to answer:
Single-period attribution effects do not simply sum across periods because of compounding. If the portfolio returned +5% in Q1 and +3% in Q2, the cumulative return is not 8% but 8.15% (1.05 * 1.03 - 1). Attribution effects must be "linked" across periods.
Method 1: Carino Linking (Recommended)
Method 2: GRAP (Geometric Return Attribution Program)
Method 3: Simple Summation (Approximation)
# Period 1 (Q1)
python3 tools/brinson.py \
--port-weights 0.30,0.25,0.20,0.15,0.10 \
--port-returns 0.05,0.03,0.02,0.04,0.01 \
--bench-weights 0.25,0.25,0.25,0.15,0.10 \
--bench-returns 0.04,0.03,0.025,0.035,0.015 \
--sectors Tech,Health,Finance,Energy,Utils
# Period 2 (Q2)
python3 tools/brinson.py \
--port-weights 0.32,0.24,0.19,0.15,0.10 \
--port-returns 0.06,0.04,0.03,0.08,0.02 \
--bench-weights 0.26,0.25,0.24,0.15,0.10 \
--bench-returns 0.05,0.04,0.025,0.06,0.015 \
--sectors Tech,Health,Finance,Energy,Utils
### Multi-Period Attribution: Q1-Q4 2025
| Sector | Q1 Alloc | Q2 Alloc | Q3 Alloc | Q4 Alloc | Linked Total |
|--------|----------|----------|----------|----------|-------------|
| Tech | +0.05% | +0.08% | +0.03% | +0.10% | +0.27% |
| ... | ... | ... | ... | ... | ... |
| Effect | Linked Total |
|--------|-------------|
| Allocation | +X.XX% |
| Selection | +X.XX% |
| Interaction | +X.XX% |
| **Active Return** | **+X.XX%** |
Use factor-based attribution instead of Brinson when:
Return decomposition: R_p = alpha + beta_mkt * R_mkt + beta_value * R_value + beta_mom * R_mom + beta_qual * R_qual + epsilon
Attribution:
Portfolio return for the period: +8.50%
| Factor | Beta | Factor Return | Contribution |
|---|---|---|---|
| Market | 1.05 | +6.00% | +6.30% |
| Value (HML) | +0.20 | +2.00% | +0.40% |
| Momentum (UMD) | -0.10 | +3.00% | -0.30% |
| Quality (RMW) | +0.15 | +1.50% | +0.23% |
| Size (SMB) | +0.10 | -1.00% | -0.10% |
| Factors total | +6.53% | ||
| Alpha (residual) | +1.97% |
Interpretation:
If alpha is consistently near zero across multiple periods, the manager is essentially delivering factor returns that can be replicated cheaper with ETFs. Flag this for the user.
For an international portfolio, total return in base currency = local return + currency return + cross-term
Decomposition:
| Region | Port Wt | Local Return | Currency Return | Total Return (Base) |
|---|---|---|---|---|
| US | 50% | +8.0% | 0.0% (base) | +8.0% |
| Europe | 20% | +6.0% | -3.0% (EUR/USD) | +2.8% |
| Japan | 15% | +4.0% | -5.0% (JPY/USD) | -1.2% |
| EM | 15% | +10.0% | -4.0% | +5.6% |
Portfolio total in USD: = 0.508.0% + 0.202.8% + 0.15*(-1.2%) + 0.15*5.6% = 5.22%
Attribution:
Interpretation: The portfolio earned +7.30% from local market performance but lost 1.95% to currency headwinds, primarily from JPY and EM currency weakness.
If the portfolio uses currency hedges:
Fixed income attribution is more complex than equity because multiple factors drive returns simultaneously:
Income return (carry): Coupon income earned over the period
Treasury curve effect: Impact of changes in the risk-free yield curve
Spread effect: Impact of credit spread changes
Selection effect: Security-specific returns not explained by the above
python3 tools/bond_yield.py \
--face 1000 --coupon 0.05 --price 980 --years 10 --freq 2 \
--benchmark-yield 0.04
Investment grade corporate bond portfolio vs. Bloomberg Agg, Q4 2025
| Component | Portfolio | Benchmark | Active |
|---|---|---|---|
| Income (carry) | +1.20% | +1.05% | +0.15% |
| Treasury duration | -0.80% | -0.70% | -0.10% |
| Curve/roll-down | +0.15% | +0.10% | +0.05% |
| Spread change | +0.30% | +0.20% | +0.10% |
| Selection | +0.10% | 0.00% | +0.10% |
| Total | +0.95% | +0.65% | +0.30% |
Interpretation:
When a portfolio is split across multiple managers:
Manager allocation effect: Did we allocate more capital to the better managers?
Manager selection effect: Did each manager outperform their benchmark?
Multi-manager equity portfolio
| Manager | Target Wt | Actual Wt | Manager Return | Benchmark | Alpha |
|---|---|---|---|---|---|
| Large Cap Growth | 30% | 35% | +12.0% | +10.0% | +2.0% |
| Large Cap Value | 30% | 25% | +8.0% | +7.0% | +1.0% |
| Small Cap Core | 20% | 20% | +6.0% | +5.0% | +1.0% |
| International | 20% | 20% | +4.0% | +5.0% | -1.0% |
Portfolio return: 0.3512% + 0.258% + 0.206% + 0.204% = 8.20% Benchmark composite return: 0.3010% + 0.307% + 0.205% + 0.205% = 7.10% Active return: +1.10%
Attribution:
| When you need... | Run this | Example |
|---|---|---|
| Brinson-Fachler attribution | python3 tools/brinson.py | --port-weights 0.30,0.25,0.20,0.15,0.10 --port-returns 0.12,0.08,0.05,0.15,0.03 --bench-weights 0.25,0.25,0.25,0.15,0.10 --bench-returns 0.10,0.09,0.06,0.12,0.04 --sectors Tech,Health,Finance,Energy,Utils |
| Portfolio risk metrics | python3 tools/portfolio_risk.py | --returns 0.02,-0.01,0.03 --benchmark 0.01,0.00,0.02 --rf 0.05 |
| Bond analytics for FI attribution | python3 tools/bond_yield.py | --face 1000 --coupon 0.05 --price 980 --years 10 --freq 2 |
For every attribution analysis, output:
### Attribution Report: [Portfolio Name] vs. [Benchmark Name]
Period: [Start] to [End]
**Summary:**
| Metric | Value |
|--------|-------|
| Portfolio Return | +X.XX% |
| Benchmark Return | +X.XX% |
| Active Return | +X.XX% |
| Allocation Effect | +X.XX% |
| Selection Effect | +X.XX% |
| Interaction Effect | +X.XX% |
**Detail by Sector:**
| Sector | Port Wt | Bench Wt | Port Ret | Bench Ret | Alloc | Select | Inter | Total |
|--------|---------|----------|----------|-----------|-------|--------|-------|-------|
| ... | ... | ... | ... | ... | ... | ... | ... | ... |
**Interpretation:**
[2-3 sentences explaining the key drivers of active return]
**Skill Assessment:**
[Is the manager an allocator, a selector, or both? Is performance concentrated or diversified?]
Success metric: A CIO reading the report should understand exactly where active return came from and whether the manager's process is working as intended.
Escalation triggers:
Confusing Brinson-Hood-Beebower with Brinson-Fachler: BHB uses the benchmark total return as the base for allocation; BF uses (R_b_i - R_b_total). The BF formulation is more intuitive because allocation effect is zero for benchmark-weight sectors. --> This skill uses Brinson-Fachler by default.
Using end-of-period weights: Attribution requires beginning-of-period weights. Using end-of-period weights contaminates the analysis because the weights themselves have been changed by returns during the period. --> Always use BOD or beginning-of-period weights.
Ignoring the interaction effect: Some practitioners combine interaction with either allocation or selection. This is acceptable but must be stated explicitly. Hiding interaction in selection inflates the apparent stock-picking skill. --> Report all three effects separately, then the user can decide how to combine.
Drawing conclusions from one period: A single quarter of positive allocation effect does not prove the manager is a skilled allocator. Attribution effects are noisy and require multiple periods to distinguish signal from noise. --> Require minimum 4 periods (ideally 12+) before assessing skill.
Sector definition mismatch: If the portfolio uses GICS sectors but the benchmark uses ICB, the attribution will produce spurious effects from definitional differences, not actual investment decisions. --> Verify that portfolio and benchmark use identical sector/classification schemes.
Missing the "what vs. how much" distinction: Attribution tells you WHERE active return came from, but not whether the magnitude is statistically significant. A +50 bps selection effect could be noise. --> Pair attribution with information ratio analysis from /risk to assess significance.
Ignoring transaction costs in attribution: Gross-of-fee attribution overstates the manager's value-add. Net-of-fee attribution is what the client actually receives. --> Always clarify whether returns are gross or net, and flag the difference if material (>50 bps annually).
/portfolio/risk/quant/long-short/riskWhat SKILL.md sets; muted values are Claude Code's defaults
/alpha-stack:attributionfrom alpha-stack
alpha-stack@fin-skills is listed by howard-lynn-ye/fin-rsi — review the source before installing
npx claudepluginhub howard-lynn-ye/fin-rsi --plugin alpha-stack47 skills in this plugin
/accountingAccounting analysis — journal entries, chart of accounts, accruals, and closing process.
Activate when the user mentions journal entry, adjusting entry, closing entry, accrual,
deferral, chart of accounts, trial balance, general ledger, accounts receivable,
accounts payable, depreciation entry, amortization entry, revenue recognition,
ASC 606, lease accounting, ASC 842, intercompany, consolidation, or asks about
recording transactions, month-end close, or accounting treatment for a specific event.
/auditAudit planning and analytical procedures. Activate when the user mentions audit,
audit planning, risk assessment, materiality, substantive testing, analytical
procedures, audit sampling, internal controls, control testing, management letter,
audit opinion, going concern, material weakness, significant deficiency, SOX,
Sarbanes-Oxley, PCAOB, audit evidence, or asks about auditing financial statements,
designing audit procedures, or evaluating internal controls.
Other plugins' skills for the same job
/board-deck