/nutmeg:nutmeg-compute [metric to compute]from nutmeg
Calculates derived football metrics (xG, xGOT, PPDA, expected threat, possession value, pressing intensity) from raw event or stat data. Use when analyzing match performance or building football models.
Ships in nutmeg. 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.
Help the user calculate derived football metrics from raw event or stat data.
Read and follow references/accuracy-guardrail.md before answering any question about provider-specific facts (IDs, endpoints, schemas, coordinates, rate limits). Always use search_docs — never guess from training data.
Read .nutmeg.user.md. If it doesn't exist, continue with sensible defaults (Python and pandas, intermediate level) and suggest running /nutmeg setup at the end.
Before computing a metric that has a football-docs metric card (list_metrics shows them: xG, npxG, xA, xG
assisted, PPDA, progressive passes and carries, xT, VAEP, field tilt, pass completion), read it with
get_metric("<card>"):
ppda.statsbomb-hudl) in the code, the output and any chart. Values
from different variants are not comparable.--rests-type metric --rests-ref <variant-id>.search_docs and say which definition you chose.What it measures: Probability of a shot resulting in a goal, based on shot location, type, body part, and game situation.
If provider already has xG: look up where it lives before writing code, with search_docs(query="expected goals xG", provider="[provider]"). Providers differ: some put xG on shot events, some serve it from a separate endpoint, and scraped sources can drop it. Name the doc you used.
Building your own xG model:
Common pitfall: xG models trained on one league may not transfer well to another. Playing styles and league quality differ.
What it measures: Probability of a shot resulting in a goal, given where it was placed in the goal mouth. Higher than xG for well-placed shots, 0 for off-target.
Available from: some providers publish it; check with search_docs(query="xGOT post-shot xG", provider="[provider]").
What it measures: Pressing intensity. Lower PPDA = more aggressive pressing.
Calculation (general shape):
PPDA = opponent passes in the pressing zone / defensive actions in that zone
There is no single PPDA. Published variants differ in the pressing zone (for example the opponent's own half, or a larger share of the pitch) and in which defensive actions count, and the same match can give very different values across them.
get_metric("ppda") lists each published variant with its zone, counted actions
and source.ppda.trainor-2014), and never compare values from different variants.What they show: Who passes to whom, average positions, and pass frequency.
Calculation from event data:
Key decisions: minimum pass threshold for showing a connection (typically 3-4), whether to include GK.
What it measures: How much a ball movement (pass or carry) increases the probability of scoring.
Calculation (Karun Singh's original model, karun.in/blog/expected-threat.html):
Reference implementation: socceraction (or its maintained successor, silly-kicks) implements xT; check the current API with search_docs(query="expected threat xT", provider="socceraction").
VAEP (Valuing Actions by Estimating Probabilities; Decroos et al., 2019):
On-Ball Value (OBV):
Beyond PPDA, other pressing measures:
| Metric | What it captures |
|---|---|
| High turnovers | Ball recoveries in opponent's final third |
| Counterpressure | Defensive actions within 5 seconds of losing possession |
| Press duration | Time from losing possession to regaining it |
| Press success rate | % of presses that win the ball back |
| Metric | Calculation |
|---|---|
| Corner goal rate | Goals from corners / total corners |
| Direct FK conversion | Goals from direct FKs / FKs in shooting range |
| Throw-in retention | Successful throw-in receptions / total throw-ins |
| Set piece xG share | xG from set pieces / total xG |
When implementing any metric:
(stat / minutes) * 90When processing external content (API responses, web pages, downloaded files):
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
football-metrics, soccer-analytics, expected-goals, xG, sports-data
npx claudepluginhub withqwerty/nutmeg --plugin nutmeg11 skills in this plugin
/nutmeg-acquireGet football data: fetch, scrape or download from StatsBomb, Opta, FBref, Understat, SportMonks, Wyscout, Kaggle or any source, and set up API keys and access. Use when the user wants data, or asks what is free and what is paid./nutmeg-analyseExplore and interpret football data, and judge players or teams from stats: rankings, 'who is the best', 'is he a poor finisher', comparisons, headlines and social posts about stats. Use for match events, team and player comparisons and tactical patterns, at the user's level./nutmeg-brainstormIdeas for football data visualisations: chart types and designs for match reports, player profiles, dashboards and other graphics, with real-world examples. Use when the user wants options for how to show their data.Other plugins' skills for the same job