# Kernelgen flagos

> Kernelgen flagos is an open-source agent skill for developer tools. Routes GPU kernel generation, optimization and platform migration to MCP-backed workflows. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/flagos-ai/skills/tree/main/skills/kernelgen-flagos
- **Repository:** https://github.com/flagos-ai/skills
- **GitHub stars:** 22
- **License:** Apache-2.0
- **Skill name:** kernelgen-flagos
- **Collection:** https://github.com/flagos-ai/skills
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-02

## About

kernelgen-flagos is a unified entry point for writing and tuning GPU kernels, mainly Triton operators. On invocation it checks that a kernelgen MCP service is configured, inspects the current project for FlagGems or vLLM markers, and then loads the matching sub-workflow for generation, iterative optimization, or migration of an operator to another chip platform such as Ascend NPU.

The actual code generation and optimization are delegated to the kernelgen MCP server rather than written by the agent itself. The workflows cover repository-specific conventions, including FlagGems integration modes and vLLM CustomOp registration, and produce a Triton kernel, a PyTorch baseline, tests and a benchmark. A separate sub-skill helps submit bug reports through the gh CLI or email.

The skill expects a Python project with PyTorch and CUDA, Triton installed, and a KernelGen token for the MCP service. Its allowed tools include shell, Python and gh commands, file read, write and edit, and search.

## When your agent uses it

> Unified GPU kernel operator generation and optimization skill. Automatically detects the target repository type (FlagGems, vLLM, or general Python/Triton) and dispatches to the appropriate specialized sub-skill. Includes operator generation, MCP-based iterative optimization, and feedback submission sub-skills. Use this skill when the user wants to generate or optimize a GPU kernel operator, create a Triton kernel, or says things like "generate an operator", "create a kernel for X", "optimize triton kernel", or "/kernelgen-flagos".

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/flagos-ai/skills/tree/HEAD/skills/kernelgen-flagos)
- [Asks for: Bash, Bash(gh:*), Bash(python:*), Bash(python3:*), Bash(command:*), Read, Write, Edit…](https://github.com/flagos-ai/skills/blob/HEAD/skills/kernelgen-flagos/SKILL.md)
- [License: Apache-2.0](https://github.com/flagos-ai/skills/tree/HEAD/skills/kernelgen-flagos)

## Features

- **Repository type detection:** Identifies FlagGems, vLLM or generic Python/Triton projects and picks the matching workflow.
- **Operator generation:** Creates Triton kernels with a PyTorch baseline, tests and benchmarks through the MCP server.
- **Iterative kernel optimization:** Runs repeated MCP-driven optimization rounds on an existing Triton kernel to improve speed.
- **Platform specialization:** Migrates GPU Triton operators to other chips such as Huawei Ascend NPU.
- **MCP setup check:** Verifies the kernelgen MCP service is configured and guides token setup when it is not.
- **Feedback submission:** Files bug reports via GitHub issues or email with environment details.

## Good for

- Generate a ReLU kernel for a vLLM or FlagGems checkout
- Optimize a slow Triton attention kernel over several iterations
- Port a CUDA-targeted Triton operator to Ascend NPU
- Report a problem with the kernel generation workflow

## Install

### Claude Code

This skill ships in the `flagos-skills` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add flagos-ai/skills
/plugin install flagos-skills@flagos-skills
```

Or copy only this skill to `~/.claude/skills/kernelgen-flagos`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/flagos-ai/skills.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/kernelgen-flagos &&
cp -R "$tmp/skills/kernelgen-flagos" ~/.claude/skills/kernelgen-flagos &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/kernelgen-flagos` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/kernelgen-flagos` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/flagos-ai/skills.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/kernelgen-flagos &&
cp -R "$tmp/skills/kernelgen-flagos" ~/.agents/skills/kernelgen-flagos &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/kernelgen-flagos` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/kernelgen-flagos` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/flagos-ai/skills.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/kernelgen-flagos &&
cp -R "$tmp/skills/kernelgen-flagos" ~/.cursor/skills/kernelgen-flagos &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/kernelgen-flagos` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/flagos-ai/skills.git --path skills/kernelgen-flagos
```

Or copy the folder to `~/.gemini/skills/kernelgen-flagos` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/kernelgen-flagos`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/flagos-ai/skills.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/kernelgen-flagos &&
cp -R "$tmp/skills/kernelgen-flagos" ~/.copilot/skills/kernelgen-flagos &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/kernelgen-flagos` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/flagos-ai/skills.git
```

Then copy `skills/skills/kernelgen-flagos` into your agent's skills folder as `kernelgen-flagos`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does the skill need before Kernelgen flagos runs?

A kernelgen MCP service with a token from kernelgen.flagos.io, plus Python 3.8+, PyTorch with CUDA and Triton.

### What files does a generation run produce?

A Triton kernel file, a PyTorch baseline, a test file and a benchmark file for the operator.

### Does the agent write the kernel code itself?

No. The skill requires all operator generation and optimization to go through the MCP server tools and stops if MCP is unavailable.

### How do I install Kernelgen flagos in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/kernelgen-flagos to use it in all your projects, or to .claude/skills/kernelgen-flagos in one project. Or install the flagos-skills plugin, which includes it: /plugin marketplace add flagos-ai/skills, then /plugin install flagos-skills@flagos-skills.

### Does Kernelgen flagos run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Kernelgen flagos?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

### What are the best alternatives to Kernelgen flagos?

The closest alternatives to Kernelgen flagos are Flaggems PR submit flagos, Tle developer flagos, Tilegym cutile python, Tilegym converting cutile to triton and Vllm plugin fl setup flagos.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Flaggems PR submit flagos](https://ai-powered.com/skills/flaggems-pr-submit-flagos): Flaggems PR submit flagos is an open-source agent skill for developer tools.
- [Tle developer flagos](https://ai-powered.com/skills/tle-developer-flagos): Tle developer flagos is an open-source agent skill for developer tools.
- [Tilegym cutile python](https://ai-powered.com/skills/tilegym-cutile-python): Tilegym cutile python is an open-source agent skill for developer tools.
- [Tilegym converting cutile to triton](https://ai-powered.com/skills/tilegym-converting-cutile-to-triton): Tilegym converting cutile to triton is an open-source agent skill for developer tools.
- [Vllm plugin fl setup flagos](https://ai-powered.com/skills/vllm-plugin-fl-setup-flagos): Vllm plugin fl setup flagos is an open-source agent skill for developer tools.
- [Tilegym improve cutile kernel perf](https://ai-powered.com/skills/tilegym-improve-cutile-kernel-perf): Tilegym improve cutile kernel perf is an open-source agent skill for developer tools.
- [Tilegym monkey patch kernels to transformers](https://ai-powered.com/skills/tilegym-monkey-patch-kernels-to-transformers): Tilegym monkey patch kernels to transformers is an open-source agent skill for developer tools.
- [Tilegym adding cutile kernel](https://ai-powered.com/skills/tilegym-adding-cutile-kernel): Tilegym adding cutile kernel is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/kernelgen-flagos
