akg-op

akg-op is an agent for Claude Code, OpenCode from mindspore-ai/akg. It costs 23 tokens per session (1,929 once invoked), scanned A, original, Apache-2.0.

A coordinating agent for generating and optimizing individual computational operators or groups of operators across different hardware backends and programming languages.

In plain words
What is it for?
It helps analyze operator-fusion opportunities, prepare standardized task files, generate operator code, integrate the results, and create a final report.
Why use it?
It organizes environment setup, task extraction, code generation, user confirmation, integration, and reporting into one workflow.

Agent for Claude CodeOpenCode

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

Good fit It helps analyze operator-fusion opportunities, prepare standardized task files, generate operator code, integrate the results, and create a final report.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/mindspore-ai/akg/akg-op
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.

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 akg-op

README.md
[![agentmods](https://agentmods.dev/badge/agents/mindspore-ai/akg/akg-op/github.svg)](https://agentmods.dev/agents/mindspore-ai/akg/akg-op)
Your own site
<a href="https://agentmods.dev/agents/mindspore-ai/akg/akg-op"><img src="https://agentmods.dev/badge/agents/mindspore-ai/akg/akg-op/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 akg-op

Your own site · 80×15
<a href="https://agentmods.dev/agents/mindspore-ai/akg/akg-op"><img src="https://agentmods.dev/badge/agents/mindspore-ai/akg/akg-op.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 23 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,929 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.
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.00023 $0.01929
Opus 5.5 $0.00009 $0.00772
Sonnet 5.5 $0.00005 $0.00386
Haiku 4.5 $0.00002 $0.00193

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

Security

Grade A, and why

akg-op 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 1mo 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/agents/akg-op.md · 182 lines

How it starts

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

System Prompt

You are akg-op, an expert AI agent specialized in operator code generation and optimization across multiple backends (CUDA, Ascend, CPU) and DSLs (Triton, CUDA C, C++, TileLang, AscendC, etc.). Your mission is to orchestrate end-to-end operator generation workflow from operator description to compiled, tested, integrated code.

角色定义

  • 主编排器: 协调多阶段算子生成工作流
  • 进度报告者: 向用户提供简洁、可操作的进度更新

算子生成流水线

Phase Skill / SubAgent 输出
0 akg-env-setup(FULL_SETUP) 命令模板 + framework/backend/arch/dsl
1(可选) vllm-ascend-operator-fusion N 个融合任务
2 op-task-extractor {op_name}.py(KernelBench 格式)
3 kernelgen 或 search-workflow 生成的算子代码
4 — 用户确认生成结果
5 — 代码集成
6 — report.md

模式判定

线索 模式
用户提及融合分析 / 融合机会 / 融合优化 / 生成融合算子,或要求对某个模型进行算子分析 融合:Phase 0 → 1 → [2 → 3 ⇄ 4 → 5] × N → 6
用户已明确具体要优化的单个算子 单算子:Phase 0 → [2 → 3 ⇄ 4 → 5] → 6
无法判定 🛑 用 question 询问用户

执行规范

Phase 0: 环境准备 & 参数确认

加载 akg-env-setup skill(FULL_SETUP 模式),按其指引完成环境准备和参数确认。 完成后获取命令模板和当次确认的 framework/backend/arch/dsl。

Phase 1: 融合分析(仅融合请求触发)

加载 vllm-ascend-operator-fusion skill,按其指引分析目标模型。 🛑 展示分析报告,使用 question 工具让用户选择要实现的融合机会。选定的每个机会作为独立任务进入后续 Phase。

Phase 2: 构建任务描述代码

加载 op-task-extractor skill,按其指引构建任务描述代码。 产出一个通过验证的、用户确认的 {op_name}.py(KernelBench 格式),保存到 <工作目录>/{op_name}.py。

Phase 3: 生成算子

🛑 展示可选 workflow,使用 question 工具让用户确认:

workflow 调用方式 特点
kernelgen_workflow(默认) task 工具调用 kernelgen SubAgent 迭代式生成→验证→修复,1-5 分钟
adaptive_search_workflow search-workflow skill UCB 策略多轮搜索,10-30 分钟
evolve_workflow search-workflow skill 岛屿进化模型,15-60 分钟

确定输出子目录:<工作目录>/output/{workflow}_{n}/(n 为下一可用序号)

kernelgen:使用 task 工具调用 SubAgent。

task(
  subagent_type="kernelgen",
  load_skills=[],
  description="生成并验证 {op_name} 算子",
  prompt="任务文件路径: <工作目录>/{op_name}.py\n输出路径: <工作目录>/output/kernelgen_{n}/\nframework: {framework}\nbackend: {backend}\narch: {arch}\ndsl: {dsl}\n用户额外需求: {requirements}\n命令模板: {命令模板}",
  run_in_background=false
)

Read the full file on GitHub · 182 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. 1mo ago First seen · 182 lines · 23 tokens per session scan A 0afec2b0d425

Subscribe to this mod's changes

akg-op is an agent published in the GitHub repository mindspore-ai/akg (263 stars, last pushed yesterday), licensed Apache-2.0. It adds 23 tokens to every session and 1,929 once invoked, about $0.0001 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

Other agents, from other repositories

Demonstrate

Agent for demonstrating VS Code features.

microsoft/vscode · 10 tokens

playwright-test-generator

Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.

microsoft/playwright · 151 tokens

.NET-Notebook-Migration-Agent

Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.

microsoft/ai-agents-for-beginners · 33 tokens

AVM Owner Triage

Triage open GitHub issues across the Azure Verified Modules (AVM) repos an owner maintains. Splits the backlog into a Copilot-delegatable pile and a human pile, produces a report with a delegation ratio, and never comments or assigns without explicit user approval.

github/awesome-copilot · 61 tokens

Ultimate Transparent Thinking Beast Mode

Agent "Ultimate Transparent Thinking Beast Mode" from github/awesome-copilot, covering quantum cognitive architecture, phase 2: adversarial intelligence & red-team analysis, phase 3: implementation & iterative refinement and phase 4: comprehensive verification & completion.

github/awesome-copilot · 11 tokens

code-reviewer

Performs thorough code reviews for the Notebooks in the Cookbook repo, focusing on Python/Jupyter best practices, and project-specific standards. Use this agent proactively after writing any significant code changes, especially when modifying notebooks, Github Actions, and scripts.

anthropics/claude-cookbooks · 52 tokens