Token导航 LogoToken导航

Agent Skill · 研究检索

java-code-review(Java 代码审查)

用于辅助 Java 项目开发、面向对象设计、Spring 生态、Maven 或 Gradle 依赖和后端工程实践。它适合让 Agent 分析类结构、设计接口、整理服务分层、生成测试或检查常见代码坏味道。使用时需要结合项目已有架构、包结构和依赖版本,不应只按通用教程改代码;涉及数据库、事务、并发或框架配置时,应先确认运行环境和回归测试范围。

java-code-review 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 64,557。

总安装 297周安装 12GitHub Stars 1下载 93核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/theepan/ai-agent-skills --skill java-code-review

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

提供 2-3 句话的概述:代码的用途、整体质量 评估,以及最重要的发现。

研究结果 使用以下结构列出每个发现: [S{n}] {类别}:{简短标题} 位置:文件和行号(如果行未知,则为方法名称) 问题:出了什么问题以及为什么它很重要 建议:具体修复,有帮助时提供代码片段 按严重性(首先是 S1)对结果进行排序,然后按每个严重性中的位置排序。积极的观察 请注意代码做得很好的 1-3 件事。

好的图案、干净的设计或彻底的 错误处理值得肯定。汇总表 以计数表结束: 严重性 计数 S1 关键 n S2 高 n S3 中型 n S4低 n 指南 具体一点。引用准确的行号、方法名称和变量名称。提供具体的修复建议,而不是模糊的建议。当建议修复时,显示一个简短的代码片段来演示 改善。

不要标记没有正确性或可读性的样式首选项 影响(例如,大括号放置样式),除非代码混合样式 不一致。对于差异,重点审查更改的行。仅标记预先存在的问题 如果他们与变化相互作用。如果代码对于单次审查来说太大,请将其分为逻辑部分 部分并进行审查,提供综合摘要。当不确定意图时,明确陈述假设而不是 做出无声的判断。

来源仓库内路径:skills/java-code-review

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/theepan/ai-agent-skills --skill java-code-revi…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

java-code-review 怎么安装?

在终端执行 npx skills add https://github.com/theepan/ai-agent-skills --skill java-code-review。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

java-code-review 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

java-code-review 需要什么权限?

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

java-code-review 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

java-code-review 用的人多吗?

公开数据是累计安装 297 次,近一周安装 12 次,下载 93 次,GitHub 1 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

java-code-review 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
java-code-review

Java 代码审查 · 本页

2971需要联网未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Java Code Review

Review Java source code systematically for correctness, security, performance, and maintainability.

Input Handling

Determine the input type and gather code accordingly:

  1. Direct code -- Code provided in the conversation. Review as-is.
  2. File path(s) -- Read the specified .java files.
  3. Directory path -- Find all .java files recursively. For large codebases (>50 files), ask the user which packages or files to focus on.
  4. Diff/patch content -- Review only the changed lines plus sufficient surrounding context. Focus findings on the changed code.

Review Process

Execute these phases in order. For each finding, assign a severity.

Phase 1: Correctness and Bug Detection

Examine code for:

  • Null safety -- Nullable parameters without checks, Optional misuse, potential NullPointerException paths
  • Resource leaks -- Unclosed streams, connections, or locks. Verify try-with-resources usage for all AutoCloseable types
  • Error handling -- Empty catch blocks, catching overly broad exceptions (Exception, Throwable), swallowed exceptions, missing finally blocks
  • Concurrency -- Race conditions, unsynchronized shared mutable state, incorrect use of volatile, double-checked locking without volatile, ConcurrentModificationException risks
  • Logic errors -- Off-by-one, incorrect operator precedence, unreachable code, broken equals/hashCode contracts
  • API misuse -- Incorrect use of Collections, Streams, Date/Time API, String comparison with == instead of.equals()

Phase 2: Security Review

Read references/security-checklist.md before this phase.

Check for:

  • Injection -- SQL injection (string concatenation in queries), command injection, LDAP injection, XPath injection, log injection
  • Authentication and authorization -- Hardcoded credentials, missing access checks, insecure token handling
  • Data exposure -- Sensitive data in logs, exceptions, or error messages. Unmasked PII
  • Cryptography -- Weak algorithms (MD5, SHA-1 for security), hardcoded keys, insecure random (Math.random for security purposes)
  • Deserialization -- Untrusted ObjectInputStream usage, missing type validation
  • Input validation -- Missing or insufficient validation of external input, path traversal risks

Phase 3: Performance Analysis

Read references/performance-patterns.md before this phase.

Check for:

  • Algorithmic complexity -- O(n^2) or worse in hot paths, unnecessary nested iterations
  • Memory -- Excessive object creation in loops, large collections held longer than needed, missing initial capacity for known-size collections
  • String handling -- String concatenation in loops (use StringBuilder), unnecessary String.format in hot paths
  • I/O -- Unbuffered streams, N+1 query patterns, missing connection pooling, synchronous I/O where async is appropriate
  • Collections -- Wrong collection type for the access pattern, unnecessary copying, missing pre-sizing
  • JVM considerations -- Excessive autoboxing, finalizer usage, classloader leaks

Phase 4: Code Quality and Maintainability

Check for:

  • Design -- God classes, excessive coupling, Liskov substitution violations, missing encapsulation
  • Naming -- Unclear variable/method names, naming convention violations (Java conventions: camelCase methods, PascalCase classes, UPPER_SNAKE constants)
  • Complexity -- Methods exceeding ~30 lines, cyclomatic complexity >10, deeply nested conditionals (>3 levels)
  • Duplication -- Repeated logic that should be extracted
  • Documentation -- Missing Javadoc on public API, outdated comments that contradict code
  • Testing gaps -- Untested public methods, missing edge case tests, no assertions in test methods, test methods that cannot fail
  • AI-generated code smells -- Hallucinated or non-existent API calls, overly verbose boilerplate that could use standard library methods, unnecessary wrapper classes or abstractions that add indirection without value, generic variable names (data, result, temp, info) that obscure intent, contradictory or parroted comments that restate the code without adding insight, TODO/FIXME/placeholder blocks left unimplemented, inconsistent patterns within the same file (e.g., mixing builder and constructor styles, mixing streams and loops for identical tasks), dead code or unreachable branches that suggest generation artifacts

Phase 5: Dependency and License Review

If build files are available (pom.xml, build.gradle, build.gradle.kts), or if import statements reference third-party libraries, check for:

  • License compatibility -- Copyleft licenses (GPL, AGPL, LGPL) in proprietary or permissively licensed projects. Flag any dependency whose license is incompatible with the project's declared license
  • License presence -- Dependencies with no discernible license (treat as all-rights-reserved). Unlicensed code cannot be safely used
  • Copyleft obligations -- LGPL dependencies linked statically (must be dynamic), GPL dependencies in non-GPL projects, AGPL dependencies in network services without source disclosure
  • Transitive risk -- A permissively licensed library that itself depends on a copyleft library. The copyleft obligation propagates
  • Deprecated or unmaintained libraries -- Dependencies with known end-of-life status, no updates in 2+ years, or archived repositories
  • Duplicate functionality -- Multiple libraries solving the same problem (e.g., both Guava and Apache Commons for the same utilities), increasing attack surface and license exposure unnecessarily

Severity Levels

Assign one severity to each finding:

SeverityLabelMeaning
S1CRITICALWill cause data loss, security breach, or production failure. Fix immediately.
S2HIGHLikely to cause bugs, performance degradation, or security weakness in production. Fix before merge.
S3MEDIUMCode smell, maintainability issue, or minor bug risk. Should be addressed.
S4LOWStyle issue, naming suggestion, or minor improvement. Address at discretion.

Output Format

Structure the review as follows:

Summary

Provide a 2-3 sentence overview: what the code does, overall quality assessment, and the most important finding.

Findings

List each finding with this structure:

[S{n}] {Category}: {Brief title}

  • Location: File and line number (or method name if line unknown)
  • Issue: What is wrong and why it matters
  • Suggestion: Concrete fix, with a code snippet when helpful

Order findings by severity (S1 first), then by location within each severity.

Positive Observations

Note 1-3 things the code does well. Good patterns, clean design, or thorough error handling deserve acknowledgment.

Summary Table

End with a count table:

SeverityCount
S1 CRITICALn
S2 HIGHn
S3 MEDIUMn
S4 LOWn

Guidelines

  • Be specific. Reference exact line numbers, method names, and variable names.
  • Provide concrete fix suggestions, not vague advice.
  • When suggesting a fix, show a brief code snippet demonstrating the improvement.
  • Do not flag style preferences that have no correctness or readability impact (e.g., brace placement style) unless the code mixes styles inconsistently.
  • For diffs, focus review on changed lines. Only flag pre-existing issues if they interact with the changes.
  • If the code is too large for a single review, divide it into logical sections and review each, providing a consolidated summary.
  • When uncertain about intent, state the assumption explicitly rather than making a silent judgment.

平台分布

Codex

35.93%
按下载量换算33

Claude

30.23%
按下载量换算28

Cursor

19.64%
按下载量换算18

Gemini CLI

10.61%
按下载量换算10

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills