Agent skill

Performance Metrics

by JoelLewis in JoelLewis/finance_skills

Evaluate investment performance on a risk-adjusted basis using industry-standard ratios and capture analysis.

MITAuto-check passedBusiness, Finance & HR

Install Performance Metrics

skills CLI
$ npx skills add JoelLewis/finance_skills --skill performance-metrics -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install JoelLewis/finance_skills performance-metrics --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/JoelLewis/finance_skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/wealth-management/skills/performance-metrics .claude/skills/performance-metrics && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
performance-metrics
GitHub stars
205
Token cost
~2.4k tokens
SKILL.md length
1,097 words
Files
2 (incl. scripts)
Skills in repo
91
Repo updated
First seen
Licence
MIT

At a glance

Evaluate investment performance on a risk-adjusted basis using industry-standard ratios and capture analysis.

  • The user asks about Sharpe ratio
  • SKILL.md covers Core Concepts, Key Formulas, Worked Examples and Common Pitfalls, plus 2 more sections
  • Runs Python scripts from its folder; calls uv, python3 and pip
  • Information Ratio

What it does

Performance Metrics is an agent skill from JoelLewis/finance_skills. Evaluate investment performance on a risk-adjusted basis using industry-standard ratios and capture analysis. Use when the user asks about Sharpe ratio, Sortino ratio, Information Ratio, Treynor ratio, Calmar ratio, Omega ratio, or upside/downside capture. Also trigger when users mention 'risk-adjusted returns', 'return per unit of risk', 'M-squared', 'is this fund worth the volatility', 'how to compare two managers', 'capture ratio', or ask which investment performed better after accounting for risk.

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including scripts (for example `scripts/performance_metrics.py`).

It sits in Business, Finance & HR, covering OKRs and executive reporting and Accounting and bookkeeping. The repository describes itself as: Claude Code skill plugins for financial services — 81 skills across 7 domain plugins covering investment management, compliance, advisory practice, trading, and operations. The licence is MIT.

When your agent uses it

  • The user asks about Sharpe ratio
  • Information Ratio
  • Upside/downside capture
  • Users mention risk-adjusted returns

Example prompts

  • “risk-adjusted returns”
  • “return per unit of risk”
  • “M-squared”
  • “/performance-metrics”

Requirements

  • Python 3

What it can do on your machine

Read from SKILL.md and the folder at commit 5c498ea. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • uv
    • python3
    • pip

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use uv and pip, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Performance Metrics loads about 2.4k tokens when it runs. Until then it costs about 132 tokens; SKILL.md has 1,097 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~132
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from JoelLewis/finance_skills at commit 5c498ea, republished under its MIT licence (© JoelLewis). 1,097 words, ~2,354 tokens.

Download SKILL.mdSave it as .claude/skills/performance-metrics/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
performance-metrics
description
Evaluate investment performance on a risk-adjusted basis using industry-standard ratios and capture analysis. Use when the user asks about Sharpe ratio, Sortino ratio, Information Ratio, Treynor ratio, Calmar ratio, Omega ratio, or upside/downside capture. Also trigger when users mention 'risk-adjusted returns', 'return per unit of risk', 'M-squared', 'is this fund worth the volatility', 'how to compare two managers', 'capture ratio', or ask which investment performed better after accounting for risk.

Performance Metrics

Core Concepts

Sharpe Ratio

The most widely used risk-adjusted performance measure. It divides excess return (over the risk-free rate) by total volatility.

SR = (R_p - R_f) / sigma_p
  • R_p: annualized portfolio return
  • R_f: annualized risk-free rate
  • sigma_p: annualized portfolio volatility (standard deviation of returns)

A higher Sharpe ratio indicates more return per unit of total risk. Typical benchmarks: SR < 0.5 is poor, 0.5-1.0 is acceptable, > 1.0 is strong, > 2.0 is exceptional.

Annualization: If computed from monthly data, SR_annual = SR_monthly * sqrt(12).

Sortino Ratio

Replaces total volatility with downside deviation, penalizing only harmful volatility (returns below a Minimum Acceptable Return).

Sortino = (R_p - R_f) / sigma_downside

where sigma_downside = sqrt((1/n) * sum(min(R_i - MAR, 0)^2)).

Common MAR choices: 0%, risk-free rate, or a target return. Always state which MAR is used, and use the same reference point in the numerator as in the downside deviation: if the MAR is not the risk-free rate, the numerator should be (R_p - MAR), not (R_p - R_f). Mixing reference points makes the ratio internally inconsistent.

Information Ratio

Measures active return (alpha) per unit of active risk (tracking error) relative to a benchmark.

