dev-insight-extractor

dev-insight-extractor is a skill for Claude Code, OpenCode from mindspore-ai/akg. It costs 91 tokens per session (4,328 once invoked), scanned A, original, Apache-2.0.

A tool for turning Cursor agent conversation logs into reusable guidance for improving GPU kernel code. It reads JSONL records, extracts general optimization lessons, and writes them as a SKILL.md file.

In plain words
What is it for?
Extracting optimization insights from Cursor transcripts, grouping them by categories such as element-wise operations, reductions, matrix multiplication, and attention, and creating or merging KernelGen guidance.
Why use it?
It preserves useful lessons from past human–agent optimization work instead of leaving them buried in chat history. It also organizes lessons by operation type and checks for an existing skill before updating it.

Skill for Claude CodeOpenCode

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

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.

agentmods
npx agentmods add skills/mindspore-ai/akg/dev-insight-extractor
Any agent
npx skills add mindspore-ai/akg --skill dev-insight-extractor
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 dev-insight-extractor

README.md
[![agentmods](https://agentmods.dev/badge/skills/mindspore-ai/akg/dev-insight-extractor.svg)](https://agentmods.dev/skills/mindspore-ai/akg/dev-insight-extractor)
Your own site
<a href="https://agentmods.dev/skills/mindspore-ai/akg/dev-insight-extractor"><img src="https://agentmods.dev/badge/skills/mindspore-ai/akg/dev-insight-extractor.svg" alt="Measured on agentmods" height="20"></a>
Per session 91 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,328 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00091 $0.04328
Opus 5 $0.00046 $0.02164
Sonnet 5 $0.00018 $0.00866
Haiku 4.5 $0.00009 $0.00433

Measured 6d ago against content hash 55a90f5a3b89, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

dev-insight-extractor 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 6d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/list_transcripts.py, scripts/preprocess.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/.opencode/skills/dev-insight-extractor/SKILL.md · 366 lines

How it starts

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

算子优化经验提取

前提

  • 输入格式为 Cursor 的 agent-transcripts JSONL(.jsonl 文件)
  • 需要 Python 3.8+ 环境(预处理脚本仅用标准库)
  • 对话记录中看不到 Agent 写的代码(工具调用内容未被记录),你只能从用户建议和 Agent 文本回复中提取方法论和代码片段

关键约束(必须遵守,违反则结果无效)

# 约束 说明
C1 逐窗口处理 每次只读取 1 个 window JSON,分析完并写入 insights_{i}.json 后才能读取下一个。严禁一次性读取多个窗口。
C2 逐窗口写入检查点 每个窗口必须写入 insights_{i}.json 后才能处理下一个窗口。不得跳过。
C3 输出路径固定 最终 SKILL.md 写入 ~/.akg/evolved_skills/{dsl_key}/evolved-improvement/{skill_name}/SKILL.md不得写入 .opencode/skills/ 或其他位置。
C4 按算子特性分组 经验按算子特性大类 + 问题子类型二级分组。大类:elemwise(逐元素)、reduction(归约)、matmul(矩阵乘)、attention(注意力机制)。子类型描述问题特征(如 broadcast、large-reduce、fused-elemwise)。skill_name 格式为 op-insight-{category}-{subtype},如 op-insight-elemwise-broadcastop-insight-reduction-large-reduce。一个 skill 包含该子类型下的所有优化手段。
C5 泛化要求 正文和 description 中禁止出现具体算子名(softmax、relu、layernorm、gelu 等)和具体 shape,必须用问题类别(如"逐元素类算子"、"归约类算子")替代。可附关键代码片段来说明做法。
C6 写入前必须检查冲突 写入任何 SKILL.md 之前,必须先检查目标路径是否已存在同名文件。如果已存在,执行合并逻辑(读取旧文件 → 合并经验 → 去重 → 更新 version),严禁直接覆盖

Step 1: 确认输入

情况 A:用户已提供文件路径 → 确认文件存在,跳到 Step 2。

情况 B:用户未提供文件路径 → 自行定位 Cursor 的 agent-transcripts 目录,然后调用脚本展示预览。

**第一步:定位 agent-transcripts 目录

Windows: %USERPROFILE%\.cursor\projects\
Linux/Mac: ~/.cursor/projects/

遍历该目录下所有子目录,查找含 agent-transcripts/ 的项目。

第二步:调用脚本提取预览

python @scripts/list_transcripts.py <agent-transcripts目录路径> --top 5

脚本接受 agent-transcripts 目录路径作为参数,扫描其中的 JSONL 文件,按修改时间倒序列出每个对话的首条和末条用户消息预览。输出示例:

目录: /path/to/agent-transcripts
共 5 条对话(按时间倒序):

  [1] 03-25 15:13  109KB  首: "请你根据这个方案写一个详细的文档..."
                           末: "帮我改成按算子特性分组..."
                           路径: /path/to/.../89533e8d....jsonl

  [2] 03-24 14:39   30KB  首: "给我分析一下当前仓库..."
                           路径: /path/to/.../751ea849....jsonl

Read the full file on GitHub · 366 lines

Files

What ships with it

4 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. 6d ago First seen · 366 lines · 91 tokens per session scan A 55a90f5a3b89

Subscribe to this mod's changes

dev-insight-extractor is a skill published in the GitHub repository mindspore-ai/akg (259 stars, last pushed 26d ago), licensed Apache-2.0. It adds 91 tokens to every session and 4,328 once invoked, about $0.0005 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 skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

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

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

insight-error-page

Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…

vercel/next.js · 83 tokens