Token导航 LogoToken导航TokenDH.com
前端设计执行命令github未标认证来源可访问clear审计通过

code-review代码审查

Agent Skill

用于辅助安全审计、权限检查、凭据风险、认证流程和常见漏洞排查。它适合让 Agent 梳理敏感配置、检查依赖风险、分析鉴权逻辑或生成安全复核清单。使用时不能把工具输出直接当最终结论,涉及密钥、令牌、用户数据或生产系统时,应先确认最小权限、脱敏方式和操作边界。

总安装

367

周安装

15

GitHub Stars

2

下载量

119
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/shino369/claude-code-personal-workspace --skill code-review

简介

用于辅助安全审计、权限检查、凭据风险、认证流程和常见漏洞排查。

  • 它适合让 Agent 梳理敏感配置、检查依赖风险、分析鉴权逻辑或生成安全复核清单。
  • 使用时不能把工具输出直接当最终结论,涉及密钥、令牌、用户数据或生产系统时,应先确认最小权限、脱敏方式和操作边界。
  • 当前尚无详细功能描述,需查阅原始 SKILL.md 获取更多信息。
  • code-review 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Code Review Best Practices

Core Principles

Review Mindset:

  • Be constructive, explain the "why"
  • Prioritize by severity (critical vs nice-to-have)
  • Suggest alternatives, not just problems
  • Acknowledge good work

Goals:

  1. Catch bugs before production
  2. Improve code quality
  3. Share knowledge
  4. Prevent security vulnerabilities
  5. Ensure consistency

Security Review

OWASP Top 10 Critical Checks

Injection Attacks:

  • SQL: Use parameterized queries, never concatenate user input
  • Command: Avoid shell commands with user input, sanitize properly
  • Code: Validate all eval(), exec(), dynamic execution
  • NoSQL/LDAP/XML: Use safe APIs

Authentication & Authorization:

  • Verify auth checks on protected endpoints
  • Proper session management (timeout, secure cookies)
  • Authorization logic prevents privilege escalation
  • Password policies enforced

Sensitive Data:

  • No hardcoded secrets (API keys, passwords, tokens)
  • Encryption at rest and in transit
  • PII/PHI minimally logged
  • No sensitive data in URLs or error messages

XSS Prevention:

  • All user input escaped/sanitized for output context
  • Content-Security-Policy headers configured
  • Framework built-in escaping (React JSX, template engines)

Deserialization:

  • Never deserialize untrusted data without validation
  • Prefer JSON over pickle/marshal
  • Validate object types post-deserialization

Misconfiguration:

  • No default credentials in production
  • Error messages don't leak internals
  • Security headers present (HSTS, X-Frame-Options)

API Security:

  • Rate limiting on sensitive endpoints
  • CORS properly configured
  • Input validation on all endpoints
  • No sensitive data in GET requests

Common Security Issues

  • Path Traversal: Validate paths, prevent ../ attacks
  • SSRF: Validate URLs, restrict internal network access
  • Open Redirects: Whitelist redirect destinations
  • Race Conditions: Check TOCTOU bugs
  • Timing Attacks: Constant-time comparison for secrets
  • Regex DoS: Avoid complex regex on user input

Code Quality

Readability & Maintainability

Naming:

  • Clear, descriptive names that reveal intent
  • Consistent conventions (camelCase, snake_case, PascalCase)
  • Avoid abbreviations unless domain-standard

Function Design:

  • Single responsibility, small (<50 lines ideal)
  • Clear input/output, minimal side effects
  • Pure functions where possible

Complexity:

  • Low cyclomatic complexity (<10)
  • Avoid deep nesting (max 3-4 levels)
  • Early returns to reduce nesting
  • Extract complex conditions into named functions

Documentation:

  • Comments explain "why", not "what"
  • Public APIs documented
  • No commented-out code (use version control)

Error Handling

  • All errors handled (catch, log, recover or fail fast)
  • No bare except/catch without handling
  • Informative error messages (what, why, action)
  • Proper error types (not generic Exception)
  • Resources cleaned up (finally/defer/using)

Anti-patterns:

  • Swallowing exceptions silently
  • Catching too broadly
  • Using exceptions for flow control
  • Returning null instead of error
  • Not validating inputs

Code Duplication

  • No copy-paste code blocks
  • Extract common logic to reusable functions
  • Use inheritance/composition appropriately
  • Be pragmatic: 3+ copies = refactor time

Performance

Algorithm & Data Structure Efficiency

  • Check time complexity (O(n²) → O(n log n) or O(n))
  • Appropriate space complexity
  • Right data structure (HashMap vs Array, Set vs List)
  • Efficient algorithms for common problems

Common Issues

Database:

  • N+1 query problems (use joins/batch)
  • Missing indexes on filtered/sorted columns
  • SELECT * instead of specific columns
  • Queries inside loops

Caching:

  • Repeated expensive calculations
  • Duplicate API calls
  • Static data not cached
  • Appropriate cache TTL

Resource Management:

  • Files/connections/streams closed
  • No memory leaks (circular refs, event listeners)
  • Unbounded collections (need limits/pagination)

Frontend:

  • Unnecessary re-renders (React useMemo, useCallback)
  • Large bundles (code splitting)
  • Images not optimized
  • Blocking JavaScript in critical path

Architecture & Design

SOLID Principles

  • Single Responsibility: One reason to change
  • Open/Closed: Open for extension, closed for modification
  • Liskov Substitution: Subtypes substitutable for base types
  • Interface Segregation: Small, focused interfaces
  • Dependency Inversion: Depend on abstractions

Other Key Principles

  • DRY: Don't Repeat Yourself
  • KISS: Keep It Simple
  • YAGNI: Don't over-engineer
  • Separation of Concerns: Distinct responsibilities
  • Composition over Inheritance

Code Structure

  • Proper layer separation (presentation, business, data)
  • Dependencies flow one direction
  • No circular dependencies
  • Modules cohesive and loosely coupled
  • Configuration separated from code

Testing

Coverage & Quality

  • Critical paths tested
  • Edge cases covered (empty, null, max values)
  • Error paths tested
  • Tests deterministic (no flaky tests)
  • Tests isolated (no shared state)

Test Quality:

  • Arrange-Act-Assert structure
  • One assertion focus per test
  • Descriptive test names
  • No test logic (tests are simple)
  • Realistic test data
  • External dependencies mocked appropriately

Review Process

Before Review

  1. Understand context (PR description, tickets)
  2. Check scope (< 400 lines ideal)
  3. Run code locally
  4. Verify CI passes

During Review

  1. Start with architecture/approach
  2. Use security/performance/quality checklists
  3. Review tests first (explain intended behavior)
  4. Ask questions, don't assume

Providing Feedback

Structure:

  • Severity: Critical (must fix) vs Nice-to-have
  • What: Specific issue
  • Why: Why it matters
  • How: Concrete alternative

Tone:

  • Use "we" language: "We should..." not "You should..."
  • Ask questions: "Have we considered...?"
  • Be specific: "Function has complexity 32, consider refactoring"

Example: ❌ "This is bad" ✅ "Using string concatenation in loop creates O(n²) complexity. Use StringBuilder for O(n)."

Priority Checklist

Critical (Must Fix)

  • Security vulnerabilities (injection, XSS, auth bypass)
  • Data loss/corruption risks
  • Memory/resource leaks
  • Breaking API changes without versioning
  • Race conditions/concurrency bugs

High Priority

  • Performance issues (O(n²), N+1 queries)
  • Missing input validation
  • Hardcoded configuration
  • Missing error logging
  • No tests for new functionality

Medium Priority

  • Code duplication (3+ instances)
  • High complexity (>15 cyclomatic)
  • Missing documentation for public APIs
  • Deep nesting (>4 levels)
  • Large functions (>100 lines)

Low Priority

  • Minor style inconsistencies
  • Could be more idiomatic
  • Variable names could be clearer
  • Magic numbers → constants

Language-Specific Notes

JavaScript/TypeScript:

  • Use const over let, avoid var
  • Proper async/await (handle rejections)
  • Use === not ==
  • TypeScript: Proper types, avoid any
  • Null/undefined handling

Python:

  • Follow PEP 8
  • Type hints for public APIs
  • Context managers (with)
  • No mutable default arguments

Java:

  • Proper exception hierarchy
  • Try-with-resources
  • Access modifiers (private/protected/public)
  • Immutability (final fields)

Go:

  • Error handling on every call
  • defer for cleanup
  • No goroutine leaks (context cancellation)
  • Small, focused interfaces

Best Practices Summary

  1. Security First: OWASP Top 10 vulnerabilities
  2. Test Coverage: Meaningful tests exist
  3. Error Handling: All errors handled
  4. Performance: Watch O(n²), N+1, memory leaks
  5. Readability: Clear, self-documenting code
  6. Maintainability: Low complexity, no duplication
  7. Documentation: Public APIs documented
  8. Consistency: Follow team conventions
  9. Constructive: Be helpful, not critical
  10. Prioritize: Critical first, style last

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

补充不同宿主或平台的使用分布数据

能力 5

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

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

平台分布

Claude Code

28.61%
按下载量换算34

Antigravity

24.16%
按下载量换算29

windsurf

19.92%
按下载量换算24

trae

12.23%
按下载量换算15

OpenCode

9.44%
按下载量换算11

Cursor

4.12%
按下载量换算5

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/shino369/claude-code-personal-workspace --skill code-review;npx skills add shino369/claude-code-personal-workspace --skill "code-review" 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills