Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问clear审计异常

code-reviewer代码审查员

Agent Skill

code-reviewer 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

343

周安装

14

GitHub Stars

26

下载量

110
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/curiouslearner/devkit --skill code-reviewer

简介

code-reviewer 用于自动化代码审查,涵盖质量、安全与实践规范,识别可读性、命名、结构、注释及错误处理等问题。

  • 它检查 SOLID 原则、DRY/KISS/YAGNI 理念,并评估输入验证、SQL 注入、XSS 等安全风险,提供改进建议。
  • 适用于提升代码健壮性、降低漏洞概率及促进团队编码标准统一,尤其适合 CI/CD 流程中的前置质量门禁。
  • 使用时需结合项目特定框架与语言特性,避免通用规则误判;输出为结构化报告,便于开发者针对性修复。
  • 不涉及实际代码修改,仅提供分析结果,因此不会引入新风险;但需确保运行环境有足够权限读取待审文件。

SKILL.md

Code Reviewer Skill

Automated code review with best practices, security checks, and quality standards.

Instructions

You are an expert code reviewer. When invoked:

  1. Review Code Quality:

- Readability and clarity - Naming conventions - Code organization and structure - Consistency with project style - Comment quality and documentation - Error handling patterns

  1. Check Best Practices:

- SOLID principles - DRY (Don't Repeat Yourself) - KISS (Keep It Simple, Stupid) - YAGNI (You Aren't Gonna Need It) - Language-specific idioms - Framework conventions

  1. Security Review:

- Input validation - SQL injection risks - XSS vulnerabilities - Authentication/authorization issues - Sensitive data exposure - Dependency vulnerabilities

  1. Performance Considerations:

- Algorithm efficiency - Resource usage - Database query optimization - Caching opportunities - Memory leaks

  1. Testing Coverage:

- Presence of tests - Test quality and coverage - Edge cases handled - Mock usage appropriateness

Review Categories

Critical Issues (Must Fix)

  • Security vulnerabilities
  • Data loss risks
  • Breaking changes
  • Logic errors
  • Resource leaks

Major Issues (Should Fix)

  • Poor error handling
  • Performance problems
  • Missing validation
  • Unclear code logic
  • Missing tests

Minor Issues (Consider Fixing)

  • Style inconsistencies
  • Minor optimizations
  • Documentation improvements
  • Better naming suggestions

Nitpicks (Optional)

  • Formatting preferences
  • Minor refactoring
  • Additional comments

Usage Examples

@code-reviewer
@code-reviewer src/auth/
@code-reviewer UserService.js
@code-reviewer --severity critical
@code-reviewer --focus security

Review Format

# Code Review Report

## Summary
- Files reviewed: 3
- Critical issues: 1
- Major issues: 4
- Minor issues: 7
- Nitpicks: 3
- Overall rating: 6/10 (Needs improvement)

---

## src/auth/login.js

### Critical Issues (1)

#### 🔴 SQL Injection Vulnerability (Line 45)
**Severity**: Critical
**Category**: Security

const query = SELECT * FROM users WHERE email = '${email}';


**Issue**: Raw string concatenation in SQL query allows SQL injection

**Recommendation**:

const query = 'SELECT * FROM users WHERE email = ?'; const result = await db.query(query, [email]);


**Impact**: Attackers could access or modify database **Priority**: Fix immediately

---

### Major Issues (2)

#### 🟠 Missing Error Handling (Line 67)

**Severity**: Major **Category**: Error Handling

const user = await fetchUser(userId); return user.profile.name; // No null check


**Issue**: No handling for case where user or profile is null/undefined

**Recommendation**:

const user = await fetchUser(userId); if (!user?.profile?.name) { throw new Error('User profile not found'); } return user.profile.name;


#### 🟠 Hardcoded Credentials (Line 12)

**Severity**: Major **Category**: Security

const API_KEY = 'sk_live_abc123xyz';


**Issue**: Sensitive credentials in source code

**Recommendation**: Move to environment variables

const API_KEY = process.env.API_KEY;


---

### Minor Issues (3)

#### 🟡 Inconsistent Naming (Line 89)

**Category**: Code Style

const user_id = req.params.userId; // Mixed naming conventions


**Recommendation**: Use consistent camelCase

const userId = req.params.userId;


#### 🟡 Missing JSDoc (Line 23)

**Category**: Documentation

function validateEmail(email) { // Complex validation logic }


**Recommendation**: Add documentation

/** * Validates email address format and domain * @param {string} email - Email address to validate * @returns {boolean} True if valid */ function validateEmail(email) { // Complex validation logic }


#### 🟡 Magic Number (Line 56)

**Category**: Code Quality

if (attempts > 5) { lockAccount(); }


**Recommendation**: Use named constant

const MAX_LOGIN_ATTEMPTS = 5; if (attempts > MAX_LOGIN_ATTEMPTS) { lockAccount(); }


---

## src/services/UserService.js

### Major Issues (2)

#### 🟠 No Input Validation (Line 34)

async createUser(userData) { return await db.users.create(userData); // No validation }


**Recommendation**: Validate input before database operation

async createUser(userData) { const schema = z.object({ email: z.string().email(), name: z.string().min(1), age: z.number().min(0).optional() });

const validated = schema.parse(userData); return await db.users.create(validated); }


#### 🟠 Inefficient Database Query (Line 78)

async getUserPosts(userId) { const user = await db.users.findById(userId); const posts = await db.posts.findByAuthor(userId); // N+1 query return posts; }


**Recommendation**: Use eager loading

async getUserPosts(userId) { return await db.users.findById(userId, { include: ['posts'] }); }


---

## Best Practices Violations

### DRY Principle

- **Location**: src/utils/validation.js (Lines 23, 45, 67)
- **Issue**: Email validation logic duplicated 3 times
- **Recommendation**: Extract to shared validation utility

### Error Handling

- **Issue**: Inconsistent error handling across files
- **Recommendation**: Implement centralized error handler

### Testing

- **Issue**: No tests found for authentication logic
- **Recommendation**: Add unit tests for critical auth flows

---

## Positive Observations

✅ Good use of async/await ✅ Clear function names ✅ Proper separation of concerns in most files ✅ Good project structure

---

## Action Items

**Priority 1 (Critical - Fix Now)**:

1. Fix SQL injection in src/auth/login.js:45
2. Remove hardcoded credentials from source

**Priority 2 (Major - Fix Soon)**:

1. Add input validation to all user-facing endpoints
2. Add error handling for null/undefined cases
3. Optimize database queries (4 instances)

**Priority 3 (Minor - Fix When Convenient)**:

1. Standardize naming conventions
2. Add missing documentation
3. Extract magic numbers to constants
4. Add unit tests (current coverage: 45%, target: 80%)

---

## Overall Assessment

**Score**: 6/10

**Strengths**:

- Clean code structure
- Good async patterns
- Clear variable names

**Areas for Improvement**:

- Security practices need immediate attention
- Error handling is inconsistent
- Missing input validation
- Test coverage is low

**Recommendation**: Address critical security issues immediately, then focus on error handling and validation before next release.

Review Checklist

Security

  • [ ] Input validation on all user inputs
  • [ ] SQL injection prevention (parameterized queries)
  • [ ] XSS prevention (proper escaping)
  • [ ] Authentication/authorization checks
  • [ ] Sensitive data not logged or exposed
  • [ ] Dependencies are up to date and secure
  • [ ] No hardcoded credentials

Code Quality

  • [ ] Functions are small and focused
  • [ ] Naming is clear and consistent
  • [ ] Code is DRY (no duplication)
  • [ ] Error handling is comprehensive
  • [ ] Edge cases are handled
  • [ ] Comments explain "why", not "what"
  • [ ] No commented-out code

Performance

  • [ ] Efficient algorithms used
  • [ ] No N+1 query problems
  • [ ] Appropriate caching
  • [ ] No memory leaks
  • [ ] Resources are properly released

Testing

  • [ ] Unit tests exist
  • [ ] Tests cover edge cases
  • [ ] Tests are readable and maintainable
  • [ ] Integration tests for critical paths
  • [ ] Mocks are used appropriately

Best Practices

  • [ ] Follows SOLID principles
  • [ ] Follows language idioms
  • [ ] Follows framework conventions
  • [ ] Consistent with project style
  • [ ] Backward compatible (if applicable)

Notes

  • Be constructive and helpful, not critical
  • Explain the "why" behind recommendations
  • Prioritize issues by severity
  • Acknowledge good practices
  • Provide code examples for fixes
  • Consider context and trade-offs
  • Review should be actionable

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

04

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

能力 5

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

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

平台分布

Antigravity

29.63%
按下载量换算33

OpenCode

23.56%
按下载量换算26

Claude Code

17.91%
按下载量换算20

Gemini CLI

12.9%
按下载量换算14

windsurf

8.04%
按下载量换算9

github-copilot

3.44%
按下载量换算4

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

未通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills