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/kjldefeated/rl.cu/add_new_kernelnpx skills add KJLdefeated/RL.cu --skill add_new_kernelgit clone --depth 1 https://github.com/KJLdefeated/RL.cuWrote 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/kjldefeated/rl.cu/add_new_kernel)<a href="https://agentmods.dev/skills/kjldefeated/rl.cu/add_new_kernel"><img src="https://agentmods.dev/badge/skills/kjldefeated/rl.cu/add_new_kernel.svg" alt="Measured on agentmods" height="20"></a>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 | $0.00020 | $0.10552 |
| Opus 5 | $0.00010 | $0.05276 |
| Sonnet 5 | $0.00004 | $0.02110 |
| Haiku 4.5 | $0.00002 | $0.01055 |
Grade C, and why
add-cuda-kernel scanned grade C with 1 finding 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.
Recursive force deletehighDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
rm -rf $(BUILDDIR) How it starts
The opening of the file, as written. The whole thing — 966 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Tutorial: Adding a New Kernel to RL.cu
Goal
Implement high performance cuda kernel with target format:
- include files: include/kernels/[kernel_name].cuh
- source files: src/kernels/[kernel_name].cu
- testing: tests/test_[kernel_name].cu
- Makefile: Compile the testing implementation Same format for non-cuda function (e.g. cpp) After finsihed implementation, you should explain how the kernel works.
Example
include/kernels/attention.cuh — Flash Attention 2 Kernel
#pragma once
#include <cuda_fp16.h>
#include <cuda_runtime.h>
// ---------------------------------------------------------------------------
// Flash Attention 2 — Prefill
// ---------------------------------------------------------------------------
// Q, K, V layout: [B, S, H, D] (H = num_heads, D = head_dim)
// O layout: [B, S, H_q, D]
//
// GQA supported: H_q % H_kv == 0. kv_head = q_head * H_kv / H_q.
// Causal mask applied (token i attends only to positions <= i).
// FP16 I/O, FP32 accumulation. Currently specialised for head_dim = 128.
//
// Tile sizes: Br=16 (Q rows per block), Bc=64 (KV cols per tile).
// Shared memory per block: 2 × Bc × D × sizeof(half) = 32 KB.
// ---------------------------------------------------------------------------
void launch_flash_attention_prefill(
const half* Q,
const half* K,
const half* V,
half* O,
int B, int S, int H_q, int H_kv, int head_dim,
cudaStream_t stream = 0
);
// ---------------------------------------------------------------------------
// Paged Attention — Decode
// ---------------------------------------------------------------------------
// Single new token (S_q=1) attends to full context stored in a paged KV cache.
//
// q layout: [num_seqs, H_q, D]
// k_cache / v_cache: [num_blocks, H_kv, block_size, D]
// block_tables: [num_seqs, max_blocks_per_seq] (logical→physical)
// seq_lens: [num_seqs] — context length including the new token
//
// Specialised for head_dim=128, block_size=16.
// ---------------------------------------------------------------------------
void launch_paged_attention_decode(
const half* q,
const half* k_cache,
const half* v_cache,
half* out,
const int* block_tables,
const int* seq_lens,
int num_seqs, int H_q, int H_kv, int head_dim,
int max_blocks_per_seq, int block_size,
cudaStream_t stream = 0
);
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 · 966 lines · 20 tokens per session scan C ef72202b70ef
add-cuda-kernel is a skill published in the GitHub repository KJLdefeated/RL.cu (42 stars, last pushed 1mo ago), licensed MIT. It adds 20 tokens to every session and 10,552 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
add-archon-model
Guide for adding a new model to the Archon engine. Use when user wants to add support for a new HuggingFace model architecture in ArchonEngine.
add-unit-tests
Guide for adding unit tests to AReaL. Use when user wants to add tests for new functionality or increase test coverage.
debug-distributed
Guide for debugging distributed training issues in AReaL. Use when user encounters hangs, wrong results, OOM, or communication errors.
add-dataset
Guide for adding a new dataset loader to AReaL. Use when user wants to add a new dataset.
add-reward
Guide for adding a new reward function to AReaL. Use when user wants to create a reward function.
commit-conventions
AReaL commit message conventions. MUST load on every git commit -- provides Conventional Commits format with scope inference from file paths.