platform-context-exporter / rules
Cursor rule48 starsChanged 18 months agoMITView on GitHub
Spring Boot development guidelines
In this repository14 other files it gives its agents.
- .cursor/rules/111-java-object-oriented-design.mdcCursor rule
- .cursor/rules/112-java-type-design.mdcCursor rule
- .cursor/rules/113-java-general-guidelines.mdcCursor rule
- .cursor/rules/114-java-secure-coding.mdcCursor rule
- .cursor/rules/115-java-concurrency.mdcCursor rule
- .cursor/rules/116-java-logging.mdcCursor rule
- .cursor/rules/121-java-unit-testing.mdcCursor rule
- .cursor/rules/122-java-integration-testing.mdcCursor rule
- .cursor/rules/131-java-refactoring-with-modern-features.mdcCursor rule
- .cursor/rules/132-java-functional-programming.mdcCursor rule
- .cursor/rules/133-java-data-oriented-programming.mdcCursor rule
- .cursor/rules/isolation_rules/main.mdcCursor rule
- .cursor/rules/isolation_rules/main-optimized.mdcCursor rule
- .cursor/rules/java-spring-cursor-rules.mdcCursor rule
The file
Files
---
description: Spring Boot development guidelines
globs: **/*.java
alwaysApply: false
---
# Spring Boot Development Guidelines
## Project Structure
## Best Practices
### Configuration
configuration_guidelines:
- "Use configuration properties classes over @Value"
- "Externalize configuration using application.yml"
- "Use profiles for environment-specific settings"
- "Follow the 12-factor app methodology"
- "Use @ConfigurationProperties for type-safe configuration"
### REST APIs
rest_guidelines:
- "Follow REST maturity model"
- "Use proper HTTP methods (GET, POST, PUT, DELETE)"
- "Implement proper error handling with @ControllerAdvice"
- "Use DTOs to control API response/request structure"
- "Implement API versioning"
- "Use proper HTTP status codes"
- "Document APIs using OpenAPI/Swagger"
### Security
security_guidelines:
- "Enable HTTPS in production"
- "Implement proper authentication and authorization"
- "Use Spring Security for security concerns"
- "Implement CORS properly"
- "Follow OWASP security guidelines"
- "Use security headers"
- "Implement rate limiting"
### Database
database_guidelines:
- "Use Spring Data JDBC repositories when possible"
- "Implement proper transaction management"
- "Use connection pooling"
- "Implement database migrations with Flyway/Liquibase"
- "Implement proper indexing strategy"
### Testing
testing_guidelines:
- "Write unit tests for services and controllers"
- "Use @SpringBootTest for integration tests"
- "Implement test slices (@WebMvcTest, @DataJpaTest)"
- "Use test containers for integration tests"
- "Mock external services"
- "Test configuration properties"
### Performance
performance_guidelines:
- "Use caching where appropriate"
- "Implement connection pooling"
- "Use async processing for long-running tasks"
- "Implement proper logging levels"
- "Use metrics and monitoring"
- "Implement proper exception handling"
### Code Examples
#### Configuration Properties
```java
@ConfigurationProperties(prefix = "app")
@Validated
public class AppProperties {
@NotNull
private String apiKey;
private int cacheTimeout;
// getters and setters
}
```
#### Controller
```java
@RestController
@RequestMapping("/api/v1")
@Validated
public class UserController {
@GetMapping("/users/{id}")
public ResponseEntity<UserDTO> getUser(@PathVariable Long id) {
// implementation
}
}
```
#### Service
```java
@Service
@Transactional
public class UserService {
private final UserRepository userRepository;
public UserService(UserRepository userRepository) {
this.userRepository = userRepository;
}
}
```
### Dependencies
essential_dependencies:
spring_boot_starters:
- "spring-boot-starter-web"
- "spring-boot-starter-data-jdbc"
- "spring-boot-starter-security"
- "spring-boot-starter-validation"
- "spring-boot-starter-actuator"
testing:
- "spring-boot-starter-test"
- "testcontainers"
utilities:
- "springdoc-openapi"
### Actuator
actuator_guidelines:
- "Enable appropriate endpoints"
- "Secure sensitive endpoints"
- "Implement custom health indicators"
- "Configure metrics collection"
- "Implement proper info endpoint"
### Logging
logging_guidelines:
- "Use SLF4J with Logback"
- "Configure appropriate log levels"
- "Implement structured logging"
- "Use MDC for request tracking"
- "Configure log rotation"
### Error Handling
error_handling:
- "Use @ControllerAdvice for global error handling"
- "Return proper error responses"
- "Implement validation error handling"
- "Log errors appropriately"
### Production Readiness
production_checklist:
- "Enable HTTPS"
- "Configure proper logging"
- "Enable metrics and monitoring"
- "Implement health checks"
- "Configure proper error pages"
- "Set up proper backup strategy"
- "Implement circuit breakers for external services"
- "Configure proper timeouts"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
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.

