Skills may execute instructions and code that could affect your environment. Marketplace scans reduce risk but do not guarantee safety. Always review files, run your own security checks, and use at your own risk.
Java Architect
Security Scan Summary
Status: Safe
Source: Syntic Skills registry
Automated security scan completed with no high-risk patterns detected. Manual review is still required.
About This Skill
Use when architecting enterprise Java applications with Spring Boot 3+, Spring Data JPA, security, microservices, and reactive patterns.
Downloadable SKILL.md
Download SKILL.md and place it in your Syntic skills folder. For Syntic Code, install in your local skills directory, review contents, and run in a controlled environment first. Acknowledge the risk notice above to enable the download.
---
name: Java Architect
description: Use when architecting enterprise Java applications with Spring Boot 3+, Spring Data JPA, security, microservices, and reactive patterns.
category: Languages
version: 1.0.0
tools: []
---
# Design Enterprise Java Applications
Build resilient applications using Spring Boot 3+, Spring Data JPA, and Java 21+ features. Prioritize enterprise robustness and clean code, avoiding over-engineering while maintaining strict type safety.
## Core Principles
- Use Java 21+ idioms: records for DTOs, sealed interfaces, pattern matching, virtual threads for concurrent I/O.
- Spring Boot auto-configuration is tested for production. Override beans only when justified.
- Enforce layered architecture: Controller → Service → Repository. No shortcuts.
- Default to immutability: `record` types, `List.of()`, `final` fields.
## Project Structure
Organize with:
- `config/` — @Configuration classes, security, CORS
- `controller/` — @RestController, request/response DTOs
- `service/` — @Service, business logic, @Transactional
- `repository/` — Spring Data JPA interfaces
- `model/entity/` — @Entity JPA classes
- `model/dto/` — Record-based DTOs
- `model/mapper/` — MapStruct mappers
- `exception/` — Custom exceptions, @ControllerAdvice handler
- `event/` — Application events, listeners
## Spring Data JPA
- Extend `JpaRepository<T, ID>` for repositories. Use derived query methods for simple cases.
- Use `@Query` (JPQL) for complex queries. Use native queries only when JPQL is insufficient.
- Solve N+1 problems with `@EntityGraph(attributePaths = {"orders", "orders.items"})`.
- Use `Specification<T>` for dynamic, type-safe query building.
- Set `spring.jpa.open-in-view=false` to prevent lazy loading outside transactions and catch performance issues early.
- Use Flyway or Liquibase for schema migrations. Never use `spring.jpa.hibernate.ddl-auto=update` in production.
## REST API Design
- Expose record-based DTOs, not JPA entities, in API responses.
- Validate input with Jakarta Bean Validation: `@NotBlank`, `@Email`, `@Size`, `@Valid` on request bodies.
- Use `@ControllerAdvice` + `@ExceptionHandler` for centralized error handling returning `ProblemDetail` (RFC 7807).
- Return `ResponseEntity<T>` for explicit HTTP status codes.
## Security
- Use Spring Security 6+ with `SecurityFilterChain` beans. `WebSecurityConfigurerAdapter` is removed.
- Apply `@PreAuthorize("hasRole('ADMIN')")` for method-level access control. Define custom expressions in a `MethodSecurityExpressionHandler`.
- Implement JWT authentication with OAuth2 resource server. Validate tokens against the issuer's JWKS endpoint.
- Hash passwords with `BCryptPasswordEncoder` using strength 12+.
## Concurrency & Virtual Threads
- Enable virtual threads with `spring.threads.virtual.enabled=true` (Spring Boot 3.2+).
- Virtual threads handle blocking I/O efficiently for database calls, HTTP clients, and file I/O.
- Avoid `synchronized` blocks. Use `ReentrantLock` to prevent thread pinning with virtual threads.
- Use `CompletableFuture` for parallel independent operations. Use `StructuredTaskScope` for structured concurrency.
## Testing
- Use `@SpringBootTest` for integration tests; `@WebMvcTest` for controller tests with mocked services.
- Use `@DataJpaTest` with Testcontainers for repository tests against a real PostgreSQL instance.
- Use Mockito for unit testing services in isolation.
- Use `MockMvc` with `jsonPath` assertions for REST endpoint verification.
- Write tests with Given-When-Then structure and descriptive `@DisplayName` annotations.
## Verification
- Compile and test: `./mvnw verify` or `./gradlew build`.
- Run static analysis: SpotBugs checks and SonarQube analysis for code quality.
- Verify no circular dependencies with ArchUnit.
- Ensure `application.yml` has separate profiles for `dev`, `test`, and `prod`.
Bundle Download
Includes SKILL.md and bundled support files where provided. Risk acknowledgement is required.
Install Targets
Syntic App
- 1. Create a dedicated folder for this skill in your local skills library.
- 2. Place SKILL.md into that folder.
- 3. Restart Syntic and invoke this skill on matching tasks.
Syntic Code (CLI)
- 1. Save SKILL.md in your local Syntic Code skills directory.
- 2. Keep related files in the same skill folder.
- 3. Run in a safe environment and validate outputs.
Source
https://github.com/rohitg00/awesome-claude-code-toolkit/blob/main/agents/language-experts/java-architect.md
Open Source LinkRelated Skills
Angular Architect
Use when building enterprise applications with Angular 17+, signals, standalone components, RxJS, and NgRx...
LanguagesClojure Developer
Use when building data-oriented systems with Clojure, REPL-driven development, persistent data structures...
LanguagesCsharp Developer
Use when building applications on .NET 8+ with ASP.NET Core, Entity Framework Core, minimal APIs, and async...
LanguagesDjango Developer
Use when building applications with Django 5+ and Django REST Framework, including ORM optimization...