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

spring-boot

Skill266 starsChanged 10 months 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, jpa-patterns and 2 more.

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

  • FaisalAlqarniSkill

    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

  • ratacatSkill

    design-patterns

    Use when designing software architecture, refactoring code structure, solving recurring design problems, or when code exhibits symptoms like tight coupling, rigid hierarchies, scattered responsibilities, or difficult-to-test components. Also use when choosing between architectural approaches or reviewing code for structural improvements.

    Also in 3 projects that use this

  • MicrosoftSkill

    code-quality

    Statically check changed C# against the same deterministic rules github-code-quality[bot] runs on pull requests, so a contributor can fix likely findings before opening the PR and keep the bot's inline comments to a minimum. Activate when a contributor asks to "check code quality", "run code quality on my changes", "will the code quality bot complain", "pre-check before I open the PR", "code quality check", or similar. Scoped to C#. Reads the diff and compares it against the enumerated csharp-code-quality rule set below — no CodeQL download or build required. This is a fast approximation of a dataflow engine, not a reproduction; report accordingly. Does NOT apply fixes unless explicitly asked.

    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 8 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 12
  2. Distinctive:

    Follow RESTful API design patterns for web services

    line 13
  3. Distinctive:

    Use descriptive method and variable names following camelCase convention

    line 14
  4. Distinctive:

    Use auto-configuration effectively to minimize boilerplate

    line 20
  5. Distinctive:

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

    line 26
  6. Distinctive:

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

    line 27
  7. Very specific:

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

    line 28
  8. Distinctive:

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

    line 32
  9. Distinctive:

    Use Spring Data JPA for database operations with proper entity relationships

    line 34
  10. Distinctive:

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

    line 40
  11. Distinctive:

    Prefer constructor injection over field injection for better testability

    line 45
  12. Distinctive:

    Use CDI annotations appropriately (@Autowired, @Qualifier)

    line 46
  13. Distinctive:

    Follow the principle of programming to interfaces

    line 47
  14. Distinctive:

    Write comprehensive unit tests using JUnit 5 and Spring Boot Test

    line 51
  15. Distinctive:

    Use MockMvc for testing REST endpoints and web layer components

    line 52
  16. Distinctive:

    Use @DataJpaTest for repository layer testing

    line 54
  17. Distinctive:

    Use @Async for asynchronous, non-blocking operations

    line 60
  18. Distinctive:

    Consider connection pooling with HikariCP

    line 62
  19. Distinctive:

    Use BCrypt for secure password encoding

    line 67
  20. Distinctive:

    Use SLF4J with Logback for structured logging

    line 73
  21. Distinctive:

    Use Springdoc OpenAPI for comprehensive API documentation

    line 80
  22. Distinctive:

    Use Maven or Gradle for dependency management and builds

    line 86
  23. Distinctive:

    Use environment variables for sensitive configuration

    line 89
  24. Distinctive:

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

    line 93

“Common” is measured: kept by at least 6 in 10 of the 8 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.