Skip to content

mzdz/java-skills

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java Skills

180 Java rules your AI coding agent can use to write better code.

Works with Claude Code, Cursor, Windsurf, Copilot, Codex, Aider, Zed, Amp, Cline, and pretty much any other agent that supports skills.

Install

npx add-skill java-skills

That's it. The CLI figures out which agents you have and installs the skill to the right place.

How to use it

After installing, just ask your agent:

/java-skills review this class
/java-skills is my exception handling correct?
/java-skills check for concurrency issues

The agent loads the relevant rules and applies them to your code.

What's in here

180 rules split into 14 categories:

Category Rules What it covers
Exception Handling 12 Checked vs unchecked, try-with-resources, Optional
Concurrency 15 Thread safety, locks, ExecutorService, virtual threads
Collections 14 Right collection choice, unmodifiable, generics
OOP Design 15 Builder pattern, composition, records, sealed classes
Stream API 12 Streams, collectors, parallel streams, Optional
JVM Optimization 12 GC tuning, JIT, profiling with JFR
Naming 14 Following Java naming conventions
Type Safety 12 Generics, pattern matching, enums
Testing 14 JUnit 5, Mockito, AssertJ, Testcontainers
Docs 11 Javadoc best practices
Performance 13 StringBuilder, boxing, caching
Project Structure 10 Maven/Gradle, package structure, modules
Code Quality 11 Static analysis, Checkstyle, SonarQube
Anti-patterns 15 Common mistakes and how to fix them

Each rule has:

  • Why it matters
  • Bad code example
  • Good code example
  • Links to official docs when relevant

Manual install

If add-skill doesn't work for your setup, here's how to install manually:

Claude Code

Global (applies to all projects):

git clone https://github.com/mzdz/java-skills.git ~/.claude/skills/java-skills

Or just for one project:

git clone https://github.com/mzdz/java-skills.git .claude/skills/java-skills
Cursor
git clone https://github.com/mzdz/java-skills.git .cursor/skills/java-skills

Or just grab the skill file:

curl -o .cursorrules https://raw.githubusercontent.com/mzdz/java-skills/master/SKILL.md
Windsurf
mkdir -p .windsurf/rules
curl -o .windsurf/rules/java-skills.md https://raw.githubusercontent.com/mzdz/java-skills/master/SKILL.md
OpenAI Codex
git clone https://github.com/mzdz/java-skills.git .codex/skills/java-skills

Or use the AGENTS.md standard:

curl -o AGENTS.md https://raw.githubusercontent.com/mzdz/java-skills/master/SKILL.md
GitHub Copilot
mkdir -p .github
curl -o .github/copilot-instructions.md https://raw.githubusercontent.com/mzdz/java-skills/master/SKILL.md
Aider

Add to .aider.conf.yml:

read: path/to/java-skills/SKILL.md

Or pass it directly:

aider --read path/to/java-skills/SKILL.md
Other agents (AGENTS.md)

If your agent supports the AGENTS.md standard:

curl -o AGENTS.md https://raw.githubusercontent.com/mzdz/java-skills/master/SKILL.md

All rules

See SKILL.md for the full list with links to each rule file.

Where these rules come from

Contributing

PRs welcome. Just follow the format of existing rules.

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published