$npx -y skills add ducpm2303/claude-java-plugins --skill java-docsGenerates Javadoc comments for Java classes and methods. Use when user asks to "add javadoc", "document this class", "write documentation", "add comments", "generate docs", or "document this method".
| 1 | Generate Javadoc comments for the Java code I've selected or provided. Follow standard Javadoc conventions. |
| 2 | |
| 3 | ## Rules for generating Javadoc |
| 4 | |
| 5 | **For classes and interfaces:** |
| 6 | |
| 7 | ``` |
| 8 | /** |
| 9 | * [One sentence describing the class's responsibility.] |
| 10 | * |
| 11 | * [Optional: 1–2 sentences of additional context, design pattern used, or usage note.] |
| 12 | * |
| 13 | * @author [omit — do not add @author unless already present] |
| 14 | * @since [omit unless the user specifies a version] |
| 15 | */ |
| 16 | ``` |
| 17 | |
| 18 | **For public and protected methods:** |
| 19 | |
| 20 | ``` |
| 21 | /** |
| 22 | * [One sentence describing what this method does — use active voice, e.g., "Returns the user with the given ID."] |
| 23 | * |
| 24 | * [Optional: additional detail about behaviour, side effects, or constraints — only if non-obvious.] |
| 25 | * |
| 26 | * @param paramName [description of the parameter — what it represents, valid values, null-safety] |
| 27 | * @return [description of the return value — what it contains, when it is empty/null] |
| 28 | * @throws ExceptionType [condition that causes this exception to be thrown] |
| 29 | */ |
| 30 | ``` |
| 31 | |
| 32 | **For fields:** |
| 33 | - Only document non-obvious fields with `/** brief description */` |
| 34 | - Do not document self-evident fields like `private String name;` |
| 35 | |
| 36 | ## Quality rules |
| 37 | - Do not restate the method signature in the description (e.g., avoid "This method takes a String and returns a String") |
| 38 | - Use present tense active voice: "Returns...", "Creates...", "Validates..." |
| 39 | - For `@param`: describe what the parameter represents, not just its type |
| 40 | - For `@return`: describe the returned value's meaning, not just "the result" |
| 41 | - For `@throws`: describe the condition, not just the exception name |
| 42 | - Do not add `@param` for `void` methods with no parameters |
| 43 | - Do not add `@return` for `void` methods |
| 44 | |
| 45 | ## Output |
| 46 | Produce the complete class or method with Javadoc inserted. Show only the documented code — do not change any logic. |