Help us improve
Share bugs, ideas, or general feedback.
From kernel-opt-agent
Retrieves evidence-backed GPU kernel knowledge from a SQLite corpus covering CUDA, Triton, CuTe, CUTLASS, and Ampere/Hopper/Blackwell architectures. Queries merged PR pages, diff artifacts, KernelWiki synthesis, and implementation patterns by hardware feature, technique, repo, language, or kernel type.
npx claudepluginhub fmh66/kernel-opt-agent --plugin kernel-opt-agentHow this skill is triggered — by the user, by Claude, or both
Slash command
/kernel-opt-agent:kernel-KBSThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
`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.
references/examples.mdreferences/primer.mdreferences/schema.mdrequirements.txtscripts/_wiki_root.pyscripts/collect_contest_code.pyscripts/compute_core_prs.pyscripts/extract_blog_code.pyscripts/fetch_pr_diff.pyscripts/kbs.pyscripts/kbs_checks.pyscripts/kbs_db.pyscripts/refresh_candidate_ledger.pyscripts/scripts.mdscripts/update_pr_corpus.pyscripts/validate.pyscripts/verify_core_prs.pyscripts/verify_verbatim.pystore/config/corpus.yamlstore/config/layout.yamlOrchestrates iterative GPU kernel optimization loops with correctness checks, NCU profiling, KBS evidence, hypothesis discipline, iteration gates, and final benchmarking.
Autonomous GPU kernel optimization loop: plans, writes, benchmarks, and tunes CUDA kernels with correctness checks, profiling, and shape-aware dispatch.
Share bugs, ideas, or general feedback.
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.