/nutmeg:nutmeg-research [the question to research]from nutmeg
Runs football analysis as a structured research project with a question, plan, and claim ledger tying every number to evidence. Use for publishable work like shortlists, match reports, memos, or charts.
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.
Work like a research assistant, not an autopilot. The user must be able to check every input, every query and every number, and see why each choice was made. A research project keeps that trail in files the user and their teammates can open.
Read and follow references/accuracy-guardrail.md. Provider facts come from
football-docs and IDs from the Reep Register, never from memory.
Run every project command through the plugin's core, in exactly this form:
python3 "${CLAUDE_PLUGIN_ROOT}/core/nutmeg.py" <command> ...
Below, nutmeg <command> is short for that line. Run nutmeg --help or nutmeg <command> --help
for the options. If python3 is missing or older than 3.10, tell the user that research projects
need Python 3.10 or newer, and continue the task without a project.
The nutmeg command comes with the nutmeg Claude Code plugin. If ${CLAUDE_PLUGIN_ROOT} is empty or
core/nutmeg.py is not there (the skills were installed on their own, for example with
npx skills add withqwerty/nutmeg), tell the user once that research projects need the plugin, and
continue the task without a project: keep the question, the plan with reasons and the sources in
your answer instead.
Start one when the user wants analysis to publish or to decide on: a shortlist, a match or opposition report, a memo, a chart or thread for social media, or any answer they ask to be sourced. Do not start one for a quick question ("what is PPDA?", "what is Opta's qualifier for a cross?"), a code fix or a lookup.
shortlist-lb or arsenal-press-2025.nutmeg new <slug> --question "<the question in one sentence>".--data-in-git no or --data-in-git yes.The project lives in research/<slug>/ and becomes the active project. nutmeg status shows it.
nutmeg config show and note the user's levels for plan, run and publish (section 10). They
decide where you stop for approval.Fill in research/<slug>/question.md: the question, the decision or output it informs, the data
and scope (competitions, seasons, providers) and what is out of scope. Use the user's words. If the
decision it informs is unclear, ask one question.
Every choice of metric, filter, join, threshold, source, method or chart is a plan choice. Add each with:
nutmeg plan choose --kind metric --choice "npxG per 90" \
--why "Penalties distort per-player comparisons." \
--rests-type docs --rests-ref "football-docs: <provider> <doc title>"
--why is one sentence a data scientist can check. Say why this option and not the obvious
other one.--rests-type and --rests-ref say what the reason rests on:
docs: a football-docs result (name the provider and the doc you used);metric: a football-docs metric card variant, by its ID from get_metric (for example
--rests-type metric --rests-ref ppda.statsbomb-hudl); use it for any metric that has a card, so readers see
exactly which definition a number uses;registry: a Reep Register record;rule: a practitioner rule, such as references/metric-misuse.md;paper: a paper or post;claim: an earlier claim in this ledger;user: the user's instruction, quoted.user only
when the user asked for it.Run nutmeg plan check and fix what it reports. Make the choices before you run anything: the plan locks
automatically at the first nutmeg run, and that locked plan is the primary specification. Choices added or changed
later are allowed, but the publish card and the workspace list them as made after the lock (nutmeg plan diff).
Then follow the user's plan level:
For data from a scrape, a download or an unknown source, record it first with
nutmeg data add <file> --source "<where it came from>": its profile reports duplicated rows, repeated IDs and
empty columns, which you then deal with (and say how) before analysis.
Put each analysis step in a .py, .R or .sql file in the repository, then run it with:
nutmeg run analysis.py --input data/events.csv --sql queries/shots.sql -- --season 2025
--input once for each data file or folder the step reads. Nutmeg hashes each one.--sql once for each SQL file the script runs, so the user sees the exact query.--sends host:columns for any data the step sends to an outside service, for example
--sends api.example.com:player_id,minutes.-- go to the script.$NUTMEG_OUTPUT_DIR, so the run records them.Run nutmeg run on its own: no &&, ;, pipes or redirects. When the research hooks are on
(nutmeg config show says so; they are off unless the user or the team turned them on), the user sees
a gate card before it runs, with the services and data the step uses, the inputs and the exact code
and SQL, and approves it. A re-run shows only what changed since the last run of the same file. If
the user declines, ask what to change. With the hooks off, the run goes ahead under the agent's
normal permissions and is still recorded. Do not turn the hooks on yourself.
If the user wants to see the card without running anything (or run the code themselves), use
nutmeg gate with the same arguments.
Numbers from a direct python3 script.py, Rscript, duckdb or psql call are not recorded and cannot go
into the ledger, so use nutmeg run. With the hooks on, such a call raises a "not recorded" card.
A run must not change the files it reads: write cleaned data to a new file. If an input changes after a run (new
data, a correction), nutmeg check marks the claims from that run as stale; run it again and update them.
Every number, provider fact, ID, citation, definition and interpretation that appears in the project's outputs goes into the ledger:
Add claims in batches, not one call each: write them to a JSON Lines file (one claim per line) and add them all in one call. Each is checked on its own, and the command lists any it rejects so you can fix just those.
nutmeg claim add --file new-claims.jsonl
where each line looks like:
{"kind": "computed", "statement": "npxG/90 rose to 0.41", "value": 0.41, "evidence": {"run_id": "R3", "metric": "npxG per 90", "n": 31, "filters": {"min_minutes": 900}}, "why": "Per 90 with a 900-minute floor keeps small samples out."}
Each kind needs its evidence:
| Kind | Use for | Evidence it needs |
|---|---|---|
computed | a number the analysis produced | run_id of the recorded run (nutmeg run prints it), plus value; add metric, n, filters |
provider_fact | a fact about a provider's data | provider, and source: the football-docs result you used |
identity | a player, team or match ID | reep_id and release from the Reep Register |
literature | a citation | citation; add source_id and the quote match from football-docs |
definition | what a term or metric means here | definition |
interpretation | a judgement that rests on other claims | claims: the IDs it rests on |
gap | something the work set out to establish and could not | reason (no data, too small a sample); never a value |
supported or contested.0.41 [C3].value
leaves the other numbers without evidence. A table is one claim: its value is the list of the numbers the table
shows, row by row, with the rows in evidence.snapshot (a CSV the run wrote), and the line above the table cites
it, for example Table 2: points by season [C9]. nutmeg check then checks every number in the table against
that list.nutmeg claim withdraw C4 --note "replaced by C23-C26". Outputs that still cite it then fail the check.nutmeg claim list shows the ledger and any bad lines.Write the report as you go. Draft it as soon as the main result exists, and add claims as numbers go into it, in
batches. Do not claim numbers ahead of writing, or numbers the outputs will not show. If a long task is cut short,
the report should already hold the main answer. Publishing has its own requirements
(${CLAUDE_SKILL_DIR}/references/publishing.md); do not spend the analysis on them.
Write the report as research/<slug>/report.md (more reports can go in research/<slug>/reports/)
and figure captions next to the figures. Put the claim ID next to each number.
Run nutmeg check. It lists every number with no ledger claim, every number that matches more
than one claim, every citation without a resolved source and quote match, and every provider fact
without a football-docs source. Fix each one: add the claim with its evidence, or correct the
output.
When a step ends with open problems, nutmeg stops you once with the list. Fix them. If the user
says a problem is not one, record their reason:
nutmeg check --accept <id> --reason "<the user's reason>". Never accept a problem on your own.
nutmeg figure register <name> --data <snapshot> --source "<source>" --claims C3,C5 --season "<competition and season>" --filters "<filters>" --metric "<metric>" --run R2 --image <chart file>.
Put the footnote it prints under the chart. /nutmeg:brainstorm has the chart conventions.When the user asks to publish, share or hand over the project, read
${CLAUDE_SKILL_DIR}/references/publishing.md first. It covers what publishing needs (alternatives for headline
results, limits on judgements, a source for each input, the teach-back), sign-off, nutmeg publish and
nutmeg bundle. Do not do that work during the analysis.
nutmeg why <claim> prints a claim's value, definition, evidence (the run and code lines, the
docs source, the Reep ID and release, or the paper and quote), filters, n, up to five sample
rows, the reason and its history. Use it to answer "where does this number come from?". Add
code_lines (for example analysis.py:12-20) and snapshot (a CSV or JSON of the rows behind
the number) to a computed claim's evidence so why can show them.nutmeg trace prints inputs, runs, claims and figures as a tree.nutmeg workspace writes research/<slug>/workspace.html: the review queue, question, plan with reasons, ledger
with each claim's evidence, report, figures, runs and the glossary entries it links. Regenerate it after changes
and tell the user where it is. It is view-only; approvals happen here in Claude Code.references/glossary.md for metrics where you can. For a metric that is not in it,
add a definition claim so readers know what it means: name the metric's term in its statement, or set
evidence.term to it, so nutmeg check links the two.Follow references/understanding.md:
nutmeg explain decline "<topic>"). Make it with nutmeg explain new <slug>, fill in the Markdown with claim
IDs next to each number, then nutmeg explain render <slug>. The user edits the .md and renders again; the
.html is one file they can share.nutmeg plan choose ... --after-results "<what it replaces>" (the method, not the person).nutmeg config show prints the user's persona and autonomy levels (L1 suggest, L2 draft, L3 execute with
checkpoints) and the team limits from .nutmeg/team.json. Follow them:
nutmeg gate with the run's arguments to show the card, and let the user run the code.nutmeg run; the user approves each run.nutmeg queue lists the cards waiting for review. Tell the user.--headline when you add them.When the user is done with the project, run nutmeg close. The files stay; only the active marker
goes. nutmeg open <slug> makes it active again.
The ledger and plan are plain files. Analysis code can be Python, R or SQL; follow the user's
profile in .nutmeg.user.md.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
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./nutmeg-computeCalculate derived football metrics and models. Use when the user wants to compute xG, xGOT, PPDA, passing networks, expected threat, possession value, pressing intensity, or any derived football statistic from raw data./nutmeg-healFix broken football data scrapers and pipelines: failed requests, API errors, changed formats. Also drafts upstream issues or PRs when the bug is in a dependency such as soccerdata or kloppy./nutmeg-learnExplain football analytics concepts and provider documentation: what a metric means (xG, PPDA, xT), learning paths and resources, and provider details such as qualifier IDs, coordinate systems, event types, schemas, ID schemes, coverage, or comparing providers.Other plugins' skills for the same job