spring-boot-project-structure

Scaffolds and audits Spring Boot project layout, @Configuration classes, and profile strategy.

1|Updated Jan 18, 2016
One-click install
npx skills add https://github.com/sklintyg/rehabstod --skill spring-boot-project-structure-sklintyg
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: spring-boot-project-structure
Source: https://github.com/sklintyg/rehabstod/tree/main/.github/skills/spring-boot-project-structure
Command: npx skills add https://github.com/sklintyg/rehabstod --skill spring-boot-project-structure-sklintyg

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Spring Boot projects often grow into disorganized codebases with monolithic @Configuration classes, scattered property injection, inconsistent profile usage, and modules that cannot be tested in isolation. This Skill provides concrete patterns and workflows to scaffold, audit, or restructure a Spring Boot application into a maintainable, Kubernetes-ready multi-module layout. ## Core Features & Use Cases - Project Scaffolding: Generate a multi-module Gradle structure with app, integration, persistence, and web modules following package-by-concern conventions. - Configuration Auditing: Map all @Configuration classes, detect field injection, mixed concerns, misplaced profiles, and modules lacking their own @ConfigurationProperties records. - Profile & Deployment Strategy: Establish a clean profile model (dev, stubs, testability) with layered configuration from application.yml through Kubernetes ConfigMaps and Secrets. - Use Case: A team inheriting a service with one 500-line configuration class can use this Skill to split it into per-concern classes, extract module-scoped property records, and verify wiring with the test suite after each step. ## Quick Start Ask the AI to audit this repository's Spring @Configuration classes and recommend a restructured multi-module layout following production-grade patterns.

Frequently Asked Questions about spring-boot-project-structure

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

FAQPage Schema
How do I structure a multi-module Spring Boot project with Gradle?▼

Create an app module owning startup and application.yml, plus separate integration, persistence, and web modules. Each module with beans contains its own @Configuration classes and @ConfigurationProperties record, registered in settings.gradle and covered by the main class's scanBasePackages.

How should Spring Boot @Configuration classes be organized?▼

Place all @Configuration classes under an infrastructure/config package with one class per concern such as TLS, caching, or a specific REST client. Use constructor injection via Lombok @RequiredArgsConstructor and keep property records in a dedicated properties subpackage.

Should integration modules have their own @ConfigurationProperties?▼

Yes. Each integration module defines its own record bound to a subtree of the root app.* hierarchy and enables it with @EnableConfigurationProperties. This keeps modules self-contained and independently testable without importing the root AppProperties.

What is the recommended Spring profile strategy for production deployments?▼

Treat production as the default with no prod profile. Use dev for local development, stub profiles for integration testing, and negative profiles like @Profile("!dev") to disable expensive infrastructure locally. Production values come from Kubernetes ConfigMaps or Secrets.

Why does @PropertySource not work with YAML test files?▼

@PropertySource only supports the .properties format, not YAML. Test configurations must use a .properties file containing all required app.* keys, combined with @EnableConfigurationProperties to bind the records under test.