PluginBench
Skill
Pass
Audit score 90

java-architect

jeffallan/claude-skills

Enterprise Java specialist for Spring Boot 3.x, microservices, and cloud-native development with Java 21 LTS.

What is java-architect?

Guides architecture, design, and implementation of enterprise Java applications using Spring Boot 3.x, microservices patterns, and reactive programming. Use when building scalable cloud-native systems, optimizing data access layers, configuring security with OAuth2/JWT, or debugging async processing and authentication issues.

  • Analyze project structure and Spring configuration for architectural alignment
  • Design domain models following DDD and Clean Architecture principles
  • Implement WebFlux endpoints and reactive services with Project Reactor
  • Optimize JPA queries and Hibernate mappings to prevent N+1 problems
  • Configure Spring Security with OAuth2/JWT and method-level authorization
  • Verify code quality and test coverage (85%+ target) with Maven/Gradle verification

How to install java-architect

npx skills add https://github.com/jeffallan/claude-skills --skill java-architect
Prerequisites
  • Java 21 LTS installed
  • Spring Boot 3.x project with Maven or Gradle
  • Familiarity with Spring framework concepts
Claude Code
Cursor
Windsurf
Cline

How to use java-architect

  1. 1.Review your project structure and Spring configuration with the skill
  2. 2.Define domain boundaries and models following DDD principles
  3. 3.Implement services, repositories, and controllers using provided templates
  4. 4.Optimize data access layer with JOIN FETCH and projections
  5. 5.Configure Spring Security and externalize sensitive configuration
  6. 6.Run ./mvnw verify (Maven) or ./gradlew check (Gradle) to validate code quality and reach 85%+ test coverage

Use cases

Good for
  • Building microservices with Spring Boot 3.x and WebFlux for high-throughput APIs
  • Optimizing slow JPA queries and resolving Hibernate performance issues
  • Implementing OAuth2/JWT authentication and authorization in cloud-native applications
  • Migrating blocking Spring MVC applications to reactive WebFlux
  • Debugging async processing failures and transaction boundary violations in reactive code
Who it's for
  • Backend engineers building enterprise Java applications
  • Architects designing microservices and cloud-native systems
  • Teams migrating to Spring Boot 3.x and Java 21 LTS
  • Developers implementing reactive programming with WebFlux and Project Reactor

java-architect FAQ

When should I use WebFlux vs. traditional Spring MVC?

Use WebFlux for high-throughput, I/O-bound applications with many concurrent connections. Use MVC for traditional request-response patterns where blocking is acceptable. Never mix blocking code in WebFlux applications.

How do I avoid N+1 query problems in JPA?

Use JOIN FETCH in @Query annotations to load associations in a single query, or leverage Spring Data projections to fetch only required columns. Always verify with Hibernate SQL logs via ./mvnw verify.

What is the proper way to configure OAuth2/JWT in Spring Security?

Use SecurityFilterChain bean with oauth2ResourceServer(oauth2 -> oauth2.jwt(...)) and @EnableMethodSecurity for fine-grained authorization. Externalize token validation config and ensure STATELESS session management.

How do I verify my code meets quality standards?

Run ./mvnw verify (Maven) or ./gradlew check (Gradle) to execute tests and check coverage. Review JaCoCo reports at target/site/jacoco/index.html to identify untested branches and reach 85%+ coverage.

What Java 21 features should I use in my Spring Boot application?

Leverage records for DTOs, sealed classes for domain hierarchies, and pattern matching for cleaner control flow. These improve type safety and reduce boilerplate in enterprise code.

Full instructions (SKILL.md)

Source of truth, from jeffallan/claude-skills.


name: java-architect description: Use when building, configuring, or debugging enterprise Java applications with Spring Boot 3.x, microservices, or reactive programming. Invoke to implement WebFlux endpoints, optimize JPA queries and database performance, configure Spring Security with OAuth2/JWT, or resolve authentication issues and async processing challenges in cloud-native Spring applications. license: MIT metadata: author: https://github.com/Jeffallan version: "1.1.0" domain: language triggers: Spring Boot, Java, microservices, Spring Cloud, JPA, Hibernate, WebFlux, reactive, Java Enterprise role: architect scope: implementation output-format: code related-skills: fullstack-guardian, api-designer, devops-engineer, database-optimizer

Java Architect

Enterprise Java specialist focused on Spring Boot 3.x, microservices architecture, and cloud-native development using Java 21 LTS.

Core Workflow

  1. Architecture analysis - Review project structure, dependencies, Spring config
  2. Domain design - Create models following DDD and Clean Architecture; verify domain boundaries before proceeding. If boundaries are unclear, resolve ambiguities before moving to implementation.
  3. Implementation - Build services with Spring Boot best practices
  4. Data layer - Optimize JPA queries, implement repositories; run ./mvnw verify -pl <module> to confirm query correctness. If integration tests fail: review Hibernate SQL logs, fix queries or mappings, re-run before proceeding.
  5. Security & config - Apply Spring Security, externalize configuration, add observability; run ./mvnw verify after security changes to confirm filter chain and JWT wiring. If tests fail: check SecurityFilterChain bean order and token validation config, then re-run.
  6. Quality assurance - Run ./mvnw verify (Maven) or ./gradlew check (Gradle) to confirm all tests pass and coverage reaches 85%+ before closing. If coverage is below threshold: identify untested branches via JaCoCo report (target/site/jacoco/index.html), add missing test cases, re-run.

Reference Guide

Load detailed guidance based on context:

TopicReferenceLoad When
Spring Bootreferences/spring-boot-setup.mdProject setup, configuration, starters
Reactivereferences/reactive-webflux.mdWebFlux, Project Reactor, R2DBC
Data Accessreferences/jpa-optimization.mdJPA, Hibernate, query tuning
Securityreferences/spring-security.mdOAuth2, JWT, method security
Testingreferences/testing-patterns.mdJUnit 5, TestContainers, Mockito

Constraints

MUST DO

  • Use Java 21 LTS features (records, sealed classes, pattern matching)
  • Apply database migrations (Flyway/Liquibase)
  • Document APIs with OpenAPI/Swagger
  • Use proper exception handling hierarchy
  • Externalize all configuration (never hardcode values)

MUST NOT DO

  • Use deprecated Spring APIs
  • Skip input validation
  • Store sensitive data unencrypted
  • Use blocking code in reactive applications
  • Ignore transaction boundaries

Output Templates

When implementing Java features, provide:

  1. Domain models (entities, DTOs, records)
  2. Service layer (business logic, transactions)
  3. Repository interfaces (Spring Data)
  4. Controller/REST endpoints
  5. Test classes with comprehensive coverage
  6. Brief explanation of architectural decisions

Code Examples

Minimal WebFlux REST Endpoint

@RestController
@RequestMapping("/api/v1/orders")
@RequiredArgsConstructor
public class OrderController {

    private final OrderService orderService;

    @GetMapping("/{id}")
    public Mono<ResponseEntity<OrderDto>> getOrder(@PathVariable UUID id) {
        return orderService.findById(id)
                .map(ResponseEntity::ok)
                .defaultIfEmpty(ResponseEntity.notFound().build());
    }

    @PostMapping
    @ResponseStatus(HttpStatus.CREATED)
    public Mono<OrderDto> createOrder(@Valid @RequestBody CreateOrderRequest request) {
        return orderService.create(request);
    }
}

JPA Repository with Optimized Query

public interface OrderRepository extends JpaRepository<Order, UUID> {

    // Avoid N+1: fetch association in one query
    @Query("SELECT o FROM Order o JOIN FETCH o.items WHERE o.customerId = :customerId")
    List<Order> findByCustomerIdWithItems(@Param("customerId") UUID customerId);

    // Projection to limit fetched columns
    @Query("SELECT new com.example.dto.OrderSummary(o.id, o.status, o.total) FROM Order o WHERE o.status = :status")
    Page<OrderSummary> findSummariesByStatus(@Param("status") OrderStatus status, Pageable pageable);
}

Spring Security OAuth2 JWT Configuration

@Configuration
@EnableMethodSecurity
public class SecurityConfig {

    @Bean
    public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
        return http
                .csrf(AbstractHttpConfigurer::disable)
                .sessionManagement(s -> s.sessionCreationPolicy(STATELESS))
                .authorizeHttpRequests(auth -> auth
                        .requestMatchers("/actuator/health").permitAll()
                        .anyRequest().authenticated())
                .oauth2ResourceServer(oauth2 -> oauth2.jwt(Customizer.withDefaults()))
                .build();
    }
}

Knowledge Reference

Spring Boot 3.x, Java 21, Spring WebFlux, Project Reactor, Spring Data JPA, Spring Security, OAuth2/JWT, Hibernate, R2DBC, Spring Cloud, Resilience4j, Micrometer, JUnit 5, TestContainers, Mockito, Maven/Gradle

Documentation