Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问clear审计异常

code-review代码审查

Agent Skill

code-review 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

29,664

周安装

1,205

GitHub Stars

821

下载量

9,312
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/llama-farm/llamafarm --skill code-review

简介

通过自动检测的特定于域的检查对差异进行全面的代码审查。

  • 分析已更改的代码以查找安全漏洞、反模式、质量问题以及跨通用、前端和后端域的重大更改
  • 从文件路径自动检测域(前端、后端、CLI、配置)并应用相关清单
  • 生成包含严重性级别、文件位置、代码片段和可行建议的结构化 Markdown 报告
  • 执行影响分析,以识别导出、API 和共享实用程序中未说明的重大更改
  • 需要 diff 作为输入上下文;可以使用 git diff、PR diff 或未暂存的更改

SKILL.md

Code Review Skill

You are performing a comprehensive code review on a diff. Your task is to analyze the changed code for security vulnerabilities, anti-patterns, and quality issues.

Input Model

This skill expects a diff to be provided in context before invocation. The caller is responsible for generating the diff.

Example invocations:

  • User pastes PR diff, then runs /code-review
  • Agent runs git diff HEAD~1, then invokes this skill
  • CI tool provides diff content for review

If no diff is present in context, ask the user to provide one or offer to generate one (e.g., git diff, git diff main..HEAD).


Domain Detection

Auto-detect which checklists to apply based on directory paths in the diff:

DirectoryDomainChecklist
designer/FrontendRead frontend.md
server/BackendRead backend.md
rag/BackendRead backend.md
runtimes/universal/BackendRead backend.md
cli/CLI/GoGeneric checks only
config/ConfigGeneric checks only

If the diff spans multiple domains, load all relevant checklists.


Review Process

Step 1: Parse the Diff

Extract from the diff:

  • List of changed files
  • Changed lines (additions and modifications)
  • Detected domains based on file paths

Step 2: Initialize the Review Document

Create a review document using the temp-files pattern:

SANITIZED_PATH=$(echo "$PWD" | tr '/' '-')
REPORT_DIR="/tmp/claude/${SANITIZED_PATH}/reviews"
mkdir -p "$REPORT_DIR"
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
FILEPATH="${REPORT_DIR}/code-review-${TIMESTAMP}.md"

Initialize with this schema:

# Code Review Report

**Date**: {current date}
**Reviewer**: Code Review Agent
**Source**: {e.g., "PR diff", "unstaged changes", "main..HEAD"}
**Files Changed**: {count}
**Domains Detected**: {list}
**Status**: In Progress

## Summary

| Category | Items Checked | Passed | Failed | Findings |
|----------|---------------|--------|--------|----------|
| Security | 0 | 0 | 0 | 0 |
| Code Quality | 0 | 0 | 0 | 0 |
| LLM Code Smells | 0 | 0 | 0 | 0 |
| Impact Analysis | 0 | 0 | 0 | 0 |
| Simplification | 0 | 0 | 0 | 0 |
{domain-specific categories added based on detected domains}

## Detailed Findings

{findings added here as review progresses}

Step 3: Review Changed Code

For EACH checklist item:

  1. Scope feedback to diff lines only - Only flag issues in the changed code
  2. Use file context - Read full file content to understand surrounding code
  3. Apply relevant checks - Use domain-appropriate checklist items
  4. Document findings - Record each violation found in changed code

Key principle: The diff is what gets reviewed. The rest of the file provides context to make that review accurate.

Step 4: Impact Analysis

Check if the diff might affect other parts of the codebase:

  • Changed exports/interfaces - Search for usages elsewhere that may break
  • Modified API signatures - Check for callers that need updating
  • Altered shared utilities - Look for consumers that may be affected
  • Config/schema changes - Find code that depends on old structure

Report any unaccounted-for impacts as findings with severity based on risk.

Step 5: Document Each Finding

For each issue found, add an entry:

### [{CATEGORY}] {Item Name}

**Status**: FAIL
**Severity**: Critical | High | Medium | Low
**Scope**: Changed code | Impact analysis

#### Violation

- **File**: `path/to/file.ext`
- **Line(s)**: 42-48 (from diff)
- **Code**:

// problematic code snippet from diff

