Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/kernelflow-ops/cuda-optimized-skill/cuda-kernel-optimizernpx skills add KernelFlow-ops/cuda-optimized-skill --skill cuda-kernel-optimizergit clone --depth 1 https://github.com/KernelFlow-ops/cuda-optimized-skillWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00198 | $0.03658 |
| Opus 5 | $0.00099 | $0.01829 |
| Sonnet 5 | $0.00040 | $0.00732 |
| Haiku 4.5 | $0.00020 | $0.00366 |
Grade A, and why
cuda-kernel-optimizer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 346 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CUDA Kernel Iterative Optimizer (v2 — Roofline-Driven)
What this skill does
Given:
- a baseline kernel file (
.cufor CUDA / CUTLASS, or.pyfor Triton), - a reference Python file (exposes
reference(**kwargs)— same contract asbenchmark.py --ref), - kernel dimension arguments (e.g.
--M=4096 --N=4096 --K=4096), - optional iteration count
N(default 3),ncu_num(default 5), andbranches(default 4),
the skill runs a roofline-guided, branch-and-select iterative optimization loop and produces a timestamped directory of per-iteration artifacts plus a final summary.
Key point
- Roofline-driven axis budget: compute/memory/latency axis budgets are allocated proportionally to measured Δ gaps, with a per-axis cap of 2.
- Branch-and-Select: each iteration generates K candidate kernels (hyperparameter/implementation variants), benchmarks all, selects champion.
- Ablation attribution: after selecting champion, each method is individually ablated to determine its actual contribution.
- SASS verification:
cuobjdump --dump-sassconfirms claimed optimizations actually appear in generated code. - Every iteration produces a full ncu report on the champion kernel.
Inputs the skill expects from the user
Before starting, confirm you have:
- Baseline operator file, e.g.
./gemm.cuor./gemm_triton.py - Reference file, e.g.
./ref.py(required — correctness validation depends on it) - Dimensions — kernel-signature scalars like
--M=4096 --N=4096 --K=4096 - Iteration count
N(default 3) ncu_num— how many top metrics to extract per axis (default 5)branches— how many hyperparameter variants per iteration (default 4)
benchmark.pyis bundled atscripts/benchmark.py; all scripts default to it automatically.
If any of these are missing, ask the user once — briefly — then proceed.
The loop at a glance
0. check_env → env.json (GPU, nvcc, CUTLASS, ncu)
1. init run folder → run_YYYYMMDD_HHMMSS/
2. copy baseline → baseline/ + bench once to seed `best`
3. for i in 1..N:
a. profile best_kernel with ncu (--set full) → iterv{i}/best_input.ncu-rep
b. extract top compute/mem/latency → ncu_top.json
c. roofline.py: compute Δ_c, Δ_m, Δ_l → roofline.json + axis_budget
if near_peak (all Δ < 0.15) → early stop
d. Claude picks methods (b_axis per axis, cap=2) → analysis.md (CoT)
e. Claude writes K branch kernels (same methods, diff hyperparams)
f. branch_explore.py: compile + bench all K → select champion
g. if champion FAIL: regenerate (max 3 retries)
h. ncu profile champion (--set full) → iterv{i}/kernel.ncu-rep
i. ablate.py: single-method rollback bench → attribution.json
j. sass_check.py: verify SASS signatures → sass_check.json
k. update state with attribution + SASS results
4. emit summary.md
What ships with it
21 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- examples/walkthrough.md 7.0 KB
- references/method_registry.json 31 KB
- references/ncu_metrics_guide.md 16 KB
- references/optimization_catalog.md 46 KB
- references/sass_signatures.json 14 KB
- scripts/__pycache__/benchmark.cpython-310.pyc 25 KB
- scripts/ablate.py 6.5 KB runs code
- scripts/benchmark.py 39 KB runs code
- scripts/branch_explore.py 7.6 KB runs code
- scripts/check_env.py 5.7 KB runs code
- scripts/orchestrate.py 15 KB runs code
- scripts/preflight.py 8.9 KB runs code
- scripts/profile_ncu.py 23 KB runs code
- scripts/roofline.py 10 KB runs code
- scripts/run_iteration.py 6.0 KB runs code
- scripts/sass_check.py 5.7 KB runs code
- scripts/state.py 14 KB runs code
- scripts/summarize.py 7.0 KB runs code
- scripts/validate_methods.py 7.5 KB runs code
- templates/iteration_report.md 4.4 KB
- templates/methods.schema.json 2.8 KB
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 346 lines · 0 tokens per session scan A 3db640895c97
cuda-kernel-optimizer is a skill published in the GitHub repository KernelFlow-ops/cuda-optimized-skill (202 stars, last pushed 4mo ago), licensed MIT. It adds 198 tokens to every session and 3,658 once invoked, about $0.0010 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.
next-cache-components-adoption
Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…
babysit-pr
Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep…
imagegen
Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output…
cpu-profile-analysis
Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…
next-cache-components-optimizer
Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…