kernel-generator

kernel-generator is a skill for Claude Code, OpenCode from mindspore-ai/akg. It costs 61 tokens per session (3,019 once invoked), scanned A, original, Apache-2.0.

A code-generation tool for computational operators, with support for several hardware-focused programming languages and frameworks.

In plain words
What is it for?
It designs and writes operator implementations, updates them from user requirements or verifier feedback, and supports CUDA, Ascend, C++, Triton, TileLang, and related formats.
Why use it?
It provides a defined process for discussing an approach, generating new code, modifying existing code, and repairing code after verification errors.

Skill for Claude CodeOpenCode

Written for Claude Code and OpenCode: argument-hint in frontmatter, but also installed under .opencode/.

Good fit It designs and writes operator implementations, updates them from user requirements or verifier feedback, and supports CUDA, Ascend, C++, Triton, TileLang, and related formats.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mindspore-ai/akg/kernel-generator
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add mindspore-ai/akg --skill kernel-generator
Clone the repo
git clone --depth 1 https://github.com/mindspore-ai/akg

Made for: Claude Code, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for kernel-generator

README.md
[![agentmods](https://agentmods.dev/badge/skills/mindspore-ai/akg/kernel-generator/github.svg)](https://agentmods.dev/skills/mindspore-ai/akg/kernel-generator)
Your own site
<a href="https://agentmods.dev/skills/mindspore-ai/akg/kernel-generator"><img src="https://agentmods.dev/badge/skills/mindspore-ai/akg/kernel-generator/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for kernel-generator

Your own site · 80×15
<a href="https://agentmods.dev/skills/mindspore-ai/akg/kernel-generator"><img src="https://agentmods.dev/badge/skills/mindspore-ai/akg/kernel-generator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 61 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,019 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00061 $0.03019
Opus 5.5 $0.00024 $0.01208
Sonnet 5.5 $0.00012 $0.00604
Haiku 4.5 $0.00006 $0.00302

Measured 3mo ago against content hash fe7abb44b567, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

kernel-generator scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

akg_agents/workspace/.opencode/skills/kernel-generator/SKILL.md · 202 lines

How it starts

The opening of the file, as written. The whole thing — 202 lines — stays where its author put it; the contents beside it link to each section on GitHub.

算子代码生成 Skill

工作模式

本 skill 根据输入自动判断工作模式:

模式 触发条件 行为
方案讨论 user_requirements 是讨论性质(如"分析一下用什么策略") 加载参考文档 → 分析算子特征 → 输出方案建议(不生成代码文件)
首次生成 无 previous_code 加载参考文档 → 分析任务 → 生成代码
修复生成 有 previous_code + 有 verifier_error 加载参考文档 → 分析错误 → 修复代码
纯修改 有 previous_code + 有 user_requirements + 无 verifier_error 跳过参考文档 → 按用户需求修改代码

无论哪种模式,所有代码变更都必须通过本 skill 的代码生成步骤产出,禁止在 skill 外直接编辑代码文件。

生成流程

Step 1: 加载参考文档

纯修改模式跳过此步骤。 其余模式根据参数,用 read 工具读取参考文档。

本 skill 加载后,<base_url> 标签提供 skill 目录路径(记为 $SD)。所有参考文档路径基于 $SD/references/。

⚠️ 参考文档路径下的文件虽然名为 SKILL.md,但在此上下文中它们是参考内容文件。请使用 read 工具按文件路径读取,不要使用 skill 工具加载。

1.1 代码生成格式规范(必加载)

始终加载,按 dsl + framework 选择对应文件(路径:$SD/references/format/):

dsl framework 文件名
triton_cuda / triton_ascend torch triton-torch.md
triton_cuda / triton_ascend mindspore triton-mindspore.md
cpp torch cpp-torch.md
cuda_c torch cuda-c-torch.md
torch(原生转换) torch torch-native.md
1.2 硬件规格(按 arch 加载)

路径:$SD/references/hardware/{文件名}

arch 前缀 文件名
a100 CUDA_A100.md
h20 CUDA_H20.md
l20 CUDA_L20.md
rtx3090 CUDA_RTX3090.md
ascend910b1 Ascend910B1.md
ascend910b2 Ascend910B2.md
ascend910b2c Ascend910B2C.md
ascend910b3 Ascend910B3.md
ascend910b4 Ascend910B4.md
ascend310p3 Ascend310P3.md
ascend910_9362 Ascend910_9362.md
ascend910_9372 Ascend910_9372.md
ascend910_9381 Ascend910_9381.md
ascend910_9382 Ascend910_9382.md
ascend910_9391 Ascend910_9391.md
ascend910_9392 Ascend910_9392.md
ascend950dt_95a Ascend950DT_95A.md
ascend950pr_950z Ascend950PR_950z.md
ascend950pr_9572 Ascend950PR_9572.md
ascend950pr_9574 Ascend950PR_9574.md
ascend950pr_9575 Ascend950PR_9575.md
ascend950pr_9576 Ascend950PR_9576.md
ascend950pr_9577 Ascend950PR_9577.md
ascend950pr_9578 Ascend950PR_9578.md
ascend950pr_9579 Ascend950PR_9579.md
ascend950pr_957b Ascend950PR_957b.md
ascend950pr_957d Ascend950PR_957d.md
ascend950pr_9581 Ascend950PR_9581.md
ascend950pr_9582 Ascend950PR_9582.md
ascend950pr_9584 Ascend950PR_9584.md
ascend950pr_9587 Ascend950PR_9587.md
ascend950pr_9588 Ascend950PR_9588.md
ascend950pr_9589 Ascend950PR_9589.md
ascend950pr_958a Ascend950PR_958a.md
ascend950pr_958b Ascend950PR_958b.md
ascend950pr_9591 Ascend950PR_9591.md
ascend950pr_9592 Ascend950PR_9592.md
ascend950pr_9599 Ascend950PR_9599.md

Read the full file on GitHub · 202 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3mo ago First seen · 202 lines · 61 tokens per session scan A fe7abb44b567

Subscribe to this mod's changes

kernel-generator is a skill published in the GitHub repository mindspore-ai/akg (269 stars, last pushed yesterday), licensed Apache-2.0. It adds 61 tokens to every session and 3,019 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

kernel-generator compared with skills from other repositories

kernel-generator next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
kernel-generatormindspore-ai/akgSkill269yesterdayApache-2.0A61Claude Code, OpenCode
local-ai-agentsmicrosoft/ai-agents-for-beginnersSkill82ktodayMITA200Claude Code, Codex
imagegenopenai/codexSkill137ktodayApache-2.0A113Codex
playwright-climicrosoft/playwrightSkill102kyesterdayApache-2.0A19Claude Code
browser-automationopenclaw/openclawSkill396ktodayMITA36Claude Code
free-llm-apismnfst/awesome-free-llm-apisSkill15kyesterdayCC0-1.0A113Claude Code, Codex
next-cache-components-adoptionvercel/next.jsSkill144ktodayMITA95Claude Code