akg-review

akg-review is a skill for Claude Code, OpenCode from mindspore-ai/akg. It costs 67 tokens per session (3,836 once invoked), scanned C, original, Apache-2.0.

A read-only pre-submission code review tool for AKG projects. It checks formatting, security-related issues, rebase conflicts, dangerous functions, and compliance with SPEC.md.

In plain words
What is it for?
Use it before committing or when requesting a code review to run tools such as ruff and bandit, inspect the target branch, apply project-specific checks, and generate a report.
Why use it?
It catches common problems before submission and records the findings in a review report without changing the code.

Skill for Claude CodeOpenCode

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

Good fit Use it before committing or when requesting a code review to run tools such as ruff and bandit, inspect the target branch, apply project-specific checks, and generate a report.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mindspore-ai/akg/akg-review
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 akg-review
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 akg-review

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/mindspore-ai/akg/akg-review"><img src="https://agentmods.dev/badge/skills/mindspore-ai/akg/akg-review.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 67 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,836 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00067 $0.03836
Opus 5 $0.00034 $0.01918
Sonnet 5 $0.00013 $0.00767
Haiku 4.5 $0.00007 $0.00384

Measured 11d ago against content hash 7fce94a811bf, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade C, and why

akg-review scanned grade C with 1 finding 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 11d ago.

The scan reads SKILL.md. This mod also ships 4 executable files (scripts/check_code_style.py, scripts/check_rebase.py, scripts/check_spec_compliance.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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf "$REVIEW_TMP_DIR"
akg_agents/.opencode/skills/akg-review/SKILL.md · 422 lines

How it starts

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

AKG Review - 提交前代码自审

⛔ 核心规则

  1. 所有产物写入 $AKG_AGENTS_DIR/.tmp/review/
  2. 优先使用现成工具ruff(代码规范)、git(rebase 检查)。
  3. 自定义检查仅覆盖项目特定规则(危险函数、包名、SPEC.md)。
  4. 不执行任何修改,只检查和报告。

依赖检查(自动):

  • ruff - 如未安装,自动执行 pip install ruff
  • git - 系统自带

流程

Step 0: 依赖检查(自动安装)

for tool in ruff bandit; do
  if ! command -v $tool &> /dev/null; then
    echo "$tool 未安装,正在安装..."
    pip install $tool -q
  fi
done

MYPY_AVAILABLE=$(command -v mypy &> /dev/null && echo "yes" || echo "no")
VULTURE_AVAILABLE=$(command -v vulture &> /dev/null && echo "yes" || echo "no")

REVIEW_TMP_DIR=$(mktemp -d "${TMPDIR:-/tmp}/akg_review_XXXXXX")

Step 1: 确定目标分支(需用户确认)

缓存文件$AKG_AGENTS_DIR/.tmp/review_last.txt,记录上次确认过的参数。

CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
TARGET_BRANCH=${ARGUMENTS:-}
REVIEW_CACHE="$AKG_AGENTS_DIR/.tmp/review_last.txt"

确定 TARGET_BRANCH 的优先级(依次尝试,取第一个有效值):

  1. 用户本次指定的参数($ARGUMENTS
  2. 缓存文件中记录的上次值($REVIEW_CACHE
  3. 自动探测远程分支
# 如果用户未指定,尝试读缓存
if [ -z "$TARGET_BRANCH" ] && [ -f "$REVIEW_CACHE" ]; then
  CACHED_TARGET=$(grep '^target_branch=' "$REVIEW_CACHE" | cut -d= -f2)
  if [ -n "$CACHED_TARGET" ] && git rev-parse --verify "$CACHED_TARGET" &>/dev/null; then
    TARGET_BRANCH="$CACHED_TARGET"
  fi
fi

# 如果仍为空,自动探测
if [ -z "$TARGET_BRANCH" ]; then
  for candidate in origin/br_agents $(git branch -r | grep '/br_agents$' | head -1 | tr -d ' '); do
    if git rev-parse --verify "$candidate" &>/dev/null; then
      TARGET_BRANCH="$candidate"
      break
    fi
  done
fi

必须向用户展示以下信息并等待确认后才能继续

📋 审查参数确认

  • 当前分支: $CURRENT_BRANCH
  • 目标分支: $TARGET_BRANCH (来源:用户指定 / 上次缓存 / 自动探测)
  • 变更文件数: git diff $TARGET_BRANCH...HEAD --name-only --relative | wc -l
  • 变更 .py 文件数: git diff $TARGET_BRANCH...HEAD --name-only --diff-filter=ACMR --relative | grep '\.py$' | wc -l

确认以上信息正确?(y/n),或指定其他目标分支。

Read the full file on GitHub · 422 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. 11d ago First seen · 422 lines · 67 tokens per session scan C 7fce94a811bf

Subscribe to this mod's changes

akg-review is a skill published in the GitHub repository mindspore-ai/akg (259 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 67 tokens to every session and 3,836 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.