java-docs
Ensure that Java types are documented with Javadoc comments and follow best practices for documentation.
Security Assessment
About java-docs
The java-docs skill is designed to ensure that Java code is thoroughly documented using Javadoc comments, promoting clear, maintainable, and standardized documentation practices. By guiding developers to document public and protected members consistently, it helps reduce ambiguity in codebases, making it easier for teams to understand, maintain, and extend Java applications. This skill addresses the common problem of poorly documented Java code, which can lead to misunderstandings, bugs, and increased onboarding time for new developers.
This skill offers comprehensive coverage of Javadoc best practices, including documenting method parameters, return values, exceptions, and type parameters for generics. It emphasizes structured inline documentation using tags such as @param, @return, @throws, @see, @since, @version, @author, and @deprecated. Additionally, it supports code formatting with {@code} for inline snippets and <pre>{@code ... }</pre> for blocks of code. Inheritance of documentation via {@inheritDoc} is also recommended where appropriate, ensuring consistency across class hierarchies and interfaces. The guidance encourages documentation for private and package-private members when necessary, particularly for complex logic that is not self-explanatory.
This skill is particularly useful for Java developers, team leads, and software architects who aim to maintain high-quality documentation standards. It is suitable for both small projects where clarity is essential and large-scale enterprise applications where consistent documentation improves collaboration and reduces maintenance overhead. By following the best practices outlined, developers can produce readable, professional, and standardized Javadoc comments, enhancing code reliability and knowledge transfer across teams.
FAQ
Do I need to document private methods with Javadoc?
While public and protected members must be documented, it is encouraged to document private and package-private members if they are complex or not self-explanatory.
Which Javadoc tags are supported by this skill?
The skill supports tags such as @param, @return, @throws/@exception, @see, @since, @version, @author, @deprecated, @param <T> for generics, and inline code formatting using {@code} or <pre>{@code ... }</pre>.
Can this skill handle inherited documentation?
Yes, it recommends using {@inheritDoc} to inherit documentation from base classes or interfaces, unless there is significant behavior change that should be documented.
Is there a version requirement for using these Javadoc practices?
The skill does not specify a version requirement for Java, but it uses standard Javadoc conventions that are widely supported in modern Java environments.
Does this skill automate Javadoc generation?
No, the skill provides best practice guidelines for writing Javadoc comments manually; it does not automatically generate or populate documentation.
Install java-docs
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
github/awesome-copilot