het-agi/collideragent/micromegas-calculator
Claude Code and agent skill by het-agi/collideragent
- community
Checking that the SKILL.md file is still in the repository.
Compute dark matter observables (relic density, direct detection, indirect detection) via micrOmegas on the Magnus cloud. Triggers when the user wants to calculate Ωh², DM-nucleon cross sections (SI/SD), annihilation ⟨σv⟩ into SM final states, or indirect-detection γ/ν/e⁺/e⁻ spectra. Consumes a CalcHEP model (from the calchep-generator skill) plus a user-supplied main.c.
Install
npx vskill@latest install het-agi/collideragent/micromegas-calculatorSKILL.md
micrOmegas Calculator
Overview
This skill runs micrOmegas for dark matter phenomenology using two Magnus blueprints in sequence:
- `micromegas-compile` — drops the CalcHEP model into a fresh micrOmegas project, installs the user-supplied
main.c, and compiles the executable. The symbolic CalcHEP engine is pre-built in the container, so this step only compiles user code and auto-generated matrix elements. - `micromegas-calc` — runs the compiled
./mainonce, captures its stdout and the structuredresults.jsonit writes, and uploads any additional output files.
Both steps execute on the Magnus cloud (see magnus skill).
Prerequisites
CalcHEP model with Z₂-odd marking
micrOmegas identifies dark-matter candidates by the `~` prefix on particle names in the P column of prtcls1.mdl — there is no separate Z₂ quantum number. Every Z₂-odd particle (the DM candidate plus any coannihilation partners) must appear as ~<name> in that column.
Concrete verification step after generate-calchep:
should list every intended Z₂-odd field. Reference examples from shipped micrOmegas projects: SingletDM → ~x1; IDM → ~H3 ~H+ ~X; RDM → ~chi0 ~chi1.
If no ~-prefixed particles appear, the .fr source is still wrong — fix it at authoring time, not by hand-editing .mdl files (the hand-edit gets lost the next time generate-calchep runs). Without the convention, `sortOddParticles` may fail, `darkOmega` may return `NaN`, and every cross section may read zero — yet the blueprint can still see exit code 0. The blueprint detects the known silent-failure markers (Can not compile, Omega=NAN, Omega=nan) and surfaces them as success: false in MAGNUS_RESULT; the caller should still check success before consuming numbers.
Current repo limitation: generate-calchep invokes plain WriteCHOutput[...] and does not pass a dedicated odd-particle list. Therefore the only reliable contract is the generated prtcls1.mdl itself. A FeynRules-side pattern that is verified to work in the current pipeline is to encode the tilde directly in ParticleName (and AntiParticleName for non-self-conjugate fields). Still, treat the exported prtcls1.mdl as the final authority, because export behavior is model-dependent. Likewise, do not assume QuantumNumbers -> {Z2 -> -1} by itself is enough: custom quantum numbers need explicit model-level declarations, and the CalcHEP writer may still not translate them into micrOmegas odd-particle names. Regenerate and re-check prtcls1.mdl until the exported names are correct.
main.c protocol
The user-supplied main.c is responsible for:
- Setting parameters (either by
assignValW/assignValCcalls, or by callingslhaReadon the SLHA file thatmicromegas-calcpasses asargv[1]) - Calling whichever subset of micrOmegas API it needs (
sortOddParticles,darkOmega,nucleonAmplitudes,calcSpectrum, …) - Writing structured results to `results.json` in the working directory. The blueprint parses this file and surfaces it in
MAGNUS_RESULT.
6.3.0 API note: read the dark-matter name from CDM[1] (a char** array). The legacy globals CDM1/CDM2 are still declared in micromegas.h for source compatibility but sortOddParticles no longer fills them — they read as NULL at runtime. Mass is McdmN[1] (still works as before). Same shift applies to nucleonAmplitudes(CDM[1], …).
A minimal skeleton:
Use bare #include "micromegas.h" as shown above. micromegas-compile exports CPATH=<MICROMEGAS_ROOT>/include to the underlying make invocation, so the same main.c compiles unchanged on the cloud and against a user's local micrOmegas install — no ../include/... prefix needed. Either form works (the legacy #include "../include/micromegas.h" is still resolvable), but bare include is the preferred convention because it stays portable across install layouts.
Also treat parameter names as data, not guesses: assignValW("Name", value) must use the exact Name column from vars1.mdl, and the function returns nonzero on unknown names while leaving defaults in place. For example:
For anything beyond a protocol smoke test, prefer starting from the closest micrOmegas reference main.c for that model and then trimming it down. Some models need extra setup before heavy calls such as darkOmega or nucleonAmplitudes.
Anything not written to results.json is still preserved in the uploaded output directory, and stdout is tailed into MAGNUS_RESULT for debugging.
Output Paths
All paths are relative to the working directory.
| Output | Path pattern | Example | |
|---|---|---|---|
| Compiled project | dm/<project_label>/ | dm/singlet_scalar/ | |
| Run output | dm/<project_label>/<run_label>/ | dm/singlet_scalar/mS_700GeV/ | |
| Structured result | dm/<project_label>/<run_label>/results.json |
Naming conventions:
<project_label>: short model name, e.g.singlet_scalar,IDM<run_label>: benchmark-point tag, e.g.mS_700GeV,tanb_10,point1
Workflow
Step 1: Compile the project
Parameters:
| Parameter | Required | Description | |
|---|---|---|---|
--calchep | Yes | Path to CalcHEP model directory (from generate-calchep). Must contain vars1.mdl, func1.mdl, prtcls1.mdl, lgrng1.mdl at top level or one subdirectory down. | |
--main | Yes | Path to the user's main.c | |
--output | Yes | Where to download the compiled project directory | |
--project | No | micrOmegas project name (used by newProject); defaults to dm_project |
The CalcHEP directory and main.c are uploaded via FileSecret. On success, the compiled project — including the ./main binary and the auto-generated matrix-element code — is downloaded to --output.
WARNING: If --output points to an existing directory it will be deleted and replaced.
Result (magnus job result <job-id>):
success(bool)project_dir(str): path to the compiled projectmain_binary(str): path to./maininside the container (informational)make_log_tail(str, only on failure): last 3000 chars ofmakeoutput
Step 2: Run the calculation
Parameters:
| Parameter | Required | Description | |
|---|---|---|---|
--project | Yes | Path to the compiled project directory (Step 1's output) | |
--output | Yes | Where to download the run output (includes results.json) | |
--slha | No | SLHA parameter card (only if main.c calls slhaRead(argv[1], 0)) | |
--extra_args | No | Extra positional arguments appended to ./main (space-separated) |
Result (magnus job result <job-id>):
success(bool)output_dir(str): path to uploaded run outputresults(object, ifresults.jsonpresent): the parsed JSON written bymain.cstdout_tail(str): last 4000 chars of./mainstdoutstderr_tail(str, on failure only)
Parameter scans: compile once, run many
Because the compiled project is returned as a directory and consumed by --project, a typical scan looks like:
Every run reuses the single compiled binary — the expensive symbolic-amplitude step is paid only once.
Examples
Relic density only
main.c:
Relic + direct detection (SI/SD on p/n)
Key conventions
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingsrc/skills/micromegas-calculator/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/het-agi/collideragent/micromegas-calculator)