/cms:combinefrom cms
Answers questions about CMS Combine (HiggsAnalysis-CombinedLimit) with citations from docs, paper, code and forums. Runs Combine commands locally or via a CERN remote service for debugging datacards, physics models, limits, fits, significances and goodness-of-fit.
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.
Combine is the CMS statistical-analysis tool: datacards, physics models, limits, fits, significances and goodness-of-fit. This skill does two things:
combine MCP server:
read-only retrieval over the official docs, the Combine paper, the source
code and the CMS forums (search_docs, fetch_doc).combine is on the user's PATH;
otherwise in the official Combine container from /cvmfs, when the site
has it; otherwise through the combine-run-remote MCP server
(run_combine), a CERN service that runs one command in a throwaway
workspace.run_combine sends the datacard and every shape file you pass to a
CERN-hosted service. For an unpublished or blinded analysis, check that this
is acceptable first, or run Combine locally or from the /cvmfs container.
Most requests need retrieval only. Run something when the user reports a command that misbehaves, asks you to run or try something, or when reproducing a result would confirm a diagnosis.
--X do", "why does Combine…")combine, text2workspace.py, combineCards.py
or combineTool.py commandThis skill uses short tool names. The tools you can call carry the plugin prefix:
| This skill says | Call it as |
|---|---|
search_docs | mcp__plugin_cms_combine__search_docs |
fetch_doc | mcp__plugin_cms_combine__fetch_doc |
run_combine | mcp__plugin_cms_combine-run-remote__run_combine |
If the names in your tool list differ, use those, copied character for
character (the prefixes mix _ and -).
source argument of search_docs / fetch_doc)| Source ID | Covers |
|---|---|
combine-docs | Official docs (MkDocs): how-to, CLI options, tutorials, reference |
combine-paper | The Combine paper, arXiv:2404.06614v2: methodology, definitions, the "why" |
combine-code | The source tree at a pinned release: what the implementation actually does |
combine-forum | cms-talk Statistics category (2022 onward): errors, workarounds, real-world edge cases |
combine-hypernews | Archived HyperNews (pre-2022): same kind of Q&A, older; lower priority, may describe outdated options |
These rules come from the combine-assistant persona
(config/AGENTS.md):
combine sources.Pick the source from the question type:
| Question | Start with |
|---|---|
"How do I X?", "What does --Y do?" | combine-docs |
| "Why does X work this way?", a definition | combine-paper |
| "I get this error / warning" | combine-forum, then combine-hypernews if nothing |
| "What does the code do?", "Is Z implemented" | combine-code |
If the first source comes up empty, fall through to the next most likely. Query two sources up front only when the question spans both (how and why, error and cause).
Search and read the scores. search_docs(query, source) returns up to
10 BM25 hits. A top score above ~15 with a clear gap: fetch it. Scores
within ~3 points: skim 2–3 snippets first. All below ~8: reformulate with
synonyms, the exact option name or the verbatim error text.
Fetch the cheapest view that answers with
fetch_doc(url_or_path, source, mode): outline to scout a long page or
thread, sections:<heading> for one section, post:accepted or
post:<N> for one forum post, markdown (default) for the full body.
Answer: the direct answer in 1–3 sentences, then inline links to the URLs the tools returned, verbatim (the per-post URL for a fetched post).
After two failed reformulations, say the corpus doesn't cover it and suggest posting on cms-talk. Never present a forum reply as if it were the canonical documentation.
The full procedure, the mode table and a worked example are in
references/retrieval.md.
Search combine-docs first: it covers every method and option. When the
server is unreachable, use the tested minimal patterns in
references/datacards.md (counting, template shapes,
unbinned parametric, RooParametricHist, and the common -M commands), and
tell the user that anything beyond them comes from prior knowledge.
combineTool.py --job-mode condor, crab):
explain instead. Don't run when no execution path is available, or when the
inputs are large and only combine-run-remote is available.command -v combine first, every timerun_combine
in that session, even though it is in your tool list./cvmfs/unpacked.cern.ch and apptainer exist
(typical on lxplus and cmslpc) → run Combine in the official Combine
container from /cvmfs, still in the user's directory and against their
files. The command is in
references/execution.md.
Don't call run_combine here either.run_combine.Run one Combine command per call: no pipes, redirects or && chains (the
container wrapper's own bash -c setup is the exception).
command -v combine # decides the path
combine -M AsymptoticLimits -d datacard.txt -m 125
In the shell, read the exit code, stdout and stderr; outputs such as
higgsCombine*.root stay in the working directory.
combine-run-remoteThe workspace is remote and empty: only the files you pass exist there.
shapes lines and read every ROOT file they name, as base64
(base64 -i shapes.root).run_combine with command (one command line), files (text inputs
as {name: content}), files_b64 (binary inputs as {name: base64}) and,
if needed, timeout_s. Refer to files by base name: the workspace is
flat.error set means a setup failure, not a physics result;
a non-zero returncode means Combine failed (read stderr); returncode
0 means success (report stdout and artifacts).run_combine).stderr line in combine-forum; check
combine-code or combine-docs for what the failing option requires.Details, the result fields and a worked example are in references/execution.md.
search_docs, fetch_doc and run_combine call fails to
connect, and the servers show as failed in /mcp. The retrieval server is
CERN-only by design, because it also serves CMS-restricted forum content.
For retrieval, tell the user to run Claude Code on lxplus, or on a laptop
connected to the CERN VPN. For execution, use a local Combine or the
/cvmfs container. Without the server, answer only from this skill's
references and clearly flagged prior knowledge.search_docs instead of the
prefixed name fails as an unknown tool. Use the name from your tool list.run_combine while Combine is on PATH fails with "file not found".
The remote workspace can't see the user's files, so a relative path such as
data/tutorials/counting/realistic-counting-experiment.txt doesn't exist
there. Check command -v combine and use the shell.run_combine returns error "not found on PATH". The server has no
Combine environment at that moment. Tell the user; don't guess numbers.combine-run-remote. Datacards plus shape
files beyond a few MB exceed its caps. Only a local Combine handles them;
otherwise explain rather than run.fetch_doc mode returns the whole page. For example
section:Rate parameters (missing s) silently gives markdown. Write
sections:<heading> exactly; if the reply's mode: line says markdown,
the mode was not recognised.post:accepted errors on an unsolved thread. Fetch the thread with
outline first and pick a post:<N>.combine-docs or
combine-code.run_combine uploads the inputs. The datacard and shape files go to a
CERN-hosted server. For an unpublished analysis, ask the user before the
first upload, or use a local Combine or the /cvmfs container.combineTool.py can submit batch jobs. Never submit condor or crab jobs
on the user's behalf.fetch_doc mode, formatting citations, or when
the corpus seems not to cover the question./cvmfs container or through combine-run-remote, when interpreting
the server's JSON result, or when working through a failing command.combine
server is unreachable.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
cms, higgs-analysis, statistical-analysis, datacard, combined-limit
npx claudepluginhub cms-ml/marketplace --plugin cms10 skills in this plugin
/analysis-spec-builderUse when a user wants to plan, scope or write down a CMS physics analysis or plotting task before coding it: creating or updating an analysis specification, turning a quick request ("plot the dimuon mass in 2016 data vs DY", "find the best trijet in ttbar") into a structured document, listing datasets, triggers, selections, histograms, corrections and statistical treatment, or producing a specification.md for later implementation./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./hepdataUse when preparing, writing, validating or reviewing a HEPData record for a CMS paper, PAS, or an Open Data study: converting spectra, efficiencies, cutflows, fit results, limits or hist/ROOT histograms into HEPData YAML with hepdata_lib, filling keywords, qualifiers and asymmetric uncertainties, running hepdata-validate, uploading to the HEPData sandbox, following the CMS (EXO, B2G) HEPData and reinterpretation requirements, or debugging errors such as "Got unexpected extra argument", "takes 2 positional arguments", "The tar ball is not valid", "Inconsistent length of 'values' list" or .nan values in the YAML./histUse when creating, filling, slicing, rebinning, normalising or plotting histograms in Python with scikit-hep hist / boost-histogram and mplhep, especially from CMS NanoAOD arrays: choosing axes and binning for GeV quantities, weighted fills with genWeight (including negative weights), normalising MC to cross section times luminosity, categorical axes for regions, processes or systematics, UHI indexing, CMS-style plots with hep.cms.label, ratio panels, or errors such as "has no attribute 'Weight'", "Select 'histtype' from" or "cannot convert to RegularArray" when filling./muon-tag-and-probeUse when measuring muon efficiencies or data/MC scale factors with tag and probe on Z → μμ in CMS NanoAOD: muon ID (tight, medium, high-pT), isolation or single-muon trigger (IsoMu24, Mu50) efficiencies in bins of pT and |η|; choosing tag and probe definitions; matching muons to trigger objects with TrigObj_filterBits; fitting pass and fail m_μμ spectra with signal plus background; comparing with or applying the Muon POG correctionlib JSON (muon_Z.json.gz, muon_HighPt.json.gz); or debugging scale factors that are above 1, differ from the POG by a few percent, or fits that fail in the fail category.Other plugins' skills for the same job