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

code-review代码审查

Agent Skill

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

总安装

448

周安装

25

GitHub Stars

11

下载量

17
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/akillness/skills-template --skill code-review

简介

用于审查 Pull Request 并提供反馈建议。

  • 覆盖架构合理性、安全性和性能问题识别。
  • 需先理解上下文,再逐层检查变更影响。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。
  • 应聚焦具体问题,避免泛泛而谈。code-review 属于前端设计类 Skill,可作为该场景下的辅助能力补充。
  • 安装时请确认是否有 PR 查看和评论权限。

SKILL.md

Code Review

When to use this skill

  • Reviewing pull requests
  • Checking code quality
  • Providing feedback on implementations
  • Identifying potential bugs
  • Suggesting improvements
  • Security audits
  • Performance analysis

Instructions

Step 1: Understand the context

Read the PR description:

  • What is the goal of this change?
  • Which issues does it address?
  • Are there any special considerations?

Check the scope:

  • How many files changed?
  • What type of changes? (feature, bugfix, refactor)
  • Are tests included?

Step 2: High-level review

Architecture and design:

  • Does the approach make sense?
  • Is it consistent with existing patterns?
  • Are there simpler alternatives?
  • Is the code in the right place?

Code organization:

  • Clear separation of concerns?
  • Appropriate abstraction levels?
  • Logical file/folder structure?

Step 3: Detailed code review

Naming:

  • Variables: descriptive, meaningful names
  • Functions: verb-based, clear purpose
  • Classes: noun-based, single responsibility
  • Constants: UPPER_CASE for true constants
  • Avoid abbreviations unless widely known

Functions:

  • Single responsibility
  • Reasonable length (< 50 lines ideally)
  • Clear inputs and outputs
  • Minimal side effects
  • Proper error handling

Classes and objects:

  • Single responsibility principle
  • Open/closed principle
  • Liskov substitution principle
  • Interface segregation
  • Dependency inversion

Error handling:

  • All errors caught and handled
  • Meaningful error messages
  • Proper logging
  • No silent failures
  • User-friendly errors for UI

Code quality:

  • No code duplication (DRY)
  • No dead code
  • No commented-out code
  • No magic numbers
  • Consistent formatting

Step 4: Security review

Input validation:

  • All user inputs validated
  • Type checking
  • Range checking
  • Format validation

Authentication & Authorization:

  • Proper authentication checks
  • Authorization for sensitive operations
  • Session management
  • Password handling (hashing, salting)

Data protection:

  • No hardcoded secrets
  • Sensitive data encrypted
  • SQL injection prevention
  • XSS prevention
  • CSRF protection

Dependencies:

  • No vulnerable packages
  • Dependencies up-to-date
  • Minimal dependency usage

Step 5: Performance review

Algorithms:

  • Appropriate algorithm choice
  • Reasonable time complexity
  • Reasonable space complexity
  • No unnecessary loops

Database:

  • Efficient queries
  • Proper indexing
  • N+1 query prevention
  • Connection pooling

Caching:

  • Appropriate caching strategy
  • Cache invalidation handled
  • Memory usage reasonable

Resource management:

  • Files properly closed
  • Connections released
  • Memory leaks prevented

Step 6: Testing review

Test coverage:

  • Unit tests for new code
  • Integration tests if needed
  • Edge cases covered
  • Error cases tested

Test quality:

  • Tests are readable
  • Tests are maintainable
  • Tests are deterministic
  • No test interdependencies
  • Proper test data setup/teardown

Test naming:

# Good
def test_user_creation_with_valid_data_succeeds():
    pass

# Bad
def test1():
    pass

Step 7: Documentation review

Code comments:

  • Complex logic explained
  • No obvious comments
  • TODOs have tickets
  • Comments are accurate

Function documentation:

def calculate_total(items: List[Item], tax_rate: float) -> Decimal:
    """
    Calculate the total price including tax.

    Args:
        items: List of items to calculate total for
        tax_rate: Tax rate as decimal (e.g., 0.1 for 10%)

    Returns:
        Total price including tax

    Raises:
        ValueError: If tax_rate is negative
    """
    pass

