Token导航 LogoToken导航

Agent Skill · 开发

code-review(代码审查)

code-review 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

code-review 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在开发类的 21,746 个 Skill 里排第 20,764。

总安装 212周安装 9GitHub Stars 3下载 74核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:code-review(代码审查)
来源仓库:https://github.com/1mangesh1/dev-skills-collection
仓库路径:skills/code-review
安装命令:
npx skills add https://github.com/1mangesh1/dev-skills-collection --skill code-review
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/1mangesh1/dev-skills-collection --skill code-review

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

专注于提升代码审查效率,帮助开发者快速识别逻辑错误、安全漏洞和边界情况。涵盖逻辑正确性、安全性、性能等多个维度的检查清单与反馈模式。通过自动化工具集成,可在 PR 提交或合并前自动运行审查规则。安装需使用 npx skills add 命令并指定 GitHub 仓库路径。

使用前请确认权限范围及是否涉及文件读写或网络访问。

来源仓库内路径:skills/code-review

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/1mangesh1/dev-skills-collection --skill code-r…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

code-review 怎么安装?

在终端执行 npx skills add https://github.com/1mangesh1/dev-skills-collection --skill code-review。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

code-review 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

code-review 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

code-review 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

code-review 用的人多吗?

公开数据是累计安装 212 次,近一周安装 9 次,下载 74 次,GitHub 3 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

code-review 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
code-review

代码审查 · 本页

2123需要联网未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Code Review

Checklists, patterns, feedback techniques, and automation for effective code reviews.


Review Checklist by Category

Logic and Correctness

  • Does the code do what the PR description says it does?
  • Are edge cases handled (empty inputs, boundary values, concurrent access)?
  • Are error conditions handled gracefully with appropriate error types?
  • Are there off-by-one errors in loops, slices, or pagination?
  • Are null/undefined/nil cases handled?
  • Does the control flow match the intended behavior (early returns, fallthrough)?

Security

  • No hardcoded secrets, keys, tokens, or passwords
  • Input validation on all user-supplied data (query params, body, headers)
  • No SQL injection, XSS, or command injection vectors
  • Authentication and authorization checks on every endpoint
  • Sensitive data not logged, not in error messages, not exposed in responses
  • CSRF protection on state-changing requests
  • Rate limiting on sensitive endpoints (auth, password reset)

Performance

  • No N+1 database queries (queries inside loops)
  • No memory leaks (event listeners, timers, subscriptions not cleaned up)
  • Large datasets paginated, not loaded entirely into memory
  • Expensive computations cached where appropriate
  • No blocking operations on the main thread or event loop
  • Database queries use indexes (check EXPLAIN plans for new queries)

Readability and Maintainability

  • Code is understandable without needing the author to explain it
  • Functions have a single responsibility and a clear name
  • No duplicated logic (DRY where it reduces coupling, not blindly)
  • Naming conventions are consistent with the codebase
  • No dead code, commented-out code, or unused imports
  • Complex logic has comments explaining why, not what

Testing

  • Tests cover the primary success path
  • Edge cases and error paths tested
  • Tests are deterministic (no flaky tests introduced)
  • Test names describe the behavior, not the implementation
  • Mocks are minimal and realistic

How to Give Constructive Feedback

The praise sandwich is patronizing and everyone sees through it. Be direct and kind. Critique the code, not the person.

Principles

  • Be specific. "This will throw if user is null on line 42" beats "handle errors better."
  • Explain the why. Don't just say what to change -- explain the risk or benefit.
  • Offer alternatives. If you flag a problem, suggest a solution or direction.
  • Acknowledge tradeoffs. If a shortcut is reasonable given constraints, say so.
  • Ask genuine questions. "What's the reasoning for X?" is valid when you don't understand.

Prefixed Comments

[nit] Minor style issue, take or leave
[suggestion] Optional improvement idea
[question] Seeking understanding, not necessarily a change
[issue] Must be addressed before merge
[praise] Something done well worth calling out
[thought] Sharing context or perspective, no action needed

Direct Feedback Examples

Instead of: "This is wrong"
Write: "This will fail when `items` is empty because `items[0]` returns undefined."

Instead of: "Why did you do it this way?"
Write: "Was there a performance reason for the manual loop? Array.filter would be more readable."

Instead of: "This is bad code"
Write: "This function handles validation, transformation, and persistence. Splitting would make each testable independently."

PR Size Guidelines

Small (< 200 lines changed)   -> Review in 15-30 min. Ideal size.
Medium (200-400 lines)         -> Review in 30-60 min. Acceptable.
Large (400-800 lines)          -> Consider splitting.
Very large (> 800 lines)       -> Should almost always be split.

