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/coder-agentnpx skills add mindspore-ai/akg --skill coder-agentgit 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/coder-agent)<a href="https://agentmods.dev/skills/mindspore-ai/akg/coder-agent"><img src="https://agentmods.dev/badge/skills/mindspore-ai/akg/coder-agent.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 | $0.00016 | $0.02076 |
| Opus 5 | $0.00008 | $0.01038 |
| Sonnet 5 | $0.00003 | $0.00415 |
| Haiku 4.5 | $0.00002 | $0.00208 |
Grade A, and why
coder-agent 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 4d 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 — 283 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Coder Agent - 代码生成专家
角色定位
Coder Agent是 AKG Agents 中的核心代码生成组件,负责:
- 将算法设计转换为高性能代码
- 支持多种DSL(CUDA、Triton、OpenCL等)
- 支持多种硬件后端(NVIDIA、AMD、Intel等)
- 提供代码优化建议
核心能力
1. 多DSL支持
CUDA
- 完整的CUDA C++语法
- Kernel launch配置优化
- 内存管理(global, shared, register)
- 性能优化技巧
Triton
- Python-like语法
- 自动内存管理
- Block-level编程
- 编译器优化
OpenCL
- 跨平台支持
- 标准内核语法
- 平台特定优化
2. 多后端支持
| 后端 | 架构 | DSL优先级 |
|---|---|---|
| NVIDIA GPU | CUDA | CUDA > Triton > OpenCL |
| AMD GPU | ROCm | OpenCL > HIP |
| Intel GPU | OneAPI | SYCL > OpenCL |
3. 代码优化
内存优化
- 合并内存访问(Coalesced Access)
- 减少Bank Conflict
- 使用Shared Memory缓存
- Prefetching技术
计算优化
- 循环展开(Loop Unrolling)
- 指令级并行(ILP)
- Warp级优化
- Tensor Core利用
配置优化
- Block size调优
- Grid size计算
- Occupancy最大化
- Register压力控制
工作流程
输入: 算法设计 + 目标后端 + 性能要求
↓
步骤1: 加载相关Skill(如cuda-basics, triton-syntax)
↓
步骤2: 生成初始代码框架
↓
步骤3: 填充计算逻辑
↓
步骤4: 应用优化技巧
↓
步骤5: 添加错误处理
↓
输出: 可编译的高性能代码
代码生成策略
保守策略(Conservative)
- 优先正确性
- 使用标准模式
- 适合初次实现
迭代策略(Iterative)
- 先简单实现
- 逐步优化
- 适合复杂算子
激进策略(Aggressive)
- 直接使用高级优化
- 可能需要调试
- 适合性能关键场景
代码模板
CUDA MatMul模板
__global__ void matmul_kernel(
const float* A,
const float* B,
float* C,
int M, int N, int K
) {
// 共享内存
__shared__ float As[TILE_SIZE][TILE_SIZE];
__shared__ float Bs[TILE_SIZE][TILE_SIZE];
// 计算线程索引
int row = blockIdx.y * TILE_SIZE + threadIdx.y;
int col = blockIdx.x * TILE_SIZE + threadIdx.x;
float sum = 0.0f;
// 分块计算
for (int tile = 0; tile < (K + TILE_SIZE - 1) / TILE_SIZE; ++tile) {
// 加载数据到共享内存
if (row < M && (tile * TILE_SIZE + threadIdx.x) < K)
As[threadIdx.y][threadIdx.x] = A[row * K + tile * TILE_SIZE + threadIdx.x];
else
As[threadIdx.y][threadIdx.x] = 0.0f;
if (col < N && (tile * TILE_SIZE + threadIdx.y) < K)
Bs[threadIdx.y][threadIdx.x] = B[(tile * TILE_SIZE + threadIdx.y) * N + col];
else
Bs[threadIdx.y][threadIdx.x] = 0.0f;
__syncthreads();
// 计算部分和
#pragma unroll
for (int k = 0; k < TILE_SIZE; ++k) {
sum += As[threadIdx.y][k] * Bs[k][threadIdx.x];
}
__syncthreads();
}
// 写回结果
if (row < M && col < N) {
C[row * N + col] = sum;
}
}
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.
- 4d ago First seen · 283 lines · 16 tokens per session scan A 1e23fce7f1e9
coder-agent is a skill published in the GitHub repository mindspore-ai/akg (259 stars, last pushed 24d ago), licensed Apache-2.0. It adds 16 tokens to every session and 2,076 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
aatmf-t10-confidentiality-breach
AATMF T10 — Integrity & Confidentiality Breach. System prompt extraction, training-data extraction, model-weight leakage, private-key recovery.
mochi-remind
Handle due reminders — notify the user with natural language and mark them done.
memory
Use when the user asks to remember, recall, forget, update, search, or inspect durable OpenSquilla memory, including profile facts in USER.md and long-term notes in MEMORY.md or memory//.md.
lazarus-group
Adversary-emulation profile for Lazarus Group (G0032, aka Hidden Cobra / Diamond Sleet / Labyrinth Chollima), a North Korean RGB-linked actor conducting espionage, destructive, and financially motivated operations.
sidewinder-rattlesnake
Adversary-emulation profile for SideWinder (G0121 / Rattlesnake / T-APT-04 / Razor Tiger), India's suspected state-sponsored cyber-espionage actor.
ha-data-stores
Map of Hope Agent's local data stores and safe read-only query workflow. Use when the user asks where Hope Agent stores data, wants to inspect sessions/messages/memory/logs/background jobs/knowledge indexes/settings, asks the model to query local app data, or debugging requires checking persisted state. Trigger…