Skip to main content
skill GitHub Copilot official · GitHub

java-docs — GitHub Copilot skill: what it does, how to install

Guides Javadoc work for Java types while following the project’s documentation style. Use it when adding or revising API comments.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add github/awesome-copilot --skill java-docs -a claude-code
Open on GitHub

What java-docs does

This skill guides GitHub Copilot when it writes Javadoc for Java types. It asks the agent to inspect implementation, callers, and tests first, so comments do not claim unverified behaviour, exceptions, nullability, or thread safety.

It keeps the project’s existing language and comment form, and limits edits to the requested scope. The guidance checks the JDK level before selecting examples: {@code ... } works on any JDK, while {@snippet} is available from JDK 18+.

For verification, it calls for mvn -q javadoc:javadoc, ./gradlew javadoc, or javadoc -Xdoclint:all. Install it if your team maintains public Java APIs and wants comments checked with the build; it is excessive for a one-line code note.

What it helps with

  • write Javadoc from verified Java behaviour
  • keep new comments consistent with project style
  • select Javadoc example syntax for the active JDK
  • fix doclint warnings introduced by a documentation change
  • document deprecations with a reason and replacement

Example prompts for the agent

  • “Add Javadoc for this Java type and verify the implementation, callers, and tests.”
  • “Update this API comment without changing the project’s existing documentation style.”
  • “Run `mvn -q javadoc:javadoc` and fix warnings introduced by the Javadoc change.”

How to install java-docs

1Skills CLI (Vercel)

npx skills add github/awesome-copilot --skill java-docs -a claude-code

2Manually: put the files in place

~/.claude/skills/java-docs/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/java-docs/

Similar

Questions about java-docs

How do I install java-docs in GitHub Copilot?

Run npx skills add github/awesome-copilot --skill java-docs or gh skill install github/awesome-copilot java-docs. The skill is placed at .github/skills/java-docs/SKILL.md.

What does java-docs do?

It provides instructions for documenting Java types with Javadoc based on verified code behaviour. It also covers project style, JDK-aware syntax, and documentation checks.

Which Javadoc example formats does java-docs cover?

{@code ... } works with any JDK. {@snippet} is for JDK 18+, while /// Markdown documentation comments require JDK 23+ and suitable project support.

Source text

SKILL.md · MIT
---
name: java-docs
description: 'Ensure that Java types are documented with Javadoc comments and follow best practices for documentation.'
---

# Java Documentation (Javadoc) Best Practices

## Principles

- Document only what the code actually does: read the implementation, callers and tests first. Never invent behaviour, thresholds, thread-safety, nullability or exceptions you have not verified; if unsure, leave it out or ask.
- Keep the existing documentation style of the project (language, tag order, comment form `/** */` vs `///`). Do not rewrite existing comments, or mass-document a codebase, unless the user asks; limit changes to the requested scope.
- Check the JDK level (`maven.compiler.release`, toolchain, `java -version`) before using newer features, and stay within it.

## Conventions

- `@since` only with the real version in which the API was introduced; `@deprecated` with a reason and replacement, together with `@Deprecated`.
- `@author` and `@version` only if the project already uses them.
- Code blocks, by JDK level:
  - Any JDK: `<pre>{@code ... }</pre>` (escape `@` at line start, balance braces).
  - JDK 18+: `{@snippet :  ... }` for inline code, or `{@snippet file="Example.java" region="demo"}` with files in `snippet-files/` (preferred for examples; `javadoc` does not compile or validate the snippet source, so compile and test the files in a separate build/test source set if you need that guarantee). Use `// @highlight substring="x"` and `// @replace` markup as needed.
  - JDK 23+ only (JEP 467): Markdown doc comments with `///`, using `[Type#member]` for links and fenced code blocks. Use them only if the project already does or the user asks, and the build runs a JDK 23+ `javadoc`.

## Verify

- Run `mvn -q javadoc:javadoc` (or `./gradlew javadoc`) and for single files `javadoc -Xdoclint:all -d target/javadoc-check <files>`; fix every warning/error you introduced (missing `@param`, bad HTML, unresolved `{@link}`, unknown tags).
- Report what was documented and the commands run; state any claims you could not verify from the code.

© github · MIT · github/awesome-copilot

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor