Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/rbarcante/claude-conductor/java-best-practicesnpx skills add rbarcante/claude-conductor --skill java-best-practicesgit clone --depth 1 https://github.com/rbarcante/claude-conductorWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/rbarcante/claude-conductor/java-best-practices)<a href="https://agentmods.dev/skills/rbarcante/claude-conductor/java-best-practices"><img src="https://agentmods.dev/badge/skills/rbarcante/claude-conductor/java-best-practices.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00030 | $0.04241 |
| Opus 5 | $0.00015 | $0.02121 |
| Sonnet 5 | $0.00006 | $0.00848 |
| Haiku 4.5 | $0.00003 | $0.00424 |
Grade A, and why
java-best-practices scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 661 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Java Best Practices
Guidance for writing type-safe, concurrent, and modern Java code targeting Java 17+ and Java 21 LTS. Covers null safety, concurrency patterns, and modern language features.
Core Principles
- Null safety first: Use Optional for return values, @Nullable/@NonNull for parameters
- Immutability preferred: Use records for data carriers, final fields where possible
- Explicit error handling: Use checked exceptions sparingly, prefer Result patterns
- Modern features: Leverage records, sealed classes, and pattern matching
- Virtual threads for IO: Use virtual threads (Java 21) for IO-bound operations
Type Safety
Use Optional for Return Values
// Good - explicit absence representation
public Optional<User> findById(String id) {
User user = userRepository.findById(id);
return Optional.ofNullable(user);
}
// Bad - null return
public User findById(String id) {
return userRepository.findById(id); // May return null
}
Never Use Optional as Parameter or Field
// Bad - Optional as parameter
public void processUser(Optional<User> user) { ... }
// Good - use @Nullable annotation or overloading
public void processUser(@Nullable User user) { ... }
public void processUser(User user) { ... } // Overload for non-null
// Bad - Optional as field
private Optional<String> middleName;
// Good - nullable field with annotation
@Nullable
private String middleName;
Use Null Safety Annotations
import org.jspecify.annotations.Nullable;
import org.jspecify.annotations.NonNull;
// Good - explicit null contract
public @NonNull User createUser(@NonNull String name, @Nullable String email) {
Objects.requireNonNull(name, "name cannot be null");
return new User(name, email);
}
Defensive Coding with Objects.requireNonNull
public class UserService {
private final UserRepository repository;
private final EmailService emailService;
// Good - fail-fast validation in constructor
public UserService(UserRepository repository, EmailService emailService) {
this.repository = Objects.requireNonNull(repository, "repository cannot be null");
this.emailService = Objects.requireNonNull(emailService, "emailService cannot be null");
}
}
What ships with it
5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 4d ago First seen · 661 lines · 30 tokens per session scan A c4dc7d9dfd8a
java-best-practices is a skill published in the GitHub repository rbarcante/claude-conductor (56 stars, last pushed 5mo ago), licensed Apache-2.0. It adds 30 tokens to every session and 4,241 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
union-type-wrappers
Add typed getters and setters over BinaryData properties that represent TypeSpec union types in generated Java models. Use when generated classes expose BinaryData for union-typed fields and you need ergonomic, type-safe accessors instead.
run-tests
Run project tests using Maven (mvn). Use when the user asks to run tests.
search-m2
Search for Java classes inside Maven dependencies in /.m2. Use when the user asks to locate classes or inspect JARs. Cross-reference pom.xml files in the current directory to resolve dependency names/versions.
dd-code-generation
Use pup CLI for immediate Datadog operations or generate code for integration into applications.
create-package-skill
Interactive wizard that walks service teams through creating a package-specific skill for their Azure SDK package. Scans the package, detects customization patterns, scaffolds a SKILL.md with references, and validates with vally lint. The skill is placed inside the package's .github/skills/ directory so…
solid-principles
SOLID principles checklist with Java examples. Use when a class has too many responsibilities, an abstraction leaks, or a dependency points the wrong way, and when the user asks about Single Responsibility, Open/Closed, Liskov, Interface Segregation or Dependency Inversion. For naming, duplication and method length…