/flagos-skills:kernelgen-flagos <operator_name> [--func-type <type>]from flagos-skills
Generates and optimizes GPU kernel operators for FlagGems, vLLM, or general Python/Triton repos. Includes MCP-based iterative optimization and platform specialization.
Ships in flagos-skills. 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.
This is a unified entry point that bundles generation and optimization sub-skills into one:
| Sub-skill file | Purpose |
|---|---|
| Generation | |
kernelgen-generate.md | Generate GPU kernels for any Python/Triton repository |
kernelgen-generate-for-flaggems.md | Specialized generation for FlagGems repositories |
kernelgen-generate-for-vllm.md | Specialized generation for vLLM repositories |
| Optimization | |
kernelgen-optimize.md | Optimize existing Triton kernels via MCP iterative optimization (general purpose) |
kernelgen-optimize-for-flaggems.md | Optimize Triton operators and integrate into FlagGems (3 modes: built-in/external/experimental) |
kernelgen-optimize-for-vllm.md | Optimize Triton operators and integrate into vLLM (with CustomOp registration) |
| Platform Specialization | |
kernelgen-specialize.md | Specialize Triton operators to target platforms (e.g., GPU → Ascend NPU) via MCP specialize_kernel |
kernelgen-specialize-for-flaggems.md | Platform specialization + FlagGems integration (4 modes: vendor-ops/vendor-fused/override-builtin/experimental) |
| MCP Configuration | |
kernelgen-mcp-setup.md | Check and auto-configure the kernelgen-server MCP service (URL built-in, user only provides Token) |
| Feedback | |
kernelgen-submit-feedback.md | Submit bug reports and feedback via GitHub or email |
All sub-skill files are located in the same directory as this SKILL.md file.
Before anything else, ensure the kernelgen-server MCP service is configured and ready.
Use the Glob tool to find kernelgen-mcp-setup.md in this skill's directory:
Glob: **/skills/kernelgen-flagos/kernelgen-mcp-setup.md
Then use the Read tool to read the matched file and follow its instructions exactly.
Use the Glob tool to check for project identity files in the current working directory:
Glob: pyproject.toml
Glob: setup.py
Glob: setup.cfg
Then use the Read tool to read whichever file exists. Determine the project name from
the file contents (e.g., name = "flag_gems" in pyproject.toml, or name='vllm' in setup.py).
Also use the Glob tool to check for characteristic directory structures:
FlagGems indicators (match ANY):
src/flag_gems/ directory existsflag_gems or flag-gems or FlagGemsimport flag_gems appears in test filesvLLM indicators (match ANY):
vllm/ directory exists at the repo root (with vllm/__init__.py)vllmcsrc/ directory exists alongside vllm/Based on the detection result, use the Read tool to read the appropriate sub-skill file from this skill's directory, then follow the instructions in that file exactly.
To locate the sub-skill files: They are in the same directory as this SKILL.md. Use the Glob tool to find the path:
Glob: **/skills/kernelgen-flagos/kernelgen-generate.md
Then use the Read tool to read the matched path.
Generation requests (user wants to create/generate a new operator):
| Detection Result | Action |
|---|---|
| FlagGems repository detected | Read kernelgen-generate-for-flaggems.md and follow it |
| vLLM repository detected | Read kernelgen-generate-for-vllm.md and follow it |
| Neither detected (or unknown) | Read kernelgen-generate.md and follow it |
Optimization requests (user wants to optimize an existing operator, mentions "optimize", "speedup", "improve performance"):
| Detection Result | Action |
|---|---|
| FlagGems repository detected | Read kernelgen-optimize-for-flaggems.md and follow it |
| vLLM repository detected | Read kernelgen-optimize-for-vllm.md and follow it |
| Neither detected (or unknown) | Read kernelgen-optimize.md and follow it |
Specialization requests (user wants to migrate/specialize an operator to a different platform, mentions "specialize", "migrate to Ascend/NPU", "platform migration"):
| Detection Result | Action |
|---|---|
| FlagGems repository detected | Read kernelgen-specialize-for-flaggems.md and follow it |
| Neither detected (or unknown) | Read kernelgen-specialize.md and follow it |
Feedback requests:
| Detection Result | Action |
|---|---|
| User reports a bug or requests feedback submission | Read kernelgen-submit-feedback.md and follow it |
Important rules:
mcp__kernelgen-mcp__generate_kernel MCP tool. Optimization uses
mcp__kernelgen-mcp__optimize_kernel, and platform specialization uses
mcp__kernelgen-mcp__specialize_kernel. NEVER generate Triton kernels, PyTorch
wrappers, or operator implementations yourself. If MCP is not configured, not reachable,
or fails after all retries, STOP and report the issue — do NOT fall back to writing code
manually.At any point during the workflow, if the user reports a bug, says something is broken, or asks to submit feedback about the skill:
kernelgen-submit-feedback.md from this skill's directory.# === Generation ===
# Generate a kernel operator (auto-detects repo type)
/kernelgen-flagos relu
# Generate with explicit function type
/kernelgen-flagos rms_norm --func-type normalization
# === Optimization ===
# Optimize an existing Triton kernel (auto-detects repo type)
# Just say "optimize the relu kernel" or "improve kernel performance"
# The skill will automatically dispatch to the right optimization sub-skill
# The skill will automatically:
# - Detect if you're in a FlagGems repo → use FlagGems-specific workflow
# - Detect if you're in a vLLM repo → use vLLM-specific workflow
# - Otherwise → use the general-purpose workflow
If you encounter any issues during generation, just say "submit feedback" or "report a bug" and the skill will guide you through the feedback submission process.
LICENSE.txt (opens in a new tab)README.md (opens in a new tab)README_zh.md (opens in a new tab)kernelgen-generate-for-flaggems.md (opens in a new tab)kernelgen-generate-for-vllm.md (opens in a new tab)kernelgen-generate.md (opens in a new tab)kernelgen-mcp-setup.md (opens in a new tab)kernelgen-optimize-for-flaggems.md (opens in a new tab)kernelgen-optimize-for-vllm.md (opens in a new tab)kernelgen-optimize.md (opens in a new tab)kernelgen-specialize-for-flaggems.md (opens in a new tab)kernelgen-specialize.md (opens in a new tab)kernelgen-submit-feedback.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
gpu-kernel, triton, operator-generation, operator-optimization, flaggems, vllm
12 skills in this plugin
/flaggems-pr-review-flagosThis skill should be used when reviewing FlagGems operator PRs, performing code review, self-reviewing before submission, or when the user mentions "review PR", "审PR", "代码review", "code review", "review #123", "self-review", "自审", "检查PR", "审查算子", "review operator". It fetches PR diffs, applies FlagGems domain-specific review rules (structural checks, naming, registration, tests, benchmarks), and posts inline review comments directly on GitHub.
/flaggems-pr-submit-flagosThis skill should be used when submitting FlagGems operator PRs, reviewing operator code before submission, preparing operator code for PR, or when the user mentions "提PR", "提交算子", "submit operator", "PR提交", "代码审核", "pre-commit". It automates code review, validates completeness and compliance, runs pre-commit and worktree tests, and directly submits PR to upstream with full description including speedup data.
/flagrelease-entrance-flagosFull FlagRelease pipeline orchestrator. Runs the complete LLM deployment, verification,
and benchmarking pipeline for multi-chip GPU backends. Executes: install-stack →
env-verify → model-verify → perf-test in sequence, passing state between steps
and producing a final structured report. Assumes gpu-container-setup (Step 1) is
already done — a running container with PyTorch + GPU access must exist.
npx claudepluginhub flagos-ai/skills --plugin flagos-skillsOther plugins' skills for the same job