agentleFS
MindrallyMindrally/skills/spring-boot/SKILL.md

spring-boot

Skill275 starsChanged 35 days agoApache-2.0View on GitHub

Expert guidance for Spring Boot application development with best practices for RESTful APIs, testing, security, and deployment

10 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use logging-patterns and jpa-patterns.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • DIL8654Skill

    logging-patterns

    Keep logs structured, correlated, low-noise, and safe for production support. Use when adding operational logging, reviewing observability, or improving diagnostics in .NET services.

    Also in 3 projects that use this

  • mstuder-slalomSkill

    jpa-patterns

    JPA/Hibernate patterns for entity design, relationships, query optimization, transactions, auditing, indexing, pagination, and pooling in Spring Boot.

    Also in 3 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

24 rules. 0 are common, 23 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 9 edited versions we read keep these.

  • 23

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Write clean, efficient, and well-documented Java code using Spring Boot conventions

    line 15
  2. Distinctive:

    Follow RESTful API design patterns for web services

    line 16
  3. Distinctive:

    Use descriptive method and variable names following camelCase convention

    line 17
  4. Distinctive:

    Use auto-configuration effectively to minimize boilerplate

    line 23
  5. Distinctive:

    Use PascalCase for class names (e.g., UserController, OrderService)

    line 29
  6. Distinctive:

    Use camelCase for method and variable names (e.g., findUserById, isOrderValid)

    line 30
  7. Very specific:

    Use ALL_CAPS for constants (e.g., MAX_RETRY_ATTEMPTS, DEFAULT_PAGE_SIZE)

    line 31
  8. Distinctive:

    Use Java 17 or later features when applicable (e.g., records, sealed classes, pattern matching)

    line 35
  9. Distinctive:

    Use Spring Data JPA for database operations with proper entity relationships

    line 37
  10. Distinctive:

    Use @Value or @ConfigurationProperties for type-safe configuration injection

    line 43
  11. Distinctive:

    Prefer constructor injection over field injection for better testability

    line 48
  12. Distinctive:

    Use CDI annotations appropriately (@Autowired, @Qualifier)

    line 49
  13. Distinctive:

    Follow the principle of programming to interfaces

    line 50
  14. Distinctive:

    Write comprehensive unit tests using JUnit 5 and Spring Boot Test

    line 54
  15. Distinctive:

    Use MockMvc for testing REST endpoints and web layer components

    line 55
  16. Distinctive:

    Use @DataJpaTest for repository layer testing

    line 57
  17. Distinctive:

    Use @Async for asynchronous, non-blocking operations

    line 63
  18. Distinctive:

    Consider connection pooling with HikariCP

    line 65
  19. Distinctive:

    Use BCrypt for secure password encoding

    line 70
  20. Distinctive:

    Use SLF4J with Logback for structured logging

    line 76
  21. Distinctive:

    Use Springdoc OpenAPI for comprehensive API documentation

    line 83
  22. Distinctive:

    Use Maven or Gradle for dependency management and builds

    line 89
  23. Distinctive:

    Use environment variables for sensitive configuration

    line 92
  24. Distinctive:

    Follow RESTful API design principles with proper HTTP methods and status codes

    line 96

“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Spring Boot

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 using Spring Boot conventions
  • Follow RESTful API design patterns for web services
  • Use descriptive method and variable names following camelCase convention
  • Structure applications with consistent package organization (controllers, services, repositories, models, configurations)

Spring Boot Specifics

  • Leverage Spring Boot starters for rapid application development
  • Use auto-configuration effectively to minimize boilerplate
  • Implement proper annotations (@SpringBootApplication, @RestController, @Service, @Repository)
  • Handle exceptions globally 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 capabilities and features
  • Use Spring Data JPA for database operations with proper entity relationships
  • Implement Bean Validation using Jakarta Validation annotations

Configuration and Properties

  • Store configuration in application.properties or application.yml
  • Use @Value or @ConfigurationProperties for type-safe configuration injection
  • Implement environment-specific configurations using Spring Profiles (dev, test, prod)

Dependency Injection

  • Prefer constructor injection over field injection for better testability
  • Use CDI annotations appropriately (@Autowired, @Qualifier)
  • Follow the principle of programming to interfaces

Testing

  • Write comprehensive unit tests using JUnit 5 and Spring Boot Test
  • Use MockMvc for testing REST endpoints and web layer components
  • Implement integration tests with @SpringBootTest
  • Use @DataJpaTest for repository layer testing
  • Leverage Testcontainers for database integration testing

Performance and Scalability

  • Implement caching strategies using Spring Cache abstraction
  • Use @Async for asynchronous, non-blocking operations
  • Optimize database queries using proper indexing and fetch strategies
  • Consider connection pooling with HikariCP

Security

  • Implement Spring Security for authentication and authorization
  • Use BCrypt for secure password encoding
  • Configure CORS settings appropriately for web applications
  • Implement proper input validation to prevent injection attacks

Logging and Monitoring

  • Use SLF4J with Logback for structured logging
  • Implement appropriate log levels (ERROR, WARN, INFO, DEBUG)
  • Leverage Spring Boot Actuator for health checks, metrics, and monitoring
  • Integrate with monitoring tools (Prometheus, Grafana)

API Documentation

  • Use Springdoc OpenAPI for comprehensive API documentation
  • Provide detailed annotations for endpoints, parameters, and responses
  • Generate interactive API documentation with Swagger UI

Build and Deployment

  • Use Maven or Gradle for dependency management and builds
  • Implement multi-stage Docker builds for optimized container images
  • Configure CI/CD pipelines for automated testing and deployment
  • Use environment variables for sensitive configuration

General Best Practices

  • Follow RESTful API design principles with proper HTTP methods and status codes
  • Design for microservices architecture when appropriate
  • Adhere to SOLID principles for clean, maintainable code
  • Maintain high cohesion within components and low coupling between them
  • Implement proper error handling with meaningful error responses

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

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.