Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问clear审计通过

code-review代码审查

Agent Skill

用于辅助安全审计、权限检查、凭据风险、认证流程和常见漏洞排查。它适合让 Agent 梳理敏感配置、检查依赖风险、分析鉴权逻辑或生成安全复核清单。使用时不能把工具输出直接当最终结论,涉及密钥、令牌、用户数据或生产系统时,应先确认最小权限、脱敏方式和操作边界。

总安装

8,340

周安装

351

GitHub Stars

69

下载量

2,920
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/jwynia/agent-skills --skill code-review

简介

code-review 用于辅助安全审计、权限检查和认证流程分析。

  • 适合梳理敏感配置、检查依赖风险或生成安全复核清单。
  • 使用时不能把工具输出直接当最终结论。
  • 安装命令:npx skills add https://github.com/jwynia/agent-skills --skill code-review
  • 涉及密钥或用户数据时应确认最小权限和操作边界。

SKILL.md

Code Review Diagnostic

Systematic code review catches 60-90% of defects before production, reduces maintenance costs by 40%, and serves as effective knowledge transfer. This skill provides structured review guidance for both human reviewers and AI agents.

When to Use This Skill

Use this skill when:

  • Reviewing code before merge
  • Assessing code quality
  • Preparing code for PR submission
  • Self-reviewing before requesting review

Do NOT use this skill when:

  • Writing new code (use implementation skills)
  • Designing architecture (use system-design)
  • Working on requirements (use requirements-analysis)

Core Principle

Review effectiveness degrades sharply with PR size. Under 400 lines: highest defect detection. 400-800 lines: 50% less effective. 800+ lines: 90% less effective.

Quick Reference: Review Effectiveness

FactorOptimalDegraded
PR size< 400 lines> 800 lines
Review time< 60 minutes> 90 minutes
Review speed200-400 LOC/hour> 500 LOC/hour
Reviewers24+ (diminishing returns)

Quality Pyramid

LevelChecksCatchesFrequency
1. AutomatedLint, types, unit tests, security scan60%Every commit
2. IntegrationIntegration tests, contracts, performance25%Every PR
3. Human ReviewDesign, logic, maintainability, context15%Significant changes

Review Focus Areas

1. Correctness

Questions:

  • Does it solve the stated problem?
  • Are edge cases handled?
  • Is error handling complete?
  • Are assumptions valid?

Validation: Test coverage, business logic, data integrity, concurrency handling

2. Maintainability

Questions:

  • Is the code self-documenting?
  • Can it be easily modified?
  • Are abstractions appropriate?
  • Is complexity justified?

Indicators: Clear naming, single responsibility, minimal coupling, high cohesion

3. Performance

Questions:

  • Are there obvious bottlenecks?
  • Is caching appropriate?
  • Are queries optimized?
  • Is memory managed?

Red Flags: N+1 queries, unbounded loops, synchronous I/O in async context, memory leaks

4. Security

Questions:

  • Is input validated?
  • Are secrets protected?
  • Is authentication checked?
  • Are permissions verified?

Critical Checks: No hardcoded secrets, SQL parameterized, XSS prevention, CSRF tokens

Code Smells Checklist

Method Level

SmellThresholdAction
Long method> 50 linesExtract method
Long parameter list> 5 paramsParameter object
Duplicate code> 10 similar linesExtract common
Dead codeNever calledRemove

Class Level

SmellSymptomsAction
God class> 1000 lines, > 20 methodsSplit class
Feature envyUses other class data excessivelyMove method
Data clumpsSame parameter groupsExtract class

Architecture Level

SmellDetectionAction
Circular dependenciesDependency cyclesIntroduce interface
Unstable dependenciesDepends on volatile modulesDependency inversion

Comment Guidelines

Comment Types

[BLOCKING] - Must fix before merge

  • Security vulnerabilities, data corruption risks, breaking API changes

[MAJOR] - Should fix before merge

  • Missing tests, performance issues, code duplication

[MINOR] - Can fix in follow-up

  • Style inconsistencies, documentation typos, naming improvements

[QUESTION] - Seeking clarification

  • Design decisions, business logic, external dependencies

Effective Comment Pattern

Observation + Impact + Suggestion

Example:
"This method is 200 lines long [observation].
This makes it hard to understand and test [impact].
Consider extracting helper methods [suggestion]."

Avoid

  • Vague: "This could be better"
  • Personal: "I don't like this"
  • Nitpicky: "Missing period in comment"
  • Overwhelming: 50+ minor style issues

Review Readiness Checklist

Before Requesting Review

  • Feature fully implemented
  • All tests written and passing
  • Self-review performed
  • No commented code or debug statements
  • Coverage threshold met
  • Linting clean
  • Build succeeds
  • Documentation updated
  • PR description explains problem and solution

PR Description Should Include

  • Problem statement (why this change?)
  • Solution approach (how does it solve it?)
  • Testing strategy (how verified?)
  • Breaking changes (if any)
  • Review focus areas (where to look closely?)

Complexity Thresholds

Cyclomatic Complexity

RangeClassificationAction
1-10SimpleOK
11-20ModerateConsider refactoring
21-50ComplexRefactor required
> 50UntestableMust decompose

Cognitive Complexity

RangeClassification
< 7Clear
7-15Acceptable
> 15Confusing - refactor needed

Anti-Patterns

Rubber Stamp

Approving without thorough review. "LGTM" in < 1 minute. Fix: Minimum review time, required comments, random audits.

Nitpicking

50+ style comments, missing real issues. Fix: Automate style checks, focus on logic/design, limit minor comments.

Big Bang Review

2000+ line PRs that overwhelm. Fix: Stack small PRs, feature flags, review drafts early.

Security Scanning Categories

Severity Classification

LevelDefinitionSLA
CriticalRemote code execution possibleFix immediately
HighData breach possibleFix within 24 hours
MediumLimited impactFix within sprint
LowMinimal riskFix when convenient

Review Metrics

Efficiency

MetricTarget
First review turnaround< 4 hours
Review cycles< 3
PR to merge time< 24 hours

Quality

MetricTarget
Defect detection rate> 80%
Post-merge defects< 0.5 per PR
Review coverage100%

Related Skills

  • github-agile - PR workflow and GitHub integration
  • task-decomposition - If PR too large, break it down
  • requirements-analysis - For unclear requirements

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

27.15%
按下载量换算793

OpenCode

24.11%
按下载量换算704

Codex

20.08%
按下载量换算586

Gemini CLI

14.2%
按下载量换算415

Cursor

8.57%
按下载量换算250

Antigravity

3.91%
按下载量换算114

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills