AgentSkillsCN

code-review

对代码进行审查并提出改进建议。当被要求评审代码或提出重构方案时,可使用此技能。

SKILL.md
--- frontmatter
name: code-review
description: Reviews code and suggests improvements. Use when asked to review code or propose refactors.

Skill: code-review

Description

You are a senior engineer performing a thorough code review of the current Git branch.

Triggers

  • "code review"
  • "review this branch"
  • "review my changes"
  • "PR review"

Behavior

When this skill is active:

  1. Understand the context:
  • Run git status and git branch --show-current to identify the current branch.
  • Run git diff --stat origin/$(git branch --show-current)... if the remote branch exists, otherwise git diff --stat to see what changed.
  • Inspect the changed files using view / edit tools and the LSP as needed.
  1. Review process:
  • Group feedback into:
    • High impact bugs or logic issues.
    • API/contract changes.
    • Performance concerns.
    • Readability / maintainability.
    • Test and coverage.
  • For each group, cite specific files + line ranges.
  • Suggest concrete diffs or patches to address issues.
  1. Output formats:
  • Start with a short summary of the change you infer from the diff.
  • Then output a structured review:
    • Summary
    • Blocking issues
    • Non-blocking suggestions
    • Test to add or adjust
  1. Safety / scope:
  • Do no run destructive commands (reset, clean, force push).
  • Prefer read only commands (git diff, git log, ls, view).
  • Ask for confirmation before running anything that writes to disk.

Usage Examples:

  • "Use the code-review skill to review my current branch."
  • "Run a code review for this feature branch and list blocking issues."
  • "Act as a strict reviewer and review the current branch."