When to Split

  • Refactoring mixed with feature changes. Ship the refactor first.
  • Infrastructure changes mixed with business logic.
  • Database migrations with application code. Migrate first, then use.
  • Multiple independent features or fixes bundled together.

When Large PRs Are Acceptable

  • Generated code (protobuf, OpenAPI, migration boilerplate).
  • Bulk renames or automated reformatting.
  • Initial project setup or deleting large amounts of dead code.

Review Speed and Turnaround

Slow reviews kill velocity. Fast reviews compound into fast teams.

  • Target: First-pass review within 4 business hours.
  • Unblocking: If a PR blocks other work, prioritize it. Say so in the review request.
  • Async norms: "I'll review by end of day" is better than silence.
  • Re-reviews: After feedback is addressed, re-review within 2 hours. Focus on the diff, don't restart.
  • Don't batch: Review PRs as they come in. End-of-day batching creates bottlenecks.
  • Stale PRs: Unreviewed for 24+ hours? Escalate or reassign.

Automated Review Tools

Automate what machines do better than humans. Save reviewers for logic and design.

GitHub Actions

name: PR Checks
on: [pull_request]
jobs:
  lint-and-test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npm ci
      - run: npm run lint
      - run: npm run typecheck
      - run: npm test -- --coverage

Danger.js

import { danger, warn, fail } from 'danger';

if (danger.github.pr.additions + danger.github.pr.deletions > 500) {
  warn('This PR is large. Consider splitting.');
}
if (!danger.github.pr.body || danger.github.pr.body.length < 20) {
  fail('Please add a meaningful PR description.');
}
const sensitive = danger.git.modified_files.filter(f =>
  f.includes('migration') || f.includes('.env') || f.includes('auth')
);
if (sensitive.length > 0) {
  warn(`Sensitive files changed: ${sensitive.join(', ')}`);
}

Other Tools

  • CodeRabbit -- AI-powered review summaries and inline suggestions
  • SonarQube / SonarCloud -- static analysis for bugs, smells, security hotspots
  • Codacy / CodeClimate -- automated code quality scoring
  • Reviewbot / Prow -- bot-driven labeling, assignment, merge gating
  • Codecov / Coveralls -- test coverage tracking and PR comments

Security-Focused Review

Check against OWASP Top 10 patterns most likely to appear in application code.

  • Injection: User input reaching queries, commands, or templates without parameterization.
  • Broken auth: Missing auth checks on new endpoints. Tokens that don't expire.
  • Data exposure: PII in logs, error messages, or API responses. Secrets in client code.
  • Access control: Can user A access user B's resources? Admin routes unprotected?
  • Misconfiguration: Debug mode in production. Default credentials. Verbose errors.
  • XSS: User input rendered without encoding in HTML or JavaScript contexts.
  • SSRF: Server requests using user-controlled URLs without allowlist validation.

Auth Review Specifics

  • Session tokens regenerated after login.
  • Password reset tokens are single-use and time-limited.
  • JWT validation checks signature, expiration, issuer, and audience.
  • API keys scoped to minimum necessary permissions.

Performance Review Patterns

N+1 Queries

// BAD: one query per iteration
for (const post of posts) {
  post.author = await db.query('SELECT * FROM users WHERE id = $1', [post.author_id]);
}
// GOOD: batch
const authorIds = [...new Set(posts.map(p => p.author_id))];
const authors = await db.query('SELECT * FROM users WHERE id = ANY($1)', [authorIds]);

Memory Leaks

  • Event listeners without cleanup on unmount/destroy.
  • Intervals/timeouts not cleared. Subscriptions not unsubscribed.
  • Growing caches without eviction. Closures holding references to large objects.

Unnecessary Renders (React)

  • Objects or arrays created inline in JSX props (new reference every render).
  • Missing useMemo/useCallback for expensive computations or callback props.
  • Context providers with unmemoized object values.

Reviewing Database Migrations

Migrations deserve extra scrutiny because they're hard to reverse in production.

  • Is the migration reversible? Does the rollback function work?
  • Will it lock tables? Adding a column with default on large tables locks in some databases.
  • Are new columns nullable or have defaults? Non-nullable without default fails on existing rows.
  • Indexes added concurrently where possible (CREATE INDEX CONCURRENTLY)?
  • Data migration separated from schema migration?
  • Is the migration idempotent (safe to run twice)?
  • Estimated run time tested against production-sized data?
  • Dropping columns has a deprecation path (stop reading first, then drop)?

Common Antipatterns in Reviews

Nitpicking -- Commenting on formatting and cosmetics a linter should catch. If you're debating semicolons, add a linter rule.

Rubber-Stamping -- "LGTM" on a 500-line PR after 2 minutes. If you can't review properly, let someone else.

Bike-Shedding -- Long debates on trivial matters while ignoring real issues. Keep comments proportional to impact.

Gatekeeper Mentality -- Blocking PRs over personal style preferences not in the team's style guide. Enforce shared standards, not individual taste.

Drive-By Reviews -- One vague comment ("this seems off") then disappearing. Either review thoroughly or don't start.


Review Templates by PR Type

Feature PR

- [ ] Requirements from the issue/spec are met
- [ ] Edge cases identified and handled
- [ ] Tests cover happy path and failure cases
- [ ] No security regressions (auth, input validation)
- [ ] Performance acceptable (no new N+1, no blocking calls)
- [ ] Documentation updated if public API changed

Bugfix PR

- [ ] Root cause identified (not just symptoms patched)
- [ ] Regression test added that fails without the fix
- [ ] Fix doesn't introduce new edge cases
- [ ] Related code checked for same class of bug

Refactor PR

- [ ] Behavior unchanged (no functional changes mixed in)
- [ ] Existing tests pass without modification
- [ ] Code is measurably better (simpler, fewer dependencies, more testable)
- [ ] Performance characteristics unchanged or improved

Dependency Update PR

- [ ] Changelog reviewed for breaking changes
- [ ] Major version bumps justified and tested
- [ ] Lock file changes are consistent (no unexpected additions)
- [ ] No new vulnerabilities introduced
- [ ] Bundle size impact acceptable

Code Ownership and CODEOWNERS

# .github/CODEOWNERS
*                       @org/platform-team
/src/components/        @org/frontend-team
/src/api/               @org/backend-team
/src/auth/              @org/security-team
/db/migrations/         @org/dba-team
/terraform/             @org/devops-team
/.github/workflows/     @org/devops-team
  • Keep ownership granular. One team owning everything defeats the purpose.
  • Review CODEOWNERS quarterly. Remove departed members. Update assignments.
  • Use for mandatory review, not as a notification mechanism.
  • Combine with branch protection rules requiring CODEOWNERS approval.

Pair Review vs Async Review

Pair Review (Synchronous)

Best for: Complex architecture, unfamiliar codebases, onboarding, contentious designs.

  • Faster resolution. No async back-and-forth.
  • Higher bandwidth catches design issues written comments miss.
  • Time-expensive. Reserve for PRs where async would take 3+ rounds.

Async Review (Standard)

Best for: Routine changes, well-understood domains, distributed teams.

  • Reviewer reads at their own pace. More thoughtful.
  • Written feedback creates searchable record.
  • Risk of miscommunication. Tone is hard in text.

When to Switch from Async to Pair

  • More than 2 rounds of back-and-forth on the same issue.
  • Reviewer and author disagree and comments aren't resolving it.
  • The PR touches unfamiliar territory needing a walkthrough.

When to Request Changes vs Approve with Comments

Request Changes

  • Bug that will break production.
  • Security vulnerability (injection, auth bypass, data leak).
  • PR doesn't do what the description says.
  • Tests missing for critical paths.
  • Change will cause data loss or corruption.

Approve with Comments

  • Suggestions are improvements but code works correctly as-is.
  • Style preferences not in the team's style guide.
  • Minor refactoring opportunities that aren't urgent.
  • Questions driven by curiosity, not blockers.

The rule: If the PR shipped right now, would it cause harm? Request changes. If it works but could be better? Approve with comments. Trust the author to address optional feedback.


Review Workflow

1. Read the PR description and linked issue
2. Understand context: what problem, why now?
3. Check PR size. If too large, ask to split before reviewing
4. Review test files first to understand expected behavior
5. Review main changes with the checklist for the PR type
6. Check correctness, security, performance, readability
7. Run locally if the change is complex or risky
8. Leave feedback using prefixed comments
9. Summarize with overall assessment and clear status

Tools

  • Danger.js -- programmable PR review rules and warnings
  • CodeRabbit -- AI-powered review summaries and inline suggestions
  • SonarQube / SonarCloud -- static analysis for bugs, smells, security hotspots
  • GitHub Actions -- CI checks, linting, test coverage gates
  • Codecov / Coveralls -- test coverage tracking and PR comments

References

平台分布

Codex

34.79%
按下载量换算26

Claude

29.12%
按下载量换算22

Cursor

17.42%
按下载量换算13

Gemini CLI

9.64%
按下载量换算7

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills