360 Secure SkillHub
360 安全技能中心

Pr Review

核心功能是全面审查PR代码的质量、安全、性能、可维护性及测试情况,涵盖命名规范、漏洞排查、性能瓶颈等细项。典型场景为代码提交前的PR评审环节,输入为PR代码变更内容,输出含评审结论、风险等级、分类别问题(附文件行号、修复建议)及正向评价的结构化报告,助力提升代码质量、规避潜在风险。

solomonneas
solomonneas
热度 50.26
最近更新 2026-05-11 17:34:47
分类:开发依赖:纯提示词应用场景:代码审查

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add sn-pr-review
Metadata
name
pr-review
description
Comprehensive pull request review covering code quality, security, performance, and maintainability. Use for any code review task.
triggers
["review PR","code review","review changes","review diff"]

Pull Request Review

Perform a thorough code review covering quality, security, performance, and maintainability.

Review Checklist

Code Quality

  • Naming: clear, descriptive, consistent with codebase conventions
  • Functions: single responsibility, reasonable length (<50 lines)
  • Error handling: all failure paths covered, no swallowed exceptions
  • Types: proper TypeScript/type annotations where applicable
  • DRY: no unnecessary duplication
  • Dead code: nothing unused or commented out

Security (see also: security-review skill)

  • No secrets or credentials in code
  • Input validation on all user-facing endpoints
  • Parameterized queries (no string concatenation for SQL)
  • Proper auth/authz checks

Performance

  • N+1 query patterns
  • Missing database indexes for new queries
  • Unbounded loops or recursive calls
  • Large payload responses without pagination
  • Missing caching where appropriate

Testing

  • New functionality has tests
  • Edge cases covered (empty arrays, null, boundaries)
  • Tests are deterministic (no timing dependencies)
  • Mocks are appropriate (not over-mocked)

Maintainability

  • Changes are documented (README, comments for complex logic)
  • Breaking changes are noted
  • Migration path is clear for schema changes
  • Dependencies added are justified

Output Format

Start with a summary:

## Review Summary
**Verdict:** APPROVE | REQUEST_CHANGES | COMMENT
**Risk Level:** Low | Medium | High
**Key Findings:** [1-3 sentence summary]

Then list findings by category, each with:

  • File and line reference
  • What the issue is
  • Suggested fix (with code when helpful)
  • Severity (blocking vs. nit)

End with:

## Positive Notes
[Things done well worth calling out]