task-constructor

task-constructor is a skill for Claude Code, Codex from mindspore-ai/akg. It costs 81 tokens per session (828 once invoked), scanned A, original, Apache-2.0.

A workflow for extracting a PyTorch or Triton operation from a code repository and packaging it as one self-contained KernelBench task file. KernelBench is a format for standardizing and testing machine-learning kernel tasks.

In plain words
What is it for?
Use it to build task files from repositories or code snippets, inline required dependencies, validate the standard format, run consistency checks, and compare the extracted implementation with the original PyTorch code.
Why use it?
It removes the manual work of tracing dependencies, copying needed functions, cleaning imports, and checking that the extracted task matches the original operation.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to build task files from repositories or code snippets, inline required dependencies, validate the standard format, run consistency checks, and compare the extracted implementation with the original PyTorch code.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mindspore-ai/akg/task-constructor
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 task-constructor
Clone the repo
git clone --depth 1 https://github.com/mindspore-ai/akg

Made for: Claude Code, Codex.

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 task-constructor

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/mindspore-ai/akg/task-constructor"><img src="https://agentmods.dev/badge/skills/mindspore-ai/akg/task-constructor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 81 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 828 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.00081 $0.00828
Opus 5.5 $0.00032 $0.00331
Sonnet 5.5 $0.00016 $0.00166
Haiku 4.5 $0.00008 $0.00083

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

Security

Grade A, and why

task-constructor 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.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/validate_kernelbench_task.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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/python/akg_agents/op/resources/skills/task-constructor/SKILL.md · 99 lines

What it actually says

标准化任务构建工作流

适用场景

  • 用户提供 PyTorch/Triton 代码仓路径,需要提取算子并构建 task_code
  • 用户提供代码片段,需要包装成 KernelBench 格式的标准化任务
  • 用户指定某个 torch 内部函数,需要提取其分解实现

目标格式

最终生成的文件必须是 单一自包含 Python 文件:

import torch
import torch.nn as nn

# 所有依赖函数内联(不能 import 外部文件)

class Model(nn.Module):
    def __init__(self, <params>):
        super(Model, self).__init__()

    def forward(self, <inputs>) -> torch.Tensor:
        return output

def get_inputs():
    return [input1, input2, ...]

def get_init_inputs():
    return [param1, ...]

工具使用指南

调用 call_task_constructor

此工具内部运行完整的 ReAct 循环,自动完成以下步骤:

  1. 定位目标代码:搜索目标函数
  2. 依赖追踪:AST 分析自动发现所有依赖(同文件函数 + 外部模块调用)
  3. 任务装配:选择最佳策略(排除式/选择性/完整嵌入)构建自包含文件
  4. 验证:格式验证(实例化 + forward + NaN/Inf + 一致性检查)
  5. 参考对比:与原始 torch 函数对比多组输入

参数

  • user_input:用户需求描述(如 "从 pytorch 仓中提取 xxx 的分解实现")
  • source_path:可选,代码仓/文件路径

返回

  • task_code:生成的标准化任务代码
  • task_code_path:代码文件路径
  • op_name:算子名称
  • summary:构建过程摘要

核心规则

  1. 禁止重写复杂函数:原始函数可运行就直接复用,一行都不改
  2. 返回值必须一致:多张量返回就返回 tuple,不能截断
  3. 内联外部函数前先查签名:通过依赖追踪自动检测外部调用来源模块

Scripts

  1. scripts/validate_kernelbench_task.py - 验证 task 代码是否符合 KernelBench 格式(参数:--stdin --json)

使用示例

Think: 需要验证生成的 task 代码是否正确
Action: execute_script(script_path="resources/skills/task-constructor/scripts/validate_kernelbench_task.py", args="--stdin --json", stdin_input="<task 代码>")
Observation: {"valid": true, "static_check": {...}, "runtime_check": {...}}

也可以直接验证文件:

Action: execute_script(script_path="resources/skills/task-constructor/scripts/validate_kernelbench_task.py", args="/path/to/task.py --json")

参考文档

  • references/kernelbench-format.md - 格式规范
  • references/assembly-strategies.md - 装配策略说明
Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 99 lines · 81 tokens per session scan A 950ac0e1defe

Subscribe to this mod's changes

task-constructor is a skill published in the GitHub repository mindspore-ai/akg (263 stars, last pushed yesterday), licensed Apache-2.0. It adds 81 tokens to every session and 828 once invoked, about $0.0003 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-08-30.

Related

Other skills, from other repositories

trulens-evaluation-workflow

Systematically evaluate your LLM application with TruLens.

truera/trulens · 18 tokens

eval-driven-dev

Improve AI application with evaluation-driven development. Define eval criteria, instrument the application, build golden datasets, observe and evaluate application runs, analyze results, and produce a concrete action plan for improvements. ALWAYS USE THIS SKILL when the user asks to set up QA, add tests, add evals…

boshi-xixixi/TraeSkill · 89 tokens

arize-dataset

INVOKE THIS SKILL when creating, managing, or querying Arize datasets and examples. Also use when the user needs test data or evaluation examples for their model. Covers dataset CRUD, appending examples, exporting data, and file-based dataset creation using the ax CLI.

boshi-xixixi/TraeSkill · 60 tokens

breakdown-plan

Issue Planning and Automation prompt that generates comprehensive project plans with Epic > Feature > Story/Enabler > Test hierarchy, dependencies, priorities, and automated tracking.

boshi-xixixi/TraeSkill · 35 tokens

breakdown-test

Test Planning and Quality Assurance prompt that generates comprehensive test strategies, task breakdowns, and quality validation plans for GitHub projects.

boshi-xixixi/TraeSkill · 29 tokens

agentic-eval

Patterns and techniques for evaluating and improving AI agent outputs. Use this skill when: Implementing self-critique and reflection loops Building evaluator-optimizer pipelines for quality-critical generation Creating test-driven code refinement workflows Designing rubric-based or LLM-as-judge evaluation systems…

boshi-xixixi/TraeSkill · 86 tokens