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 skills add pjt222/agent-almanac --skill analyze-kernel-bottleneckgit clone --depth 1 https://github.com/pjt222/agent-almanacWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/pjt222/agent-almanac/analyze-kernel-bottleneck)<a href="https://agentmods.dev/skills/pjt222/agent-almanac/analyze-kernel-bottleneck"><img src="https://agentmods.dev/badge/skills/pjt222/agent-almanac/analyze-kernel-bottleneck.svg" alt="Measured on agentmods" height="20"></a>- NVIDIA SkillSpector pass
What 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.1 | $0.00077 | $0.04486 |
| Opus 5 | $0.00039 | $0.02243 |
| Sonnet 5 | $0.00015 | $0.00897 |
| Haiku 4.5 | $0.00008 | $0.00449 |
Grade A, and why
analyze-kernel-bottleneck 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 4d 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 — 317 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Analyze Kernel Bottleneck
Systematically identify whether a GPU kernel is compute-bound, memory-bound, or latency-bound by measuring baseline performance, classifying on the roofline, computing occupancy and compute/load ratio per tile, inspecting SASS instruction mix and stall codes, checking the shared memory cliff, and applying a decision matrix to select the right optimization strategy.
When to Use
- Before optimizing any CUDA kernel -- establish baseline and classify bottleneck type
- After writing a first working version of a kernel to identify the optimization path
- When a kernel underperforms expectations relative to theoretical peak
- When deciding between cp.async, larger tiles, or algorithmic restructuring
Inputs
- Required: Compiled kernel (
.cubinor.cusource with build command) - Required: Benchmark harness that launches the kernel with CUDA event timing
- Required: Problem dimensions (e.g., M, N, K for GEMM; seq_len, heads, head_dim for attention)
- Optional: Target GPU architecture (default: GA104 / sm_86 / RTX 3070 Ti)
- Optional: Expected peak utilization percentage for comparison
- Optional: Prior profiling data (Nsight Compute reports)
Procedure
Step 1: Measure Baseline Performance
Run the kernel with CUDA events (BenchTimer), record time in milliseconds. Calculate effective throughput metrics:
- Compile the kernel if not already built:
nvcc --cubin -arch=sm_86 -O2 -o kernel.sm_86.cubin kernel.cu nvcc -arch=sm_86 -O2 -o bench bench.cu -lcuda -I../../phase2/common - Run with representative problem sizes, ensuring warmup runs precede measurement:
./bench 4096 4096 4096 - Record kernel time in ms from CUDA events (not wall-clock).
- Calculate effective GFLOPS and effective bandwidth:
- GEMM:
effective_gflops = (2 * M * N * K) / (time_ms / 1000) / 1e9 - Bandwidth-limited kernels:
effective_bw = total_bytes / (time_ms / 1000) / 1e9 - Flash Attention:
effective_gflops = (4 * batch * heads * seq_len^2 * head_dim) / (time_ms / 1000) / 1e9
- GEMM:
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.
- 4d ago First seen · 317 lines · 77 tokens per session scan A ea09e5404f93
analyze-kernel-bottleneck is a skill published in the GitHub repository pjt222/agent-almanac (32 stars, last pushed today), licensed MIT. It adds 77 tokens to every session and 4,486 once invoked, about $0.0004 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-09-03.
Other skills, from other repositories
triage-issue
Verify an issue, persisted audit finding, or unresolved review finding against current code, classify it, and write only the contracted forge/ledger outcome. Supports independent batches and an immediate-fix review-finding route. Triggers: "triage-issue", "triage issue N", "triage this finding", "is this trigger met".
pet-development
Use when developing, running, or debugging Commodore PET software (Commodore BASIC or 6502 assembly) on the VICE emulator with the pet CLI or the pet-tools MCP server. Covers the build/run/observe/debug loop, the stopped-state discipline, PET text encodings, and per-model differences.
ai-equipment-failure-rca-draft
A root-cause analysis draft assistant for investigating equipment failures. Root-cause analysis means looking for the underlying reason a failure happened, not only its visible symptom.
gke-ai-troubleshooting-tpu-dynamic-slices-monitoring
Monitors, troubleshoots, and manages GKE TPU Dynamic Slices custom resources. Use when checking TPU slice lifecycle states, troubleshooting slice provisioning failures, validating single-slice or multi-slice (JobSet) workload manifests, or safely patching stuck finalizers and disabling the slice controller. Don't use…
gke-ai-troubleshooting-tpu-vbar-oom
Diagnoses and prevents vbarcontrolagent segfaults, out-of-memory (OOM) errors, and TPU device initialization failures on TPU v6e nodes in GKE caused by race conditions during TPU device resets or high-frequency metrics polling. Use when troubleshooting vbarcontrolagent crashes, memory cgroup OOMs in serial console…
cocoreview
CocoReview — structured code review with six-severity findings vocabulary, progressive disclosure architecture, and universal anti-pattern baseline. Invoked via $review [file] [--complexity] [--security] [--architecture] [--language ].