/cms:analysis-spec-builderfrom cms
Turns informal CMS physics analysis requests into structured specification.md documents covering datasets, triggers, selections, histograms, corrections, and statistical treatment.
Ships in cms. 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.
Turn an informal analysis request into a concise, structured specification
that someone (or an agent) can implement. Fill the CMS template, ask only the
questions that block progress, iterate until the user confirms, then write
specification.md. The spec says what is to be done. It is not an
implementation plan.
specification.md with new details| Section | Must capture |
|---|---|
| Data Samples | Exact DAS names (verbatim), tier, era/campaign, role. Golden JSON, triggers, MC normalisation |
| Histograms | Quantity, LaTeX label with units (GeV), binning if given, entries per event, weights |
| Analysis Steps | Object and event selections, derived variables, explicit combinatorics |
| Corrections and Systematics | POG corrections/SFs and variations, or "None" |
| Workflow | Source-level skim, branches to read, then histogramming |
| Statistical Analysis / Tools | Fit/limit or "None". Which tool does what |
{{...}} with content derived from the request. Keep
the section order.(question: ...) rather than leaving a placeholder.specification.md (or the path they give)
and say where it was written.Check that no placeholder survived:
grep -n '{{' specification.md || echo "no placeholders left"
| Topic | Default |
|---|---|
| Data format | NanoAOD (NANOAOD / NANOAODSIM) |
| Dataset lookup | dasgoclient -query="dataset=/<Primary>/<Era>*/NANOAOD*". Never invent dataset names; ask |
| Data quality | Apply the Golden JSON for the era (state it as a question if unconfirmed) |
| MC weights | genWeight × σ × L / Σ Runs/genEventSumw. Cross section and its source as a question |
| Reading/skim | uproot + awkward (coffea for large multi-file processing) |
| Kinematics | vector |
| Corrections | correctionlib with POG JSON files |
| Histograms | hist + mplhep (CMS style), PNG output |
| Statistics | Combine (binned shape fits, limits) when a fit is requested |
The awkward-array, vector-awkward and hist skills cover the
implementation of these tools.
genWeight, Pileup_nTrueInt, GenPart_*
exist only in MC, so list them separately in the Workflow.$m_{\mu\mu}$ [GeV]).genWeights. The
normalisation line must use the sum of weights, not the event count.analysis-spec-builder skill
(BSD 3-Clause; see plugins/cms/VENDORED-LICENSES.md):
https://github.com/iris-hep/marketplace/tree/main/iris-hep/skills/analysis-spec-builderWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub cms-ml/marketplace --plugin cms10 skills in this plugin
/awkward-arrayUse when working with jagged or variable-length arrays in Python with Awkward Array 2 (import awkward as ak): reading CMS NanoAOD or other ROOT ntuples into arrays with uproot, building per-object records with ak.zip, selecting objects or events with masks, counting with ak.num or ak.count, pairing objects with ak.combinations or ak.cartesian (dilepton masses, deltaR, jet cleaning), taking the leading object or argmax per event, following NanoAOD index branches such as Jet_muonIdx1, flattening for histograms, writing Parquet or JSON, or debugging awkward errors such as "cannot slice", "index out of range" or None values appearing in results./cmsswUse when setting up or working inside a CMSSW release area (cmsrel, cmsenv, scram), choosing a CMSSW release or SCRAM_ARCH for a dataset, running an old release inside a cmssw-el7/el8 container, checking out or patching CMSSW packages with git cms-addpkg or git cms-merge-topic, writing or building an EDAnalyzer, EDProducer or EDFilter, writing or debugging a cmsRun Python configuration (_cfg.py, _cfi.py, _cff.py), inspecting EDM ROOT files (MiniAOD, AOD, RECO) with edm* tools, or installing extra Python packages on top of a CMSSW release./combineUse when working with CMS Combine (HiggsAnalysis-CombinedLimit): writing or debugging a datacard or physics model, choosing or running a Combine method (AsymptoticLimits, FitDiagnostics, MultiDimFit, HybridNew, Significance, GoodnessOfFit, ChannelCompatibilityCheck, Impacts), interpreting Combine output, explaining a Combine error message or warning, asking how or why Combine does something, or running a Combine command (combine, text2workspace.py, combineCards.py, combineTool.py) to reproduce, diagnose or confirm a result.Other plugins' skills for the same job