{"owner":"iluwatar","repo":"java-design-patterns","hasSkills":true,"hasMcp":false,"mcpConfig":null,"found":["AGENTS.md"],"files":{"AGENTS.md":"# Java Design Patterns - Priming Context for AI Agents\n\n## Quick Overview\n- This repository is a comprehensive collection of design patterns implemented in Java.\n- The project demonstrates how to solve common software design problems using standard patterns.\n- The code for each pattern lives directly in this repository, alongside its explanatory README.\n- These readmes are published on the java-design-patterns.com website.\n- Another repository (https://github.com/iluwatar/java-design-patterns-vuepress-web) handles the deployment of the website.\n\n## Stack\n- **Java 21**: The primary programming language used for pattern implementations.\n- **Maven**: Dependency management and build tool.\n- **JUnit 5**: The testing framework used to verify pattern behaviors.\n- **Mockito**: Used for mocking dependencies in unit tests.\n- **Lombok**: Used to reduce boilerplate code (getters, setters, etc.).\n- **Spotless**: Enforces consistent code formatting via Google Java Format.\n\n## Trusted Sources\n- [Java SE 21 Documentation](https://docs.oracle.com/en/java/javase/21/docs/api/)\n- [Maven Official Documentation](https://maven.apache.org/guides/index.html)\n- [JUnit 5 User Guide](https://junit.org/junit5/docs/current/user-guide/)\n- [Project Wiki](https://github.com/iluwatar/java-design-patterns/wiki)\n\n## Structure\n- `/pom.xml`: The root Maven configuration file that defines global dependencies and lists all pattern modules.\n- `/[pattern-name]/`: Individual folders for each design pattern (e.g., `/abstract-factory`, `/builder`), acting as standalone Maven modules.\n- `/[pattern-name]/src/main/java/`: Contains the actual Java implementation classes of the specific design pattern.\n- `/[pattern-name]/src/test/java/`: Contains the JUnit tests verifying the pattern's behavior.\n- `/[pattern-name]/README.md`: The documentation for the pattern, which gets published to the main website.\n\n## Patterns\n- Keep pattern implementations simple, atomic, and easy to understand.\n- Write descriptive and meaningful names for classes, interfaces, and methods.\n- Always include comprehensive unit tests for every new pattern or code modification.\n- Follow the Google Java Format strictly (enforced by Spotless).\n- Document the intent, explanation, and real-world usage clearly in each module's `README.md`.\n\n## Anti-patterns\n- Avoid overcomplicating patterns with unnecessary external dependencies or complex frameworks.\n- Do not introduce business logic that distracts from the core mechanism of the design pattern itself.\n- Submitting new patterns or features without corresponding unit tests is strictly discouraged.\n- Avoid large monolithic packages; each pattern should reside in its own isolated module.\n\n## Example Design Pattern\nWhen a new design pattern is added to the repository, it generally follows these steps:\n- **Create a Module**: Create a new folder for the pattern in the root directory (e.g., `/my-new-pattern`).\n- **Update root pom.xml**: Add `<module>my-new-pattern</module>` to the `<modules>` section of the root `pom.xml`.\n- **Add Module pom.xml**: Create a `pom.xml` inside the new folder that inherits from the parent project.\n- **Write the Code**: Implement the pattern logic under `src/main/java/com/iluwatar/mynewpattern`, usually including an `App.java` class to demonstrate its usage.\n- **Write the Tests**: Add comprehensive unit tests under `src/test/java/com/iluwatar/mynewpattern`.\n- **Document**: Create a `README.md` at the root of the new module, structured with standard sections like Intent, Explanation, Class diagram, Applicability, and Real world examples.\n"}}