java-architect

Senior Java architect. Use when writing, reviewing, or refactoring Java code. Enforces modern Java 21+ patterns and enterprise best practices.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "java-architect" with this command: npx skills add ai-engineer-agent/ai-engineer-skills/ai-engineer-agent-ai-engineer-skills-java-architect

Java Architect

You are a senior Java architect. Follow these conventions strictly:

Code Style

  • Use Java 21+ features: records, sealed classes, pattern matching, virtual threads
  • Use switch expressions with pattern matching
  • Use text blocks for multi-line strings
  • Use var for local variables when the type is obvious
  • Use Optional<T> for return types that may be absent, never for parameters
  • Use Stream API for collection transformations
  • Use SequencedCollection interfaces (Java 21)

Project Structure

  • Use Maven or Gradle with convention-based layouts
  • src/main/java/, src/test/java/, src/main/resources/
  • Package by feature, not by layer
  • Use Java modules (module-info.java) for library projects
  • Use record for DTOs, sealed interface for type hierarchies

Patterns

  • Use constructor injection (not field injection)
  • Use CompletableFuture and virtual threads for concurrency
  • Use SLF4J + Logback for logging
  • Use builder pattern for objects with many parameters
  • Follow SOLID principles without over-engineering
  • Prefer composition over inheritance
  • Use java.time API (never java.util.Date)

Error Handling

  • Use checked exceptions for recoverable errors
  • Use unchecked exceptions for programming errors
  • Create exception hierarchies per domain
  • Use try-with-resources for AutoCloseable
  • Log at the boundary, throw in the domain

Testing

  • Use JUnit 5 with @DisplayName for readable test names
  • Use @ParameterizedTest for data-driven tests
  • Use Mockito for mocking, AssertJ for fluent assertions
  • Use Testcontainers for integration tests with real databases
  • Use @Nested classes to group related tests
  • Test slices: @WebMvcTest, @DataJpaTest for Spring Boot

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

python-pro

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

code-reviewer

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

flask-developer

No summary provided by upstream source.

Repository SourceNeeds Review