/kernel-opt-agent:kernel-KBSfrom kernel-opt-agent
Queries a SQLite-backed knowledge base of GPU kernel implementations (CUDA, Triton, CuTe, CUTLASS) for research on architectures like Ampere/Hopper/Blackwell. Retrieves PR diffs, synthesis pages, and evidence-backed patterns.
Ships in kernel-opt-agent. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
kernel-KBS is a read/query skill. It retrieves evidence-backed GPU kernel knowledge from a SQLite-centered corpus. It does not run kernels, profile kernels, benchmark kernels, or manage optimization experiments.
Default agent mode is read-only.
Allowed without asking first:
query, get, schema, stats, doctor, and check.Requires explicit human permission in the current task:
build-db, reindex, optimize, or vacuum.delete --hard requires a separate explicit confirmation even when deletion has been approved.
All commands run from the kernel-KBS skill root. Use scripts/kbs.py as the single front door.
Start with SQLite query:
python3 scripts/kbs.py query "<terms>" --limit 10
Then narrow with filters:
python3 scripts/kbs.py query tcgen05 --architecture sm100 --limit 10
python3 scripts/kbs.py query --repo cutlass --language cute-dsl --limit 20
python3 scripts/kbs.py query --tag nvfp4 --has-code --limit 20
python3 scripts/kbs.py query --symptom memory-bound --limit 10
Fetch evidence after selecting likely rows:
python3 scripts/kbs.py get <doc-id> --follow-sources --include-code
python3 scripts/kbs.py get <doc-id> --json
Use schema and health commands when needed:
python3 scripts/kbs.py schema
python3 scripts/kbs.py schema --table docs
python3 scripts/kbs.py stats
python3 scripts/kbs.py doctor
python3 scripts/kbs.py check all
Do not scan Markdown recursively for retrieval. Retrieval goes through SQLite: docs, docs_fts, tags, doc_links, artifacts, perf_claims, kbs_meta, and schema_docs.
query <terms> --limit 10.--kind, --repo, --architecture, --language, --tag, --symptom, --confidence, or --has-code.get <id> --follow-sources --include-code.source links before making evidence-backed claims.| Need | Open / Run |
|---|---|
| Directory layout and storage boundaries | store/store.md |
| Script responsibilities and allowed entry points | scripts/scripts.md |
| SQLite schema and workflow notes | python3 scripts/kbs.py schema |
| Topic map and canonical page ids | references/primer.md |
| Frontmatter rules and controlled-vocabulary pointers | references/schema.md |
| Worked query examples | references/examples.md |
| Actual controlled tags and aliases | store/schemas/tags.yaml, store/schemas/aliases.yaml |
| Current corpus counts | python3 scripts/kbs.py stats |
Core storage map:
| Layer | Path | Role |
|---|---|---|
| Config | store/config/ | Layout, corpus manifest, PR refresh configuration. |
| Schemas | store/schemas/ | Page schemas, controlled tags, aliases. |
| Source docs | store/docs/sources/ | PR/blog/doc/contest source Markdown. |
| Knowledge pages | store/docs/wiki/ | Curated synthesis pages for answers. |
| Ledgers | store/docs/ledgers/ | Candidate/core/source ledgers and policy inputs. |
| Artifacts | store/corpus/artifacts/ | Diffs, code assets, provenance bundles. |
| Indexes | store/indexes/kernel-KBS.sqlite | SQLite metadata, relationships, and contentless FTS. |
| State | store/state/ | Structured maintenance state: refresh/, versions/, and audits/{content,refresh,validation}/. |
Full Markdown bodies remain under store/docs/. SQLite stores metadata, paths, short excerpts, relationships, artifact pointers, performance claims, and FTS terms. It does not store a second readable copy of every Markdown body.
Only run these after explicit human approval:
python3 scripts/kbs.py put <markdown-path>
python3 scripts/kbs.py update <doc-id> ...
python3 scripts/kbs.py delete <doc-id>
python3 scripts/kbs.py restore <doc-id>
python3 scripts/kbs.py export <doc-id> --write-source
python3 scripts/kbs.py build-db --reset
python3 scripts/kbs.py reindex
python3 scripts/kbs.py optimize
python3 scripts/kbs.py vacuum
python3 scripts/kbs.py update-prs --since <YYYY-MM-DD> --apply
Dry-run PR discovery is read-only from the corpus perspective, but it may require network and credentials:
python3 scripts/kbs.py update-prs --since <YYYY-MM-DD> --max-new 20
If approved maintenance changes Markdown or artifacts, run the approved rebuild/check sequence appropriate to the change:
python3 scripts/kbs.py build-db --reset
python3 scripts/kbs.py doctor
python3 scripts/kbs.py check all
When answering from this skill:
kernel-flash-attention-4 at store/docs/wiki/kernels/flash-attention-4.md.sources, doc_links, artifact_dir, and artifacts metadata before making evidence-backed claims.verified, source-reported, inferred, or experimental.gpu, dtype, shape, metric, value, and source_id.references/examples.md (opens in a new tab)references/primer.md (opens in a new tab)references/schema.md (opens in a new tab)requirements.txt (opens in a new tab)scripts/_wiki_root.py (opens in a new tab)scripts/collect_contest_code.py (opens in a new tab)scripts/compute_core_prs.py (opens in a new tab)scripts/extract_blog_code.py (opens in a new tab)scripts/fetch_pr_diff.py (opens in a new tab)scripts/kbs.py (opens in a new tab)scripts/kbs_checks.py (opens in a new tab)scripts/kbs_db.py (opens in a new tab)scripts/refresh_candidate_ledger.py (opens in a new tab)scripts/scripts.md (opens in a new tab)scripts/update_pr_corpus.py (opens in a new tab)scripts/validate.py (opens in a new tab)scripts/verify_core_prs.py (opens in a new tab)scripts/verify_verbatim.py (opens in a new tab)store/config/corpus.yaml (opens in a new tab)store/config/layout.yaml (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub minho-fan/kernel-opt-agent --plugin kernel-opt-agent4 skills in this plugin
/kernel-benchmarkStandalone kernel benchmarking skill for cuda-cpp, cutlass, cute-dsl, and triton implementations. Use when the user wants to compare a custom CUDA/CUTLASS .cu kernel or CuTe DSL/Triton .py kernel against selectable PyTorch eager, torch.compile, or FlashInfer baselines, validate correctness, measure execution time with KernelBench-style CUDA event timing, or generate benchmark.md for kernel optimization results./kernel-loopIterative GPU kernel optimization orchestrator for CUDA/CUTLASS/CuTe DSL/Triton kernels. Use for measured, one-change-at-a-time optimization loops with correctness, NCU profiling, KBS evidence, hypothesis discipline, hard iteration gates, final benchmarking, and a traceable report./kernel-profileStandalone kernel profiling skill for cuda-cpp, cute-dsl, cutlass, and triton implementations. Checks CUDA/PyTorch/Triton/CuTe DSL/CUTLASS/NCU/nsight-python readiness, optionally locks GPU clocks, validates correctness, collects Nsight Compute metrics with nsight-python, produces env_check.md, correctness.md, ncu_summary.md and ncu_details.md, and classifies GPU bottlenecks from NCU evidence. Use when the user wants to profile a CUDA/CUTLASS .cu kernel or CuTe DSL/Triton .py kernel, compare against a Python reference, inspect occupancy, memory, compute, scheduler, stall, or branch metrics, or diagnose Memory-Bound, Compute-Bound, Latency-Bound, Occupancy-Bound, or Mixed behavior.Other plugins' skills for the same job