IR = (R_p - R_b) / TE

where TE = std(R_p - R_b) * sqrt(N).

An IR above 0.5 is generally considered good; above 1.0 is exceptional and difficult to sustain.

Treynor Ratio

Measures excess return per unit of systematic risk (beta) rather than total risk.

Treynor = (R_p - R_f) / beta_p

Useful for evaluating diversified portfolios where idiosyncratic risk has been diversified away. For undiversified holdings, the Sharpe ratio is more appropriate.

Calmar Ratio

Relates annualized return to the worst peak-to-trough drawdown.

Calmar = CAGR / |MaxDrawdown|

A Calmar ratio above 1.0 means the annualized return exceeds the maximum drawdown. This ratio is popular among CTAs and hedge fund investors. Typically computed over a 3-year window.

Omega Ratio

A gain-loss ratio that considers the entire return distribution above and below a threshold tau.

Omega(tau) = integral from tau to +inf of [1 - F(r)] dr
             / integral from -inf to tau of F(r) dr

where F(r) is the cumulative distribution function of returns.

In practice, this is computed as:

Omega(tau) = sum(max(R_i - tau, 0)) / sum(max(tau - R_i, 0))

Omega > 1 means expected gains above tau exceed expected losses below tau. Unlike Sharpe, Omega captures the full shape of the distribution (skewness, kurtosis).

Upside and Downside Capture Ratios

Measure how the portfolio participates in benchmark up and down markets.

Up Capture   = R_p(in up months) / R_b(in up months) * 100
Down Capture = R_p(in down months) / R_b(in down months) * 100
Capture Ratio = Up Capture / Down Capture

Ideal profile: Up Capture > 100% and Down Capture < 100%, yielding a Capture Ratio > 1. "Up months" and "down months" are defined by the benchmark return being positive or negative, respectively.

M-Squared (Modigliani-Modigliani)

Expresses risk-adjusted return in the same units as return, by leveraging or deleveraging the portfolio to match benchmark volatility.

M^2 = R_f + SR_p * sigma_b
    = R_f + ((R_p - R_f) / sigma_p) * sigma_b

Interpretation: "If this portfolio were scaled to have the same volatility as the benchmark, it would have returned M-squared." This makes it directly comparable to benchmark returns.

Key Formulas

FormulaExpressionUse Case
Sharpe Ratio(R_p - R_f) / sigma_pReturn per unit of total risk
Sortino Ratio(R_p - R_f) / sigma_downsideReturn per unit of downside risk
Information Ratio(R_p - R_b) / TEActive return per unit of active risk
Treynor Ratio(R_p - R_f) / beta_pReturn per unit of systematic risk
Calmar RatioCAGR /MaxDD
Omega Ratiosum(max(R_i - tau, 0)) / sum(max(tau - R_i, 0))Full-distribution gain-loss ratio
Up CaptureR_p(up) / R_b(up) * 100Participation in rising markets
Down CaptureR_p(down) / R_b(down) * 100Participation in falling markets
M-SquaredR_f + SR_p * sigma_bRisk-adjusted return in return units

Worked Examples

Example 1: Sharpe Ratio Calculation

Given: A fund returned 12% annualized, the risk-free rate is 4%, and the fund's annualized volatility is 15%.

Calculate: Sharpe Ratio.

Solution:

SR = (0.12 - 0.04) / 0.15
   = 0.08 / 0.15
   = 0.533

The fund earned 0.533 units of excess return per unit of risk. This is in the "acceptable" range but below 1.0.

Example 2: Comparing Funds with Sharpe and Sortino

Given:

  • Fund A: Sharpe = 0.8, Sortino = 1.2
  • Fund B: Sharpe = 0.7, Sortino = 1.5

Calculate: Which fund is better for a downside-averse investor?

Solution:

Fund A has a higher Sharpe ratio (0.8 vs 0.7), indicating better total-risk-adjusted performance. However, Fund B has a notably higher Sortino ratio (1.5 vs 1.2), meaning it delivers significantly more return per unit of downside risk.

The divergence implies Fund B's volatility is more skewed to the upside -- its total volatility includes more "good" volatility (gains), while its downside volatility is relatively contained.

For a downside-averse investor, Fund B is preferable because the Sortino ratio better captures the risk they care about (losses), and Fund B's superior Sortino indicates better downside risk management.

Show full SKILL.md (405 more words)Show less
Example 3: Information Ratio

Given: A portfolio returned 10% annualized, its benchmark returned 8%, and the tracking error is 4%.

Calculate: Information Ratio.

Solution:

IR = (0.10 - 0.08) / 0.04
   = 0.02 / 0.04
   = 0.50

