Token导航 LogoToken导航TokenDH.com
研究检索需要联网clawhub未标认证来源可访问clear审计提醒

afrexai-code-reviewerafrexai 代码审查员

Agent Skill

afrexai-code-reviewer 用于记录任务执行中的错误、用户纠正、经验和能力缺口,适合在 OpenClaw 中希望让 Agent 持续沉淀问题、修正和最佳实践时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

24,734

周安装

1,025

GitHub Stars

公开资料未说明

下载量

7,816
OpenClaw

安装说明

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

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install afrexai-code-reviewer

简介

企业级代码审查代理。检查 PR、差异或代码文件中的安全漏洞、性能问题、错误处理差距、架构气味和测试覆盖率。适用于任何语言、任何存储库,无需依赖项。

SKILL.md

name
afrexai-code-reviewer
description
Enterprise-grade code review agent. Reviews PRs, diffs, or code files for security vulnerabilities, performance issues, error handling gaps, architecture smells, and test coverage. Works with any language, any repo, no dependencies required.
auto_trigger
false

Code Review Engine

Enterprise-grade automated code review. Works on GitHub PRs, local diffs, pasted code, or entire files. No dependencies — pure agent intelligence.

Quick Start

Review a GitHub PR

Review PR #42 in owner/repo

Review a local diff

Review the staged changes in this repo

Review a file

Review src/auth/login.ts for security issues

Review pasted code

Just paste code and say "review this"


Review Framework: SPEAR

Every review follows the SPEAR framework — 5 dimensions, each scored 1-10:

🔴 S — Security (Weight: 3x)

CheckSeverityExample
Hardcoded secretsCRITICALAPI keys, passwords, tokens in source
SQL injectionCRITICALString concatenation in queries
XSS vectorsHIGHUnsanitized user input in HTML/DOM
Path traversalHIGHUser input in file paths without validation
Insecure deserializationHIGHeval(), pickle.loads(), JSON.parse on untrusted input
Auth bypassCRITICALMissing auth checks on endpoints
SSRFHIGHUser-controlled URLs in server requests
Timing attacksMEDIUMNon-constant-time string comparison for secrets
Dependency vulnerabilitiesMEDIUMKnown CVEs in imported packages
Sensitive data loggingMEDIUMPII, tokens, passwords in log output
Insecure randomnessMEDIUMMath.random() for security-sensitive values
Missing rate limitingMEDIUMAuth endpoints without throttling

🟡 P — Performance (Weight: 2x)

CheckSeverityExample
N+1 queriesHIGHDB call inside a loop
Unbounded queriesHIGHSELECT * without LIMIT on user-facing endpoints
Missing indexes (implied)MEDIUMFrequent WHERE/ORDER on unindexed columns
Memory leaksHIGHEvent listeners never removed, growing caches
Blocking main threadHIGHSync I/O in async context, CPU-heavy in event loop
Unnecessary re-rendersMEDIUMReact: missing memo, unstable refs in deps
Large bundle importsMEDIUMimport _ from 'lodash' vs import get from 'lodash/get'
Missing paginationMEDIUMReturning all records to client
Redundant computationLOWSame expensive calc repeated without caching
Connection pool exhaustionHIGHNot releasing DB/HTTP connections

🟠 E — Error Handling (Weight: 2x)

CheckSeverityExample
Swallowed errorsHIGHEmpty catch blocks, Go _ := on error
Missing error boundariesMEDIUMReact components without error boundaries
Unchecked null/undefinedHIGHNo null checks before property access
Missing finally/cleanupMEDIUMResources opened but not guaranteed closed
Generic error messagesLOWcatch(e) { throw new Error("something went wrong") }
Missing retry logicMEDIUMNetwork calls without retry on transient failures
Panic/exit in library codeHIGHpanic(), os.Exit(), process.exit() in non-main
Unhandled promise rejectionsHIGHAsync calls without .catch() or try/catch
Error type conflationMEDIUMAll errors treated the same (4xx vs 5xx, retriable vs fatal)

🔵 A — Architecture (Weight: 1.5x)

CheckSeverityExample
God functions (>50 lines)MEDIUMSingle function doing too many things
God files (>300 lines)MEDIUMMonolithic module
Tight couplingMEDIUMDirect DB calls in request handlers
Missing abstractionLOWRepeated patterns that should be extracted
Circular dependenciesHIGHA imports B imports A
Wrong layerMEDIUMBusiness logic in controllers, SQL in UI
Magic numbers/stringsLOWHardcoded values without named constants
Missing typesMEDIUMany in TypeScript, missing type hints in Python
Dead codeLOWUnreachable branches, unused imports/variables
Inconsistent patternsLOWDifferent error handling styles in same codebase

📊 R — Reliability (Weight: 1.5x)

CheckSeverityExample
Missing tests for changesHIGHNew logic without corresponding test
Test qualityMEDIUMTests that only check happy path
Missing edge casesMEDIUMNo handling for empty arrays, null, boundary values
Race conditionsHIGHShared mutable state without synchronization
Non-idempotent operationsMEDIUMRetrying could cause duplicates
Missing validationHIGHUser input accepted without schema validation
Brittle testsLOWTests depending on execution order or timing
Missing loggingMEDIUMError paths with no observability
Configuration driftMEDIUMHardcoded env-specific values
Missing migrationsHIGHSchema changes without migration files

Scoring System

Per-Finding Severity

CRITICAL  → -3 points from dimension score
HIGH      → -2 points
MEDIUM    → -1 point
LOW       → -0.5 points
INFO      → 0 (suggestion only)

Overall SPEAR Score Calculation

Raw Score = (S×3 + P×2 + E×2 + A×1.5 + R×1.5) / 10
Final Score = Raw Score × 10  (scale 0-100)

Verdict Thresholds

ScoreVerdictAction
90-100✅ EXCELLENTShip it
75-89🟢 GOODMinor suggestions, approve
60-74🟡 NEEDS WORKAddress findings before merge
40-59🟠 SIGNIFICANT ISSUESMajor rework needed
0-39🔴 BLOCKCritical issues, do not merge

Review Output Template

Use this structure for every review:

# Code Review: [PR title or file name]

## Summary
[1-2 sentence overview of what this code does and overall quality]

## SPEAR Score: [X]/100 — [VERDICT]

| Dimension | Score | Key Finding |
|-----------|-------|-------------|
| 🔴 Security | X/10 | [worst finding or "Clean"] |
| 🟡 Performance | X/10 | [worst finding or "Clean"] |
| 🟠 Error Handling | X/10 | [worst finding or "Clean"] |
| 🔵 Architecture | X/10 | [worst finding or "Clean"] |
| 📊 Reliability | X/10 | [worst finding or "Clean"] |

## Findings

### [CRITICAL/HIGH] 🔴 [Title]
**File:** `path/to/file.ts:42`
**Category:** Security
**Issue:** [What's wrong]
**Impact:** [What could happen]
**Fix:**

// suggested fix


### [MEDIUM] 🟡 [Title]
...

## What's Done Well
- [Genuinely good patterns worth calling out]

## Recommendations
1. [Prioritized action items]

Language-Specific Patterns

TypeScript / JavaScript

  • any type usage → Architecture finding
  • as type assertions → potential runtime error
  • console.log in production code → Style
  • == instead of === → Reliability
  • Missing async/await error handling
  • useEffect missing cleanup return
  • Index signatures without validation

Python

  • Bare except: or except Exception: → Error Handling
  • eval() / exec() → Security CRITICAL
  • Mutable default arguments → Reliability
  • import * → Architecture
  • Missing __init__.py type hints
  • f-strings with user input → potential injection

Go

  • _ := discarding errors → Error Handling HIGH
  • panic() in library code → Reliability HIGH
  • Missing defer for resource cleanup
  • Exported functions without doc comments
  • interface{} / any overuse

Java

  • Catching Exception or Throwable → Error Handling
  • Missing @Override annotations
  • Mutable static fields → thread safety
  • System.out.println in production
  • Missing null checks (pre-Optional code)

SQL

  • String concatenation in queries → Security CRITICAL
  • SELECT * → Performance
  • Missing WHERE on UPDATE/DELETE → Security CRITICAL
  • No LIMIT on user-facing queries → Performance
  • Missing indexes for JOIN columns

Advanced Techniques

Reviewing for Business Logic

Beyond code quality, check:

  • Does the code match the PR description / ticket requirements?
  • Are there edge cases the spec didn't mention?
  • Could this break existing functionality?
  • Is there a simpler way to achieve the same result?

Reviewing for Operability

  • Can this be debugged in production? (logging, error messages)
  • Can this be rolled back safely?
  • Are feature flags needed?
  • What monitoring should accompany this change?

Reviewing Database Changes

  • Is the migration reversible?
  • Will it lock tables during migration?
  • Are there indexes for new query patterns?
  • Is there a data backfill needed?

Security Review Depth Levels

LevelWhenWhat
QuickInternal tool, trusted inputOWASP Top 10 patterns only
StandardUser-facing feature+ auth, input validation, output encoding
DeepPayment, auth, PII handling+ crypto review, session management, audit logging
Threat ModelNew service/API surface+ attack surface mapping, trust boundaries

Integration Patterns

GitHub PR Review

# Get PR diff
gh pr diff 42 --repo owner/repo

# Get PR details
gh pr view 42 --repo owner/repo --json title,body,files,commits

# Post review comment
gh pr review 42 --repo owner/repo --comment --body "review content"

Local Git Review

# Review staged changes
git diff --cached

# Review branch vs main
git diff main..HEAD

# Review last N commits
git log -5 --oneline && git diff HEAD~5..HEAD

Heartbeat / Cron Integration

Check for open PRs in [repo] that I haven't reviewed yet.
For each, run a SPEAR review and post the results as a PR comment.

Edge Cases & Gotchas

  • Large PRs (>500 lines): Break into logical chunks. Review file-by-file. Flag the PR size itself as a finding (Architecture: "PR too large — consider splitting").
  • Generated code: Skip generated files (proto, swagger, migrations from ORMs). Note that you skipped them.
  • Dependency updates: Focus on breaking changes in changelogs, not the lockfile diff.
  • Merge conflicts markers: Flag immediately as CRITICAL — <<<<<<< in code means broken merge.
  • Binary files: Note presence, can't review content.
  • Config changes: Extra scrutiny — wrong env var = production outage.
  • Refactors: Verify behavior preservation. Check if tests still pass conceptually.

Review Checklist (Quick Mode)

For fast reviews when full SPEAR isn't needed:

  • [ ] No hardcoded secrets or credentials
  • [ ] No SQL injection / XSS / path traversal
  • [ ] All errors handled (no empty catch, no discarded errors)
  • [ ] No N+1 queries or unbounded operations
  • [ ] Tests exist for new/changed logic
  • [ ] No console.log / print / fmt.Print left in
  • [ ] Functions under 50 lines, files under 300 lines
  • [ ] Types are specific (no any / interface{})
  • [ ] PR description matches the actual changes
  • [ ] No TODOs without linked issues

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

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

04

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

能力 5

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

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

平台分布

OpenClaw

88.68%
按下载量换算6,931

安全审计

VirusTotal

可疑

ClawScan

可疑

Static analysis

未展示

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills