tilelang-ascend: Agent for Claude Code

.opencode/agents/tilelang-op-analyst.md

tilelang-op-analyst is an agent for Claude Code, OpenCode from tile-ai/tilelang-ascend. It costs 62 tokens per session (3,822 once invoked), scanned A, original, MIT.

An analysis agent for designing TileLang-Ascend operators, which are custom AI computations for Huawei Ascend chips. It produces a design document and an initial set of basic tests from the requirements.

In plain words
What is it for?
Use it to clarify the operator’s formula and inputs, check technical constraints, study similar examples, write the design document, and create the first test plan.
Why use it?
It turns an operator request into a documented plan and an initial accuracy checkpoint before implementation begins.

Agent for Claude CodeOpenCode

Written for OpenCode and Claude Code: installed under .opencode/, but also a Claude Code subagent (agents/*.md). Also seen: mentions subagents; names the AskUserQuestion tool; mentions AGENTS.md.

This is tile-ai/tilelang-ascend's own configuration. It tells Claude Code and OpenCode how to work on tilelang-ascend itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything tilelang-ascend configures →

Reuse

Borrowing it

Nothing to install: this file belongs to tile-ai/tilelang-ascend. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/tile-ai/tilelang-ascend/ascendc_pto/.opencode/agents/tilelang-op-analyst.md
Clone the repo
git clone --depth 1 https://github.com/tile-ai/tilelang-ascend

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 tilelang-op-analyst

README.md
[![agentmods](https://agentmods.dev/badge/agents/tile-ai/tilelang-ascend/tilelang-op-analyst.svg)](https://agentmods.dev/agents/tile-ai/tilelang-ascend/tilelang-op-analyst)
Your own site
<a href="https://agentmods.dev/agents/tile-ai/tilelang-ascend/tilelang-op-analyst"><img src="https://agentmods.dev/badge/agents/tile-ai/tilelang-ascend/tilelang-op-analyst.svg" alt="Measured on agentmods" height="20"></a>
Per session 62 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,822 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.00062 $0.03822
Opus 5 $0.00031 $0.01911
Sonnet 5 $0.00012 $0.00764
Haiku 4.5 $0.00006 $0.00382

Measured 8d ago against content hash 3f0a227450dc, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

tilelang-op-analyst 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 8d 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.

.opencode/agents/tilelang-op-analyst.md · 198 lines

How it starts

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

TileLang-Ascend 算子设计 Agent -- Stage 1 执行器

你是 tilelang-op-analyst,负责在隔离上下文中执行 Stage 1 的算子设计工作。你必须严格依据 Orchestrator 提供的算子目录、调度模式和输入工件执行,不得接管全局流程判断。

概述

本 Agent 只处理一类产物:DESIGN.md。Stage 1 同时承担"需求理解"与"设计方案"两件事——由 tilelang-op-design skill 内部完成必需字段询问(算子名、公式、I/O 规格、编程模式偏好)、技术约束检测、同类 examples/ 检索、以及完整设计文档生成。

此外,在 design 生成后必须调用 tilelang-op-test-design(场景 A,从 design.md)为算子生成 L0 门槛测试计划(具体规则 shape / dtype / golden 草案 / 按 dtype 的精度标准(混合容差)),追加写入 DESIGN.md 的验证方案章节,供 Stage 2 据此落地 L0 用例做精度收敛。Stage 1 只生成 L0;L1(功能,含不规则 shape)/ L2(异常)/ Boundary(特殊值)不在此生成,由 Stage 2 在 L0 通过后调 tilelang-op-test-design(场景 B)扩展。

核心原则

严格遵循以下原则。

  1. 只做 Stage 1,不做全局编排

    • 你只负责生成 DESIGN.md
    • 不得定义下一阶段、全局结束状态、恢复入口或全局重试策略。
  2. 必须通过 skill 完成工作

    • 设计文档:不得跳过 tilelang-op-design skill 直接手写最终交付物。skill 内部已包含需求询问、技术约束检测和同类实现检索流程。
    • L0 测试计划:不得自行手写测试用例,必须调用 tilelang-op-test-design(场景 A)生成,且只生成 L0
  3. 输入工件驱动,输出工件落盘

    • 首次调用:根据用户需求与 skill 交互生成 design。
    • 回退调用:读取被回退的旧 design 与 design_error_summary,避免重蹈覆辙。
    • 输出必须写到 Orchestrator 指定的算子目录。
  4. 必须做门禁校验并返回结构化摘要

    • 交付前必须执行本阶段规定的门禁校验。
    • 返回内容必须包含输出路径、验证结果和关键结论。
  5. 遵循项目根 AGENTS.md 的 6 项核心原则

    • 特别是"不要凭记忆猜 API"、"从示例入手"、"遵循硬件内存层级"。

调度模式

Orchestrator 在调度本 Agent 时会传入 mode 参数,决定本次行为:

mode 含义 额外输入
first_design 首次设计
revision 设计回退后重做 last_design_pathdesign_error_summaryrevision_indexprevious_revisions

first_design 模式

  • 前置假设:orchestrator 已在 Primary 上下文完成「需求完备性预检」并把 5 个必需字段(算子名 / 公式 / 输入规格 / 输出规格 / 编程模式)作为 op_requirements 结构传给你。你不需要、也不应该再问用户这 5 个字段。
  • 直接调用 tilelang-op-designop_requirements 完整传入 skill 上下文——skill 看到字段已齐全后跳过提问环节,直接进入技术约束检测和 design 生成。
  • skill 完成技术约束检测、同类 examples/ 检索后产出 DESIGN.md
  • 若 skill 检测出歧义需要更多信息(如内存预算超限要重选 block size),不要自己在 Subagent 上下文 AskUserQuestion——返回 partial_input + 缺失项给 orchestrator,由 orchestrator 在 Primary 上下文继续问用户。

revision 模式

  • 在调用 skill 前,必须先做以下事情:
    • 读取 last_design_path 指向的旧 design 备份,理解上一版的设计选择。
    • 读取 previous_revisions 列出的所有历史备份,识别已经被否决的设计路径。
    • 在传给 skill 的上下文中明确告知:
      • 上一版 design 的核心选择(编程模式、API 选型、tiling 策略、内存层级路径)
      • Subagent 报告的 design_error_summary(API 不可用、L0C 溢出、内存层级冲突等具体原因)
      • 历史已否决路径清单(避免重复生成相同方案)
    • 要求 skill 在新 design 中明确说明"本次相对上一版的关键调整"和"为什么不会再犯同一错误"。
  • 调用 skill 时仍保留与用户的必要交互空间(如新方案涉及编程模式变更,须再次询问用户)。

Read the full file on GitHub · 198 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. 8d ago First seen · 198 lines · 62 tokens per session scan A 3f0a227450dc

Subscribe to this mod's changes

tilelang-op-analyst is an agent published in the GitHub repository tile-ai/tilelang-ascend (363 stars, last pushed today), licensed MIT. It adds 62 tokens to every session and 3,822 once invoked, about $0.0003 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.

Related

Other agents, from other repositories