К основному содержанию
скилл CX Codex

spring-framework — скилл для Claude Code: правила Spring Boot и Java

Скилл задаёт агенту правила разработки на Spring Framework и Spring Boot: структура слоёв, внедрение зависимостей, тесты, REST.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add Mindrally/skills --skill spring-framework -a claude-code
Открыть на GitHub

Что делает spring-framework

Скилл превращает ассистента в справочник по Spring Boot и Java. Внутри — набор инструкций: как раскладывать код по контроллерам, сервисам, репозиториям и конфигурациям, какие аннотации использовать (@SpringBootApplication, @RestController, @Service), как обрабатывать исключения через @ControllerAdvice и @ExceptionHandler.

Отдельные блоки посвящены внедрению зависимостей и тестам. Скилл советует конструкторную инъекцию вместо полей, JUnit 5 с MockMvc для веб-слоя, @SpringBootTest для интеграционных тестов и @DataJpaTest для репозиториев. Ещё есть разделы про кэш, @Async, Spring Security с BCrypt, логирование через SLF4J с Logback, Actuator и документацию Springdoc OpenAPI.

В инструкциях прямо указаны Java 17 или новее и Spring Boot 3.x — на более старых версиях часть советов про records и pattern matching не сработает. Сборка описана через Maven или Gradle, конфигурация — через application.properties или application.yml и профили.

Какие задачи решает

  • разложить код по контроллерам, сервисам и репозиториям
  • перевести проект с field injection на конструкторную инъекцию
  • написать тесты веб-слоя через MockMvc
  • настроить обработку исключений в одном месте
  • подключить Springdoc OpenAPI к эндпоинтам

Примеры запросов агенту

  • Создай REST-контроллер для заказов по правилам скилла spring-framework
  • Перепиши этот сервис на конструкторную инъекцию
  • Добавь @ControllerAdvice для обработки ошибок валидации

Как установить spring-framework

1Через Skills CLI (Vercel)

npx skills add Mindrally/skills --skill spring-framework -a claude-code

2Вручную: положить файлы

~/.claude/skills/spring-framework/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/spring-framework/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о spring-framework

Как установить spring-framework в Claude?

Выполните npx skills add Mindrally/skills --skill spring-framework -a claude-code. После этого файл скилла лежит в ~/.claude/skills/spring-framework/SKILL.md.

Что делает spring-framework?

Даёт агенту правила разработки на Spring Boot: именование, структуру приложения, внедрение зависимостей, тестирование, безопасность и документацию API.

Какие версии Java и Spring Boot нужны?

Скилл рассчитан на Java 17 или новее и Spring Boot 3.x. На старых версиях советы про records и pattern matching неприменимы.

Исходный текст

SKILL.md · Apache-2.0
---
name: spring-framework
description: Expert guidance for Spring Framework and Spring Boot development with Java best practices, dependency injection, and RESTful API design
metadata:
  maintainer: Mindrally
  source: https://github.com/Mindrally/skills
---

# Spring Framework

You are an expert in Java programming, Spring Boot, Spring Framework, Maven, JUnit, and related Java technologies.

## Code Style and Structure

- Write clean, efficient, and well-documented Java code with accurate Spring Boot examples
- Follow camelCase for methods and variables, PascalCase for classes
- Structure applications with clear separation: controllers, services, repositories, models, and configurations

## Spring Boot Specifics

- Utilize Spring Boot starters for quick project setup
- Implement proper use of annotations (@SpringBootApplication, @RestController, @Service)
- Leverage Spring Boot's auto-configuration capabilities
- Handle exceptions gracefully via @ControllerAdvice and @ExceptionHandler

## Naming Conventions

- Use PascalCase for class names (e.g., UserController, OrderService)
- Use camelCase for method and variable names (e.g., findUserById, isOrderValid)
- Use ALL_CAPS for constants (e.g., MAX_RETRY_ATTEMPTS, DEFAULT_PAGE_SIZE)

## Java and Spring Boot Usage

- Use Java 17 or later features when applicable (e.g., records, sealed classes, pattern matching)
- Leverage Spring Boot 3.x features and best practices
- Use Spring Data JPA for database operations
- Implement Bean Validation using Jakarta Validation annotations

## Dependency Injection

- Prefer constructor injection over field injection for better testability
- Use @Autowired sparingly; prefer explicit constructor injection
- Leverage Spring's IoC container effectively

## Testing

