$npx -y skills add github/awesome-copilot --skill java-docsEnsure that Java types are documented with Javadoc comments and follow best practices for documentation.
| 1 | # Java Documentation (Javadoc) Best Practices |
| 2 | |
| 3 | - Public and protected members should be documented with Javadoc comments. |
| 4 | - It is encouraged to document package-private and private members as well, especially if they are complex or not self-explanatory. |
| 5 | - The first sentence of the Javadoc comment is the summary description. It should be a concise overview of what the method does and end with a period. |
| 6 | - Use `@param` for method parameters. The description starts with a lowercase letter and does not end with a period. |
| 7 | - Use `@return` for method return values. |
| 8 | - Use `@throws` or `@exception` to document exceptions thrown by methods. |
| 9 | - Use `@see` for references to other types or members. |
| 10 | - Use `{@inheritDoc}` to inherit documentation from base classes or interfaces. |
| 11 | - Unless there is major behavior change, in which case you should document the differences. |
| 12 | - Use `@param <T>` for type parameters in generic types or methods. |
| 13 | - Use `{@code}` for inline code snippets. |
| 14 | - Use `<pre>{@code ... }</pre>` for code blocks. |
| 15 | - Use `@since` to indicate when the feature was introduced (e.g., version number). |
| 16 | - Use `@version` to specify the version of the member. |
| 17 | - Use `@author` to specify the author of the code. |
| 18 | - Use `@deprecated` to mark a member as deprecated and provide an alternative. |