README/docs:

  • README updated if needed
  • API docs updated
  • Migration guide if breaking changes

Step 8: Provide feedback

Be constructive:

✅ Good:
"Consider extracting this logic into a separate function for better
testability and reusability:

def validate_email(email: str) -> bool:
    return '@' in email and '.' in email.split('@')[1]

This would make it easier to test and reuse across the codebase."

❌ Bad:
"This is wrong. Rewrite it."

Be specific:

✅ Good:
"On line 45, this query could cause N+1 problem. Consider using
.select_related('author') to fetch related objects in a single query."

❌ Bad:
"Performance issues here."

Prioritize issues:

  • 🔴 Critical: Security, data loss, major bugs
  • 🟡 Important: Performance, maintainability
  • 🟢 Nice-to-have: Style, minor improvements

Acknowledge good work:

"Nice use of the strategy pattern here! This makes it easy to add
new payment methods in the future."

Review checklist

Functionality

  • Code does what it's supposed to do
  • Edge cases handled
  • Error cases handled
  • No obvious bugs

Code Quality

  • Clear, descriptive naming
  • Functions are small and focused
  • No code duplication
  • Consistent with codebase style
  • No code smells

Security

  • Input validation
  • No hardcoded secrets
  • Authentication/authorization
  • No SQL injection vulnerabilities
  • No XSS vulnerabilities

Performance

  • No obvious bottlenecks
  • Efficient algorithms
  • Proper database queries
  • Resource management

Testing

  • Tests included
  • Good test coverage
  • Tests are maintainable
  • Edge cases tested

Documentation

  • Code is self-documenting
  • Comments where needed
  • Docs updated
  • Breaking changes documented

Common issues

Anti-patterns

God class:

# Bad: One class doing everything
class UserManager:
    def create_user(self): pass
    def send_email(self): pass
    def process_payment(self): pass
    def generate_report(self): pass

Magic numbers:

# Bad
if user.age > 18:
    pass

# Good
MINIMUM_AGE = 18
if user.age > MINIMUM_AGE:
    pass

Deep nesting:

# Bad
if condition1:
    if condition2:
        if condition3:
            if condition4:
                # deeply nested code

# Good (early returns)
if not condition1:
    return
if not condition2:
    return
if not condition3:
    return
if not condition4:
    return
# flat code

Security vulnerabilities

SQL Injection:

# Bad
query = f"SELECT * FROM users WHERE id = {user_id}"

# Good
query = "SELECT * FROM users WHERE id = %s"
cursor.execute(query, (user_id,))

XSS:

// Bad
element.innerHTML = userInput;

// Good
element.textContent = userInput;

Hardcoded secrets:

# Bad
API_KEY = "sk-1234567890abcdef"

# Good
API_KEY = os.environ.get("API_KEY")

Best practices

  1. Review promptly: Don't make authors wait
  2. Be respectful: Focus on code, not the person
  3. Explain why: Don't just say what's wrong
  4. Suggest alternatives: Show better approaches
  5. Use examples: Code examples clarify feedback
  6. Pick your battles: Focus on important issues
  7. Acknowledge good work: Positive feedback matters
  8. Review your own code first: Catch obvious issues
  9. Use automated tools: Let tools catch style issues
  10. Be consistent: Apply same standards to all code

Tools to use

Linters:

  • Python: pylint, flake8, black
  • JavaScript: eslint, prettier
  • Go: golint, gofmt
  • Rust: clippy, rustfmt

Security:

  • Bandit (Python)
  • npm audit (Node.js)
  • OWASP Dependency-Check

Code quality:

  • SonarQube
  • CodeClimate
  • Codacy

References

Examples

Example 1: Basic usage

Example 2: Advanced usage

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

36.95%
按下载量换算6

Claude

26.04%
按下载量换算4

Cursor

19.13%
按下载量换算3

Gemini CLI

8.88%
按下载量换算2

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

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

来源信息

继续浏览同类 Skills