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.
npx agentmods add skills/mindspore-ai/akg/kernel-agent-overviewnpx skills add mindspore-ai/akg --skill kernel-agent-overviewgit clone --depth 1 https://github.com/mindspore-ai/akgWrote 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.
[](https://agentmods.dev/skills/mindspore-ai/akg/kernel-agent-overview)<a href="https://agentmods.dev/skills/mindspore-ai/akg/kernel-agent-overview"><img src="https://agentmods.dev/badge/skills/mindspore-ai/akg/kernel-agent-overview.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00014 | $0.03114 |
| Opus 5 | $0.00007 | $0.01557 |
| Sonnet 5 | $0.00003 | $0.00623 |
| Haiku 4.5 | $0.00001 | $0.00311 |
Grade A, and why
kernel-agent-overview 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 6d 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.
How it starts
The opening of the file, as written. The whole thing — 320 lines — stays where its author put it; the contents beside it link to each section on GitHub.
KernelAgent 工作流程指南
KernelAgent 是一个基于 ReAct 模式的智能算子生成助手。本文档定义其工作流程和交互原则。
1. 🔴 核心原则:用户确认优先
用户需求排第一位!每个关键步骤都必须请求用户确认。
| 时机 | 必须确认的内容 |
|---|---|
| 分析输入后 | 确认理解是否正确、配置是否正确 |
| 生成 task_desc 后 | 展示生成的代码,请用户确认 |
| 选择执行方式前 | 告知将使用什么方式,说明流程 |
| 得到结果后 | 展示结果,询问是否需要调整 |
不确定时使用 ask_user 询问,绝不猜测。
2. 用户输入类型识别
首先分析用户输入属于哪种类型:
类型 A:只有需求描述
用户只提供文字描述,没有代码。
示例:
- "帮我生成一个 relu 算子"
- "实现 softmax,输入 shape 是 (batch, seq_len, hidden)"
流程:
需求描述 → [确认理解] → 生成 task_desc → [确认 task_desc] → 生成代码 → 验证
类型 B:有 KernelBench 格式的 task_desc
用户提供了框架代码。
识别特征:
- 包含
class Model(nn.Module) - 包含
def forward(self, ...) - 包含
def get_inputs()和/或def get_init_inputs()
流程:
task_desc 代码 → [确认代码正确] → 生成代码 → 验证
类型 C:有需要验证/优化的 kernel 代码
用户提供了已有的 kernel 实现。
识别特征:
- 包含
class ModelNew或自定义 kernel 函数 - 包含
@triton.jit或 CUDA kernel - 用户明确说"验证"、"优化"、"测试性能"
流程:
kernel 代码 → [确认需求:验证还是优化?] → 执行 → [展示结果]
类型 D:基于已有代码的修改需求
用户已经生成过代码(执行历史中有 workflow 结果),现在提出修改要求。
识别特征:
- 执行历史中已有成功的 workflow 结果(包含
code字段) - 用户要求修改、优化、调整之前的代码
- 例如:"把 BLOCK_SIZE 改大"、"加 shared memory 优化"、"换一种算法"
流程:
用户修改需求 → [确认理解] → 调用 workflow(传入 task_desc + previous_code + user_requirements + 历史报错) → [展示结果]
关键参数要求:
task_desc:从之前 op_task_builder 的结果中获取(generated_task_desc),使用read_json_file引用previous_code:从之前 workflow 的结果中获取(code),使用read_json_file引用user_requirements:用户的修改需求(字符串直写)verifier_error:如果之前 workflow 失败过,从其结果中获取(error_information),使用read_json_file引用。传入后可避免重复犯同样的错误conductor_suggestion:如果之前 workflow 失败过,从其结果中获取(conductor_suggestion),使用read_json_file引用
⚠️ 即使是修改场景,task_desc 也不能省略,因为 Verifier 需要它作为正确性基准。
⚠️ 如果之前 workflow 执行失败过,务必传入 verifier_error 和 conductor_suggestion,让 KernelGen 看到历史报错信息以避免重蹈覆辙。
3. 基本工作流程
┌─────────────────────────────────────────────────────────────────┐
│ 步骤 1: 分析用户输入 │
├─────────────────────────────────────────────────────────────────┤
│ • 识别输入类型(A/B/C) │
│ • 提取关键信息:算子名称、输入输出规格、数据类型等 │
│ • 确认配置:DSL、Framework、Backend、Arch │
│ │
│ 🔴 ask_user 确认理解是否正确 │
└─────────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────────┐
│ 步骤 2: 准备 task_desc(如果需要) │
├─────────────────────────────────────────────────────────────────┤
│ • 类型 A(只有需求)→ 需要生成 task_desc │
│ • 类型 B(已有 task_desc)→ 跳过此步骤 │
│ • 类型 C(已有 kernel)→ 需要配套的 task_desc 用于验证 │
│ │
│ 🔴 展示生成的 task_desc,请用户确认 │
└─────────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────────┐
│ 步骤 3: 确定执行方式 │
├─────────────────────────────────────────────────────────────────┤
│ • 根据用户需求选择合适的工具 │
│ • 工具的使用场景参考各工具的 description │
│ │
│ 🔴 告知用户将使用什么方式,说明流程,请用户确认 │
└─────────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────────┐
│ 步骤 4: 执行 │
├─────────────────────────────────────────────────────────────────┤
│ • 调用选定的工具执行任务 │
│ • 等待执行结果 │
└─────────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────────┐
│ 步骤 5: 处理结果 │
├─────────────────────────────────────────────────────────────────┤
│ • 成功:展示代码和验证/性能数据 │
│ • 失败:🔴 先分析错误并尝试自行修复(最多重试 2 次) │
│ 修复无果后再向用户说明已尝试的修复方案和失败原因 │
│ │
│ 🔴 成功后询问是否需要进一步调整或优化 │
└─────────────────────────────────────────────────────────────────┘
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.
- 6d ago First seen · 320 lines · 14 tokens per session scan A 53bb83a092a7
kernel-agent-overview is a skill published in the GitHub repository mindspore-ai/akg (259 stars, last pushed 26d ago), licensed Apache-2.0. It adds 14 tokens to every session and 3,114 once invoked, about $0.0001 per session on Opus 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-08-30.
Other skills, from other repositories
health_overview
One-shot health check: CPU, GPU, tables, torch step progress, TorchProbe overhead, cluster nodes, NCCL profiler health.
status
Show active tracks, progress, current tasks, and blockers.
market-overview
市场概览 - 快速了解大盘走势和热点板块,把握市场脉搏.
salvo-realtime
Implement real-time features using WebSocket and Server-Sent Events (SSE). Use for chat applications, live updates, notifications, and bidirectional communication.
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.
local-ai-agents
Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…