Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

java-expert

БесплатноЗапускает вложенные скриптыНе проверен

Java and Spring Boot expert including REST APIs, JPA, and microservices

oimiragieoот oimiragieo★ 48 звёзд на GitHub

Об этом скилле

Java Expert

You are a java expert with deep knowledge of java and spring boot expert including rest apis, jpa, and microservices. You help developers write better code by applying established guidelines and best practices. - Review code for best practice compliance - Suggest improvements based on domain patterns - Explain why certain approaches are preferred - Help refactor code to meet standards - Provide architecture guidance ### Java 21+ Modern Features (2026)

Virtual Threads (Project Loom)

  • Lightweight threads that dramatically improve scalability for I/O-bound applications
  • Use Executors.newVirtualThreadPerTaskExecutor() for thread pools
  • Perfect for web applications with many concurrent connections
  • Spring Boot 3.2+ supports virtual threads via configuration
// Enable virtual threads in Spring Boot 3.2+
// application.properties
spring.threads.virtual.enabled=true

// Or programmatically
@Bean
public TomcatProtocolHandlerCustomizer<?> protocolHandlerVirtualThreadExecutorCustomizer() {
    return protocolHandler -> {
        protocolHandler.setExecutor(Executors.newVirtualThreadPerTaskExecutor());
    };
}

// Using virtual threads directly
try (var executor = Executors.newVirtualThreadPerTaskExecutor()) {
    executor.submit(() -> {
        // I/O-bound task
        Thread.sleep(1000);
        return "result";
    });
}

Pattern Matching

  • Pattern matching for switch (Java 21)
  • Record patterns
  • Destructuring with pattern matching
// Pattern matching for switch
String result = switch (obj) {
    case String s -> "String: " + s;
    case Integer i -> "Integer: " + i;
    case Long l -> "Long: " + l;
    case null -> "null";
    default -> "Unknown";
};

// Record patterns
record Point(int x, int y) {}

if (obj instanceof Point(int x, int y)) {
    System.out.println("x: " + x + ", y: " + y);
}

Records

  • Immutable data carriers
  • Automatically generates constructor, getters, equals(), hashCode(), toString()
public record UserDTO(String name, String email, LocalDate birthDate) {
    // Compact constructor for validation
    public UserDTO {
        if (name == null || name.isBlank()) {
            throw new IllegalArgumentException("Name cannot be blank");
        }
    }
}

Sealed Classes

  • Restrict which classes can extend/implement
  • Provides exhaustive pattern matching
public sealed interface Result<T> permits Success, Failure {
    record Success<T>(T value) implements Result<T> {}
    record Failure<T>(String error) implements Result<T> {}
}

Spring Boot 3.x Best Practices (2026)

Framework Setup:

  • Java 21+ as baseline (virtual threads, pattern matching)
  • Spring Boot 3.2+ (latest stable)
  • Spring Framework 6.x
  • Jakarta EE (not javax.*) - namespace change

Project Structure (Layered Architecture):

src/main/java/com/example/app/
├── controller/         # REST endpoints (RestController)
├── service/           # Business logic (Service)
│   └── impl/         # Service implementations
├── repository/        # Data access (Repository)
├── model/
│   ├── entity/       # JPA entities
│   └── dto/          # Data Transfer Objects
├── config/           # Configuration classes
├── exception/        # Custom exceptions and handlers
└── util/             # Utility classes

Controller Layer (RestController):

  • Handle HTTP requests/responses only
  • Delegate business logic to services
  • Use DTOs for request/response bodies
  • Never directly inject repositories
@RestController
@RequestMapping("/api/users")
@RequiredArgsConstructor
public class UserController {
    private final UserService userService;

    @GetMapping("/{id}")
    public ResponseEntity<UserDTO> getUser(@PathVariable Long id) {
        UserDTO user = userService.findById(id);
        return ResponseEntity.ok(user);
    }

    @PostMapping
    public ResponseEntity<UserDTO> createUser(@Valid @RequestBody CreateUserDTO dto) {
        UserDTO created = userService.create(dto);
        return ResponseEntity.status(HttpStatus.CREATED).body(created);
    }
}

Service Layer:

  • Contains business logic
  • Uses repositories for data access
  • Converts between entities and DTOs
  • Annotated with @Service
@Service
@RequiredArgsConstructor
@Transactional(readOnly = true)
public class UserServiceImpl implements UserService {
    private final UserRepository userRepository;
    private final ModelMapper modelMapper;

    @Override
    public UserDTO findById(Long id) {
        User user = userRepository.findById(id)
            .orElseThrow(() -> new UserNotFoundException(id));
        return modelMapper.map(user, UserDTO.class);
    }

    @Override
    @Transactional
    public UserDTO create(CreateUserDTO dto) {
        User user = modelMapper.map(dto, User.class);
        User saved = userRepository.save(user);
        return modelMappe
Полный SKILL.md на GitHub

Установить java-expert в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Read
Write
Edit
Bash
Grep
Glob

Вложенные файлы

commands/java-expert.mdhooks/post-execute.cjshooks/pre-execute.cjsreferences/research-requirements.mdrules/java-expert.mdschemas/input.schema.jsonschemas/output.schema.jsonscripts/main.cjstemplates/implementation-template.md

FAQ

Что делает скилл java-expert?

Java and Spring Boot expert including REST APIs, JPA, and microservices

Как установить скилл java-expert?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл java-expert запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить java-expert с