forge-review

forge-review is a skill for Claude Code from yike-gunshi/forge-skills. It costs 133 tokens per session (2,015 once invoked), scanned A, original, MIT.

A pre-release review guide for comparing the current code branch with its base branch, meaning the branch the changes are intended to merge into. It looks for structural problems that tests may not catch and can fix findings directly.

In plain words
What is it for?
Use it before a pull request is merged or released to inspect the full diff, verify the correct base branch, and review SQL safety, concurrency, LLM boundaries, and enumeration completeness.
Why use it?
It provides a focused review of changes before merging, including security issues, race conditions, trust boundaries around language models, and incomplete cases.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; mentions CLAUDE.md; names the AskUserQuestion tool.

Good fit Use it before a pull request is merged or released to inspect the full diff, verify the correct base branch, and review SQL safety, concurrency, LLM boundaries, and enumeration completeness.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/yike-gunshi/forge-skills/forge-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 yike-gunshi/forge-skills --skill forge-review
Clone the repo
git clone --depth 1 https://github.com/yike-gunshi/forge-skills

Made for: Claude Code.

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 forge-review

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/yike-gunshi/forge-skills/forge-review"><img src="https://agentmods.dev/badge/skills/yike-gunshi/forge-skills/forge-review.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 133 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,015 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.00133 $0.02015
Opus 5 $0.00067 $0.01007
Sonnet 5 $0.00027 $0.00403
Haiku 4.5 $0.00013 $0.00201

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

Security

Grade A, and why

forge-review 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 12d 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.

skills/forge-review/SKILL.md · 206 lines

How it starts

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

文档落地路径:遵循 forge-doc-policy 规范。完整白名单 + frontmatter schema 见 ~/.claude/skills/forge-doc-policy/doc-paths.md当前文档加载顺序:需要判断需求/设计/工程口径时,先读项目 CLAUDE.mddocs/README.mddocs/INDEX.md 和相关根级当前真相源;历史 archive 只作追溯证据。 详细规则见 ~/.claude/skills/_shared/current-doc-loading.md

/forge-review:代码审查

前置脚本(每次先运行)

_BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown")
echo "当前分支: $_BRANCH"

提问格式与批量策略见 ~/.claude/skills/_shared/interaction-protocol.md


第0步:确定基础分支

按顺序判断此 PR 合并到哪个分支:

# 1. 检查是否已有 PR
gh pr view --json baseRefName -q .baseRefName 2>/dev/null

# 2. 没有 PR 则获取仓库默认分支
gh repo view --json defaultBranchRef -q .defaultBranchRef.name 2>/dev/null

# 3. 都失败则回退到 main

打印出基础分支名称,后续所有 git diffgit fetchgit merge 等命令中用实际分支名替换"基础分支"。


第1步:检查分支状态

git branch --show-current
git fetch origin <基础分支> --quiet && git diff origin/<基础分支> --stat

如果在基础分支上,或没有 diff,输出:"没有可审查的内容——你在基础分支上或没有变更。" 并停止。


第2步:获取完整 diff

git fetch origin <基础分支> --quiet
git diff origin/<基础分支>

在评论之前先读完完整 diff。 不要标记 diff 中已经修复的问题。


第3步:两轮审查

第一轮(严重问题)

逐项检查以下类别,对每个 diff 文件详细分析:

1. SQL 与数据安全

检查

  • 用户输入是否直接拼入 SQL?(注入风险)
  • 原始 SQL 查询是否使用了参数化?
  • 批量更新/删除是否有 WHERE 条件?(全表操作风险)
  • 事务边界是否正确?(部分成功状态)
  • 软删除记录是否在所有查询中被过滤了?

报告格式[严重] 文件:行号 — 问题描述 → 修复建议

2. 竞态条件与并发

检查

  • 先读后写操作是否有并发安全问题?(检查-再-操作 TOCTOU)
  • 数据库操作是否需要乐观锁/悲观锁?
  • 共享状态是否在多个请求间安全?
  • 缓存失效是否有竞态?

特别注意:状态转换(如 draft → published)必须用数据库级约束,不能只依赖应用层检查。

3. LLM 输出信任边界

检查

  • LLM 生成的内容在写入数据库前是否经过验证/清洗?
  • LLM 输出是否直接用于 SQL 构建或系统命令?
  • 是否对 LLM 输出的类型和格式做了断言?
  • Prompt 中是否包含了敏感数据(密钥、PII)?
4. 枚举与值完整性

检查

  • 新增枚举值/状态/类型时,所有引用了同级值的文件是否都处理了新值?

重要:枚举完整性必须读取 diff 以外的代码。当 diff 新增了枚举值,用 Grep 找出所有引用了同级值的文件,Read 这些文件检查新值是否被处理。

第二轮(信息性问题)

5. 条件副作用

检查

  • 副作用(发邮件、写日志、扣费用)是否在 if 语句的所有分支中都正确处理?
  • 删除或禁用功能时,是否清理了对应的副作用触发器?
6. 魔法数字与字符串耦合

检查

  • 是否有应该提取为常量的重复数字/字符串?
  • 硬编码的限制值(如 1001000)是否有注释说明含义?

Read the full file on GitHub · 206 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. 12d ago First seen · 206 lines · 133 tokens per session scan A 0fb8343c24a9

Subscribe to this mod's changes

forge-review is a skill published in the GitHub repository yike-gunshi/forge-skills (13 stars, last pushed 1mo ago), licensed MIT. It adds 133 tokens to every session and 2,015 once invoked, about $0.0007 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