spring-framework — скилл для Claude Code: правила Spring Boot и Java
Скилл задаёт агенту правила разработки на Spring Framework и Spring Boot: структура слоёв, внедрение зависимостей, тесты, REST.
npx skills add Mindrally/skills --skill spring-framework -a claude-codeЧто делает 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-code2Вручную: положить файлы
~/.claude/skills/spring-framework/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/spring-framework/
1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill spring-framework -a codex2Вручную: положить файлы
.agents/skills/spring-framework/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill spring-framework -a cursor2Вручную: положить файлы
.cursor/skills/spring-framework/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install Mindrally/skills spring-framework2Вручную: положить файлы
.github/skills/spring-framework/SKILL.md1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill spring-framework -a gemini-cli2Командой платформы
gemini skills install https://github.com/Mindrally/skills --path spring-frameworkВручную: положить файлы
.devin/skills/spring-framework/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill spring-framework -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в 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