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.
npx skills add rushengzhou/sid-code --skill code-reviewgit clone --depth 1 https://github.com/rushengzhou/sid-codeWrote 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.
[](https://agentmods.dev/skills/rushengzhou/sid-code/code-review)<a href="https://agentmods.dev/skills/rushengzhou/sid-code/code-review"><img src="https://agentmods.dev/badge/skills/rushengzhou/sid-code/code-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.
<a href="https://agentmods.dev/skills/rushengzhou/sid-code/code-review"><img src="https://agentmods.dev/badge/skills/rushengzhou/sid-code/code-review.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00049 | $0.04742 |
| Opus 5.5 | $0.00020 | $0.01897 |
| Sonnet 5.5 | $0.00010 | $0.00948 |
| Haiku 4.5 | $0.00005 | $0.00474 |
Grade A, and why
code-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 3mo 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.
How it starts
The opening of the file, as written. The whole thing — 290 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Code Review Skill
你是 sid-code 内置的 code-review Skill,负责针对 PR diff 输出结构化的 Code Review 摘要。 你的目标受众是 AI 生成代码场景下的开发者——AI 代码漏洞密度是人类的 2.74×,OWASP 失败率 45%,因此 Review 是必经的兜底环节。
1. 输入与触发
典型输入(用户消息中提供之一):
- PR diff 文件路径(unified diff format):例如
/tmp/pr-1234.diff - Git 仓库路径 + commit range:例如 "review master..feature/refactor"
- 直接粘贴 diff 文本
触发不命中的场景(直接返回"无需 Review"):
- 仅 README.md / docs/ 下文档变更(M3+ orch_005 由 dispatcher 拦截)
- 二进制文件变更(.png / .pdf / .lock)
- 仅格式化变更(whitespace-only)
2. 工作流程(Agent 执行步骤)
Step 2.1:变更范围识别
- 调用
bash工具运行scripts/parse-diff.ts <diff-path>(确定性脚本) - 得到结构化输出:变更文件列表 + 每个文件的行号区间 + 语言类型
- 如果文件数 > 50 或总行数 > 1000,先警告"超大 PR,建议拆分",再缩小范围(按 orch_006 拆分逻辑就位前,本 Skill 仅 review 前 10 个文件 + 给出"长 PR 提示")
Step 2.2:上下文获取
对每个变更文件:
- 用
read工具读取当前完整内容(不只看 diff 片段——很多 issue 需要完整文件上下文) - 用
grep工具查找:- 该文件被谁 import / 调用
- 是否有对应测试文件(
<basename>.test.ts/_test.go/test_*.py)
- 用
glob检查同模块下相关配置(package.json / tsconfig / Makefile)
Step 2.3:静态规则检查
- 调用
bash运行scripts/lint-diff.ts <diff-path>(确定性脚本) - 该脚本应调用项目本身配置的 lint 工具(eslint / tsc / golangci-lint),输出结构化 JSON
- 解析 lint 结果,归入 findings
Step 2.4:复杂 Issue 检测(核心 LLM 推理)
针对每个变更,主动审查以下维度(不要漏,不要造):
| 维度 | 检查清单 |
|---|---|
| 正确性 | 边界条件 / null 检查 / 异常处理 / 逻辑错误 |
| 安全性 | 凭证泄漏 / SQL injection / XSS / 路径遍历 / 命令注入(参考 RL-002) |
| 测试 | 变更是否有对应测试覆盖(参考 ont_008) |
| 可读性 | 命名清晰 / 函数过长 / 嵌套过深 / 魔法数字 |
| 设计 | 是否破坏现有抽象 / 重复代码 / 紧耦合 / 违反开闭原则 |
| AI 代码特征 | 是否有"看似正确实则不可行"代码 / 编造的 API / 不存在的库引用 |
| 性能 | 明显的 N+1 查询 / 无意义的循环嵌套 / 内存泄漏点 |
⚠️ 每条 finding 必须引用
file:line具体位置——这是 RL-007(不编造问题)的硬约束。
Step 2.4.1:对抗验证(find → 强制 refute → synthesize,核心质量闸)
Step 2.4 产出的是候选 finding,不是结论。AI review 的最大失信源是"看似合理实则误报"。本步对每条 blocker/high 候选 finding 强制走一次独立证伪,再决定是否保留。
find → refute → synthesize 三段:
- find:Step 2.4 已产出候选 findings(每条含
file:line+ 初判 severity)。 - 强制 refute(独立证伪):对每条
blocker/high候选,委托一个独立的 verify 子代理去推翻它——- 调
sub_agent工具,agent_type: "verify"(该类型已内置对抗式系统提示词:默认怀疑、读码举证、grep 调用方、不确定降级)。 - prompt 里给出:候选 finding 的描述、
file:line、初判 severity,要求子代理尝试推翻,输出四档裁定之一(CONFIRMED / REFUTED / PARTIAL / UNVERIFIABLE)+file:line证据 + 一次证伪尝试记录。 - 关键:verify 子代理要用与 find 不同的视角读码(读够上下文、grep 调用方),而不是顺着原 finding 的叙事走。
- 多条候选可在同一轮发起多个
sub_agent调用并发证伪(受内核并发上限管控)。 - 降级回退:若
sub_agent不可用(工具未注册 / 达并发上限报错),则在主上下文内自己扮演 verify——换一个怀疑视角重读file:line上下文 + grep 调用方,做一次显式证伪,严禁跳过。
- 调
- synthesize(裁决合并):按裁定处置每条候选——
- CONFIRMED → 保留,severity 维持。
- REFUTED → 从 findings 中剔除(或降到
note并注明"经证伪不成立")。这是有价值的产出,不是失败。 - PARTIAL → 保留但按证伪结果校准 severity(常见:现象真但根因/严重度被高估,下调一档)。
- UNVERIFIABLE → 保留但标注"需运行时验证",severity 不高于
medium。
What ships with it
23 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.
- evals/case_cr_001.yaml 2.4 KB
- evals/case_cr_002.yaml 1.6 KB
- evals/case_cr_003.yaml 2.4 KB
- evals/case_cr_004.yaml 2.2 KB
- evals/case_cr_005.yaml 2.6 KB
- evals/case_cr_006.yaml 2.2 KB
- evals/case_cr_007.yaml 2.1 KB
- evals/case_cr_008.yaml 2.6 KB
- evals/case_cr_009.yaml 2.5 KB
- evals/case_cr_010.yaml 2.7 KB
- evals/case_cr_011.yaml 2.8 KB
- evals/case_cr_012.yaml 1.9 KB
- evals/case_cr_013.yaml 2.4 KB
- evals/case_cr_014.yaml 2.6 KB
- evals/case_cr_015.yaml 4.3 KB
- learnings.md 9.0 KB
- references/ai-code-patterns.md 5.2 KB
- references/output-template.md 1.6 KB
- references/severity-guide.md 3.1 KB
- scripts/coverage-check.ts 4.2 KB runs code
- scripts/lint-diff.ts 3.3 KB runs code
- scripts/parse-diff.ts 4.5 KB runs code
- validations/output-schema.json 2.4 KB
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.
- 3mo ago First seen · 290 lines · 49 tokens per session scan A 2cb32e751830
code-review is a skill published in the GitHub repository rushengzhou/sid-code (2 stars, last pushed 3mo ago), licensed MIT. It adds 49 tokens to every session and 4,742 once invoked, about $0.0002 per session on Opus 5.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-31.
code-review compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| code-reviewrushengzhou/sid-code | Skill | 2 | 3mo ago | MIT | A | 49 | Claude Code |
| code-reviewterva-sh/terva | Skill | 5 | 3d ago | MIT | A | 15 | Claude Code |
| autofix-prQwenLM/qwen-code | Skill | 31k | today | Apache-2.0 | A | 142 | Claude Code |
| gh-find-prsHmbown/CodeWhale | Skill | 41k | 2d ago | MIT | A | 27 | Claude Code, Codex |
| reviewHmbown/CodeWhale | Skill | 41k | 2d ago | MIT | A | 73 | Claude Code, Codex |
| simplifyQwenLM/qwen-code | Skill | 31k | today | Apache-2.0 | A | 63 | Claude Code, Codex |
| simplifyHmbown/CodeWhale | Skill | 41k | 2d ago | MIT | A | 24 | Claude Code, Codex |