SPEC

A specification for developing agents in the MindSpore AKG project's core_v2/agents directory. It describes the agent base classes, registration process, key files, and conventions.

In plain words
What is it for?
Use it when creating or reviewing agents, prompt templates, registration code, or agent-related tests in that project.
Why use it?
It gives developers the rules needed to add an agent without changing shared core behavior or placing files in the wrong directory.

Agent

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 agents/mindspore-ai/akg/spec
Clone the repo
git clone --depth 1 https://github.com/mindspore-ai/akg
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 451 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 $0.00000 $0.00451
Opus 5 $0.00000 $0.00226
Sonnet 5 $0.00000 $0.00090
Haiku 4.5 $0.00000 $0.00045

Measured 2d ago against content hash d807d4c6de7a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

SPEC 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 2d 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.

akg_agents/python/akg_agents/core_v2/agents/SPEC.md · 47 lines

What it actually says

core_v2/agents/ — Agent 开发规范

职责

定义 Agent 基类、继承体系和注册机制。

继承体系

AgentBase                          # base.py — 所有 Agent 的根
├── ReActAgent                     # react_agent.py — ReAct 循环 + 工具调用
├── PlanAgent                      # plan.py — 规划型 Agent
└── SkillEvolutionBase             # skill_evolution_base.py — Skill 进化基类

关键文件

文件 说明
base.py AgentBaseJinja2TemplateWrapperLLMAPIError
react_agent.py ReActAgent(继承 AgentBase,内置工具调用循环)
plan.py PlanAgent
skill_evolution_base.py SkillEvolutionBase
registry.py AgentRegistry@register_agent 装饰器

开发约定

新增 Agent 的标准流程

  1. 在业务目录(如 op/agents/)创建文件,继承 AgentBaseReActAgent
  2. 实现 run() 方法
  3. 使用 @register_agent 注册到 AgentRegistry
  4. Prompt 模板放在 op/resources/prompts/<agent_name>/
  5. 通过 self.load_template() 加载模板(基于 get_prompt_path() 解析路径)

AgentBase 核心 API

  • load_template(path) → 从 prompt 根目录加载 Jinja2 模板
  • run() → Agent 执行入口(子类必须实现)
  • LLM 调用通过 LLMClient 完成

不做什么

  • 不要直接修改 AgentBase 的核心行为——通过继承扩展
  • 不要在此目录放业务 Agent(如 KernelGen)——归 op/agents/
  • 不要在此目录放测试——归 tests/ut/
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. 2d ago First seen · 47 lines · 0 tokens per session scan A d807d4c6de7a

Subscribe to this mod's changes

SPEC is an agent published in the GitHub repository mindspore-ai/akg (259 stars, last pushed 22d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 451 tokens. 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

system-architect

Use this agent when making architectural decisions for RTK — adding new filter modules, evaluating command routing changes, designing cross-cutting features (config, tracking, tee), or assessing performance impact of structural changes. Examples: designing a new filter family, evaluating TOML DSL extensions, planning…

rtk-ai/rtk · 0 tokens

model-compatibility

Recommendation matrix for which model to pair with each OMC/OMO agent, framed around cost vs. quality. This page exists so the recurring "어떤 모델을 어느 agent에 박아야 함?" question stops being tribal Discord knowledge.

Yeachan-Heo/oh-my-claudecode · 0 tokens

kimi

Kimi CLI is Moonshot's coding agent. In CCR it is CLI only and always uses Only opened from CCR.

musistudio/claude-code-router · 0 tokens

AGENTS

In-depth tutorials on LLMs, RAGs and real-world AI agent applications.

patchy631/ai-engineering-hub · 0 tokens

dynamic-agents

Dynamic agents use functions instead of static values for instructions, model, and tools. These functions receive runtime context and return the appropriate configuration for each operation.

VoltAgent/voltagent · 0 tokens

codemap

Defines agent personalities (Orchestrator, Explorer, Librarian, etc.) and manages their configuration lifecycle. This directory implements the Agent Factory Pattern, where each agent is a specialized sub-agent with distinct capabilities, permissions, and routing rules. The Orchestrator agent (src/agents/index.ts)…

alvinunreal/oh-my-opencode-slim · 0 tokens