跳到主内容
智客 ZICQ

技能库 智客分类:安全测试 code-reviewer

Code Reviewer

分析代码diffs和文档以识别出错误,安全弱点(SQL注入,XSS,不安全去序列化),代码发臭,N+1查询,命名问题,以及建筑问题,然后产生结构化的审查报告,并附有优先,可操作的反馈. 在审查拉动请求、进行代码质量审计、查明重构机会或检查安全问题时使用。 启动PR审查,代码质量检查,重构建议,审查代码,代码质量. 辅助专业技能(安全审查员、测试主管),提供范围广泛、涵盖正确性、性能、可维持性以及测试覆盖的单一通行证.

6075 安装量

官方网址:skills.sh

技能介绍

先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。

做什么

分析代码diffs和文档以识别出错误,安全弱点(SQL注入,XSS,不安全去序列化),代码嗅觉,N+1查询,命名问题和建筑问题,然后生成结构化的审查报告,并附有优先可操作的反馈

何时用

这个技能

代理如何加载

按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:Code Reviewer、When to Use This Skill、Core Workflow、Reference Guide、Review Patterns (Quick Reference)、N+1 Query — Bad vs Good。 其中含规范建议的小节:分步指令。

文件分析

文件分析:除 SKILL.md 外,正文引用了 references/review-checklist.md、references/common-issues.md、references/feedback-examples.md、references/report-template.md、references/spec-compliance-review.md、references/receiving-feedback.md,属于带资源的技能包,这些文件按需再读。

官方 description(原文)

Analyzes code diffs and files to identify bugs, security vulnerabilities (SQL injection, XSS, insecure deserialization), code smells, N+1 queries, naming issues, and architectural concerns, then produces a structured review report with prioritized, actionable feedback. Use when reviewing pull requests, conducting code quality audits, identifying refactoring opportunities, or checking for security issues. Invoke for PR reviews, code quality checks, refactoring suggestions, review code, code quality. Complements specialized skills (security-reviewer, test-master) by providing broad-scope review across correctness, performance, maintainability, and test coverage in a single pass.

Code ReviewerWhen to Use This SkillCore WorkflowReference GuideReview Patterns (Quick Reference)N+1 Query — Bad vs GoodBAD: query inside loopGOOD: prefetch in bulkMagic Number — Bad vs GoodBADGOODSecurity: SQL Injection — Bad vs Good

· 许可:MIT · allowed-tools:Read, Grep, Glob

来源分类:skills.sh agent-skill

SKILL.md 与 Agent 调用

官方规范 ↗
name
code-reviewer
description
Analyzes code diffs and files to identify bugs, security vulnerabilities (SQL injection, XSS, insecure deserialization), code smells, N+1 queries, naming issues, and architectural concerns, then produces a structured review report with prioritized, actionable feedback. Use when reviewing pull requests, conducting code quality audits, identifying refactoring opportunities, or checking for security issues. Invoke for PR reviews, code quality checks, refactoring suggestions, review code, code quality. Complements specialized skills (security-reviewer, test-master) by providing broad-scope review across correctness, performance, maintainability, and test coverage in a single pass.
allowed-tools
Read, Grep, Glob实验字段,支持情况取决于客户端;字段声明本身不会授予工具权限。
许可
MIT
  1. 发现技能客户端向 Agent 提供名称与描述目录。
  2. 匹配与调用用户指定或任务匹配后,载入 SKILL.md 指令。
  3. 按需加载按步骤读取参考文档、使用脚本与素材。
指令中引用的文件 · 6
  • references/review-checklist.md
  • references/common-issues.md
  • references/feedback-examples.md
  • references/report-template.md
  • references/spec-compliance-review.md
  • references/receiving-feedback.md

以下路径提取自原文;文件是否齐全请以来源仓库中的完整目录为准。

具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗

安装这个技能

Skills CLI ↗

先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。

该技能引用了附属文件,请从来源获取完整目录;仅复制 SKILL.md 可能缺少依赖。

交给 Agent 安装

复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。

把 Agent Skill「code-reviewer」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-6fb439a352cbc4eb-%E4%BB%A3%E7%A0%81%E5%AE%A1%E6%9F%A5%E5%99%A8.html
请存为 .cursor/skills/code-reviewer/SKILL.md 或 .claude/skills/code-reviewer/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。
该技能还带 scripts/、references/、assets/ 等文件,请从 https://github.com/jeffallan/claude-skills 取完整目录,不要只建一个 SKILL.md。

GitHub 完整包 ↗

终端安装 · Skills CLI

需要 Node.js 与 npx。先查看仓库技能列表,确认实际名称。

npx skills add 'https://github.com/jeffallan/claude-skills' --list

npx skills add 'https://github.com/jeffallan/claude-skills' --skill 'code-reviewer'

CLI 会交互选择目标 Agent,默认安装到项目;用户级安装使用 -g。先通过查看命令核对仓库内容,再用 npx skills list 检查已安装技能。

