diff --git a/.cursor/rules/100-java-system-prompt-java-list.md b/.cursor/rules/100-java-system-prompt-java-list.md new file mode 100644 index 00000000..87668f5f --- /dev/null +++ b/.cursor/rules/100-java-system-prompt-java-list.md @@ -0,0 +1,114 @@ +--- +author: Juan Antonio Breña Moral +version: 0.12.0-SNAPSHOT +--- +# Create a Checklist with all Java steps to use with system prompts for Java + +## Role + +You are a Senior software engineer with extensive experience in Java software development + +## Goal + +Your task is to create a comprehensive step-by-step guide that follows the exact format +and structure defined in the embedded template below. Create a markdown file named +`SYSTEM-PROMPTS-JAVA.md` with the following content: + +```markdown +# Cursor rules Java + +Use the following collection of System prompts of Java to improve your Java development. + +## Generate this list of System prompts for Java + +| Cursor Rule | Description | User Prompt | Notes | +|----|----|-----|-----| +| [100-java-cursor-rules-list](.cursor/rules/100-java-cursor-rules-list.md) | Generate list of System Prompts for Java | **User Prompt:** `Create a document with all System prompts for Java using @100-java-cursor-rules-list` | | + +## Build system rules (Maven) + +| Cursor Rule | Description | Prompt | Notes | +|----|----|-----|----| +| [110-java-maven-best-practices](.cursor/rules/110-java-maven-best-practices.md) | Analyze your `pom.xml` and apply Maven best practices | **User Prompt:** `Apply in the pom.xml the rule @110-java-maven-best-practices` **Note:** Add in the context the `pom.xml` which you want to generate the documentation. **User Prompt with Consultative Interactive Behaviour:** `Apply in the pom.xml the rule @110-java-maven-best-practices with the behaviour @behaviour-consultative-interaction`| You can use the System prompt in a purist way or add the Behaviours to customize the final behaviour. | +| [111-java-maven-dependencies](.cursor/rules/111-java-maven-dependencies.md) | Add Maven dependencies for improved code quality | **Interactive User Prompt:** `Add essential Maven dependencies for code quality using @111-java-maven-dependencies` **User Prompt:** `Add VAVR dependency with the help of@111-java-maven-dependencies and not make any question` (Example)**Note:** Add in the context the `pom.xml` which you want to enhance with quality dependencies. | It is possible to apply the System prompt in an interactive and non interactive way. Using the interactive approach, the Software engineer will interact with the cursor rule to selectively add JSpecify, Error Prone, NullAway and VAVR dependencies based on project needs. | +| [112-java-maven-plugins](.cursor/rules/112-java-maven-plugins.md) | Update your `pom.xml` with Maven Dependencies & Plugins | **Interactive User Prompt:** `Improve the pom.xml using the cursor rule @112-java-maven-plugins` **User Prompt:** `Add Maven Enforcer plugin only from the rule @112-java-maven-plugins without any question` (Example) **Note:** Add in the context the `pom.xml` which you want to generate the documentation. | It is possible to apply the System prompt in an interactive and non interactive way. Using the interactive approach, the Software engineer will interact with the cursor rule to update the `pom.xml`. | +| [113-java-maven-documentation](.cursor/rules/113-java-maven-documentation.md) | Create a Maven Documentation with the file `README-DEV.md` | **User Prompt:** `Generate developer documentation with essential Maven commands using @113-java-maven-documentation` **Note:** Add in the context the `pom.xml` which you want to generate the documentation. | This cursor rule is applied automatically without any interaction with the Software engineer. | + +## Design rules + +| Cursor Rule | Description | Prompt | Notes | +|----|----|-----|----| +| [121-java-object-oriented-design](.cursor/rules/121-java-object-oriented-design.md) | Take another point of view with an Object Oriented Design of your development | **User prompt:** `Improve the class/classes added in the context applying the system prompt @121-java-object-oriented-design`(Example) **Note:** Add in the context a class/classes to improve the design. **User Prompt with Consultative Interactive Behaviour:** `Improve the class/classes added in the context applying the system prompt @121-java-object-oriented-design with the behaviour @behaviour-consultative-interaction` | You can use the System prompt in a purist way or add the Behaviours to customize the final behaviour. | +| [122-java-type-design](.cursor/rules/122-java-type-design.md) | Review the Type Design in your development | **User prompt:** `Improve the class/classes added in the context applying the system prompt @122-java-type-design` (Example) **Note:** Add in the context a class/classes to improve the design. **User Prompt with Consultative Interactive Behaviour:** `Improve the class/classes added in the context applying the system prompt @122-java-type-design with the behaviour @behaviour-consultative-interaction` | You can use the System prompt in a purist way or add the Behaviours to customize the final behaviour. | + +## Coding rules + +| Cursor Rule | Description | Prompt | Notes | +|----|----|-----|----| +| [123-java-general-guidelines](.cursor/rules/123-java-general-guidelines.md) | Apply general purpose Java guidelines | **User Prompt:** `Improve the class/classes added in the context applying the system prompt @123-java-general-guidelines` (Example) **Note:** Add in the context a class/classes. **User Prompt with Consultative Interactive Behaviour:** `Improve the class/classes added in the context applying the system prompt @123-java-general-guidelines with the behaviour @behaviour-consultative-interaction` | You can use the System prompt in a purist way or add the Behaviours to customize the final behaviour. | +| [124-java-secure-coding](.cursor/rules/124-java-secure-coding.md) | Review my code for Secure Java Coding rules | **User Prompt:** `Improve the class/classes added in the context applying the system prompt @124-java-secure-coding` (Example) **Note:** Add in the context a class/classes. **User Prompt with Consultative Interactive Behaviour:** `Improve the class/classes added in the context applying the system prompt @124-java-secure-coding with the behaviour @behaviour-consultative-interaction` | You can use the System prompt in a purist way or add the Behaviours to customize the final behaviour. | +| [125-java-concurrency](.cursor/rules/125-java-concurrency.md) | Improve your code with Concurrency rules | **User Prompt:** `Improve the class/classes added in the context applying the system prompt @125-java-concurrency` (Example) **Note:** Add in the context a class/classes. **User Prompt with Consultative Interactive Behaviour:** `Improve the class/classes added in the context applying the system prompt @125-java-concurrency with the behaviour @behaviour-consultative-interaction` | You can use the System prompt in a purist way or add the Behaviours to customize the final behaviour. | +| [126-java-logging](.cursor/rules/126-java-logging.md) | Apply logging guidelines in your development | **User Prompt:** `Improve the class/classes added in the context applying the system prompt @126-java-logging` (Example) **Note:** Add in the context a class/classes. **User Prompt with Consultative Interactive Behaviour:** `Improve the class/classes added in the context applying the system prompt @126-java-logging with the behaviour @behaviour-consultative-interaction` | You can use the System prompt in a purist way or add the Behaviours to customize the final behaviour. | +| [127-java-exception-handling](.cursor/rules/127-java-exception-handling.md) | Add Exception handling | **User Prompt:** `Improve the class/classes added in the context applying the system prompt @127-java-exception-handling` (Example) **Note:** Add in the context a class/classes. **User Prompt with Consultative Interactive Behaviour:** `Improve the class/classes added in the context applying the system prompt @127-java-exception-handling with the behaviour @behaviour-consultative-interaction` | You can use the System prompt in a purist way or add the Behaviours to customize the final behaviour. | +| [128-java-generics](.cursor/rules/128-java-generics.md) | Apply generics in a class | **User Prompt:** `Improve the class/classes added in the context applying the system prompt @128-java-generics` (Example) **Note:** Add in the context a class/classes. **User Prompt with Consultative Interactive Behaviour:** `Improve the class/classes added in the context applying the system prompt @128-java-generics with the behaviour @behaviour-consultative-interaction` **User Prompt with Training behaviour:** `Create a course about @128-java-generics.md using the behavior @behaviour-progressive-learning.md and put the course here` **Note:** Add in the context the location to add the course. | You can use the System prompt in a purist way or add the Behaviours to customize the final behaviour. | + +## Unit Testing rules + +| Cursor Rule | Description | Prompt | Notes | +|----|----|-----|----| +| [131-java-unit-testing](.cursor/rules/131-java-unit-testing.md) | Apply Unit Testing best practices | **User Prompt:** `Improve the class/classes added in the context applying the system prompt @131-java-unit-testing` (Example) **Note:** Add in the context a class/classes. **User Prompt with Consultative Interactive Behaviour:** `Improve the class/classes added in the context applying the system prompt @131-java-unit-testing with the behaviour @behaviour-consultative-interaction` | You can use the System prompt in a purist way or add the Behaviours to customize the final behaviour. | + +## Refactoring rules + +| Cursor Rule | Description | Prompt | Notes | +|----|----|-----|----| +| [141-java-refactoring-with-modern-features](.cursor/rules/141-java-refactoring-with-modern-features.md) | Add Modern Java Features in your development | **User Prompt:** `Improve the class/classes added in the context applying the system prompt @141-java-refactoring-with-modern-features` (Example) **Note:** Add in the context a class/classes. **User Prompt with Consultative Interactive Behaviour:** `Improve the class/classes added in the context applying the system prompt @141-java-refactoring-with-modern-features with the behaviour @behaviour-consultative-interaction` | You can use the System prompt in a purist way or add the Behaviours to customize the final behaviour. | +| [142-java-functional-programming](.cursor/rules/142-java-functional-programming.md) | Add Functional Programming style in your development | **User Prompt:** `Improve the class/classes added in the context applying the system prompt @142-java-functional-programming` (Example) **Note:** Add in the context a class/classes. **User Prompt with Consultative Interactive Behaviour:** `Improve the class/classes added in the context applying the system prompt @142-java-functional-programming with the behaviour @behaviour-consultative-interaction` | You can use the System prompt in a purist way or add the Behaviours to customize the final behaviour. | +| [143-java-functional-exception-handling](.cursor/rules/143-java-functional-exception-handling.md) | Apply functional programming approaches for error handling using Optional and VAVR Either types | **User Prompt:** `Improve the class/classes added in the context applying the system prompt @143-java-functional-exception-handling` (Example) **Note:** Add in the context a class/classes. **User Prompt with Consultative Interactive Behaviour:** `Improve the class/classes added in the context applying the system prompt @143-java-functional-exception-handling with the behaviour @behaviour-consultative-interaction` | You can use the System prompt in a purist way or add the Behaviours to customize the final behaviour. It promotes using Monads like Optional and Either instead of exceptions for predictable failures. | +| [144-java-data-oriented-programming](.cursor/rules/144-java-data-oriented-programming.md) | Add Data Oriented Programming in your development | **User Prompt:** `Improve the class/classes added in the context applying the system prompt @144-java-data-oriented-programming` (Example) **Note:** Add in the context a class/classes. **User Prompt with Consultative Interactive Behaviour:** `Improve the class/classes added in the context applying the system prompt @144-java-data-oriented-programming with the behaviour @behaviour-consultative-interaction` | You can use the System prompt in a purist way or add the Behaviours to customize the final behaviour. | +| - | Improve a Java class method using results from a JMH analysis | **User Prompt:** `Add JMH support using the cursor rule @112-java-maven-plugins and not make any question` (For Maven projects without modules). In Order to design a JMH Benchmark use the following **User Prompt:** `Can you create a JMH benchmark in order to know what is the best implementation?` **Note:** add in the context the Java class that you want to benchmark. Once you execute the Benchmark and you have generated the JSON file, you can analyze the results with the following **User Prompt:** `Can you explain the JMH results and advice about the best implementation?` Add in the context the JMH report in JSON format **Note:** | User prompts | + +## Performance rule (Jmeter) + +| Activity | Description | Prompt | Notes | +|----|---|-----|----| +| [151-java-performance-jmeter](.cursor/rules/151-java-performance-jmeter.md) | Run a performance test with Jmeter | **User Prompt:** `Add JMeter performance testing to this project using @151-java-performance-jmeter` **Note:** You could ask the model to create a JMeter based on a RestController/Resource. Example: `Can you create a Jmeter file based on the restcontroller in the path src/test/resources/jmeter/load-test.jmx?` | This cursor rule is applied automatically without any interaction with the Software engineer. If you create a Jmeter file with the model, review the generation, sometimes it is necessary to hammer a bit. | + +## Profiling rules (Async profiler, jps, jstack, jcmd & jstat) + +| Activity | Description | Prompt | Notes | +|----|----|-----|----| +| [161-java-profiling-detect](.cursor/rules/161-java-profiling-detect.md) | Profile your development in runtime and collect evidences to be analyzed later. | **Prompt:** `My Java application has performance issues - help me set up comprehensive profiling process using @161-java-profiling-detect and use the location YOUR-DEVELOPMENT/profiler` **Note:** Replace YOUR-DEVELOPMENT with your actual development path. Example: examples/spring-boot-memory-leak-demo/profiler | Non conversational cursor rule. The Cursor rule will generate 2 scripts. One script designed to run your development with the right JVM flags for profiling and the second scripts will ask few questions about what problem do you want to solve/analyze over one particular PID. **Step 1:** execute `./run-with-profiler.sh --help` **Step2:** execute `./run-jmeter.sh --help` **Step 3:** execute `./profiler/scripts/java-profile.sh` | +| [162-java-profiling-analyze](.cursor/rules/162-java-profiling-analyze.md) | Analyze results from previous step and generate reports with the analysis results.| **Prompt:** `Analyze the results located in YOUR-DEVELOPMENT/profiler and use the cursor rule @162-java-profiling-analyze` **Note:** Replace YOUR-DEVELOPMENT with your actual development path. Example: examples/spring-boot-memory-leak-demo/profiler | Non conversational cursor rule. | +| - | Code Refactoring from suggestions from analysis | `Can you apply the solutions from @profiling-solutions-yyyymmdd.md in @/info to mitigate bottlenecks` | Make a refactoring with the notes from the analysis | +| [164-java-profiling-verify](.cursor/rules/164-java-profiling-verify.md) | Compare results comparing results before and after applying changes in the code | **Prompt:** `Review if the problems was solved with last refactoring using the reports located in @/results with the cursor rule @164-java-profiling-verify` **Note:** Put in the context the folder with the results | This cursor rule is applied automatically without any interaction with the Software engineer. | + +## Documentation rules + +| Activity | Description | Prompt | Notes | +|----|----|-----|----| +| [170-java-documentation](.cursor/rules/170-java-documentation.md) | Generate Java project documentation including README.md, package-info.java files, and Javadoc using a modular step-based approach | **Interactive User Prompt:** `Generate technical documentation about the project with the cursor rule @170-java-documentation` **User Prompt:** `Generate README.md with @170-java-documentation without any question` (Example) **Note:** Add in the context the folder to generate the documentation. The rule will analyze existing documentation and ask for user preferences before generating anything. Ensures project validation with Maven before proceeding. | Focused on documentation generation only. For diagrams, use @171-java-diagrams | +| [171-java-diagrams](.cursor/rules/171-java-diagrams.md) | Generate Java project diagrams including UML sequence, class, state-machine diagrams and C4 model diagrams using a modular step-based approach | **Interactive User Prompt:** `Generate diagrams about the project with the cursor rule @171-java-diagrams` **User Prompt:** `Create UML class diagrams with @171-java-diagrams without any question` (Example) **Note:** Add in the context the folder to generate the diagrams. The rule will analyze the codebase and ask for user preferences before generating anything. Ensures project validation with Maven before proceeding. | Focused on diagram generation only. I recommend to run the JBang tool `jbang puml-to-png@jabrena --watch .` in order to generate diagrams in PNG format on the fly | + +--- + +**Note:** This guide is self-contained and portable. Copy it into any Java project to get started with Cursor Rules for Java development. + +``` + +## Constraints + +**MANDATORY REQUIREMENT**: Follow the embedded template EXACTLY - do not add, remove, or modify any steps, sections, or cursor rules that are not explicitly shown in the template. ### What NOT to Include: + +- **DO NOT** create additional steps beyond what's shown in the template +- **DO NOT** add cursor rules that are not explicitly listed in the embedded template +- **DO NOT** expand or elaborate on sections beyond what the template shows +- **ONLY** use cursor rules that appear in the embedded template +- **ONLY** use the exact wording and structure from the template +- If a cursor rule exists in the workspace but is not in the template, **DO NOT** include it + +## Output Format + +- **File Creation**: Generate the complete markdown file named `SYSTEM-PROMPTS-JAVA.md` in the project root directory +- **Template Adherence**: Follow the embedded template structure and content exactly - no additions, modifications, or omissions +- **File Handling**: If `SYSTEM-PROMPTS-JAVA.md` already exists, overwrite it completely with the new generated content \ No newline at end of file diff --git a/.cursor/rules/164-java-profiling-compare.md b/.cursor/rules/164-java-profiling-verify.md similarity index 99% rename from .cursor/rules/164-java-profiling-compare.md rename to .cursor/rules/164-java-profiling-verify.md index 85bbe67b..cb1b9786 100644 --- a/.cursor/rules/164-java-profiling-compare.md +++ b/.cursor/rules/164-java-profiling-verify.md @@ -2,7 +2,7 @@ author: Juan Antonio Breña Moral version: 0.12.0-SNAPSHOT --- -# Java Profiling Workflow / Step 4 / Compare results after refactoring +# Java Profiling Workflow / Step 4 / Verify results ## Role diff --git a/CHANGELOG.md b/CHANGELOG.md index 548145a4..7ecedc4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -130,7 +130,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **Architecture Decision Records (ADRs)**: Added formal documentation for architectural decisions - ADR-001: Generate cursor rules from XML files - ADR-002: Configure cursor rules with manual scope -- **Comprehensive User Guide**: Added `CURSOR-RULES-JAVA.md` as a complete reference guide for all cursor rules +- **Comprehensive User Guide**: Added `SYSTEM-PROMPTS-JAVA.md` as a complete reference guide for all cursor rules - **Build Infrastructure Improvements**: - JBang script for markdown validation - GitHub workflow artifact upload for generated cursor rules diff --git a/README.md b/README.md index 388f7c56..72511684 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ ## Goal The project provides a collection of `System prompts` for Java Enterprise development that help software engineers in their daily programming work and data pipelines. -The [available System prompts for Java](./CURSOR-RULES-JAVA.md) cover aspects like `Build system based on Maven`, `Design`, `Coding`, `Testing`, `Refactoring & JMH Benchmarking`, `Performance testing with JMeter`, `Profiling with Async profiler/OpenJDK tools`, `Documentation` & `Diagrams`. +The [available System prompts for Java](./SYSTEM-PROMPTS-JAVA.md) cover aspects like `Build system based on Maven`, `Design`, `Coding`, `Testing`, `Refactoring & JMH Benchmarking`, `Performance testing with JMeter`, `Profiling with Async profiler/OpenJDK tools`, `Documentation` & `Diagrams`. ### Compatibility with Modern IDEs, CLI & Others @@ -63,7 +63,7 @@ New to this repository? Start with our [comprehensive guide](./documentation/GET ## How many system prompts for Java does this project include? -Explore the [complete catalog of available System prompts](./CURSOR-RULES-JAVA.md) to discover the full range of capabilities and find the perfect rules for your specific use cases. +Explore the [complete catalog of available System prompts](./SYSTEM-PROMPTS-JAVA.md) to discover the full range of capabilities and find the perfect rules for your specific use cases. ## Constraints, Output format & Safety guards diff --git a/CURSOR-RULES-JAVA.md b/SYSTEM-PROMPTS-JAVA.md similarity index 97% rename from CURSOR-RULES-JAVA.md rename to SYSTEM-PROMPTS-JAVA.md index f2db27b3..5c8f3259 100644 --- a/CURSOR-RULES-JAVA.md +++ b/SYSTEM-PROMPTS-JAVA.md @@ -63,7 +63,7 @@ Use the following collection of System prompts of Java to improve your Java deve | [161-java-profiling-detect](.cursor/rules/161-java-profiling-detect.md) | Profile your development in runtime and collect evidences to be analyzed later. | **Prompt:** `My Java application has performance issues - help me set up comprehensive profiling process using @161-java-profiling-detect and use the location YOUR-DEVELOPMENT/profiler` **Note:** Replace YOUR-DEVELOPMENT with your actual development path. Example: examples/spring-boot-memory-leak-demo/profiler | Non conversational cursor rule. The Cursor rule will generate 2 scripts. One script designed to run your development with the right JVM flags for profiling and the second scripts will ask few questions about what problem do you want to solve/analyze over one particular PID. **Step 1:** execute `./run-with-profiler.sh --help` **Step2:** execute `./run-jmeter.sh --help` **Step 3:** execute `./profiler/scripts/java-profile.sh` | | [162-java-profiling-analyze](.cursor/rules/162-java-profiling-analyze.md) | Analyze results from previous step and generate reports with the analysis results.| **Prompt:** `Analyze the results located in YOUR-DEVELOPMENT/profiler and use the cursor rule @162-java-profiling-analyze` **Note:** Replace YOUR-DEVELOPMENT with your actual development path. Example: examples/spring-boot-memory-leak-demo/profiler | Non conversational cursor rule. | | - | Code Refactoring from suggestions from analysis | `Can you apply the solutions from @profiling-solutions-yyyymmdd.md in @/info to mitigate bottlenecks` | Make a refactoring with the notes from the analysis | -| [164-java-profiling-compare](.cursor/rules/164-java-profiling-compare.md) | Compare results comparing results before and after applying changes in the code | **Prompt:** `Review if the problems was solved with last refactoring using the reports located in @/results with the cursor rule @164-java-profiling-compare` **Note:** Put in the context the folder with the results | This cursor rule is applied automatically without any interaction with the Software engineer. | +| [164-java-profiling-verify](.cursor/rules/164-java-profiling-verify.md) | Compare results comparing results before and after applying changes in the code | **Prompt:** `Review if the problems was solved with last refactoring using the reports located in @/results with the cursor rule @164-java-profiling-verify` **Note:** Put in the context the folder with the results | This cursor rule is applied automatically without any interaction with the Software engineer. | ## Documentation rules diff --git a/site-generator/assets/images/0.11.0-github-stats.png b/site-generator/assets/images/0.11.0-github-stats.png index 24d31723..60ae0b5f 100644 Binary files a/site-generator/assets/images/0.11.0-github-stats.png and b/site-generator/assets/images/0.11.0-github-stats.png differ diff --git a/site-generator/content/blog/2025/09/release-0.10.0.md b/site-generator/content/blog/2025/09/release-0.10.0.md index 4cbcbfb8..5310c57c 100644 --- a/site-generator/content/blog/2025/09/release-0.10.0.md +++ b/site-generator/content/blog/2025/09/release-0.10.0.md @@ -9,7 +9,7 @@ status=published ## What are Cursor rules for Java? The project provides a collection of System prompts for Java that help software engineers in their daily programming work. -The [available System prompts for Java](https://github.com/jabrena/cursor-rules-java/blob/main/CURSOR-RULES-JAVA.md) cover aspects like `Build system based on Maven`, `Design`, `Coding`, `Testing`, `Refactoring & JMH Benchmarking`, `Performance testing with JMeter`, `Profiling with Async profiler/JDK tools` & `Documentation`. +The [available System prompts for Java](https://github.com/jabrena/cursor-rules-java/blob/main/SYSTEM-PROMPTS-JAVA.md) cover aspects like `Build system based on Maven`, `Design`, `Coding`, `Testing`, `Refactoring & JMH Benchmarking`, `Performance testing with JMeter`, `Profiling with Async profiler/JDK tools` & `Documentation`. ![](/cursor-rules-java/images/workflow.png) @@ -282,7 +282,7 @@ Add Maven Enforcer plugin only from the rule @112-java-maven-plugins without any Add tests for the following classes with @131-java-unit-testing ``` -Additional examples in the [documentation](https://github.com/jabrena/cursor-rules-java/blob/main/CURSOR-RULES-JAVA.md). +Additional examples in the [documentation](https://github.com/jabrena/cursor-rules-java/blob/main/SYSTEM-PROMPTS-JAVA.md). ### Improve readability in system prompts diff --git a/site-generator/content/blog/2025/09/release-0.11.0.md b/site-generator/content/blog/2025/09/release-0.11.0.md index 52cf7166..f759b5c3 100644 --- a/site-generator/content/blog/2025/09/release-0.11.0.md +++ b/site-generator/content/blog/2025/09/release-0.11.0.md @@ -8,7 +8,7 @@ status=published ## What are Cursor rules for Java? -The project provides a collection of System prompts for Java Enterprise development that help software engineers in their daily programming work & data pipelines. The [available System prompts for Java](https://github.com/jabrena/cursor-rules-java/blob/main/CURSOR-RULES-JAVA.md) cover areas such as `Build system based on Maven`, `Design`, `Coding`, `Testing`, `Refactoring & JMH Benchmarking`, `Performance testing with JMeter`, `Profiling with async-profiler/JDK tools`, `Documentation`, and `Diagrams`. +The project provides a collection of System prompts for Java Enterprise development that help software engineers in their daily programming work & data pipelines. The [available System prompts for Java](https://github.com/jabrena/cursor-rules-java/blob/main/SYSTEM-PROMPTS-JAVA.md) cover areas such as `Build system based on Maven`, `Design`, `Coding`, `Testing`, `Refactoring & JMH Benchmarking`, `Performance testing with JMeter`, `Profiling with async-profiler/JDK tools`, `Documentation`, and `Diagrams`. ## What's new in this release? @@ -71,7 +71,7 @@ Improve the classes provided in the context by applying the system prompt @128-java-generics ``` -Further information: https://github.com/jabrena/cursor-rules-java/blob/0.11.0/CURSOR-RULES-JAVA.md +Further information: https://github.com/jabrena/cursor-rules-java/blob/0.11.0/SYSTEM-PROMPTS-JAVA.md With this evolution, software engineers now can combine pure system prompts and specialized behaviors in `16^3 = 4096` combinations by design. @@ -133,7 +133,7 @@ In this release, the script `profile-java-process.sh`, included in `@161-java-p ![](/cursor-rules-java/images/0.11.0-profiling-menu.png) -In recent months, I have been inspired by the work of outstanding engineers in this field: [Francesco Nigro](https://x.com/forked_franz), [Jaromir Hamala](https://x.com/jerrinot), [Johannes Bechberger](https://x.com/parttimen3rd) & [Brendan Gregg](https://x.com/brendangregg). I highly recommend following them. +In recent months, I have been inspired by the work of outstanding engineers in this field: [Francesco Nigro](https://x.com/forked_franz), [Jaromir Hamala](https://x.com/jerrinot), [Johannes Bechberger](https://x.com/parttimen3rd), [Erik Gahlin](https://x.com/ErikGahlin), [Marcus Hirt](https://x.com/hirt) & [Brendan Gregg](https://x.com/brendangregg). I highly recommend following them. If you are interested in the Profiling model `Detect, Analyze, Refactor & Compare` implemented with the following set of System prompts: diff --git a/system-prompts-generator/src/main/resources/100-java-cursor-rules-list.xml b/system-prompts-generator/src/main/resources/100-java-system-prompt-java-list.xml similarity index 85% rename from system-prompts-generator/src/main/resources/100-java-cursor-rules-list.xml rename to system-prompts-generator/src/main/resources/100-java-system-prompt-java-list.xml index c638ee5c..5690c4c8 100644 --- a/system-prompts-generator/src/main/resources/100-java-cursor-rules-list.xml +++ b/system-prompts-generator/src/main/resources/100-java-system-prompt-java-list.xml @@ -4,17 +4,17 @@ Juan Antonio Breña Moral 0.12.0-SNAPSHOT - Create a Checklist with all Java steps to use with cursor rules for Java + Create a Checklist with all Java steps to use with system prompts for Java You are a Senior software engineer with extensive experience in Java software development Your task is to create a comprehensive step-by-step guide that follows the exact format and structure defined in the embedded template below. Create a markdown file named - `CURSOR-RULES-JAVA.md` with the following content: + `SYSTEM-PROMPTS-JAVA.md` with the following content: ```markdown - + ``` @@ -37,10 +37,10 @@ **File Creation**: Generate the complete markdown file named - `CURSOR-RULES-JAVA.md` in the project root directory + `SYSTEM-PROMPTS-JAVA.md` in the project root directory **Template Adherence**: Follow the embedded template structure and content exactly - no additions, modifications, or omissions - **File Handling**: If `CURSOR-RULES-JAVA.md` already exists, + **File Handling**: If `SYSTEM-PROMPTS-JAVA.md` already exists, overwrite it completely with the new generated content diff --git a/system-prompts-generator/src/main/resources/164-java-profiling-compare.xml b/system-prompts-generator/src/main/resources/164-java-profiling-verify.xml similarity index 99% rename from system-prompts-generator/src/main/resources/164-java-profiling-compare.xml rename to system-prompts-generator/src/main/resources/164-java-profiling-verify.xml index cf9d057e..9e566456 100644 --- a/system-prompts-generator/src/main/resources/164-java-profiling-compare.xml +++ b/system-prompts-generator/src/main/resources/164-java-profiling-verify.xml @@ -4,7 +4,7 @@ Juan Antonio Breña Moral 0.12.0-SNAPSHOT - Java Profiling Workflow / Step 4 / Compare results after refactoring + Java Profiling Workflow / Step 4 / Verify results You are a Senior software engineer with extensive experience in Java software development diff --git a/system-prompts-generator/src/main/resources/fragments/java-cursor-rules-list-template.md b/system-prompts-generator/src/main/resources/fragments/java-system-prompts-java-list-template.md similarity index 97% rename from system-prompts-generator/src/main/resources/fragments/java-cursor-rules-list-template.md rename to system-prompts-generator/src/main/resources/fragments/java-system-prompts-java-list-template.md index 96905b90..108423b0 100644 --- a/system-prompts-generator/src/main/resources/fragments/java-cursor-rules-list-template.md +++ b/system-prompts-generator/src/main/resources/fragments/java-system-prompts-java-list-template.md @@ -64,7 +64,7 @@ Use the following collection of System prompts of Java to improve your Java deve | [161-java-profiling-detect](.cursor/rules/161-java-profiling-detect.md) | Profile your development in runtime and collect evidences to be analyzed later. | **Prompt:** `My Java application has performance issues - help me set up comprehensive profiling process using @161-java-profiling-detect and use the location YOUR-DEVELOPMENT/profiler` **Note:** Replace YOUR-DEVELOPMENT with your actual development path. Example: examples/spring-boot-memory-leak-demo/profiler | Non conversational cursor rule. The Cursor rule will generate 2 scripts. One script designed to run your development with the right JVM flags for profiling and the second scripts will ask few questions about what problem do you want to solve/analyze over one particular PID. **Step 1:** execute `./run-with-profiler.sh --help` **Step2:** execute `./run-jmeter.sh --help` **Step 3:** execute `./profiler/scripts/java-profile.sh` | | [162-java-profiling-analyze](.cursor/rules/162-java-profiling-analyze.md) | Analyze results from previous step and generate reports with the analysis results.| **Prompt:** `Analyze the results located in YOUR-DEVELOPMENT/profiler and use the cursor rule @162-java-profiling-analyze` **Note:** Replace YOUR-DEVELOPMENT with your actual development path. Example: examples/spring-boot-memory-leak-demo/profiler | Non conversational cursor rule. | | - | Code Refactoring from suggestions from analysis | `Can you apply the solutions from @profiling-solutions-yyyymmdd.md in @/info to mitigate bottlenecks` | Make a refactoring with the notes from the analysis | -| [164-java-profiling-compare](.cursor/rules/164-java-profiling-compare.md) | Compare results comparing results before and after applying changes in the code | **Prompt:** `Review if the problems was solved with last refactoring using the reports located in @/results with the cursor rule @164-java-profiling-compare` **Note:** Put in the context the folder with the results | This cursor rule is applied automatically without any interaction with the Software engineer. | +| [164-java-profiling-verify](.cursor/rules/164-java-profiling-verify.md) | Compare results comparing results before and after applying changes in the code | **Prompt:** `Review if the problems was solved with last refactoring using the reports located in @/results with the cursor rule @164-java-profiling-verify` **Note:** Put in the context the folder with the results | This cursor rule is applied automatically without any interaction with the Software engineer. | ## Documentation rules diff --git a/system-prompts-generator/src/test/java/info/jab/pml/SystemPromptsInventory.java b/system-prompts-generator/src/test/java/info/jab/pml/SystemPromptsInventory.java index 6952210d..c61203d1 100644 --- a/system-prompts-generator/src/test/java/info/jab/pml/SystemPromptsInventory.java +++ b/system-prompts-generator/src/test/java/info/jab/pml/SystemPromptsInventory.java @@ -9,7 +9,7 @@ private SystemPromptsInventory() { public static final Stream baseNames() { return Stream.of( - "100-java-cursor-rules-list", + "100-java-system-prompt-java-list", "110-java-maven-best-practices", "111-java-maven-dependencies", "112-java-maven-plugins", @@ -29,7 +29,7 @@ public static final Stream baseNames() { "151-java-performance-jmeter", "161-java-profiling-detect", "162-java-profiling-analyze", - "164-java-profiling-compare", + "164-java-profiling-verify", "170-java-documentation", "171-java-diagrams", "behaviour-consultative-interaction",