java-springboot
Skill2 starsChanged 3 months agoMITView on GitHub
Get best practices for developing applications with Spring Boot.
We split this skill into the rules it gives an agent
21 rules. About 0 are common, 9 are distinctive, and 12 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
12
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 12
Build Tool: Use Maven (pom.xml) or Gradle (build.gradle) for dependency management.
- Very specific: line 13
Starters: Use Spring Boot starters (e.g., spring-boot-starter-web, spring-boot-starter-data-jpa) to simplify dependency management.
- Distinctive: line 18
Constructor Injection: Always use constructor-based injection for required dependencies.
- Very specific: line 20
Component Stereotypes: Use @Component, @Service, @Repository, and @Controller/@RestController annotations appropriately to define beans.
- Very specific: line 24
Externalized Configuration: Use application.yml (or application.properties) for configuration.
- Very specific: line 25
Type-Safe Properties: Use @ConfigurationProperties to bind configuration to strongly-typed Java objects.
- Very specific: line 26
Profiles: Use Spring Profiles (application-dev.yml, application-prod.yml) to manage environment-specific configurations.
- Distinctive: line 27
Secrets Management: Do not hardcode secrets. Use environment variables, or a dedicated secret management tool like HashiCorp Vault or AWS …
- Distinctive: line 32
DTOs (Data Transfer Objects): Use DTOs to expose and consume data in the API layer.
- Very specific: line 33
Validation: Use Java Bean Validation (JSR 380) with annotations (@Valid, @NotNull, @Size) on DTOs to validate request payloads.
- Very specific: line 40
Transaction Management: Use @Transactional on service methods to manage database transactions declaratively.
- Very specific: line 44
Spring Data JPA: Use Spring Data JPA repositories by extending JpaRepository or CrudRepository for standard database operations.
- Distinctive: line 46
Projections: Use DTO projections to fetch only the necessary data from the database.
- Distinctive: line 50
SLF4J: Use the SLF4J API for logging.
- Very specific: line 52
Parameterized Logging: Use parameterized messages (logger.info("Processing user {}...", userId);) instead of string concatenation to …
- Distinctive: line 56
Unit Tests: Write unit tests for services and components using JUnit 5 and a mocking framework like Mockito.
- Very specific: line 57
Integration Tests: Use @SpringBootTest for integration tests that load the Spring application context.
- Very specific: line 58
Test Slices: Use test slice annotations like @WebMvcTest (for controllers) or @DataJpaTest (for repositories) to test specific parts of the …
- Distinctive: line 59
Testcontainers: Consider using Testcontainers for reliable integration tests with real databases, message brokers, etc.
- Distinctive: line 63
Spring Security: Use Spring Security for authentication and authorization.
- Distinctive: line 64
Password Encoding: Always encode passwords using a strong hashing algorithm like BCrypt.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Spring Boot Best Practices
Your goal is to help me write high-quality Spring Boot applications by following established best practices.
Project Setup & Structure
- Build Tool: Use Maven (
pom.xml) or Gradle (build.gradle) for dependency management. - Starters: Use Spring Boot starters (e.g.,
spring-boot-starter-web,spring-boot-starter-data-jpa) to simplify dependency management. - Package Structure: Organize code by feature/domain (e.g.,
com.example.app.order,com.example.app.user) rather than by layer (e.g.,com.example.app.controller,com.example.app.service).
Dependency Injection & Components
- Constructor Injection: Always use constructor-based injection for required dependencies. This makes components easier to test and dependencies explicit.
- Immutability: Declare dependency fields as
private final. - Component Stereotypes: Use
@Component,@Service,@Repository, and@Controller/@RestControllerannotations appropriately to define beans.
Configuration
- Externalized Configuration: Use
application.yml(orapplication.properties) for configuration. YAML is often preferred for its readability and hierarchical structure. - Type-Safe Properties: Use
@ConfigurationPropertiesto bind configuration to strongly-typed Java objects. - Profiles: Use Spring Profiles (
application-dev.yml,application-prod.yml) to manage environment-specific configurations. - Secrets Management: Do not hardcode secrets. Use environment variables, or a dedicated secret management tool like HashiCorp Vault or AWS Secrets Manager.
Web Layer (Controllers)
- RESTful APIs: Design clear and consistent RESTful endpoints.
- DTOs (Data Transfer Objects): Use DTOs to expose and consume data in the API layer. Do not expose JPA entities directly to the client.
- Validation: Use Java Bean Validation (JSR 380) with annotations (
@Valid,@NotNull,@Size) on DTOs to validate request payloads. - Error Handling: Implement a global exception handler using
@ControllerAdviceand@ExceptionHandlerto provide consistent error responses.
Service Layer
- Business Logic: Encapsulate all business logic within
@Serviceclasses. - Statelessness: Services should be stateless.
- Transaction Management: Use
@Transactionalon service methods to manage database transactions declaratively. Apply it at the most granular level necessary.
Data Layer (Repositories)
- Spring Data JPA: Use Spring Data JPA repositories by extending
JpaRepositoryorCrudRepositoryfor standard database operations. - Custom Queries: For complex queries, use
@Queryor the JPA Criteria API. - Projections: Use DTO projections to fetch only the necessary data from the database.
Logging
- SLF4J: Use the SLF4J API for logging.
- Logger Declaration:
private static final Logger logger = LoggerFactory.getLogger(MyClass.class); - Parameterized Logging: Use parameterized messages (
logger.info("Processing user {}...", userId);) instead of string concatenation to improve performance.
Testing
- Unit Tests: Write unit tests for services and components using JUnit 5 and a mocking framework like Mockito.
- Integration Tests: Use
@SpringBootTestfor integration tests that load the Spring application context. - Test Slices: Use test slice annotations like
@WebMvcTest(for controllers) or@DataJpaTest(for repositories) to test specific parts of the application in isolation. - Testcontainers: Consider using Testcontainers for reliable integration tests with real databases, message brokers, etc.
Security
- Spring Security: Use Spring Security for authentication and authorization.
- Password Encoding: Always encode passwords using a strong hashing algorithm like BCrypt.
- Input Sanitization: Prevent SQL injection by using Spring Data JPA or parameterized queries. Prevent Cross-Site Scripting (XSS) by properly encoding output.
Trending
Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data
Other versions5 projects use a version of this.
Word for word · 3
- github/awesome-copilot★ 41k100% same
- LucasMatuszewski/claude-code-course-jsystems-2026-07★ 0100% same
- xpppppppppp/agent-skills★ 0100% same
Edited · 0
None found.
Wrote their own version · 2
- vekzz-dev/opencode-skills★ 4same name
- robiparvez/claude-code-guidelines★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository383 other files it gives its agents.
- 37signals-waySkill
- ab-test-analysisSkill
- advisor-orchestrator-workerSkill
- ai-ml-engineeringSkill
- algorithmic-artSkill
- analyze-feature-requestsSkill
- animation-vocabularySkill
- apple-designSkill
- emil-design-engSkill
- find-animation-opportunitiesSkill
- improve-animationsSkill
- pick-ui-librarySkill
- prototypeSkill
- review-animationsSkill
- ansoff-matrixSkill
- api-and-interface-designSkill
- api-design-best-practicesSkill
- app-store-changelogSkill
- auth-authorizationSkill
- beachhead-segmentSkill
- blue-ocean-strategySkill
- brainstorm-experiments-existingSkill
- brainstorm-experiments-newSkill
- brainstorm-ideas-existingSkill
- brainstorm-ideas-newSkill
- brainstorm-okrsSkill
- brand-guidelinesSkill
- browser-testing-with-devtoolsSkill
- bug-hunt-swarmSkill
- business-modelSkill
- canvas-designSkill
- ci-cd-and-automationSkill
- claude-apiSkill
- clean-architectureSkill
- clean-codeSkill
- cli-creatorSkill
- code-review-and-qualitySkill
- code-review-skillSkill
- code-simplificationSkill
- cohort-analysisSkill
- cold-start-problemSkill
- commit-archaeologistSkill
- competitive-battlecardSkill
- competitor-analysisSkill
- contagiousSkill
- context-engineeringSkill
- continuous-discoverySkill
- architecture-blueprint-generatorSkill
- azure-architecture-autopilotSkill
- cli-masterySkill
- codeqlSkill
- conventional-commitSkill
- create-implementation-planSkill
- csharp-asyncSkill
- diagnoseSkill
- dotnet-best-practicesSkill
- draw-io-diagram-generatorSkill
- git-commitSkill
- github-actions-efficiencySkill
- mcp-cliSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

