ask-matt
MAmattpocock/skills336k5,004 new stars in the last 7 days
Author new Cosmos3 agent skills and their eval configs, and get them through the skill eval. Use when adding a skill under .agents/skills/, migrating a cookbook notebook or README into a skill, writing or updating an eval.config, choosing eval cases and assertions, fixing a skill after a failed or self-corrected eval cell, reading an eval report on the dashboard, or preparing a skill PR. Covers the required structure, the writing rules that decide first-attempt pass/fail, the eval.config schema (multi-case evals), how the evaluator judges, and how to run the eval in GitHub CI or locally. Do not use it to run the Cosmos3 workloads themselves (the per-workload skills do that) or to change the evaluator.
How to write a skill for this repository and make it automatically evaluable.
.agents/skills/ is the source of truth for agent skills; keep the existing
layout (one directory per skill) and do not restructure it.
The bar: a skill passes its eval when every documented command works unchanged
on the first attempt, for each of the four agent backends, on every runner class
(see references/running-the-eval.md).
Self-corrections count against the skill. ../cosmos3-inference-generate-media/SKILL.md
is the worked example behind every rule in this file.
.agents/skills/<skill-name>/
├── SKILL.md # required — the runnable path (read first by agents)
├── eval/
│ └── eval.config # required for CI evaluation — see below
├── assets/ # vendored sample data the eval cases consume
├── references/ # optional: sources migrated 1:1 (notebooks, READMEs) with marked skill notes
└── scripts/ # optional: deterministic helpers SKILL.md links to (shebang, executable)
eval/ is the home for everything evaluation-related (config today; fixtures,
goldens or overrides later). The evaluator also accepts a legacy top-level
eval.config.
Rules the automated static checks enforce (keep them green):
name: must equal the directory name; description: must
exist, be ~60–1200 chars, and contain an explicit trigger clause
("Use when ...") — the description is the ONLY text agents see when
deciding to load your skill, so pack it with the user phrasings you want
to match.body size warning that costs 5 points of the static
score, visible as the dashboard's "Static" tile) — but the budget is never a
reason to drop a pin, a prerequisite, a success signal or a recovery step.
Keep the essential workflow, the worked example and every decision rule in
SKILL.md; put conditional detail, long notes and 1:1 migrated sources in
references/ and link to them at the step where they matter — the worked
example is held to the same budget, with its long notes under
references/; put deterministic, repetitive operations in scripts/. One
canonical source per shared fact (checkpoint names, prompt formats, request
bodies) — link to it, do not copy it into files that drift.cosmos3-setup's "Path convention" section).*.sh needs a shebang.Section order that works (the cosmos3-inference-generate-media layout): a short
intro; Read this first (numbered rules the agent must apply before the
first command: which reference to read, what to check on the host, which tool
versions each variant uses, how to verify outputs); any decision tables
(model sizes vs GPU with measured figures, per-backend switches); one
section per variant / use case with a Reference: line, the runnable block
and, for server-mode variants, the request body and the readiness rule;
Verify the output; Reference files; Things not obvious from the
docs; Related skills. Keep a "When to use this skill" list near the top.
Before writing a line, define: the one user job and its outcome; the target
user and what they must already have (hardware, access, artifacts); one
representative request and one accepted result; the shortest executable happy
path; which content belongs in SKILL.md, in references/, in scripts/.
Write two or three positive trigger phrasings, two negative ones (requests the
skill must NOT answer — e.g. Reasoner inference for a Generator skill) and one
forward workflow test; run them against the finished skill with a fresh agent.
export, source …/activate and cd do not
carry over. Give every command an explicit target (--python <venv>,
<venv>/bin/python, absolute paths), say when a block must run as one call,
and make the failure mode a stop, not a silent install somewhere else.python -c "import …", <tool> --help | grep …) before any
large download, so a wrong install fails in seconds, not after the download.setsid … &), the readiness route with its warm-up behaviour and a
deadline, logs kept (no --rm), teardown by process group with escalation,
and never a second server on a busy GPU.references/ file
migrated from a notebook or README keeps the source wording and headings;
every eval-derived addition sits next to the source text as a marked note
("Skill note (not in the source): …"), and every deviation from the source
is declared in the block that carries it and listed in the fixes PR.Before/after evidence for each rule: the worked example
../cosmos3-inference-generate-media/SKILL.md; its fixes and the 44/44 result cited
below come from the stacked fixes PR (#327), which merges into the #324 branch
before that branch reaches main.
\ on every continued line, launcher options
before the entry point (torchrun … -m module …), quoting and order preserved.One cell = one eval case × one agent backend (claude, codex, cursor, opencode). Per cell the report carries:
PASS / FAIL (the tester's own verdict in eval_report.md),
NO-REPORT (the agent finished without writing the report), ERROR (model
gateway, agent or node failure: status_reason says which; a gateway budget
error is not a skill result).PASS only when the documented workflow needed no
correction: from grading.json (self_correction.was_needed, with
first_attempt_errors items tagged owner: skill | tester | environment —
tester-only slips such as quoting errors or a missing editing tool do not
count) and the report's "First attempt: SUCCEEDED | FAILED" line.skill, framework, docs, evaluator,
environment, expected-agent-variance) and fix suggestions (lv1_serious
with file:line edits into the skill, lv2_improvements). Only skill (and
framework when the skill documents that framework command) need a skill
change; take the diagnosis, check the proposed wording against the sources.first_attempt = FAIL) even if a
retry later succeeded — it does not change the cell status. "The skill's
documented workflow executed without errors on the first attempt" should
therefore be an assertion of every case.The eval.config is the measuring stick: once a case exists, fix the skill, never the prompt, the assertions or the checks — a before/after comparison is only meaningful on an identical config.
eval.config is JSON. The evaluator (cosmos-skill-eval, Harbor-based) runs
every case with real agent harnesses — Claude Code, Codex, Cursor CLI and
OpenCode (--backend claude,codex,cursor,opencode) — and produces one report
with four criteria: Discovery (pass/fail — did the agent find and apply the
skill?), Execution (graded Correctness / Effectiveness / Discoverability /
Efficiency), Skill lift (opt-in), Static.
{
"evals": [ // one entry PER USE-CASE (multi-case supported)
{
"id": "t2v-smoke", // short, stable, kebab-case
"prompt": "User-voice TASK ONLY: what to produce, which bundled asset to use (skill-relative path), and the required output filename under outputs/. Environment setup, model loading details and flags belong in the SKILL, not here; artifact/summary/headless rules are injected by the evaluator automatically.",
"expected_outcome": "One sentence a grader can verify from artifacts.",
"assertions": [ // authored ONCE, reused every run — do not leave empty
"Concrete, evidence-checkable statements about first-attempt behavior and outputs"
],
"checks": [ // deterministic file checks (no LLM)
{"path": "result_summary.md", "min_bytes": 100},
{"path": "outputs/video_0.mp4", "min_bytes": 1000}
],
"stages": ["prepare", "inference", "verify"] // optional: pins the report's stage table rows
}
],
"credentials": ["HF_TOKEN"], // env vars forwarded to the agent (HF_TOKEN, NGC_API_KEY, GITHUB_TOKEN; the inference key is the evaluator's own)
"gpus": 1, // GPUs for the task container (runners: H100 80 GB PCIe/SXM and 94 GB NVL — every case must fit all of them); a case may set its own "gpus" (cells of a case with more than one go to the multi-GPU runner)
"shm_size": "32gb", // optional, per case or global: /dev/shm of the task container (Docker's default is 64 MB); set it for cases that train, whose data-loader workers pass batches through shared memory
"docker": false, // per-case or global: give the agent the host docker socket (read-only mount) for container-served backends (vLLM-Omni, SGLang, NIM)
"budget": {"minutes": 45, "tokens": 3000000}, // drives timeouts + Efficiency scoring; cells that install a framework in-run take 15–45 min
"setup": { // for skills that need the repo checkout
"repo": "https://github.com/NVIDIA/cosmos-framework.git",
"ref": "<pin a commit sha>",
"dest": "/app/repo",
"src_mount": "/opt/cosmos-src" // runners without GitHub egress mount a snapshot here
},
"lift": {"enabled": true} // OPT-IN with-skill vs no-skill comparison arms
}
Skill lift is OFF by default. It triples agent runs, so enable it only where the comparison is informative — utility skills whose value is guidance (setup, troubleshooting, authoring). For workload recipes (inference/training runs), leave it off: the execution criterion already measures what matters.
Authoring rules:
id named after
the variant). The report shows a case matrix plus a full section per case.first_attempt = FAIL) even if a retry later
succeeded — it does not change the cell status.assets/ directory. Never
reference assets in another repository — source material may be retired
once a skill ships. If the original data is gated or unavailable, pick a
small open Hugging Face asset of the same modality and say so in the
prompt. Never require a multi-GB download for a smoke case.budget.minutes.budget drives arm timeouts and is what the
Efficiency dimension scores against — set it to what a competent run
actually needs, not a wish.outputs/<name>.png) and the prompt should
say where to put it.Full detail: references/running-the-eval.md.
GitHub CI (self-hosted H100 runners). Nothing runs automatically. Two
triggers: an owner, member or collaborator comments /run-skill-eval [args]
on the PR — this fires only once the workflow file is on main (the comment
runs main's copy) — or someone dispatches the workflow with the same args
(Actions → skill-eval → Run workflow, or
gh workflow run skill-eval.yml --ref <branch> -f pr_number=<N> -f scope=full|smoke -f args='<args>',
which runs the copy on the branch you name): the dispatch is the way until the
workflow is on main, and also the way to re-measure one cell
(force cells=<backend>/<case>). No args: every touched skill with an
eval/eval.config, all four backends; cells with a reusable result for the
same skill content are reused. Args: force (run
everything, reuse nothing — after a skill change you want fully re-measured),
rerun-failed (only the cells that are not PASS), smoke-only (alias smoke;
the CPU-only canary alone, a pipeline check — add force, otherwise cached
canary cells are reused and nothing runs), with-smoke (the canary first, then
the skills — the canary never runs unless asked for), cells=<backend>/<case>,…
(only the matching cells; shell globs over <backend>/<case> or
<skill>/<backend>/<case>), group=<id> (file the runs under that dashboard
group).
The run posts one live comment per head commit (case × backend table with report links; same-commit re-runs update it)
and files the cells under the dashboard group ci-pr<N>-<sha7> of the skill
version. Three runners, one cell each at a time: H100 PCIe 80 GB with 125 GiB
host RAM, H100 SXM 80 GB with 251 GiB, H100 NVL 94 GB with 1 TB — a cell lands
on any of them, so the skill must work on all three. An 11 × 4 matrix takes
about two hours and roughly $100–130 of inference-hub budget (the
COSMOS_SKILL_EVAL_NVIDIA_API_KEY secret); ERROR cells with model_api
reasons are gateway or budget problems, not the skill.
Locally (any docker + GPU host with the image; the CI runner hosts already have the launcher, env file and image):
~/cosmos-skill-eval-src/scripts/cosmos-skill-eval --env-file ~/cosmos-skill-eval.env \
--image "$(sed -n 's/^image: //p' .github/skill-eval.yml)" --skill-src <checkout> \
--output-dir ~/run-claude-my-case \
eval /workspace/skill-source/.agents/skills/<skill-name> --backend claude --case <id>
The env file supplies NVIDIA_API_KEY (required, never baked into the image;
the launcher prints where the key came from, never its value) and the case
credentials; COSMOS_EVAL_GROUP_ID=<group> files the run under a dashboard
group; --no-publish keeps it private. The container publishes by itself (S3
upload + dashboard refresh) and ends with the links (<dashboard> below is the
dashboard host named in the reference). Image v20261030 and older print two
lines: [cosmos-eval] published: <dashboard>/runs/<run_id>/ and
[cosmos-eval] s3: s3://…/runs/<run_id>/. Image v20261031 and newer
(evaluator 0.3.2) print four: [cosmos-eval] group: <dashboard>/skills/<skill>/groups/<group>/, [cosmos-eval] compare: <dashboard>/skills/<skill>/compare?b=group%3A<group> (B is preselected, pick
A), then published: and s3:; <group> is COSMOS_EVAL_GROUP_ID when set,
else the run id (a one-run group); published.json beside report.json holds
the same url, group_url, compare_url and s3_prefix. Read the run page
(one tab per case × backend: report, transcript, corrections, fix suggestions,
media, a Static box with the run's static score), the group page (matrix with
first-attempt marks; the "Static" tile next to "Pass rate" on the skill and
group pages is the version's static score) and the compare view
/skills/<skill>/compare?a=<ref>&b=<ref> (Static · A and Static · B tiles
with the delta on B), where a ref is
group:<id>[@<ISO asof>], branch:<name> or run:<run_id>; both refs are
required (with only b the page shows pickers). Examples:
compare?a=group:ci-pr324-b50b766&b=group:ci-pr327-b7ad087 and
compare?a=branch:skills/generate-media-migration-and-eval-public&b=branch:skills/generate-media-fixes-public.
Static checks (<1 s, no agent): the evaluator's static tier enforces the
structure rules above and scores them 0–100 (critical −15, warning −5) — the
dashboard's "Static" tile; CI's pre-commit (rumdl) formats the Markdown.
A skill is done when every cell of its matrix is PASS and first-attempt PASS.
The way there is a loop, run as a separate PR stacked on the skill's PR so the
measured skill and its fixes stay reviewable apart (full detail:
references/running-the-eval.md § 4):
eval/eval.config; one commit per root cause, every addition marked as a
skill note and recorded in the migration record.force cells=<backend>/<case>.
Repeat 2–3 until every affected cell is first-attempt PASS. An ERROR from
the gateway, a budget cap, a runner or an agent service is a rerun, not a fix.eval/eval.config is
unchanged.Owner gates: each iteration — which cells to treat, which fix, which rerun, and
any full run — is proposed to the skill owner and runs only after they confirm.
Commits land on the fixes PR branch; the skill PR is not touched until the loop
is done. The fixes PR merges into the skill PR's branch first; the skill PR then
carries both to main.
.agents/skills/<skill-name>/ (plus docs the skill
references). Don't touch other skills' layouts.git commit -s).file:lines permalinks),
evidence (the report of each affected cell before the fix, fatal vs
self-correction), result in the final run — plus the compare-view link and the
sentence that eval/eval.config is unchanged.| Skill | When to use |
|---|---|
../cosmos3-setup/SKILL.md | Environment setup the eval cases assume |
../cosmos3-inference/SKILL.md | Inference workflows your cases exercise |
../cosmos3-codebase-nav/SKILL.md | Finding configs/params to reference |
../cosmos3-inference-generate-media/SKILL.md | Worked example: 7 variants, 11 eval cases; 44/44 PASS, 44/44 first-attempt on the fixes PR's full run (group ci-pr327-b7ad087; fixes from the stacked PR #327) |
MAmattpocock/skills336k5,004 new stars in the last 7 days
MAmattpocock/skills336k5,004 new stars in the last 7 days
MAmattpocock/skills336k5,004 new stars in the last 7 days
OBobra/superpowers331k5,757 new stars in the last 7 days
AFaffaan-m/ECC314k4,125 new stars in the last 7 days
AFaffaan-m/ECC314k4,125 new stars in the last 7 days