Gemini CLI is Google's terminal-based AI coding agent. It supports context injection via GEMINI.md files, direct file references, and inline prompting — all of which work well with kernel-skills SKILL.md files.
The most direct approach: copy the SKILL.md content and include it in your Gemini CLI prompt.
gemini "$(cat skills/cuda/write-cuda-reduction-kernel/SKILL.md)
Using the skill above, write a parallel warp-shuffle reduction kernel:
- Input: float32, shape [N=65536]
- Operation: sum reduction to a scalar
- Target: A100 (sm_80)
- Use warp shuffle intrinsics for the final warp reduction
- Provide a host-side launcher"The $(cat ...) shell substitution inlines the skill content directly into the prompt string. Gemini CLI will respect the structured reasoning process in the skill.
Gemini CLI reads a GEMINI.md file from the current working directory (similar to Claude Code's CLAUDE.md). You can place skill content in GEMINI.md to apply it to all interactions in a project session.
# In your kernel project root:
cat skills/cuda/write-cuda-gemm-kernel/SKILL.md > GEMINI.mdOr combine multiple skills:
cat skills/cuda/write-cuda-gemm-kernel/SKILL.md \
skills/cuda/optimize-shared-memory-tiling/SKILL.md \
> GEMINI.mdThen launch Gemini CLI from that directory:
geminiAll interactions in that session will follow the skill instructions without needing to re-paste the content.
If kernel-skills is cloned inside your working directory or as a submodule, you can reference files directly in your prompt:
gemini "@skills/cuda/debug-cuda-kernel-correctness/SKILL.md
My kernel produces wrong results for inputs with N=2047. Here is the kernel:
$(cat src/my_reduction.cu)
Classify the bug using the skill and identify the root cause."The @ file reference syntax tells Gemini CLI to read the file and include it in context.
For iterative kernel development, use Gemini CLI's interactive mode and include the skill at the start of the session:
gemini --interactiveIn the first message:
I want you to follow this kernel engineering skill throughout our conversation:
[paste skill content]
Acknowledge the skill and tell me what inputs you need before writing any code.
Then continue the session with follow-up messages as you refine the kernel.
# Step 1: Write a first-draft kernel
gemini "$(cat skills/cuda/write-cuda-layernorm-kernel/SKILL.md)
Write a float16 LayerNorm kernel for shape [batch=64, hidden=4096], target sm_80."
# The output kernel is saved as layernorm_v1.cu
# Step 2: Optimize it
gemini "$(cat skills/cuda/optimize-shared-memory-tiling/SKILL.md)
Kernel to optimize:
$(cat layernorm_v1.cu)
Apply the shared memory tiling skill to identify memory access bottlenecks and propose improvements."- For long skills, the
$(cat file)substitution is more reliable than manual copy-paste since it avoids formatting loss. - Gemini CLI works well when the skill's "Inputs the agent should gather first" list is pre-filled. Provide all inputs (shapes, dtypes, hardware target) in the first message to avoid back-and-forth.
- When asking Gemini to follow the review checklist: explicitly paste the checklist section at the end of your prompt and say "check each item and confirm compliance before finishing."
- For multi-skill sessions, ordering matters: put the "write" skill before the "test plan" skill, or ask for one deliverable at a time per skill rather than requesting everything simultaneously.
- Use a current strong reasoning or coding model. Kernel engineering tasks benefit significantly from a capable model — smaller or older versions produce noticeably weaker results for GPU kernel work.