From backend-java
Use when writing or reviewing Java code — enforces modern Java patterns including records, sealed classes, Optional, streams, text blocks, pattern matching for instanceof, and effective Java principles
How this skill is triggered — by the user, by Claude, or both
Slash command
/backend-java:java-codingThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
| Element | Convention | Example |
| Element | Convention | Example |
|---|---|---|
| Package | lowercase, reverse domain | com.yourorg.order.service |
| Class | PascalCase, noun | OrderService, PaymentGateway |
| Interface | PascalCase, adjective or noun | Payable, OrderRepository |
| Method | camelCase, verb | createOrder, findById |
| Constant | UPPER_SNAKE | MAX_RETRY_COUNT |
| Variable | camelCase | orderId, totalAmount |
// Records for DTOs and value objects
public record OrderResponse(Long id, String customerId, BigDecimal total, OrderStatus status) {}
// Sealed classes for domain hierarchies
public sealed interface PaymentResult permits PaymentSuccess, PaymentFailure, PaymentPending {}
public record PaymentSuccess(String transactionId) implements PaymentResult {}
public record PaymentFailure(String reason) implements PaymentResult {}
// Pattern matching for instanceof
if (result instanceof PaymentSuccess success) {
log.info("Payment completed: {}", success.transactionId());
}
// Text blocks for SQL/JSON
var query = """
SELECT o.id, o.customer_id, o.total
FROM orders o
WHERE o.status = :status
""";
Optional<T> from finder methods that may not find a resultOptional as a method parameter or fieldorElseThrow() with specific exception over get()map/flatMap for chaining, not isPresent/get// Good
Order order = repository.findById(id)
.orElseThrow(() -> new OrderNotFoundException(id));
// Bad
Optional<Order> opt = repository.findById(id);
if (opt.isPresent()) { return opt.get(); }
items.stream().map(Item::name)Collectors.toUnmodifiableList() for immutable resultsOrderNotFoundException, InsufficientStockExceptionException or Throwable broadlyfinal fields for all injected dependenciesnpx claudepluginhub gagandeepp/software-agent-teams --plugin backend-javaGuides completion of development work by verifying tests, detecting environment, and presenting structured options for merge, PR, or cleanup.
Enforces test-driven development: write failing test first, then minimal code to pass. Use when implementing features or bugfixes.
Guides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.