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 skills add mindspore-ai/akg --skill sketch-designgit 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/sketch-design)<a href="https://agentmods.dev/skills/mindspore-ai/akg/sketch-design"><img src="https://agentmods.dev/badge/skills/mindspore-ai/akg/sketch-design/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.
<a href="https://agentmods.dev/skills/mindspore-ai/akg/sketch-design"><img src="https://agentmods.dev/badge/skills/mindspore-ai/akg/sketch-design.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.00030 | $0.03169 |
| Opus 5 | $0.00015 | $0.01584 |
| Sonnet 5 | $0.00006 | $0.00634 |
| Haiku 4.5 | $0.00003 | $0.00317 |
Grade A, and why
sketch-design 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 10d 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 — 357 lines — stays where its author put it; the contents beside it link to each section on GitHub.
UnifiedSketch 设计
目标与原则
目标
用最小DSL表达算子设计意图,便于LLM理解和Coder实现。
原则
- 极简原语:只有少数核心操作(alloc/load/store/compute/...)
- 统一语法:所有操作都是函数调用风格,无语法差异
- 标准控制流:使用Python for/range语法,不发明新语法
- hint分离:复杂优化用hint表达,不影响主逻辑清晰性
核心语法元素
结构声明
sketch <op_name> {
symbols: M, N, K; # 符号变量声明
tensors: A[M, K]: f16; B[K, N]: f16; C[M, N]: f32; # 张量声明
constexpr: m0, k0, n0
}
@llm_hint 装饰器详解
基本语法
@llm_hint 用于给 LLM 提供优化提示,帮助 coder 选择最优的实现策略。
@llm_hint("optimization_type") # 单一提示
@llm_hint("optimization_type", "context") # 带上下文的提示
@llm_hint("opt1", "opt2", "opt3") # 多重提示
优化类型
"parallel"- 并行化此循环"pipeline"- 流水线优化"vectorize"- 向量化"unroll"- 循环展开
硬件上下文提示
"grididx"- GPU grid 级别并行(对应 blockIdx)"threadidx"- GPU thread 级别并行(对应 threadIdx)"coreidx"- NPU core 级别并行"warp"- GPU warp 级别优化"simd"- CPU/NPU SIMD 向量化
for循环表达
# GPU风格:grid + thread 两级并行
@llm_hint("parallel", "grididx.x")
for i in range(0, M, 128): # block级别
@llm_hint("parallel", "threadidx.x")
for j in range(0, N, 32): # thread级别
@llm_hint("pipeline")
for k in range(0, K, k_tile):
# 计算逻辑
# NPU风格:core级别并行
@llm_hint("parallel", "coreidx")
for core_idx in range(num_cores):
@llm_hint("pipeline")
for k in range(0, K, k_tile):
# 每个core的计算
# CPU风格:SIMD向量化
@llm_hint("parallel") # OpenMP并行
for i in range(0, M, tile_size):
@llm_hint("vectorize", "simd") # SIMD向量化
for j in range(tile_size):
# 向量化计算
核心操作
- alloc - 内存分配
- load - 数据加载
- store - 数据存储
- compute函数 - 计算操作
语法概览
sketch matmul {
symbols: M, N, K;
tensors: A[M, K]: f16; B[K, N]: f16; C[M, N]: f32;
m0, k0, n0 = 128, 256, 256
@llm_hint("parallel")
for i_outer in range(0, ceil(M, m0)):
@llm_hint("parallel")
for j_outer in range(0, ceil(N, n0)):
# 内存分配
c_tile = alloc([m0, n0], llm_hint=["accumulator", "init_zero"])
a_tile = alloc([m0, k0], llm_hint=["fast", "input_cache"])
b_tile = alloc([k0, n0], llm_hint=["fast", "input_cache"])
@llm_hint("pipeline")
for k_outer in range(0, ceil(K, k0)):
# 数据搬移
load(A[i_outer:i_outer+m0, k_outer:k_outer+k0] -> a_tile)
load(B[k_outer:k_outer+k0, j_outer:j_outer+n0] -> b_tile)
# 计算操作
gemm(a_tile, b_tile, dst=c_tile)
# 数据写回
store(c_tile -> C[i_outer:i_outer+m0, j_outer:j_outer+n0])
}
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.
- 10d ago First seen · 357 lines · 30 tokens per session scan A b61721a6a410
sketch-design is a skill published in the GitHub repository mindspore-ai/akg (259 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 30 tokens to every session and 3,169 once invoked, about $0.0002 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
triton-ascend-reduce
An optimization guide for reduction operations in Triton on Ascend hardware, including sums, maxima, cumulative operations, softmax, and normalization.
triton-ascend-matmul
An optimization guide for matrix multiplication in Triton on Ascend hardware, covering tiled computation, work distribution, and large inner dimensions.
triton-ascend-elementwise
An optimization guide for Triton kernels where every tensor element receives the same independent operation, such as addition, activation, casting, or clamping.
triton-ascend-optimization
A general performance guide for Triton kernels on Ascend hardware, covering block-size selection, grid setup, memory alignment, automatic tuning, and numeric precision.
triton-ascend-attention
An optimization guide for Transformer-style attention operations in Triton on Ascend hardware, including QKV computation, online softmax, and causal masking.
triton-ascend-elementwise-reduce-fused
An optimization guide for Triton kernels that first transform each tensor element and then combine the results with a sum, mean, or other reduction.