阅读排版
--- name: code-reviewer description: Analyzes code diffs and files to identify bugs, security vulnerabilities (SQL injection, XSS, insecure deserialization), code smells, N+1 queries, naming issues, and architectural concerns, then produces a structured review report with prioritized, actionable feedback. Use when reviewing pull requests, conducting code quality audits, identifying refactoring opportunities, or checking for security issues. Invoke for PR reviews, code quality checks, refactoring suggestions, review code, code quality. Complements specialized skills (security-reviewer, test-master) by providing broad-scope review across correctness, performance, maintainability, and test coverage in a single pass. license: MIT allowed-tools: Read, Grep, Glob metadata: author: https://github.com/Jeffallan version: "1.1.0" domain: quality triggers: code review, PR review, pull request, review code, code quality role: specialist scope: review output-format: report related-skills: security-reviewer, test-master, architecture-designer --- # Code Reviewer Senior engineer conducting thorough, constructive code reviews that improve quality and share knowledge. ## When to Use This Skill - Reviewing pull requests - Conducting code quality audits - Identifying refactoring opportunities - Checking for security vulnerabilities - Validating architectural decisions ## Core Workflow 1. **Context** — Read PR description, understand the problem being solved. **Checkpoint:** Summarize the PR's intent in one sentence before proceeding. If you cannot, ask the author to clarify. 2. **Structure** — Review architecture and design decisions. Ask: Does this follow existing patterns in the codebase? Are new abstractions justified? 3. **Details** — Check code quality, security, and performance. Apply the checks in the Reference Guide below. Ask: Are there N+1 queries, hardcoded secrets, or injection risks? 4. **Tests** — Validate test coverage and quality. Ask: Are edge cases covered? Do tests assert behavior, not implementation? 5. **Feedback** — Produce a categorized report using the Output Template. If critical issues are found in step 3, note them immediately and do not wait until the end. > **Disagreement handling:** If the author has left comments explaining a non-obvious choice, acknowledge their reasoning before suggesting an alternative. Never block on style preferences when a linter or formatter is configured. ## Reference Guide Load detailed guidance based on context: | Topic | Reference | Load When | |-------|-----------|-----------| | Review Checklist | `references/review-checklist.md` | Starting a review, categories | | Common Issues | `references/common-issues.md` | N+1 queries, magic numbers, patterns | | Feedback Examples | `references/feedback-examples.md` | Writing good feedback | | Report Template | `references/report-template.md` | Writing final review report | | Spec Compliance | `references/spec-compliance-review.md` | Reviewing implementations, PR review, spec verification | | Receiving Feedback | `references/receiving-feedback.md` | Responding to review comments, handling feedback | ## Review Patterns (Quick Reference) ### N+1 Query — Bad vs Good ```python # BAD: query inside loop for user in users: orders = Order.objects.filter(user=user) # N+1 # GOOD: prefetch in bulk users = User.objects.prefetch_related('orders').all() ``` ### Magic Number — Bad vs Good ```python # BAD if status == 3: ... # GOOD ORDER_STATUS_SHIPPED = 3 if status == ORDER_STATUS_SHIPPED: ... ``` ### Security: SQL Injection — Bad vs Good ```python # BAD: string interpolation in query cursor.execute(f"SELECT * FROM users WHERE id = {user_id}") # GOOD: parameterized query cursor.execute("SELECT * FROM users WHERE id = %s", [user_id]) ``` ## Constraints ### MUST DO - Summarize PR intent before reviewing (see Workflow step 1) - Provide specific, actionable feedback - Include code examples in suggestions - Praise good patterns - Prioritize feedback (critical → minor) - Review tests as thoroughly as code - Check for security issues (OWASP Top 10 as baseline) ### MUST NOT DO - Be condescending or rude - Nitpick style when linters exist - Block on personal preferences - Demand perfection - Review without understanding the why - Skip praising good work ## Output Template Code review report must include: 1. **Summary** — One-sentence intent recap + overall assessment 2. **Critical issues** — Must fix before merge (bugs, security, data loss) 3. **Major issues** — Should fix (performance, design, maintainability) 4. **Minor issues** — Nice to have (naming, readability) 5. **Positive feedback** — Specific patterns done well 6. **Questions for author** — Clarifications needed 7. **Verdict** — Approve / Request Changes / Comment ## Knowledge Reference SOLID, DRY, KISS, YAGNI, design patterns, OWASP Top 10, language idioms, testing patterns [Documentation](https://jeffallan.github.io/claude-skills/skills/quality/code-reviewer/)

相关技能

安全测试

Skill Vetter

人工智能特工的安全第一技能审查。 在安装来自 ClawdHub, GitHub 或其他来源的任何技能之前使用 。 检查红旗,许可范围,可疑图案.

安全测试

Moltguard

MoltGuard——由OpenGuardrails担任OpenClaw保安. 安装 MoltGuard 以保护你和你的人类免受迅速注射、数据过滤和恶意命令的影响。 资料来源:https://github.com/openguardrails/openguardrails/tre…

安全测试

Security Auditor

用于审查安全漏洞代码,实施认证流,审计OWASP Top 10,配置CORS/CSP头,处理秘密,输入验证,SQL注射预防,XSS保护,或任何与安全相关的代码审查.

安全测试

Skill Vetter

安装任何AI代理技能前的安全审查协议. 红旗侦取入证盗取,疏通密码,放出. 风险分类:低/中/高/高。 编制结构化审查报告。 不先运行此功能, 绝不安装不信任的技能 .