spring-boot-conventions

Enforce Spring Boot three-layer architecture and standardized package layout.

1|3|Updated Mar 4, 2026
One-click install
npx skills add https://github.com/rizwan2004cs/AI-Donor-Matcher-Backend --skill spring-boot-conventions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spring-boot-conventions
Source: https://github.com/rizwan2004cs/AI-Donor-Matcher-Backend/tree/main/docs/skills/spring-boot-conventions
Command: npx skills add https://github.com/rizwan2004cs/AI-Donor-Matcher-Backend --skill spring-boot-conventions

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Inconsistent backend coding patterns across the Spring Boot project lead to maintainability challenges and team friction. This guide defines standard architecture, package structure, and class patterns to keep the codebase predictable and easier to onboard.

Core Features & Use Cases

  • Enforces a three-layer architecture: Controller → Service → Repository.
  • Standardizes package layout: config/, controller/, dto/, entity/, enums/, repository/, service/.
  • Promotes specific class patterns: Entities with Lombok, Enums as STRING, DTOs as Java records, and repositories with clear query methods.
  • Provides guidelines for DTOs, repositories, services, and controllers to avoid common anti-patterns and drift.

Quick Start

Start by structuring any new Java class to the com.aidonormatcher.backend layout and applying the three-layer pattern.

Frequently Asked Questions about spring-boot-conventions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce a consistent Spring Boot backend architecture across my team?

To enforce consistent Spring Boot backend architecture, apply a standardized three-layer pattern—Controller, Service, and Repository—across your codebase. This approach prevents pattern drift and ensures new code follows predictable structural guidelines.

What is the standard package layout for a Spring Boot backend project?

The standard package layout for a Spring Boot backend separates classes into specific directories: config, controller, dto, entity, enums, repository, and service. This structure keeps related classes grouped logically and makes the codebase easier to navigate.

Should I use Java records for DTOs in Spring Boot applications?

Yes, you should use Java records for DTOs in Spring Boot applications. Defining DTOs as records provides immutability and reduces boilerplate code, aligning with modern coding conventions to standardize data transfer structures.

How do you structure JPA entities and enums in a Spring Boot codebase?

Structure JPA entities in a Spring Boot codebase by applying proper Lombok annotations for boilerplate reduction and mapping database columns accurately. Enums should be persisted as STRING values to ensure readability and database compatibility.

What is the best way to review Spring Boot controllers and services for anti-patterns?

The best way to review Spring Boot controllers and services for anti-patterns is checking them against prescribed class guidelines. Ensure controllers only handle HTTP requests and services contain business logic, avoiding common structural drift.

Can I apply Spring Boot coding conventions during code refactoring?

Yes, you can apply Spring Boot coding conventions during code refactoring. Use the defined architectural patterns to guide the restructuring of existing controllers, services, repositories, DTOs, and entities into the standardized three-layer layout.