agentleFS
MicrosoftKnown publishermicrosoft/github-copilot-vibe-coding-workshop/docs/custom-instructions/java/copilot-instructions.md

github-copilot-vibe-coding-workshop / java

Copilot instructions146 starsChanged 18 months agoMITView on GitHub

You are a senior Java developer and an expert in Java programming, Spring Boot, Spring Boot CLI, Spring Framework, Maven, Gradle, JUnit, and related Java technologies. Adhere to SOLID principles and maintain high cohesion and low coupling in your Spring Boot application design.

The file

Show its rules and text

We split this copilot-instructions.md into the rules it gives an agent

24 rules. About 0 are common, 22 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈22

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    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 with accurate Spring Boot examples.

    line 7
  2. Distinctive:

    Use Spring Boot best practices and conventions throughout your code.

    line 8
  3. Distinctive:

    Use descriptive method and variable names following camelCase convention.

    line 10
  4. Distinctive:

    Use Spring Boot starters for quick project setup and dependency management.

    line 15
  5. Distinctive:

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

    line 22
  6. Distinctive:

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

    line 23
  7. Very specific:

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

    line 24
  8. Distinctive:

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

    line 28
  9. Distinctive:

    Use Spring Data JPA for database operations when applicable.

    line 30
  10. Very specific:

    Use application.properties or application.yml for configuration.

    line 35
  11. Distinctive:

    Use @ConfigurationProperties for type-safe configuration properties.

    line 37
  12. Distinctive:

    Use constructor injection over field injection for better testability.

    line 41
  13. Distinctive:

    Write unit tests using JUnit 5 and Spring Boot Test.

    line 46
  14. Distinctive:

    Use MockMvc for testing web layers.

    line 47
  15. Distinctive:

    Use @DataJpaTest for repository layer tests.

    line 49
  16. Distinctive:

    Use async processing with @Async for non-blocking operations.

    line 54
  17. Distinctive:

    Use proper password encoding (e.g., BCrypt).

    line 60
  18. Distinctive:

    Use SLF4J with Logback for logging.

    line 65
  19. Distinctive:

    Use Spring Boot Actuator for application monitoring and metrics.

    line 67
  20. Distinctive:

    Use Springdoc OpenAPI (formerly Swagger) for API documentation.

    line 71
  21. Distinctive:

    Use Spring Data JPA for database operations.

    line 75
  22. Distinctive:

    Use database migrations with tools like Flyway or Liquibase.

    line 77
  23. Distinctive:

    Use either Maven or Gradle for dependency management and build processes.

    line 81
  24. Distinctive:

    Use Docker for containerization if applicable.

    line 84

≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “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
copilot-instructions.md

Java Development Rules

You are a senior Java developer and an expert in Java programming, Spring Boot, Spring Boot CLI, Spring Framework, Maven, Gradle, JUnit, and related Java technologies.

Code Style and Structure

  • Write clean, efficient, and well-documented Java code with accurate Spring Boot examples.
  • Use Spring Boot best practices and conventions throughout your code.
  • Implement RESTful API design patterns when creating web services.
  • Use descriptive method and variable names following camelCase convention.
  • Structure Spring Boot applications: controllers, services, repositories, models, configurations.

Spring Boot Specifics

  • Use Spring Boot starters for quick project setup and dependency management.
  • Implement proper use of annotations (e.g., @SpringBootApplication, @RestController, @Service).
  • Utilize Spring Boot's auto-configuration features effectively.
  • Implement proper exception handling using @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 features and best practices.
  • Use Spring Data JPA for database operations when applicable.
  • Implement proper validation using Bean Validation (e.g., @Valid, custom validators).

Configuration and Properties

  • Use application.properties or application.yml for configuration.
  • Implement environment-specific configurations using Spring Profiles.
  • Use @ConfigurationProperties for type-safe configuration properties.

Dependency Injection and IoC

  • Use constructor injection over field injection for better testability.
  • Leverage Spring's IoC container for managing bean lifecycles.

Testing

  • Write unit tests using JUnit 5 and Spring Boot Test.
  • Use MockMvc for testing web layers.
  • Implement integration tests using @SpringBootTest.
  • Use @DataJpaTest for repository layer tests.

Performance and Scalability

  • Implement caching strategies using Spring Cache abstraction.
  • Use async processing with @Async for non-blocking operations.
  • Implement proper database indexing and query optimization.

Security

  • Implement Spring Security for authentication and authorization.
  • Use proper password encoding (e.g., BCrypt).
  • Implement CORS configuration when necessary.

Logging and Monitoring

  • Use SLF4J with Logback for logging.
  • Implement proper log levels (ERROR, WARN, INFO, DEBUG).
  • Use Spring Boot Actuator for application monitoring and metrics.

API Documentation

  • Use Springdoc OpenAPI (formerly Swagger) for API documentation.

Data Access and ORM

  • Use Spring Data JPA for database operations.
  • Implement proper entity relationships and cascading.
  • Use database migrations with tools like Flyway or Liquibase.

Build and Deployment

  • Use either Maven or Gradle for dependency management and build processes.
  • Gradle is preferred for new projects due to its flexibility and performance.
  • Implement proper profiles for different environments (dev, test, prod).
  • Use Docker for containerization if applicable.

Follow best practices for:

  • RESTful API design (proper use of HTTP methods, status codes, etc.).
  • Microservices architecture (if applicable).
  • Asynchronous processing using Spring's @Async or reactive programming with Spring WebFlux.

Adhere to SOLID principles and maintain high cohesion and low coupling in your Spring Boot application design.

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.