{"kind":"AgentDefinition","metadata":{"namespace":"community","name":"springboot","version":"0.1.0"},"spec":{"agents_md":"---\ndescription: 'Guidelines for building Spring Boot base applications'\napplyTo: '**/*.java, **/*.kt'\n---\n\n# Spring Boot Development\n\n## General Instructions\n\n- Make only high confidence suggestions when reviewing code changes.\n- Write code with good maintainability practices, including comments on why certain design decisions were made.\n- Handle edge cases and write clear exception handling.\n- For libraries or external dependencies, mention their usage and purpose in comments.\n\n## Spring Boot Instructions\n\n### Dependency Injection\n\n- Use constructor injection for all required dependencies.\n- Declare dependency fields as `private final`.\n\n### Configuration\n\n- Use YAML files (`application.yml`) for externalized configuration.\n- Environment Profiles: Use Spring profiles for different environments (dev, test, prod)\n- Configuration Properties: Use @ConfigurationProperties for type-safe configuration binding\n- Secrets Management: Externalize secrets using environment variables or secret management systems\n\n### Code Organization\n\n- Package Structure: Organize by feature/domain rather than by layer\n- Separation of Concerns: Keep controllers thin, services focused, and repositories simple\n- Utility Classes: Make utility classes final with private constructors\n\n### Service Layer\n\n- Place business logic in `@Service`-annotated classes.\n- Services should be stateless and testable.\n- Inject repositories via the constructor.\n- Service method signatures should use domain IDs or DTOs, not expose repository entities directly unless necessary.\n\n### Logging\n\n- Use SLF4J for all logging (`private static final Logger logger = LoggerFactory.getLogger(MyClass.class);`).\n- Do not use concrete implementations (Logback, Log4j2) or `System.out.println()` directly.\n- Use parameterized logging: `logger.info(\"User {} logged in\", userId);`.\n\n### Security \u0026 Input Handling\n\n- Use parameterized queries | Always use Spring Data JPA or `NamedParameterJdbcTemplate` to prevent SQL injection.\n- Validate request bodies and parameters using JSR-380 (`@NotNull`, `@Size`, etc.) annotations and `BindingResult`\n\n## Build and Verification\n\n- After adding or modifying code, verify the project continues to build successfully.\n- If the project uses Maven, run `mvn clean package`.\n- If the project uses Gradle, run `./gradlew build` (or `gradlew.bat build` on Windows).\n- Ensure all tests pass as part of the build.\n\n## Useful Commands\n\n| Gradle Command            | Maven Command                     | Description                                   |\n|:--------------------------|:----------------------------------|:----------------------------------------------|\n| `./gradlew bootRun`       |`./mvnw spring-boot:run`           | Run the application.                          |\n| `./gradlew build`         |`./mvnw package`                   | Build the application.                        |\n| `./gradlew test`          |`./mvnw test`                      | Run tests.                                    |\n| `./gradlew bootJar`       |`./mvnw spring-boot:repackage`     | Package the application as a JAR.             |\n| `./gradlew bootBuildImage`|`./mvnw spring-boot:build-image`   | Package the application as a container image. |\n","description":"Guidelines for building Spring Boot base applications","import":{"commit_sha":"541b7819d8c3545c6df122491af4fa1eae415779","imported_at":"2026-05-18T20:05:35Z","license_text":"MIT License\n\nCopyright GitHub, Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","owner":"github","repo":"github/awesome-copilot","source_url":"https://github.com/github/awesome-copilot/blob/541b7819d8c3545c6df122491af4fa1eae415779/instructions/springboot.instructions.md"},"manifest":{}},"content_hash":[184,189,192,160,186,56,136,44,111,77,242,143,5,194,6,41,31,135,218,100,198,61,96,251,252,120,244,92,223,159,198,123],"trust_level":"unsigned","yanked":false}
