akg-pr

akg-pr is a skill for Claude Code, OpenCode from mindspore-ai/akg. It costs 57 tokens per session (2,862 once invoked), scanned A, original, Apache-2.0.

A tool that creates pull-request descriptions from the differences between a current Git branch and a target branch. A pull request is a proposed set of code changes for review and merging.

In plain words
What is it for?
Collecting Git branch and remote details, summarizing code changes, generating AKG-format Markdown and JSON PR files, validating them, and optionally submitting them through an API.
Why use it?
It turns branch changes into a project-formatted description and checks that the result follows the required rules. It keeps the generated files in a temporary directory and waits for the user before submitting anything.

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 Collecting Git branch and remote details, summarizing code changes, generating AKG-format Markdown and JSON PR files, validating them, and optionally submitting them through an API.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/mindspore-ai/akg/akg-pr"><img src="https://agentmods.dev/badge/skills/mindspore-ai/akg/akg-pr.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 57 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,862 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 3 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Data Exfiltration · line 259
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
  • medium Data Exfiltration · line 259
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
  • medium Data Exfiltration · line 282
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
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.00057 $0.02862
Opus 5 $0.00028 $0.01431
Sonnet 5 $0.00011 $0.00572
Haiku 4.5 $0.00006 $0.00286

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

Security

Grade A, and why

akg-pr scanned grade A 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 10d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/validate_pr.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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s -X POST "https://api.gitcode.com/api/v5/repos/<owner>/<repo>/pulls?access_token=$GITCODE_TOKEN" \
akg_agents/.opencode/skills/akg-pr/SKILL.md · 307 lines

How it starts

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

AKG PR 生成

⛔ 核心规则

  1. 所有产物写入 $AKG_AGENTS_DIR/.tmp/pr/禁止写入其他位置
  2. PR 模板格式已内嵌在本文档 Step 3b 中,无需读取外部文件,直接使用下方模板。
  3. 所有 PR 标题必须带 [AKG_AGENTS] 前缀,格式:[AKG_AGENTS] <kind>: <概要描述>
  4. 生成完成后必须执行规范校验,校验不通过必须提示用户修复。
  5. 本 skill 不执行 git push。API 提交仅在用户选择后执行。
  6. 禁止在 shell 中打印 Token 值。检查 Token 是否存在只能用 [ -z "$VAR" ] 判断。

流程总览

Step 1  确定分支与远程信息(自动)
Step 2  收集差异数据(自动)
Step 3  生成 PR 描述文件(自动)
Step 4  规范校验(自动)
Step 5  展示结果 + 用户决策(一次交互)
Step 6  执行 API 提交(仅当用户选择"提交"时,不再二次确认)

Step 1: 确定分支与远程信息

执行以下命令收集 git 上下文:

git rev-parse --abbrev-ref HEAD
git remote -v
git config --get branch.$(git rev-parse --abbrev-ref HEAD).remote

参数解析规则(解析 $ARGUMENTS):

  • 如果参数包含 /(如 origin/master):
    • 先检查是否是已知 remote 名:执行 git remote 获取列表
    • / 前部分在 remote 列表中 → 该部分为 REMOTE,/ 后为 TARGET_BRANCH
    • / 前部分不在 remote 列表中 → 整体作为 TARGET_BRANCH 使用(可能是 用户名/分支名 格式的 ref)
  • 无参数 → TARGET_BRANCH = master

远程名优先级:用户指定 > tracking remote > origin > origin_gitcode > 第一个

平台与仓库(⚠️ 必须从 git remote -v 的 URL 提取,禁止从用户输入的分支名推断):

  • 从 remote URL 识别平台:gitcode.com / gitee.com / github.com
  • 从 remote URL 提取 owner/repo(去掉 .git 后缀)

🛑 当前分支 == 目标分支 → 报错终止。


Step 2: 收集差异数据

git diff <target_branch>...HEAD --stat
git log <target_branch>..HEAD --oneline --no-merges
git diff <target_branch>...HEAD
git status --short

⚠️ 无差异 → 报错终止。 ⚠️ 有未提交变更 → 提醒但继续。


Step 3: 生成 PR 文件

3a. 分析与推断

字段 推断逻辑
kind 从 commit message 关键词推断:fix/bugbugfeat/add/supportfeature,其他 → task
title [AKG_AGENTS] <kind>: <概要描述>。单 commit 时可直接用 message 加前缀
fixes 从 commit message 提取 Fixes #NClose #N未检测到时写 N/A,不要编造。关联 Issue 时必须使用完整 URLFixes https://gitcode.com/mindspore/akg/issues/399
description AI 总结:做了什么、为什么做、怎么做的
reviewer_notes 重点变更、潜在风险、需要特别关注的文件

Read the full file on GitHub · 307 lines

Files

What ships with it

1 file 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. 10d ago First seen · 307 lines · 57 tokens per session scan A 8b63d5dc8874

Subscribe to this mod's changes

akg-pr is a skill published in the GitHub repository mindspore-ai/akg (259 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 57 tokens to every session and 2,862 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). 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

review-implement-phase

Implements triaged review actions, commits focused fixes, and posts Done plus resolves threads. Use when the user wants only the implementation phase of the review-framework workflow.

prisma/orm · 38 tokens

engram-branch-pr

PR creation workflow for Engram following the issue-first enforcement system. Trigger: When creating a pull request, opening a PR, or preparing changes for review.

Gentleman-Programming/engram · 37 tokens

verify-behavior

Verify or reproduce visible product behavior by driving the real UI with pi-computer-use's checked tools, requiring verified expect postconditions and durable state evidence for meaningful UI flows. Use when triage needs visual reproduction, implementation needs behavioral proof, review needs interactive confirmation…

nicknisi/dotfiles · 68 tokens

github-contributor

End-to-end playbook for shipping high-quality pull requests to open-source projects you don't maintain — discovery, CONTRIBUTING compliance, PR-size check, minimal-diff implementation, PR description with AI-assisted disclosure, conflict resolution, and post-submission maintainer interaction. Use whenever creating…

daymade/claude-code-skills · 133 tokens

revdiff

Review diffs, files, and documents with inline annotations in a TUI overlay, or answer questions about revdiff usage, configuration, themes, and keybindings. Opens revdiff in agterm/tmux/zellij/herdr/kitty/wezterm/cmux/ghostty/iterm2/emacs-vterm, captures annotations, and addresses them. Works in git, hg, and jj repos…

umputun/revdiff · 248 tokens

write-pr

Reference standards for writing pull request titles and descriptions in the tldraw repository, plus the pre-flight comment sweep over the diff. Use as supporting guidance when another skill or workflow needs PR content standards, not as the user-facing create/update PR workflow.

tldraw/tldraw · 53 tokens