- **Issue**: {explanation of what's wrong}
- **Recommendation**: {how to fix it}

Step 6: Finalize the Report

After completing all checks:

  1. Update the summary table with final counts
  2. Add an executive summary:

- Total issues found - Critical issues requiring immediate attention - Impact analysis results - Recommended priority order for fixes

  1. Update status to "Complete"
  2. Inform the user of the report location

Generic Review Categories

These checks apply to ALL changed code regardless of domain.


Category: Security Fundamentals

Hardcoded Secrets

Check diff for:

  • API keys, passwords, secrets in changed code
  • Patterns: api_key, apiKey, password, secret, token, credential with literal values

Pass criteria: No hardcoded secrets in diff (should use environment variables) Severity: Critical


Eval and Dynamic Code Execution

Check diff for:

  • JavaScript/TypeScript: eval(, new Function(, setTimeout(", setInterval("
  • Python: eval(, exec(, compile(

Pass criteria: No dynamic code execution in changed lines Severity: Critical


Command Injection

Check diff for:

  • Python: subprocess with shell=True, os.system(
  • Go: exec.Command( with unsanitized input

Pass criteria: No unvalidated user input in shell commands Severity: Critical


Category: Code Quality

Console/Print Statements

Check diff for:

  • JavaScript/TypeScript: console.log, console.debug, console.info
  • Python: print( statements

Pass criteria: No debug statements in production code changes Severity: Low


TODO/FIXME Comments

Check diff for:

  • TODO:, FIXME:, HACK:, XXX: comments

Pass criteria: New TODOs should be tracked in issues Severity: Low


Empty Catch/Except Blocks

Check diff for:

  • JavaScript/TypeScript: catch {} or catch(e) {}
  • Python: except: pass or empty except blocks

Pass criteria: All error handlers log or rethrow Severity: High


Category: LLM Code Smells

Placeholder Implementations

Check diff for:

  • TODO, PLACEHOLDER, IMPLEMENT, NotImplemented
  • Functions that just return None, return [], return {}

Pass criteria: No placeholder implementations in production code Severity: High


Overly Generic Abstractions

Check diff for:

  • New classes/functions with names like GenericHandler, BaseManager, AbstractFactory
  • Abstractions without clear reuse justification

Pass criteria: Abstractions are justified by actual reuse Severity: Low


Category: Impact Analysis

Breaking Changes

Check if diff modifies:

  • Exported functions/classes - search for imports elsewhere
  • API endpoints - search for callers
  • Shared types/interfaces - search for usages
  • Config schemas - search for consumers

Pass criteria: All impacted code identified and accounted for Severity: High (if unaccounted impacts found)


Category: Simplification

Duplicate Logic

Check diff for:

  • Repeated code patterns (not just syntactic similarity)
  • Copy-pasted code with minor variations
  • Similar validation, transformation, or formatting logic

Pass criteria: No obvious duplication in changed code Severity: Medium Suggestion: Extract shared logic into reusable functions


Unnecessary Complexity

Check diff for:

  • Deeply nested conditionals (more than 3 levels)
  • Functions doing multiple unrelated things
  • Overly complex control flow

Pass criteria: Code is reasonably flat and focused Severity: Medium Suggestion: Use early returns, extract helper functions


Verbose Patterns

Check diff for:

  • Patterns that have simpler alternatives in the language
  • Redundant null checks or type assertions
  • Unnecessary intermediate variables

Pass criteria: Code uses idiomatic patterns Severity: Low Suggestion: Simplify using language built-ins


Domain-Specific Review Items

Based on detected domains, read and apply the appropriate checklists:

  • Frontend detected (designer/): Read frontend.md and apply those checks to changed code
  • Backend detected (server/, rag/, runtimes/): Read backend.md and apply those checks to changed code

Final Summary Template

## Executive Summary

**Review completed**: {timestamp}
**Total findings**: {count}

### Critical Issues (Must Fix)
1. {issue 1}
2. {issue 2}

### Impact Analysis Results
- {summary of any breaking changes or unaccounted impacts}

### High Priority (Should Fix)
1. {issue 1}
2. {issue 2}

### Recommendations
{Overall recommendations based on the changes reviewed}

Notes for the Agent

  1. Scope to diff: Only flag issues in the changed lines. Don't review unchanged code.
  2. Use context: Read full files to understand the changes, but feedback targets the diff only.
  3. Check impacts: When changes touch exports, APIs, or shared code, search for affected consumers.
  4. Be specific: Include file paths, line numbers (from diff), and code snippets for every finding.
  5. Prioritize: Flag critical security issues immediately.
  6. Provide solutions: Each finding should include a recommendation for how to fix it.
  7. Update incrementally: Update the review document after each category, not at the end.

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

04

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

能力 5

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

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

平台分布

Claude Code

32.24%
按下载量换算3,002

OpenCode

22.27%
按下载量换算2,074

Codex

16.93%
按下载量换算1,577

Cursor

12.47%
按下载量换算1,161

windsurf

9.09%
按下载量换算846

Antigravity

3.9%
按下载量换算363

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

未通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills