Token导航 LogoToken导航TokenDH.com
研究检索external-servicegithub未标认证来源可访问许可证需确认审计提醒

code-review代码审查

Agent Skill

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

总安装

20,494

周安装

601

GitHub Stars

33

下载量

8,318
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/zapier/zapier-mcp --skill 'Code Review'

简介

code-review 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中根据关键词快速定位候选结果。

  • 它支持基于任务场景或来源线索的信息聚合,适用于代码审查相关的研究工作流。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装,具体用法需结合 README 确认。
  • 安装前应检查权限范围、维护状态,并留意是否涉及联网或文件操作。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Code Review

Perform comprehensive code reviews of a branch against the base branch, providing actionable feedback on code quality, security, performance, and best practices.

When to Use This Skill

Activate this skill when:

  • The user types "review" or "code review" (with or without slash command)
  • The user types "review BRANCH-NAME" to review a specific branch
  • The user types "review TICKET-ID" (e.g., "review AGP-123" or "review AICC-456") to review the branch associated with a Jira ticket
  • The user asks to review a branch, pull request, or merge request
  • Analyzing code changes before merging
  • Performing code quality assessments
  • Checking for security vulnerabilities or performance issues
  • Reviewing branch diffs

Branch Selection

Jira Ticket ID Detection

If a Jira ticket ID is provided (e.g., "review AGP-123" or "review AICC-456"):

A Jira ticket ID matches the pattern: uppercase letters followed by a hyphen and numbers (e.g., AGP-123, AICC-456).

  1. Fetch latest from origin: git fetch origin
  2. Find the branch containing the ticket ID: git branch -r | grep -i "<TICKET-ID>" | head -1
  3. If a matching branch is found, extract the branch name (remove origin/ prefix)
  4. Set up a git worktree for isolated review (see Worktree Setup below)
  5. Proceed with the review in the worktree
  6. Clean up the worktree after review is complete

Worktree Setup for Non-Disruptive Reviews

When reviewing a branch that isn't the current branch (either from a ticket ID or explicit branch name), use a git worktree to avoid disturbing the current working state:

  1. Create a worktree directory at <repo-root>/.worktrees/<branch-name>: git worktree add.worktrees/<branch-name> origin/<branch-name>
  2. Perform all review operations within the worktree directory
  3. After the review is complete, remove the worktree: git worktree remove.worktrees/<branch-name>

Important: Always use the worktree path when reading files or running git commands during the review. This ensures the user's current work remains untouched.

Dependency Installation in Worktrees

When setting up a worktree, install dependencies if you need to run checks (tests, type checking, linting):

  1. Detect package manager: Check for pnpm-lock.yaml in the worktree
  2. Install dependencies: cd <worktree-path> && pnpm install
  3. Run checks (optional, if needed for thorough review): cd <worktree-path> && pnpm check

When to install dependencies:

  • When you need to run tests, type checking, or linting
  • When reviewing changes that affect build or compilation
  • When the review requires verifying the code actually works

When to skip dependency installation:

  • Simple reviews that only need to examine diffs
  • Quick reviews of documentation or config changes
  • When the user only wants a high-level code review

Branch Name Provided

If a branch name is provided (e.g., "review AGP-738-show-manage-admins-button"):

  1. Fetch latest from origin: git fetch origin
  2. Set up a git worktree for the branch (see Worktree Setup above)
  3. Proceed with the review in the worktree
  4. Clean up the worktree after review

No Branch Specified

If no branch name is provided (e.g., just "review"):

  1. Review the current branch as-is in the current directory
  2. Do not create a worktree or switch branches

Worktree Error Handling

If the worktree already exists:

# Remove existing worktree first
git worktree remove .worktrees/<branch-name> --force 2>/dev/null || true
git worktree add .worktrees/<branch-name> origin/<branch-name>

If no matching branch is found for a ticket ID:

  • Inform the user that no branch containing the ticket ID was found
  • List available branches that might be related (partial matches)
  • Ask the user to provide the exact branch name

Always clean up worktrees:

  • Even if the review encounters errors, attempt to clean up the worktree
  • Use git worktree list to verify cleanup was successful

.gitignore Recommendation

The .worktrees directory should be added to .gitignore if not already present. Check and suggest adding it if missing:

# Code review worktrees
.worktrees/

Analyze Branch Context

First, gather essential information about the branch to review:

  • Identify the current branch name
  • Determine the appropriate base branch (staging, main, or master)
  • Check for any uncommitted changes that should be reviewed
  • Find the merge-base to isolate only commits made in this branch
  • Get the list of commits and changed files

Finding Branch-Specific Changes (CRITICAL)

You MUST use git merge-base to find the common ancestor. This ensures you only review commits that were made in THIS branch, not commits from other branches that happened to be merged into main.

# 1. Find the merge-base (common ancestor)
MERGE_BASE=$(git merge-base origin/main HEAD)

# 2. List only commits IN THIS BRANCH (not in main)
git log --oneline $MERGE_BASE..HEAD

# 3. Show files changed ONLY BY THIS BRANCH
git diff --name-status $MERGE_BASE..HEAD

# 4. Show the actual diff ONLY FOR THIS BRANCH
git diff $MERGE_BASE..HEAD

Why this matters:

  • git diff origin/main..HEAD shows ALL differences between main and HEAD, which includes changes from OTHER branches that were merged into main after this branch was created
  • git diff $(git merge-base origin/main HEAD)..HEAD shows ONLY the changes introduced in THIS branch

Example:

main:    A---B---C---D---E  (where D and E are from other merged branches)
              \
feature:       X---Y---Z  (this is what we want to review)

# WRONG: git diff origin/main..HEAD
# Shows: differences from E to Z (includes D and E changes we don't care about)

# CORRECT: git diff $(git merge-base origin/main HEAD)..HEAD
# Shows: only X, Y, Z changes (merge-base is B)

Always use the merge-base approach for:

  • git log - to list commits
  • git diff - to see changes
  • git diff --stat - for change statistics
  • git diff --name-status - for file list

Perform Comprehensive Code Review

Conduct a thorough review of only the changes introduced in this branch (using merge-base as described above).

1. Change Analysis

  • Use git diff $(git merge-base origin/main HEAD)..HEAD -- <file> to review each modified file
  • Examine commits using git show <commit-hash> for individual commits in the branch
  • Identify patterns across changes
  • Check for consistency with existing codebase
  • Only comment on code that was changed in THIS branch's commits

2. Code Quality Assessment

  • Code style and formatting consistency
  • Variable and function naming conventions
  • Code organization and structure
  • Adherence to DRY (Don't Repeat Yourself) principles
  • Proper abstraction levels

3. Technical Review

  • Logic correctness and edge cases
  • Error handling and validation
  • Performance implications
  • Security considerations (input validation, SQL injection, XSS, etc.)
  • Resource management (memory leaks, connection handling)
  • Concurrency issues if applicable

4. Best Practices Check

  • Design patterns usage
  • SOLID principles adherence
  • Testing coverage implications
  • Documentation completeness
  • API consistency
  • Backwards compatibility

5. Dependencies and Integration

  • New dependencies added
  • Breaking changes to existing interfaces
  • Impact on other parts of the system
  • Database migration requirements

6. Fetch Jira Ticket Details

Use the MCP Zapier tool to fetch the ticket:

mcp__zapier-frontend__jira_software_cloud_find_issue_by_key({
  instructions: "Get details for ticket [TICKET_ID]",
  key: "[TICKET_ID]",
  fields: "summary,description,issuetype,priority,status"
})

Extract from response:

  • Summary (title)
  • Description
  • Issue type
  • Status
  • Any other relevant context

Generate Review Report

Create a structured code review report with:

  1. Executive Summary: High-level overview of changes and overall assessment
  2. Statistics:

- Files changed, lines added/removed - Commits reviewed - Critical issues found

  1. Strengths: What was done well
  2. Issues by Priority:

- 🔴 Critical: Must fix before merging (bugs, security issues) - 🟡 Important: Should address (performance, maintainability) - 🟢 Suggestions: Nice to have improvements

  1. Detailed Findings: For each issue include:

- File and line reference - A question framing the concern (e.g., "Could this cause X?" or "Would it help to Y?") - Context explaining why you're asking - Code example if helpful

  1. Security Review: Specific security considerations
  2. Performance Review: Performance implications
  3. Testing Recommendations: What tests should be added
  4. Documentation Needs: What documentation should be updated

User Interaction

After completing the review:

  1. Display the complete review report in markdown format
  2. Provide actionable next steps based on findings
  3. If critical issues found, highlight them prominently

Feedback Style: Questions, Not Directives

Frame all feedback as questions, not commands. This encourages dialogue and respects the author's context.

Examples

Don't write:

  • "You should use early returns here"
  • "This needs error handling"
  • "Extract this into a separate function"
  • "Add a null check"

Do write:

  • "Could this be simplified with an early return?"
  • "What happens if this API call fails? Would error handling help here?"
  • "Would it make sense to extract this into its own function for reusability?"
  • "Is there a scenario where this could be null? If so, how should we handle it?"

Why Questions Work Better

  • The author may have context you don't have
  • Questions invite explanation rather than defensiveness
  • They acknowledge uncertainty in the reviewer's understanding
  • They create a conversation rather than a checklist

Important Notes

  • CRITICAL: Only review changes from THIS branch's commits - use git merge-base to isolate branch-specific changes. Never comment on code that was changed in other branches.
  • Frame feedback as questions to encourage dialogue
  • Be constructive and specific in feedback
  • Provide code examples for suggested improvements
  • Acknowledge good practices and improvements
  • Prioritize issues clearly
  • Consider the context and purpose of changes
  • Review not just code but also architectural decisions
  • Check for potential impacts on other systems
  • Ensure review is actionable and helpful
  • Verify code review is within the acceptance criteria of the Jira Ticket

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

33.1%
按下载量换算2,753

Claude

28.66%
按下载量换算2,384

Cursor

20.63%
按下载量换算1,716

Gemini CLI

10.32%
按下载量换算858

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

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

来源信息

继续浏览同类 Skills