performance-attribution
Skill by HKUDS
Decomposes portfolio excess returns into sector allocation, stock selection, factor exposure and timing effects. Built for analysts who need to explain why a strategy made or lost money, using Brinson, factor and market-timing models.
Install performance-attribution
Built from the published package, never by AI.
git clone --depth 1 https://github.com/HKUDS/Vibe-Trading /tmp/Vibe-Trading && mkdir -p ~/.claude/skills && cp -r /tmp/Vibe-Trading/agent/src/skills/performance-attribution ~/.claude/skills/performance-attributionRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
Step-by-step: install performance-attribution in Claude Code
git clone --depth 1 https://github.com/HKUDS/Vibe-Trading /tmp/Vibe-Trading && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/Vibe-Trading/agent/src/skills/performance-attribution ~/.gemini/antigravity-cli/skills/performance-attributionAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install performance-attribution in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
Performance attribution is an agent skill that breaks portfolio excess returns into explainable sources. It covers Brinson-Fachler sector allocation, selection and interaction effects for a single period, and Carino logarithmic linking for multi-period results. It also covers alpha and beta regression, multi-factor attribution in the Fama-French style, Treynor-Mazuy and Henriksson-Merton timing tests, and comparison metrics such as Sharpe, Sortino, Calmar and information ratio.
The skill points to a Python module, src/quantlib/attribution.py, which provides the Brinson and linking functions, so the assistant should import them rather than retype the formulas. It also includes a report template with performance overview, attribution breakdown and factor exposure tables. The source is aimed at analysts who want to know why a strategy performed as it did, not only how much it gained or lost. It includes notes on benchmark choice, survivorship bias and multiple testing.
Written from the project's SKILL.md and checked against it.
What it can do
- Brinson-Fachler attributionSplits single-period active return into allocation, selection and interaction effects by sector.
- Carino multi-period linkingLinks period attributions so the effects sum to the compounded active return, with scaling factors exposed.
- Alpha-beta decompositionRuns an OLS regression of portfolio returns on market returns to estimate alpha, beta and residual risk.
- Multi-factor attributionDecomposes excess returns on market, size, value and momentum factors, with China A-share proxies.
- Market-timing evaluationApplies Treynor-Mazuy and Henriksson-Merton models and bull and bear capture ratios.
- Risk-adjusted metricsCovers Sharpe, Sortino, Calmar, information ratio and Treynor, plus rolling analysis windows.
- Benchmark selection guideSuggests benchmarks for A-shares, Hong Kong, US equities, crypto and multi-asset portfolios.
- Attribution report templateProvides a markdown template for performance overview, attribution breakdown and factor exposure.
What you need
- Python
- The src/quantlib/attribution.py module from the repository
- Factor return data, from tushare or self-constructed
Try asking
- Run a Brinson attribution on my portfolio against the CSI 300 by sector.
- Regress my strategy's monthly returns on the market and report alpha and beta.
- Test whether my fund shows market timing ability using Treynor-Mazuy.
Good to know
- Attribution explains past performance and does not guarantee future results.
- A benchmark sector the portfolio never held shows no selection or interaction effect.
- Arithmetic linking is acceptable only when the residual is reported.
- Factor OLS regression requires at least 60 data points.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: agent/src/skills/performance-attribution/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md12 KB
Alternatives to performance-attribution
All alternatives →Lists live launchpad token feeds and AI-detected hot topics for meme tokens on BSC, Solana and Base. Covers new, finalizing and just-migrated tokens on launchpads such as Pump.fun and Four.meme.
The okx-market skill lets an AI assistant retrieve cryptocurrency market data from the OKX V5 REST API. It is aimed at users who want spot, derivatives and index data in Python without an account.
Calculates key SaaS health metrics such as ARR, churn, LTV and CAC from raw business numbers, then gives prioritized advice. Built for founders and finance leads who share revenue or customer figures.
Fetches U.S. SEC EDGAR data for research. It resolves a ticker to its CIK, lists recent filings with primary-document URLs, and pulls XBRL financial series. Built for analysts who need free, U.S.-only filing data.
Provides free, no-auth access to Eastmoney market data for A-shares, Hong Kong stocks and US stocks. It covers fund flows, dragon-tiger lists, financial statements and stock screening.
Reads and manages a user's QuickBooks business through Intuit's official MCP server. It answers finance questions from reports, invoices, customers, products and benchmarks, and completes approved actions.
Compare with meme-rush, okx-market or saas-metrics-coach
performance-attribution: common questions
Does it handle multi-period attribution?
Yes. The source describes carino_link, which links per-period Brinson results so the effects sum to the compounded active return, and exposes the scaling factors for audit.
Why can a single-period Brinson result have no residual?
The source says the three effects sum to R_p minus R_b exactly when portfolio and benchmark weights total the same. Any gap against the reported fund return comes from inputs such as trading, cash drag or FX and should be quantified separately.
Which benchmark should I use?
The source gives a table by strategy type, such as CSI 300 for China A-share large cap, S&P 500 for US equities and a self-constructed 60/40 for multi-asset. It warns that benchmark choice can change whether alpha appears.
How do I install performance-attribution?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is performance-attribution free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is performance-attribution safe to use?
It scores 91 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to performance-attribution?
Similar skills: meme-rush, okx-market, saas-metrics-coach, sec-edgar.
