AgentSkillsCN

review

对 Go 代码进行漏洞检测、安全问题排查以及风格规范审查。适用于在提交更改前对代码进行审阅时使用。

SKILL.md
--- frontmatter
name: review
description: Review Go code for bugs, security issues, and style. Use when reviewing changes before committing.
argument-hint: "[file-path or branch-name]"
context: fork
agent: Explore
allowed-tools: Bash(git diff *), Bash(git log *), Bash(git status *), Read, Grep, Glob

Code Review

Review the changes specified by $ARGUMENTS. If no argument, review all uncommitted changes.

Check for

  1. Correctness: Logic errors, off-by-one, nil pointer dereference, unclosed resources
  2. Security: Path traversal, command injection (especially in git/exec calls), symlink attacks
  3. Error handling: Follow validate -> check preconditions -> execute -> verify pattern
  4. Edge cases: Empty inputs, missing files, broken symlinks, permission errors
  5. Tests: Are new functions tested? Are edge cases covered?
  6. Style: Consistent with existing code, follows CLAUDE.md conventions

Output format

For each issue found:

code
[!] <severity: critical/warning/note> <file>:<line>
    <description of issue>
    <suggested fix>

End with a summary: total issues by severity, overall assessment.