The manager generated 0.50 units of active return per unit of active risk. This is generally considered a good IR, suggesting consistent alpha generation relative to benchmark deviations.

Common Pitfalls

  • Annualizing Sharpe incorrectly: The Sharpe ratio scales by sqrt(N) where N is the number of periods per year. SR_annual = SR_monthly * sqrt(12), not * 12. The excess return and volatility must be in consistent units before dividing.
  • Using wrong risk-free rate frequency: If computing monthly Sharpe, use the monthly risk-free rate (annual rate / 12), not the annual rate directly.
  • Sortino MAR ambiguity: The Sortino ratio result changes significantly depending on whether MAR = 0, MAR = risk-free rate, or MAR = some target return. Always state the MAR assumption explicitly.
  • Small sample sizes making ratios unreliable: Ratios computed from fewer than 36 monthly observations are statistically unreliable. A Sharpe ratio from 12 months of data has a standard error of approximately sqrt((1 + SR^2/2) / 12), which is very wide.
  • Comparing Sharpe ratios across different time periods: A Sharpe of 1.0 in a low-vol environment is not the same as 1.0 in a high-vol environment. Performance ratios are period-specific and not directly comparable across different market regimes.

Cross-References

  • historical-risk (wealth-management plugin): Provides the risk measures (volatility, drawdown, downside deviation, tracking error) used as denominators in these performance ratios.
  • performance-reporting (wealth-management plugin) and return-calculations (core plugin): For TWR/MWR calculation methodology and reporting presentation, see performance-reporting and core/return-calculations.
  • forward-risk (wealth-management plugin): Forward-looking risk measures (VaR, CVaR) complement retrospective performance assessment by estimating future potential losses.
  • volatility-modeling (wealth-management plugin): Volatility forecasts from GARCH or EWMA can be used to compute forward-looking or conditional Sharpe ratios.
  • factor-investing (wealth-management plugin): Factor regressions decompose the alpha behind these ratios; the closet-index screen uses tracking error and a breakeven Information Ratio

Running the script

Run with uv run scripts/performance_metrics.py (the PEP 723 header resolves numpy automatically) or with python3 scripts/performance_metrics.py after pip install numpy scipy. A bare run prints a full scorecard (Sharpe, Sortino, Information Ratio, Calmar, Treynor, Omega, capture ratios, batting average, win/loss) on seeded synthetic portfolio and benchmark data. Use --verify to assert outputs match this skill's worked examples and the demo's expected values (exit code 0 on PASS) and --help for an overview of the class. The file is primarily meant to be imported as a module (e.g., from performance_metrics import PerformanceScorecard).

© JoelLewis, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (scripts) in plugins/wealth-management/skills/performance-metrics of JoelLewis/finance_skills.

  • SKILL.md
  • scripts/performance_metrics.py

Open the folder on GitHubat commit 5c498ea

Compare with similar skills

Performance Metrics next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Performance Metrics compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Performance Metrics this skillJoelLewis/finance_skills205—~2.4kAutomated safety check: PassMIT
Ads Performance Analyticsrampstackco/claude-skills941—~6.2kAutomated safety check: PassMIT
Subscription Revenue TrackerLeoYeAI/openclaw-master-skills2.2k—~5kAutomated safety check: PassMIT
Investor Reportrevfactory/harness-1001.3k—~1.7kAutomated safety check: PassApache-2.0
Sync Upstreamnyaruka/phonenumbers1.6k—~2.8kAutomated safety check: PassMIT
Radiology Tablehuang-sir1/radiology-skills1.9k—~1.3kAutomated safety check: PassCustom licence

Similar skills

  • Ads Performance Analytics

    rampstackco/claude-skills

    How to read paid media dashboards without fooling yourself. An agent skill from rampstackco/claude-skills.

    941 GitHub stars~6.2k tokensUpdated 2 days ago
    Business, Finance & HRAuto-check passed
  • Subscription Revenue Tracker

    LeoYeAI/openclaw-master-skills

    SaaS and subscription business revenue intelligence. An agent skill from LeoYeAI/openclaw-master-skills.

    2.2k GitHub stars~5k tokensUpdated 2 mo ago
    Business, Finance & HRAuto-check passed
  • Investor Report

    revfactory/harness-100

    A full pipeline that systematizes investor reports into financial performance analysis, KPI dashboard, market trends, strategy updates, and risk disclosures.

    1.3k GitHub stars~1.7k tokensUpdated 6 mo ago
    Business, Finance & HRAuto-check passed
  • Sync Upstream

    nyaruka/phonenumbers

    Sync this Go port with a new upstream google/libphonenumber release — regenerate the embedded metadata and reconcile the ported Java logic.

    1.6k GitHub stars~2.8k tokensUpdated 7 days ago
    Business, Finance & HRAuto-check passed
  • Radiology Table

    huang-sir1/radiology-skills

    Create/audit editable publication tables with source reconciliation; not figures or statistical inference.

    1.9k GitHub stars~1.3k tokensUpdated 18 days ago
    Business, Finance & HRAuto-check passed
  • Pine Backtester

    TradersPost/pinescript-agents

    Implements comprehensive backtesting and performance metrics.

    170 GitHub starsUsed in 1 repo~3.9k tokens
    Business, Finance & HRAuto-check passed

More from JoelLewis/finance_skills

All 91 skills in this repo
  • Asset Allocation

    JoelLewis/finance_skills

    Determine how to distribute capital across asset classes using strategic and tactical allocation frameworks.

    205 GitHub stars~2.5k tokensUpdated 2 mo ago
    Auto-check passed
  • Bet Sizing

    JoelLewis/finance_skills

    Determine how much capital to allocate to individual positions within a portfolio.

    205 GitHub stars~2.5k tokensUpdated 2 mo ago
    Auto-check passed
  • Commodities

    JoelLewis/finance_skills

    Analyze commodity markets including futures curve dynamics, roll yield, and supply/demand fundamentals.

    205 GitHub stars~1.9k tokensUpdated 2 mo ago
    Auto-check passed
  • Currencies And Fx

    JoelLewis/finance_skills

    Analyze currency markets, exchange rate mechanics, and FX risk management for international portfolios.

    205 GitHub stars~1.9k tokensUpdated 2 mo ago
    Auto-check passed
  • Debt Management

    JoelLewis/finance_skills

    Provide frameworks for managing and paying off personal debt effectively.

    205 GitHub stars~2.5k tokensUpdated 2 mo ago
    Auto-check passed
  • Diversification

    JoelLewis/finance_skills

    Build diversified portfolios using correlation analysis, efficient frontier construction, and factor-based diversification.

    205 GitHub stars~2.3k tokensUpdated 2 mo ago
    Auto-check passed

Questions about Performance Metrics

What does Performance Metrics do?

Evaluate investment performance on a risk-adjusted basis using industry-standard ratios and capture analysis. Performance Metrics is an agent skill from JoelLewis/finance_skills. Evaluate investment performance on a risk-adjusted basis using industry-standard ratios and capture analysis.

When should I use Performance Metrics?

Performance Metrics fits situations like: the user asks about Sharpe ratio; information Ratio; upside/downside capture; users mention risk-adjusted returns.

How do I install Performance Metrics in Claude Code?

Run `npx skills add JoelLewis/finance_skills --skill performance-metrics -a claude-code`. Or copy the skill folder (plugins/wealth-management/skills/performance-metrics in JoelLewis/finance_skills) into .claude/skills/performance-metrics in your project. Claude Code loads it when a task matches its description.

How do I install Performance Metrics in Codex?

Run `npx skills add JoelLewis/finance_skills --skill performance-metrics -a codex`. Or copy the skill folder (plugins/wealth-management/skills/performance-metrics in JoelLewis/finance_skills) into .agents/skills/performance-metrics in your project. Codex loads it when a task matches its description.

Can I use Performance Metrics in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add JoelLewis/finance_skills --skill performance-metrics -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/performance-metrics, .gemini/skills/performance-metrics, .github/skills/performance-metrics and .opencode/skills/performance-metrics in your project.

What does Performance Metrics need to run?

Going by SKILL.md and its folder, Performance Metrics needs Python for the scripts in its folder and the command-line tools its instructions call (uv, python3 and pip). Our summary lists: Python 3.

Does Performance Metrics access the network?

SKILL.md contains no URLs. Its commands use uv and pip, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Performance Metrics safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Performance Metrics use?

Performance Metrics is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Performance Metrics use?

About 2.4k tokens (SKILL.md is roughly 9.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Performance Metrics?

Skills that share tags, products or a category with Performance Metrics: Ads Performance Analytics (rampstackco/claude-skills, 941 stars), Subscription Revenue Tracker (LeoYeAI/openclaw-master-skills, 2.2k stars), Investor Report (revfactory/harness-100, 1.3k stars) and Sync Upstream (nyaruka/phonenumbers, 1.6k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Performance Metrics?

JoelLewis (a GitHub user) maintains it in JoelLewis/finance_skills, which has 205 GitHub stars. The repository holds 91 skills in this directory. The repository was last updated on July 18, 2026.

Source: JoelLewis/finance_skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.