代码自审

代码自审 is a skill for Claude Code, Codex from jianchen08/Agent-os-open. It costs 65 tokens per session (769 once invoked), scanned A, original, Apache-2.0.

A checklist for mechanically reviewing code after implementation. It checks module boundaries, dependency cycles, requirement links, lint and type errors, security issues, and repeated or dead code.

In plain words
What is it for?
Running pre-submission checks and recording a structured pass-or-fail self-review.
Why use it?
It catches objective problems before code is submitted without requiring a separate reviewer for every small change.

Skill for Claude CodeCodex

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 skills/jianchen08/agent-os-open/code-self-review
Any agent
npx skills add jianchen08/Agent-os-open --skill code-self-review
Clone the repo
git clone --depth 1 https://github.com/jianchen08/Agent-os-open

Made for: Claude Code, Codex.

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 代码自审

README.md
[![agentmods](https://agentmods.dev/badge/skills/jianchen08/agent-os-open/code-self-review.svg)](https://agentmods.dev/skills/jianchen08/agent-os-open/code-self-review)
Your own site
<a href="https://agentmods.dev/skills/jianchen08/agent-os-open/code-self-review"><img src="https://agentmods.dev/badge/skills/jianchen08/agent-os-open/code-self-review.svg" alt="Measured on agentmods" height="20"></a>
Per session 65 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 769 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.1 $0.00065 $0.00769
Opus 5 $0.00032 $0.00385
Sonnet 5 $0.00013 $0.00154
Haiku 4.5 $0.00006 $0.00077

Measured today against content hash 7d09bd215975, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

代码自审 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 today.

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/code-self-review/SKILL.md · 50 lines

What it actually says

代码自审

本技能是流程指引,不是逐条打勾清单:按场景判断使用,遇不适用情况保持裁量,不机械执行。

用途

编码完成、提交 task_evaluate 之前,对本次改动的代码做机械化检查。只跑确定性检查(工具能客观判定,不依赖"第二双眼睛"的逻辑判断),目的是拦截低级错误,省去对小改动派独立审查的开销。

能力边界:本技能只覆盖机械检查。需求追溯、架构边界四问、AC 符合度判断仍需独立 code_reviewer_agent。

检查项(物理保险 5 项)

检查项 怎么查 判定
模块边界物理化 检查是否有跨模块非法导入(绕过公共接口直接访问内部实现,如 import _ 前缀函数、直接访问内部属性) 有则失败
架构约束测试 检查模块间依赖方向是否正确,是否存在循环依赖(可用 lsp_references / grep import 链) 有循环则失败
需求覆盖扫描 检查新增代码是否关联了需求来源(AC编号或需求描述),识别无需求的孤儿代码 有孤儿代码则失败
安全与风格Lint 运行 ruff/flake8/mypy,检查空 catch、遗留 print/console.log、无需求 TODO、硬编码密钥 有 error 级则失败
冗余模式检测 检测重复代码、翻译式注释、无效错误处理、死代码 有则失败

执行流程

  1. bash_execute 跑 lint/类型检查工具(ruff、mypy 等)
  2. enhanced_search / lsp_references 检查跨模块导入和依赖方向
  3. enhanced_search 扫描无需求 TODO、硬编码密钥、遗留 print
  4. 汇总结果,填写执行报告模板的「自审结论」章节

产出(填入执行报告)

self_review:
  status: pass | fail        # 任一物理保险失败 = fail
  module_boundary: {status: pass|fail, violations: []}
  architecture: {status: pass|fail, cycles: []}
  security_lint: {status: pass|fail, issues: []}
  redundancy: {status: pass|fail}
  must_fix_before_submit: []  # status=fail 时必填,列出必须修的问题

规则

  • status=fail 时,must_fix_before_submit 中的问题必须全部修复后才能调用 task_evaluate
  • 自审结果写入执行报告的「自审结论」章节,供编排器核对
  • 自审只覆盖机械检查;本任务是否还需独立 code_reviewer_agent,由执行 Agent 根据风险分级标签判断(见执行报告模板)
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. today Changed · +2 lines 7d09bd215975
  2. 5d ago First seen · 48 lines · 65 tokens per session scan A 4e87deadee62

Subscribe to this mod's changes

代码自审 is a skill published in the GitHub repository jianchen08/Agent-os-open (5 stars, last pushed yesterday), licensed Apache-2.0. It adds 65 tokens to every session and 769 once invoked, about $0.0003 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-31.

Related

Other skills, from other repositories

background-task

Add or modify work that runs outside the request/response cycle — emails, document ingestion, webhooks, cleanups, scheduled jobs. Use when something is slow or fire-and-forget, or when adding a periodic/cron task. This project's queue is {{ cookiecutter.backgroundtasks }}.

vstorm-co/full-stack-ai-agent-template · 62 tokens

agent-tool

Add a new tool/function the AI agent can call (e.g. look something up, hit an external API, perform an action). Use when extending the assistant's capabilities, wiring a new function into the agent, or when the model needs a new action. This project uses {{ cookiecutter.aiframework }}.

vstorm-co/full-stack-ai-agent-template · 66 tokens

frontend-feature

Build a new page, view, or data-driven feature in the Next.js frontend. Use when adding a route under the dashboard/marketing area, wiring UI to a backend endpoint, adding client state, or creating a localized page. Covers App Router, data fetching, Zustand stores, and i18n.

vstorm-co/full-stack-ai-agent-template · 64 tokens

rag-knowledge

Work with the RAG knowledge base — ingest documents, run semantic search, manage collections, or add a sync source/connector (Google Drive, S3). Use when populating or debugging the knowledge base, tuning retrieval, or adding a new document source. This project uses {{ cookiecutter.vectorstore }} + {{…

vstorm-co/full-stack-ai-agent-template · 76 tokens

alembic-migration

Create, review, and apply database schema changes with Alembic. Use whenever a SQLAlchemy model is added or changed, a column/index/constraint needs to change, or a data backfill is required — anything that alters the PostgreSQL schema.

vstorm-co/full-stack-ai-agent-template · 56 tokens

channel-bot

Work with messaging-channel bots (Telegram / Slack) — register a bot, route inbound messages through the AI agent, handle webhooks vs polling, or add a new channel adapter. Use when wiring chat into a messaging platform or debugging bot delivery.

vstorm-co/full-stack-ai-agent-template · 53 tokens