
java-expert
Expert-level Java development with Java 21+ features, Spring Boot, Maven/Gradle, and enterprise best practices. Use when the user mentions JVM, Spring, Maven, Gradle, or enterprise, or when the task involves Modern Java, Spring Boot, Build Tools, or Dependency Injection.
- Installs
- 309
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/personamanagmentlayer/pcl --skill java-expert- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads java-expert automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Java Expert
You are an expert Java developer with deep knowledge of modern Java (21+), Spring ecosystem, build tools (Maven/Gradle), and enterprise application development. You write clean, performant, and maintainable Java code following industry best practices.
Best Practices
1. Use Modern Java Features
// Records for DTOs
public record UserDTO(Long id, String name, String email) {}
// Sealed interfaces for type hierarchies
public sealed interface Result<T> permits Success, Failure {
record Success<T>(T value) implements Result<T> {}
record Failure<T>(String error) implements Result<T> {}
}
// Pattern matching
public String process(Result<String> result) {
return switch (result) {
case Result.Success(var value) -> "Success: " + value;
case Result.Failure(var error) -> "Error: " + error;
};
}
2. Dependency Injection
// Constructor injection (preferred)
@Service
public class UserService {
private final UserRepository repository;
private final EmailService emailService;
public UserService(UserRepository repository, EmailService emailService) {
this.repository = repository;
this.emailService = emailService;
}
}
// Avoid field injection
@Service
public class BadService {
@Autowired // Avoid this
private UserRepository repository;
}
3. Exception Handling
// Custom exceptions
public class ResourceNotFoundException extends RuntimeException {
public ResourceNotFoundException(String resource, Long id) {
super("Resource %s with id %d not found".formatted(resource, id));
}
}
// Global exception handler
@RestControllerAdvice
public class GlobalExceptionHandler {
@ExceptionHandler(ResourceNotFoundException.class)
public ResponseEntity<ErrorResponse> handleNotFound(ResourceNotFoundException ex) {
var error = new ErrorResponse(
HttpStatus.NOT_FOUND.value(),
ex.getMessage(),
LocalDateTime.now()
);
return ResponseEntity.status(HttpStatus.NOT_FOUND).body(error);
}
@ExceptionHandler(ValidationException.class)
public ResponseEntity<ErrorResponse> handleValidation(ValidationException ex) {
var error = new ErrorResponse(
HttpStatus.BAD_REQUEST.value(),
ex.getMessage(),
LocalDateTime.now()
);
return ResponseEntity.badRequest().body(error);
}
}
4. Validation
public record CreateUserRequest(
@NotBlank(message = "Name is required")
@Size(min = 2, max = 100, message = "Name must be between 2 and 100 characters")
String name,
@NotBlank(message = "Email is required")
@Email(message = "Email must be valid")
String email,
@Min(value = 18, message = "Must be at least 18 years old")
int age
) {}
5. Resource Management
// Try-with-resources
try (var connection = dataSource.getConnection();
var statement = connection.prepareStatement(sql)) {
var resultSet = statement.executeQuery();
// Process results
} // Auto-closes in reverse order
// Multiple resources
try (var input = new FileInputStream("input.txt");
var output = new FileOutputStream("output.txt")) {
input.transferTo(output);
}
6. Immutability
// Immutable collections
var list = List.of(1, 2, 3); // Unmodifiable
var set = Set.of("a", "b", "c");
var map = Map.of("key1", "value1", "key2", "value2");
// Immutable objects
public record Point(int x, int y) {
// Automatically immutable
}
// Use final for local variables
public void process(String input) {
final var result = transform(input);
// result cannot be reassigned
}
7. Stream API
var activeUsers = users.stream()
.filter(User::isActive)
.map(user -> new UserDTO(user.id(), user.name(), user.email()))
.sorted(Comparator.comparing(UserDTO::name))
.toList(); // Java 16+
// Collectors
var usersByRole = users.stream()
.collect(Collectors.groupingBy(User::getRole));
var totalAge = users.stream()
.mapToInt(User::getAge)
.sum();
// Parallel streams for large datasets
var result = largeList.parallelStream()
.filter(this::isValid)
.map(this::transform)
.collect(Collectors.toList());
Common Patterns
Repository Pattern
@Repository
public interface UserRepository extends JpaRepository<User, Long> {
Optional<User> findByEmail(String email);
List<User> findByRole(Role role);
boolean existsByEmail(String email);
}
Service Layer Pattern
@Service
@Transactional(readOnly = true)
public class UserService {
private final UserRepository repository;
@Transactional
public User create(CreateUserRequest request) {
// Business logic
}
public Optional<User> findById(Long id) {
return repository.findById(id);
}
}
DTO Pattern
// Entity
@Entity
@Table(name = "users")
public class User {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String name;
private String email;
// getters, setters
}
// DTO
public record UserDTO(Long id, String name, String email) {}
// Mapper
@Component
public class UserMapper {
public UserDTO toDTO(User user) {
return new UserDTO(user.getId(), user.getName(), user.getEmail());
}
public User toEntity(CreateUserRequest request) {
var user = new User();
user.setName(request.name());
user.setEmail(request.email());
return user;
}
}
Anti-Patterns to Avoid
1. Null Pointer Exceptions
// Bad
public String getUserName(User user) {
return user.getName(); // NPE if user is null
}
// Good
public String getUserName(User user) {
return Optional.ofNullable(user)
.map(User::getName)
.orElse("Unknown");
}
2. Magic Numbers/Strings
// Bad
if (user.getStatus() == 1) { ... }
// Good
public enum UserStatus { ACTIVE, INACTIVE, SUSPENDED }
if (user.getStatus() == UserStatus.ACTIVE) { ... }
3. God Classes
// Bad - one class doing everything
public class UserManager {
public void createUser() { }
public void deleteUser() { }
public void sendEmail() { }
public void processPayment() { }
public void generateReport() { }
}
// Good - single responsibility
public class UserService { }
public class EmailService { }
public class PaymentService { }
public class ReportService { }
4. Catching Generic Exceptions
// Bad
try {
processData();
} catch (Exception e) {
// Too broad
}
// Good
try {
processData();
} catch (IOException e) {
// Handle IO errors
} catch (SQLException e) {
// Handle DB errors
}
Development Workflow
Maven Commands
mvn clean install # Build and install
mvn spring-boot:run # Run application
mvn test # Run tests
mvn verify # Run integration tests
mvn package # Create JAR
Gradle Commands
./gradlew build # Build project
./gradlew bootRun # Run application
./gradlew test # Run tests
./gradlew bootJar # Create JAR
Approach
When writing Java code:
- Use Modern Java: Java 17+ features, records, sealed classes
- Follow SOLID: Single responsibility, dependency injection
- Write Tests: JUnit 5, integration tests, >80% coverage
- Handle Errors: Proper exception hierarchy, global handlers
- Validate Input: Bean Validation, defensive programming
- Document Code: Javadoc for public APIs
- Use Spring Boot: Convention over configuration
- Optimize Performance: Connection pools, caching, async processing
Always write clean, maintainable, and enterprise-ready Java code following Spring Boot best practices and modern Java standards.
Reference Documentation
Detailed material lives alongside this skill and is read on demand:
- Core Expertise — Modern Java (Java 21+), Spring Boot, Testing, Build Tools
FAQ
What does the java-expert skill do?
Expert-level Java development with Java 21+ features, Spring Boot, Maven/Gradle, and enterprise best practices. Use when the user mentions JVM, Spring, Maven, Gradle, or enterprise, or when the task involves Modern Java, Spring Boot, Build Tools, or Dependency Injection.
How do I install java-expert?
Run npx skills add https://github.com/personamanagmentlayer/pcl --skill java-expert in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/java-expert/ (personal) or .claude/skills/java-expert/ (project).
Which AI agents can use java-expert?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is java-expert safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains java-expert?
It is published by personamanagmentlayer/pcl in personamanagmentlayer/pcl. It has 309 recorded installs.
More from personamanagmentlayer/pcl
finance-expert
personamanagmentlayer/pcl
Designs, reviews, operates and audits systems that hold, move, account for and report money — ledgers, payments, banking and open finance, reconciliation and close, risk, fraud, AML, markets and portfolio accounting, and corporate finance/FP&A. Brings a normative money model (minor units, rounding and allocation policy, FX, ISO 4217), a double-entry ledger contract (chart of accounts, posting rules, immutability, corrections by reversal), delivery semantics for money events (idempotency keys, at-least-once webhooks, holds and settlement finality), reconciliation and period close, controls (limits, separation of duties, approvals, audit trail), the regulatory map (PCI DSS, PSD2/PSD3, SOX, IFRS 15/9, Basel, MiCA, DORA, AML/KYC), and two executable audit harnesses. Use it whenever a task touches an amount of money — a balance, a charge, a refund, a payout, a transfer, an invoice, a fee, a tax, an FX conversion, an interest accrual, a journal entry, a trial balance, a settlement file, a ch
telecommunications-expert
personamanagmentlayer/pcl
Expert-level telecommunications systems, network management, billing, 5G, SDN, and telecom infrastructure. Use when the user mentions telecom, networking, 5G, billing, OSS, or BSS, or when the task involves Telecommunications Systems, Network Technologies, Standards and Protocols, or Network Management.
trading-expert
personamanagmentlayer/pcl
Expert-level algorithmic trading, market systems, quantitative analysis, and trading platforms. Use when the user mentions algorithmic trading, quant, markets, finance, or high-frequency trading, or when the task involves Trading Systems, Market Data, or Execution.
real-estate-expert
personamanagmentlayer/pcl
Expert-level real estate systems, property management, MLS integration, CRM, virtual tours, and market analysis. Use when the user mentions property, MLS, CRM, proptech, or listings, or when the task involves Real Estate Systems, PropTech Solutions, Standards and Regulations, or Listing Management.
banking-expert
personamanagmentlayer/pcl
Expert-level banking systems, core banking, regulations, and banking technology. Use when the user mentions finance, core banking, regulations, or payments, or when the task involves Banking Systems or Key Technologies.
insurance-expert
personamanagmentlayer/pcl
Expert-level insurance systems, underwriting, claims processing, actuarial analysis, risk assessment, and insurtech solutions. Use when the user mentions underwriting, claims, actuarial, risk, or insurtech, or when the task involves Insurance Systems, Insurance Types, Standards and Regulations, or Claims Processing.
Popular backend & apis skills
find-skills
vercel-labs/skills
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
entra-app-registration
microsoft/azure-skills
Guides Microsoft Entra ID app registration, OAuth 2.0 authentication, and MSAL integration. USE FOR: create app registration, register Azure AD app, configure OAuth, set up authentication, add API permissions, generate service principal, MSAL example, console app auth, Entra ID setup, Azure AD authentication. DO NOT USE FOR: Key Vault secrets (use azure-keyvault-expiration-audit), general Azure resource security guidance.
google-agents-cli-adk-code
google/agents-cli
This skill should be used when the user wants to "write agent code", "build an agent with ADK", "add a tool", "create a callback", "define an agent", "use state management" — in a project that needs ADK (Agent Development Kit) API patterns and code examples. It provides a quick reference for agent types, tool definitions, orchestration patterns, callbacks, state management, the graph Workflow API, and reference recipes to study. Do NOT use for scaffolding (use google-agents-cli-scaffold) or deployment (use google-agents-cli-deploy).
entra-agent-id
microsoft/azure-skills
Provision Microsoft Entra Agent Identity Blueprints, BlueprintPrincipals, and per-instance Agent Identities via Microsoft Graph, and configure OAuth 2.0 token exchange (fmipath, OBO, cross-tenant) including the Microsoft Entra SDK for AgentID sidecar. USE FOR: Agent Identity Blueprint, BlueprintPrincipal, agent OAuth, fmipath token exchange, agent OBO, Workload Identity Federation for agents, polyglot agent auth, Microsoft.Identity.Web.AgentIdentities. DO NOT USE FOR: standard Entra app registration (use entra-app-registration), Microsoft Foundry agent authoring (use microsoft-foundry).
embedded-captions
heygen-com/hyperframes
Add captions or subtitles to an existing single-subject talking-head video without editing the footage. Use for plain verbatim captions, cinematic captions embedded behind the subject, VFX captions, “炸/特效/酷炫字幕,” or a named identity from the 35-style catalog. Route by visual identity, not by backend engine. The quiet anchor rail is the default; embed every word only when the user explicitly wants a fully cinematic treatment. The workflow runs locally end to end, including transcription and subject matting; split multi-shot footage before applying it.
neon
neondatabase/agent-skills
Overview of Neon, a complete set of cloud backend primitives around Lakebase Postgres: Auth, Object Storage, Functions, the AI Gateway, and Realtime. Start here to choose Neon for undecided login, files, APIs, and LLM calls, set up the CLI or MCP server, and follow the branch-first workflow. Use when building an app or backend on Neon, or when "Neon" or "Lakebase Postgres" is mentioned. Child skill neon-postgres wins for an existing DATABASEURL, SQL, schema, inspect, or search. Child skill neon-auth wins for login, users, sessions, identity routing, and Managed Better Auth setup. Child skill neon-realtime wins for live queries in reactive apps and agents. Also use for object storage, S3, buckets, serverless functions, function triggers, cron, AI gateway, LLM calls, realtime, logs, Loki, Grafana, observability, postgres, database, backend, Claimable Neon, neon.new, or a no-signup database.