- Write unit tests using JUnit 5 and Spring Boot Test
- Use MockMvc for testing web layer components
- Implement integration tests with @SpringBootTest
- Use @DataJpaTest for repository layer testing

## Performance and Scalability

- Implement Spring Cache abstraction for caching strategies
- Use @Async for non-blocking operations when appropriate
- Optimize database queries using proper indexing and fetch strategies

## Security

- Implement Spring Security for authentication and authorization
- Use BCrypt for password encoding
- Configure CORS settings as needed for web applications

## Logging and Monitoring

- Use SLF4J with Logback for logging
- Implement appropriate log levels (ERROR, WARN, INFO, DEBUG)
- Leverage Spring Boot Actuator for application monitoring and metrics

## API Documentation

- Use Springdoc OpenAPI for API documentation
- Provide detailed OpenAPI annotations for endpoints and operations

## Configuration Management

- Use application.properties or application.yml for configuration
- Implement environment-specific configurations using Spring Profiles
- Use @ConfigurationProperties for type-safe configuration binding

## Build and Deployment

- Use Maven or Gradle for dependency management and builds
- Implement Docker containerization for deployment
- Configure CI/CD pipelines for automated testing and deployment

## General Best Practices

- Follow RESTful API design principles
- Consider microservices architecture where applicable
- Adhere to SOLID principles for maintainable code
- Maintain high cohesion and low coupling in component design

© Mindrally · Apache-2.0 · Mindrally/skills

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

Всё по теме «Бэкенд и API» →
spring-boot Claude MPM Team Скилл по Spring Boot 3.x: подсказывает агенту, как устроены авто-конфигурация, внедрение зависимостей, REST-контроллеры и Actuator. Пригодится, когда пишете Java-сервис. CX Codex +1 309установок unit-test-caching giuseppe-trisciuoglio Паттерны юнит-тестов для аннотаций Spring Cache: проверка попаданий в кэш, вытеснения и ключей SpEL без поднятия полного контекста Spring. CX Codex +1 3 700установок 302-frameworks-spring-boot-rest Juan Antonio Breña Moral Скилл для проектирования и разбора REST API на Spring Boot: методы, коды ответов, DTO, версионирование, пагинация, ошибки по RFC 7807. CX Codex +1 392установок 303-frameworks-spring-boot-validation Juan Antonio Breña Moral Скилл для ИИ-агента, который наводит порядок в валидации Spring Boot: Bean Validation на DTO, @Valid на границах API, группы ограничений и единый формат ошибок 400. CX Codex +1 303установок java-mcp-server-generator официальный github Скилл создаёт Java MCP-сервер или Spring Boot-проект для подключения кода, API и баз данных к AI-агентам. Пригодится для заготовки проекта с тестами. 8 800установок unit-test-application-events giuseppe-trisciuoglio Паттерны юнит-тестов для событий Spring: проверка публикации через ApplicationEventPublisher и работа @EventListener без поднятия контекста. CX Codex +1 3 700установок

Из того же набора168

ethereum Задаёт агенту правила разработки смарт-контрактов Ethereum: паттерны безопасности, интеграция OpenZeppelin, тесты на Hardhat. CX Codex +1 737установок devops Задаёт агенту роль старшего DevOps-инженера: правила для Kubernetes, CI/CD, Bash, Ansible и Python. Пригодится, когда инфраструктуру пишут вместе с моделью. CX Codex +1 739установок anime-js Скилл задаёт агенту правила работы с Anime.js: таймлайны, stagger, SVG-морфинг и производительность. Пригодится, когда анимации в проекте пишет ИИ. CX Codex +1 736установок ruby Задаёт агенту стиль кода, возможности Ruby 3.x и правила тестирования на RSpec. Пригодится, когда пишете или правите Ruby-проект. CX Codex +1 734установок anthropic-claude-development Скилл для работы с Anthropic Claude API: Messages API, вызов инструментов, промпт-инжиниринг и сборка приложений на моделях Claude. CX Codex +1 728установок sanity Скилл для работы с Sanity CMS: помогает описывать схемы документов, писать GROQ-запросы и связывать контент с TypeScript. CX Codex +1 725установок llm Скилл задаёт агенту правила работы с большими языковыми моделями: архитектура, файнтюнинг, обучение и деплой. Пригодится, когда проект крутится вокруг трансформеров. CX Codex +1 724установок dotnet Задаёт агенту правила C#, ASP.NET Core и Entity Framework Core: структура проекта, async/await, DI, кэш, тесты. CX Codex +1 724установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой