Token导航 LogoToken导航

Agent Skill · 研究检索

java-code-comments(Java 代码 comments)

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

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

总安装 1,947周安装 78GitHub Stars 347下载 630核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/teachingai/full-stack-skills --skill java-code-comments

这个 Skill 是做什么的

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

用于辅助 Java 项目开发、面向对象设计和 Spring 生态集成。适合分析类结构、设计接口、整理服务分层或生成测试代码。使用时需结合项目已有架构、包结构和依赖版本,避免仅按教程修改代码。涉及数据库、事务或并发配置时,应先确认运行环境和回归测试范围。

java-code-comments 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

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

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

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

常见问题

6 条

java-code-comments 怎么安装?

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

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

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

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

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

java-code-comments 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

java-code-comments 用的人多吗?

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

java-code-comments 安全吗?

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

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

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 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-comments

Java 代码 comments · 本页

1,947347需要联网MIT通过

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

SKILL.md 原文

When to use this skill

ALWAYS use this skill when the user mentions:

  • Adding comments to Java code
  • Documenting Java classes, methods, or fields
  • Generating JavaDoc comments
  • Improving code documentation
  • Code annotation or code commenting
  • 给 Java 代码添加注释
  • 生成 Java 文档注释
  • 代码注释
  • 添加注释

Trigger phrases include:

  • "给这段代码添加注释" (add comments to this code)
  • "生成 JavaDoc" (generate JavaDoc)
  • "添加类注释" (add class comments)
  • "添加方法注释" (add method comments)
  • "添加属性注释" (add field comments)
  • "代码注释" (code comments)
  • "文档注释" (documentation comments)
  • "一句话给 Java 代码添加注释" (add comments to Java code with one sentence)

Component types this skill handles:

  • Controller (REST controllers, Spring MVC controllers)
  • Service (business service interfaces)
  • ServiceImpl (service implementations)
  • Application Service (DDD application services, orchestrating domain logic)
  • Domain Service (DDD domain services, domain business logic)
  • Feign Service Interface (Feign remote service interfaces)
  • Mapper (MyBatis mappers, data access layer)
  • Model (data models, domain models)
  • Entity (JPA entities, database entities)
  • BO (Business Object, business logic objects)
  • DTO (Data Transfer Object)
  • VO (Value Object, View Object)
  • DAO (Data Access Object)
  • Repository (Spring Data repositories)
  • Configuration (Spring configuration classes)
  • Component (Spring components)
  • Utility (utility classes)
  • Exception (custom exception classes)

How to use this skill

CRITICAL: This skill should be triggered when the user wants to add comments to Java code, regardless of the component type or complexity.

Workflow Overview

This skill follows a systematic 4-step workflow:

  1. Scan and Understand - Scan the entire codebase and related documentation to gain comprehensive understanding
  2. Confirm Component Types - Ask user to confirm which component types need comments
  3. Create Todo List - Generate a detailed todo list with class names and method names
  4. Execute Commenting - Add comments in order: class comments → method comments → field comments, updating todo list after each completion

Step-by-Step Process

Step 1: Scan and Understand the Codebase

CRITICAL: Before adding any comments, you MUST:

  1. Scan all Java files in the project:

- Read all .java files in the current directory and subdirectories - Understand the project structure and architecture - Identify relationships between classes (dependencies, inheritance, composition)

  1. Read related documentation:

- README.md files - API documentation - Architecture documentation - Business requirements documents (if available)

  1. Understand the context:

- What does each class do? - What is the purpose of each method? - What do fields represent? - How do components interact with each other?

  1. Identify patterns:

- Naming conventions used in the project - Existing comment styles (if any) - Architecture patterns (MVC, DDD, etc.) - Framework usage (Spring, MyBatis, etc.)

Output: A summary of your understanding of the codebase, including:

  • Project structure overview
  • Key components identified
  • Architecture patterns detected
  • Existing documentation status
Step 2: Confirm Component Types

CRITICAL: You MUST ask the user to confirm which component types need comments.

Present a checklist of common Java component types and ask the user to select:

请确认需要进行代码注释的分类(可多选):
- [ ] Controller(控制器)
- [ ] Service(服务接口)
- [ ] ServiceImpl(服务实现)
- [ ] Application Service(应用服务,DDD架构)
- [ ] Domain Service(领域服务,DDD架构)
- [ ] Feign Service Interface(Feign远程服务接口)
- [ ] Mapper(数据访问层)
- [ ] Model(数据模型)
- [ ] Entity(实体类)
- [ ] BO(业务对象)
- [ ] DTO(数据传输对象)
- [ ] VO(视图对象)
- [ ] DAO(数据访问对象)
- [ ] Repository(仓储)
- [ ] Configuration(配置类)
- [ ] Component(组件类)
- [ ] Utility(工具类)
- [ ] Exception(异常类)
- [ ] 其他(请 specify)

Also ask about comment types:

  • 类注释(Class-level comments)
  • 方法注释(Method-level comments)
  • 属性注释(Field-level comments)

Wait for user confirmation before proceeding to the next step.

Step 3: Create Todo List

CRITICAL: After user confirms component types, create a detailed todo list.

For each component type selected by the user:

  1. Scan the codebase to find all matching classes:

- Use file search to find classes matching the pattern (e.g., *Controller.java, *Service.java) - List all classes that need comments

  1. For each class, identify:

- Class name - Methods that need comments - Fields that need comments

  1. Generate a structured todo list in the following format:
## Todo List: Java Code Comments

### Controller 层
- [ ] UserController
  - [ ] 类注释
  - [ ] createUser() - 方法注释
  - [ ] updateUser() - 方法注释
  - [ ] deleteUser() - 方法注释
  - [ ] userId - 属性注释

### Service 层
- [ ] UserService
  - [ ] 类注释
  - [ ] findUserById() - 方法注释
  - [ ] saveUser() - 方法注释

### ServiceImpl 层
- [ ] UserServiceImpl
  - [ ] 类注释
  - [ ] findUserById() - 方法注释
  - [ ] saveUser() - 方法注释

### Mapper 层
- [ ] UserMapper
  - [ ] 类注释
  - [ ] selectById() - 方法注释

### Model/Entity 层
- [ ] User
  - [ ] 类注释
  - [ ] id - 属性注释
  - [ ] username - 属性注释
  - [ ] email - 属性注释

Important:

  • Organize by component type
  • List all classes that match the selected types
  • Include all methods and fields that need comments
  • Use checkboxes for tracking progress
Step 4: Execute Commenting Work

CRITICAL: Add comments in the specified order and update todo list after each completion.

Order of execution:

  1. Class-level comments (类注释) - First
  2. Method-level comments (方法注释) - Second
  3. Field-level comments (属性注释) - Third

For each item in the todo list:

  1. Process one class at a time:

- Start with class-level comment - Then process all methods in that class - Finally process all fields in that class - Update the todo list after completing each class

  1. Class-level comment format (Standard JavaDoc): /** * [Class description] * * <p>This class [purpose and responsibility] * * @author [Author name if available] * @since [Version or date if available] */ public class UserController { Class-level comment format (Java Coding Standards - strict): /** * <p>[Class description]</p> * * <p>This class [purpose and responsibility]</p> * * @author [Author name if available] * @since [Version or date if available] */ public class UserController { Specialized class comment formats (Java Coding Standards - strict): Application Service: /** * {服务名称}应用服务 * * <p>{详细描述服务的业务功能、职责和应用场景}</p> * <p>主要功能包括:</p> * <ul> * <li>{功能点1}</li> * <li>{功能点2}</li> * <li>{功能点3}</li> * </ul> * * @author system * @since 2025-01-21 */ public class UserApplicationService { Domain Service: /** * {服务名称}领域服务 * * <p>{详细描述服务的领域职责和业务逻辑}</p> * <p>主要功能包括:</p> * <ul> * <li>{功能点1}</li> * <li>{功能点2}</li> * </ul> * * @author system * @since 2025-01-21 */ public class UserDomainService { Feign Service Interface: /** * {服务名称}Feign远程服务接口 * * <p>通过Feign调用{目标服务}的远程接口</p> * <p>主要功能:</p> * <ul> * <li>{接口功能1}</li> * <li>{接口功能2}</li> * </ul> * * @author system * @since 2025-01-21 */ public interface UserFeignService {
  2. Method-level comment format (Standard JavaDoc): /** * [Method description] * * @param [paramName] [parameter description] * @return [return value description] * @throws [ExceptionType] [exception description] */ public UserDTO createUser(@RequestBody UserCreateRequest request) { Method-level comment format (Java Coding Standards - strict): /** * <p>[Method description]</p> * * <p>[Detailed description]</p> * * @param [paramName] [paramType] [parameter description] * @return [returnType] [return value description] * @exception [full.package.ExceptionType] [exception description] */ public UserDTO createUser(@RequestBody UserCreateRequest request) {
  3. Field-level comment format (Standard JavaDoc): /** * [Field description] */ private Long userId; Field-level comment format (Java Coding Standards - strict): /** * <p>[Field description]</p> * * <p>[Detailed description if needed]</p> */ private Long userId;
  4. After completing each class:

- Update the todo list: mark completed items with [x] - Show progress to the user - Continue to the next class

Example progress update:

## Progress Update

✅ Completed: UserController
  - [x] 类注释
  - [x] createUser() - 方法注释
  - [x] updateUser() - 方法注释
  - [x] deleteUser() - 方法注释
  - [x] userId - 属性注释

🔄 In Progress: UserService
  - [x] 类注释
  - [ ] findUserById() - 方法注释
  - [ ] saveUser() - 方法注释

Comment Quality Guidelines

IMPORTANT: Comment Format Standards

This skill follows two standards:

  1. Standard JavaDoc (default): See javadoc-standards.md (within this skill)
  2. Java Coding Standards (strict): See java-coding-standards.md (within this skill)

The Java Coding Standards require:

  • Description must be wrapped in <p> tags: <p>description</p>
  • Parameter types must be declared: @param paramName paramType description
  • Return types must be declared: @return returnType description
  • Exception types must be declared with full package name: @exception java.lang.Exception description

Class Comments Should Include:

  • Clear description of the class purpose (wrapped in <p> tags if following Java Coding Standards)
  • Main responsibilities
  • Usage examples (if complex)
  • Related classes or components
  • Author and version (if available)

Method Comments Should Include:

  • Clear description of what the method does (wrapped in <p> tags if following Java Coding Standards)
  • All parameters with descriptions and types
  • Return value description with type
  • Exceptions that may be thrown (with full package names)
  • Usage examples (for complex methods)
  • Side effects (if any)

Field Comments Should Include:

  • Clear description of what the field represents (wrapped in <p> tags if following Java Coding Standards)
  • Data type and constraints (if applicable)
  • Default values (if applicable)
  • Relationships to other fields (if applicable)

Best Practices

  1. Be concise but complete: Comments should be clear and informative without being verbose
  2. Use JavaDoc format: Follow standard JavaDoc conventions
  3. Maintain consistency: Use consistent style across all comments
  4. Update todo list: Always update the todo list after completing each item
  5. One class at a time: Process one complete class before moving to the next
  6. Respect existing code: Don't modify code logic, only add comments
  7. Context-aware: Comments should reflect the actual code behavior and business context

Comment Templates

For different component types, use appropriate templates from the templates/ directory:

  • templates/controller-comment-template.md - Controller class comments
  • templates/service-comment-template.md - Service interface comments
  • templates/serviceimpl-comment-template.md - Service implementation comments
  • templates/application-service-comment-template.md - Application Service comments (DDD)
  • templates/domain-service-comment-template.md - Domain Service comments (DDD)
  • templates/feign-service-comment-template.md - Feign Service Interface comments
  • templates/mapper-comment-template.md - Mapper comments
  • templates/entity-comment-template.md - Entity class comments
  • templates/dto-comment-template.md - DTO class comments

Comment Standards Reference

Note: All reference documents are located within this skill's directory structure.

When to use Java Coding Standards format:

  • When the project explicitly follows 《JAVA 编程规范》
  • When the project requires strict format with <p> tags for descriptions
  • When parameter and return types must be explicitly declared in comments

Examples

See the examples/ directory for complete examples:

  • examples/controller-example.md - Controller commenting example
  • examples/service-example.md - Service commenting example
  • examples/entity-example.md - Entity commenting example
  • examples/full-workflow-example.md - Complete workflow example

Keywords

English keywords: java, code comments, javadoc, documentation, class comments, method comments, field comments, code annotation, code documentation, java documentation, add comments, generate comments, document code, code comments java, java code comments, controller comments, service comments, mapper comments, entity comments, dto comments

Chinese keywords (中文关键词): Java 代码注释, 添加注释, 生成注释, 代码注释, 文档注释, JavaDoc, 类注释, 方法注释, 属性注释, 字段注释, 给代码添加注释, 代码文档, Java 文档, 注释生成, 一句话添加注释, Controller 注释, Service 注释, Mapper 注释, Entity 注释, DTO 注释, 代码注解

平台分布

Claude Code

27.09%
按下载量换算171

Antigravity

26.51%
按下载量换算167

OpenCode

17.37%
按下载量换算109

Gemini CLI

14.32%
按下载量换算90

Cursor

7.61%
按下载量换算48

Codex

3.34%
按下载量换算21

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

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

继续浏览同类 Skills