Java Comment Standardization Skills: Unifying Java Comment Maintenance with Agent Skill

Preface

In our team, Java comments are often written inconsistently: class headers lack @version, lines are cluttered with trailing explanations, @author tags don’t match actual contributors, and formatting requires manual review before merging. Relying solely on verbal agreements or scattered Checkstyle rules makes it difficult to consistently implement standards during daily routines of “adding comments, modifying comments, and reviewing comments.” Below is an introduction to the Java Comment Standards Skills (@user_b0ac05b7/java-comment-rules) on SkillHub. It encodes requirements such as class comment templates, version number inference, block comment placement, blank lines, and file encoding into a SKILL.md file. An Agent then processes Java files according to this unified set of rules in corresponding trigger scenarios.

What is this

Java Comment Standards Skills is a community-sourced (community) Agent Skill located at @user_b0ac05b7/java-comment-rules. Its current version is 1.0.0, categorized under dev-programming, and published by user_b0ac05b7. It does not require an API Key (requires_api_key=false).

The Agent should enable this skill when a user requests to add, modify, review, or organize comment formatting for Java code, or to process Java files according to coding comment standards. It targets the entire workflow of “generating and maintaining comments,” rather than just generating a few lines of explanatory text in a single instance.

Official Portals:

  • SkillHub Page: https://www.skillhub.cn/skills/user_b0ac05b7/java-comment-rules
  • API URL: https://api.skillhub.cn/user_b0ac05b7/java-comment-rules

Core Functions

The following capabilities are derived from the official description; details not present in the source material are not expanded upon.

  1. Class Comment Template
    Uniformly generates and maintains the Java class-level comment structure, facilitating the addition of class comments and the verification of tags like @author against team conventions.

  2. Version Number Inference via Git vs. Release Comparison
    When updating @version is required, it infers the version by combining the relationship between Git and release comparisons, reducing omissions or inconsistencies during manual version updates.

  3. Chinese Block Comments Above Lines
    Adds “block comments in Chinese above each line of code” and supports relocating trailing comments to the line above the code, preventing cluttered lines that hinder readability.

  4. Comment Blank Line Rules
    Adjusts blank lines between comments and code according to rules defined within the skill, ensuring consistent formatting across similar files.

  5. UTF-8 without BOM
    Maintains UTF-8, No BOM encoding when processing Java files, preventing warnings caused by BOM in certain build processes or toolchains.

  6. Typical Trigger Scenarios (Official List)
    Adding class comments, updating @version, checking @author provenance, organizing trailing comments, moving comments to the line above code, checking comment compliance, and pre-build Java comment style checks.

Installation and Activation

This skill is based on the universal SKILL.md format. The installation guide provided on the SkillHub page is: install the coordinate @user_b0ac05b7/java-comment-rules following the SkillHub Installation Documentation.

1. Install SkillHub CLI (If not already installed)

First, confirm if skillhub is available on your local machine:

command -v skillhub && skillhub --version

If not installed, you can execute the full installation (CLI + Default Skills) according to the official documentation:

curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash

If only the CLI is needed:

curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash -s -- --cli-only

2. Install to the current Agent’s skills directory

When installing the skill, you must use --dir to point to the skills directory recognized by your current Agent; installing to the default ./skills/ might not be loaded by the Agent. Common paths documented in the official docs are as follows:

Environment skills Directory
Cursor ~/.cursor/skills/
Claude Code ~/.claude/skills/
Codex ~/.codex/skills/ or .agents/skills/ under the project

Example of installing in Cursor:

skillhub install @user_b0ac05b7/java-comment-rules --dir ~/.cursor/skills/

You can also search first and then install:

skillhub search java-comment
skillhub install @user_b0ac05b7/java-comment-rules --dir ~/.cursor/skills/

Following the steps above, the skill will be placed in the SKILL package within the corresponding directory; the specific subdirectory name depends on the actual extraction result of skillhub install. If the Agent does not immediately recognize the new skill, please refresh or restart according to your client’s instructions and try again.

3. “Prompt Installation” on the Page Side

The SkillHub skill page also provides a snippet of text that can be sent directly to an AI, roughly meaning: Please install @user_b0ac05b7/java-comment-rules based on https://skillhub.cn/install/skillhub.md. This is suitable for scenarios where the CLI is not configured, but the Agent is expected to complete the installation following the official documentation.

Typical Usage

This skill does not list a separate repository of copy-run Java examples; usage is reflected in conversational triggers and task descriptions. Under the premise that the SKILL is installed, you can clarify the scenario using natural language, for example:

  1. “Complete the class comment for this UserService.java and check @author.”
  2. “Compare the current branch with the release tag and update @version in the class comment.”
  3. “Move trailing comments in the method to the line above the code, and add Chinese block comments according to comment standards.”
  4. “Help me check the comment style and blank lines for the Java files in this module before building.”

Once the Agent loads @user_b0ac05b7/java-comment-rules, it will process the specified Java files according to the rules in SKILL.md; you still need to provide the file path or select the target files within the workspace in the conversation, and specify whether to use Git releases as the basis for versioning.

Applicable Scenarios & Notes

Who is it for

  • Teams or individuals maintaining existing Java projects who need to unify class comments and line comment formats.
  • Developers who frequently review comments before merging or want to batch organize comments via an Agent in the IDE.
  • Multi-module projects with specific requirements for file encoding (UTF-8 without BOM).

Usage Notes

  • The “Version Number Inference via Git vs. Release Comparison” described in the skill depends on whether your local repository’s Git history and release tags are standardized; if tag naming or branch strategies are inconsistent, you need to specify which release is the baseline in the conversation.
  • Block comment and blank line rules are subject to the agreements within the skill. If there is a conflict with existing Checkstyle or company standards, align the SKILL rules first or choose one of the two to avoid repeated rewrites.
  • SkillHub Page Statistics (as of data capture): Rating 100000, Downloads 815, Installations 3; Community skills are maintained by the publisher, for upgrades please follow the version number of the coordinate @user_b0ac05b7/java-comment-rules (currently 1.0.0).

Conclusion

Java Comment Standards Skills consolidates the addition, modification, review, and formatting of Java comments into a unified Agent workflow, covering common pain points such as class templates, @version, block comments above lines, blank lines, and UTF-8 without BOM. If you are looking for dev-programming tools on SkillHub, you can start by installing and viewing the instructions on the official page:

https://www.skillhub.cn/skills/user_b0ac05b7/java-comment-rules

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye