diff --git a/.cursor/rules/templates/java-checklist-template.md b/.cursor/rules/templates/java-checklist-template.md index f9481134..d0314405 100644 --- a/.cursor/rules/templates/java-checklist-template.md +++ b/.cursor/rules/templates/java-checklist-template.md @@ -8,56 +8,54 @@ Use the following process to improve the java development in some areas if requi | Cursor Rule | Description | Prompt | Notes | |-------------|-------------|--------|-------| -| [110-java-maven-best-practices](.cursor/rules/110-java-maven-best-practices.mdc) | Maven Best Practices | `Help me to review the pom.xml following the best practices for dependency management and directory structure use the cursor rule @110-java-maven-best-practices` | Add in the context the `pom.xml` which you want to generate the documentation | -| [111-java-maven-deps-and-plugins](.cursor/rules/111-java-maven-deps-and-plugins.mdc) | Maven Dependencies & Plugins | `Can you improve the pom.xml using the cursor rule @111-java-maven-deps-and-plugins` | Add in the context the `pom.xml` which you want to generate the documentation. Conversational approach | -| [112-java-maven-documentation](.cursor/rules/112-java-maven-documentation.mdc) | Maven Documentation | `Generate developer documentation with essential Maven commands using @112-java-maven-documentation` | Add in the context the `pom.xml` which you want to generate the documentation | +| [110-java-maven-best-practices](.cursor/rules/110-java-maven-best-practices.mdc) | Analyze your `pom.xml` and apply Maven best practices | **Prompt:** `Help me to review the pom.xml following the best practices for dependency management and directory structure use the cursor rule @110-java-maven-best-practices` **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. | +| [111-java-maven-deps-and-plugins](.cursor/rules/111-java-maven-deps-and-plugins.mdc) | Update your `pom.xml` with Maven Dependencies & Plugins | **Prompt:** `Can you improve the pom.xml using the cursor rule @111-java-maven-deps-and-plugins` **Note:** Add in the context the `pom.xml` which you want to generate the documentation. | Using a Conversational approach, the Software engineer will interact with the cursor rule to update the `pom.xml`. | +| [112-java-maven-documentation](.cursor/rules/112-java-maven-documentation.mdc) | Create a Maven Documentation with the file `README-DEV.md` | **Prompt:** `Generate developer documentation with essential Maven commands using @112-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 | |-------------|-------------|--------|-------| -| [123-java-general-guidelines](.cursor/rules/123-java-general-guidelines.mdc) | General Java Guidelines | `Review my code for general Java best practices using the cursor rule @123-java-general-guidelines` | | -| [124-java-secure-coding](.cursor/rules/124-java-secure-coding.mdc) | Secure Java Coding | `Check my code for security issues using the cursor rule @124-java-secure-coding` | | -| [125-java-concurrency](.cursor/rules/125-java-concurrency.mdc) | Concurrency | `Review my code for concurrency best practices using the cursor rule @125-java-concurrency` | | -| [126-java-logging](.cursor/rules/126-java-logging.mdc) | Logging Guidelines | `Help me improve logging using the cursor rule @126-java-logging` | | +| [121-java-object-oriented-design](.cursor/rules/121-java-object-oriented-design.mdc) | Take another point of view with an Object Oriented Design of your development | **Prompt:** `Review my code for object-oriented design using the cursor rule @121-java-object-oriented-design` **Note:** Add in the context a package to improve the design. | This cursor rule is applied automatically without any interaction with the Software engineer. It is an interesting prompt to see what alternatives offer the model for your package. | +| [122-java-type-design](.cursor/rules/122-java-type-design.mdc) | Review the Type Design in your development | **Prompt:** `Help me improve my type design using the cursor rule @122-java-type-design` **Note:** Add in the context a package to improve the design. | This cursor rule is applied automatically without any interaction with the Software engineer. It is an interesting prompt to see what alternatives offer the model for your package. | ### Coding rules | Cursor Rule | Description | Prompt | Notes | |-------------|-------------|--------|-------| -| [123-java-general-guidelines](.cursor/rules/123-java-general-guidelines.mdc) | General Java Guidelines | `Review my code for general Java best practices using the cursor rule @123-java-general-guidelines` | | -| [124-java-secure-coding](.cursor/rules/124-java-secure-coding.mdc) | Secure Java Coding | `Check my code for security issues using the cursor rule @124-java-secure-coding` | | -| [125-java-concurrency](.cursor/rules/125-java-concurrency.mdc) | Concurrency | `Review my code for concurrency best practices using the cursor rule @125-java-concurrency` | | -| [126-java-logging](.cursor/rules/126-java-logging.mdc) | Logging Guidelines | `Help me improve logging using the cursor rule @126-java-logging` | | +| [123-java-general-guidelines](.cursor/rules/123-java-general-guidelines.mdc) | Apply general purpose Java guidelines | **Prompt:** `Review my code for general Java best practices using the cursor rule @123-java-general-guidelines` **Note:** Add a package in the context. | Non conversational cursor rule. | +| [124-java-secure-coding](.cursor/rules/124-java-secure-coding.mdc) | Review your coide with Secure Java Coding rules | **Prompt:** `Check my code for security issues using the cursor rule @124-java-secure-coding` **Note:** Add a package in the context. | Non conversational cursor rule. | +| [125-java-concurrency](.cursor/rules/125-java-concurrency.mdc) | Improve your code with Concurrency rules | **Prompt:** `Review my code for concurrency best practices using the cursor rule @125-java-concurrency` **Note:** Add a class or package which consider that it could bye improved by the cursor rule. | Non conversational cursor rule. | +| [126-java-logging](.cursor/rules/126-java-logging.mdc) | Apply logging guidelines in your development | **Prompt:** `Help me improve logging using the cursor rule @126-java-logging` **Note:** Add a class or package which consider that it could bye improved by the cursor rule. | This cursor rule is applied automatically without any interaction with the Software engineer. | ### Testing rules | Cursor Rule | Description | Prompt | Notes | |-------------|-------------|--------|-------| -| [131-java-unit-testing](.cursor/rules/131-java-unit-testing.mdc) | Unit Testing | `Can improve the unit tests using the cursor rule @131-java-unit-testing` | Add in the context a Test Class or the package | +| [131-java-unit-testing](.cursor/rules/131-java-unit-testing.mdc) | Apply Unit Testing best practices | **Prompt:** `Can improve the unit tests using the cursor rule @131-java-unit-testing` **Note:** Add a class or package which consider that it could bye improved by the cursor rule. | This cursor rule is applied automatically without any interaction with the Software engineer. | ### Refactoring rules | Cursor Rule | Description | Prompt | Notes | |-------------|-------------|--------|-------| -| [141-java-refactoring-with-modern-features](.cursor/rules/141-java-refactoring-with-modern-features.mdc) | Add Modern Java Features | `Refactor my code to use modern Java features using the cursor rule @141-java-refactoring-with-modern-features` | | -| [142-java-functional-programming](.cursor/rules/142-java-functional-programming.mdc) | Functional Programming | `Refactor my code to use functional programming using the cursor rule @142-java-functional-programming` | | -| [143-java-data-oriented-programming](.cursor/rules/143-java-data-oriented-programming.mdc) | Data Oriented Programming | `Refactor my code to use data oriented programming using the cursor rule @143-java-data-oriented-programming` | | +| [141-java-refactoring-with-modern-features](.cursor/rules/141-java-refactoring-with-modern-features.mdc) | Add Modern Java Features in your development | **Prompt:** `Refactor my code to use modern Java features using the cursor rule @141-java-refactoring-with-modern-features` **Note:** Add a class or package which consider that it could bye improved by the cursor rule. | Non conversational cursor rule. | +| [142-java-functional-programming](.cursor/rules/142-java-functional-programming.mdc) | Add Functional Programming style in your development | **Prompt:** `Refactor my code to use functional programming using the cursor rule @142-java-functional-programming` **Note:** Add a class or package which consider that it could bye improved by the cursor rule. | This cursor rule is applied automatically without any interaction with the Software engineer. | +| [143-java-data-oriented-programming](.cursor/rules/143-java-data-oriented-programming.mdc) | Add Data Oriented Programmin in your development | **Prompt:** `Refactor my code to use data oriented programming using the cursor rule @143-java-data-oriented-programming` **Note:** Add a class or package which consider that it could bye improved by the cursor rule. | This cursor rule is applied automatically without any interaction with the Software engineer. | ### Performance rule (Jmeter) | Activity | Description | Prompt | Notes | |----------|------|--------|-------| -| [151-java-performance-jmeter](.cursor/rules/151-java-performance-jmeter.mdc) | Run a peformance test with Jmeter | `Add JMeter performance testing to this project using @151-java-performance-jmeter.mdc` | 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?` | +| [151-java-performance-jmeter](.cursor/rules/151-java-performance-jmeter.mdc) | Run a peformance test with Jmeter | **Prompt:** `Add JMeter performance testing to this project using @151-java-performance-jmeter.mdc` **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) | Activity | Description | Prompt | Notes | -|----------|------|--------|-------| -| [161-java-profiling-detect](.cursor/rules/161-java-profiling-detect.mdc) | Measure problems | `My Java application has performance issues - help me set up comprehensive profiling process using @151-java-profiling-detect.mdc and use the location YOUR-DEVELOPMENT/profiler` | Replace YOUR-DEVELOPMENT with your actual development path. Example: examples/spring-boot-memory-leak-demo/profiler | -| [162-java-profiling-analyze](.cursor/rules/162-java-profiling-analyze.mdc) | Analyze results | `Analyze the results located in YOUR-DEVELOPMENT/profiler and use the cursor rule @152-java-profiling-analyze` | Replace YOUR-DEVELOPMENT with your actual development path. Example: examples/spring-boot-memory-leak-demo/profiler | -| - | Code Refactoring | `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/162-java-profiling-compare.mdc) | Analyze results | `Review if the problems was solved with last refactoring using the reports located in @/results with the cursor rule 154-java-profiling-compare.mdc` | Put in the context the folder with the results | +|----------|-------------|--------|-------| +| [161-java-profiling-detect](.cursor/rules/161-java-profiling-detect.mdc) | 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.mdc 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. | +| [162-java-profiling-analyze](.cursor/rules/162-java-profiling-analyze.mdc) | 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.mdc) | 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 154-java-profiling-compare.mdc` **Note:** Put in the context the folder with the results | This cursor rule is applied automatically without any interaction with the Software engineer. | --- diff --git a/CHANGELOG.md b/CHANGELOG.md index a3e82b49..ee8ed859 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,41 +5,53 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [0.7.0] +## [0.7.0] - 2025-06-30 ### Added - **Java Profiling Support**: Added comprehensive profiling cursor rules (#81, #88, #91) - - `@151-java-profiling-detect` for detecting performance issues - - `@152-java-profiling-analyze` for analyzing profiling results - - `@154-java-profiling-compare` for comparing profiling data + - `@161-java-profiling-detect` for detecting performance issues + - `@162-java-profiling-analyze` for analyzing profiling results + - `@164-java-profiling-compare` for comparing profiling data - **Java Checklist Guide**: Added `@100-java-checklist-guide` cursor rule to help developers use cursor rules effectively (#59) - **Maven Documentation**: Added `@112-java-maven-documentation` cursor rule to generate README-DEV.md from existing pom.xml files - **Maven Dependencies & Plugins**: Added `@111-java-maven-deps-and-plugins` cursor rule for better Maven dependency management -- **Cloud Examples**: Added serverless examples - - AWS Lambda Hello World example with native image support - - Azure Function Hello World example with GraalVM configuration -- **Performance Examples**: Added specialized demo projects (#82, #86) - - Spring Boot Memory Leak Demo with profiling tools - - Spring Boot Performance Bottleneck Demo with CPU profiling +- **Performance Testing**: Added `@151-java-performance-jmeter` cursor rule for JMeter-based performance testing (#97) +- **Cloud Examples**: Added serverless examples with native image support + - AWS Lambda Hello World example with GraalVM native image configuration + - Azure Function Hello World example with GraalVM configuration and Azure-specific setup +- **Maven Demo**: Added complete Maven demo project with Euler problem examples and proper testing structure +- **Quarkus Demo**: Added Quarkus framework example with profiling support and Docker configurations +- **Performance Examples**: Added specialized demo projects (#82, #86, #95) + - Spring Boot comprehensive demo with film query service, PostgreSQL integration, and full testing suite + - Spring Boot Memory Leak Demo with profiling tools and detailed analysis documentation + - Spring Boot Performance Bottleneck Demo with CPU profiling and optimization examples + - Spring Boot JMeter Demo for performance testing integration - **Template System**: Added comprehensive template files to support cursor rule generation - - Java checklist templates - - Maven dependencies and plugins templates -- **DevOps Integration**: Added modern development tooling (#63, #64, #76) - - Dependabot configuration for automatic dependency updates - - CODEOWNERS file for code review assignments - - GitHub Sponsors funding configuration + - Java checklist templates for systematic development approaches + - Maven dependencies and plugins templates for project setup + - Performance testing script templates + - Profiling script templates for application analysis +- **Documentation**: Added extensive documentation and diagrams + - Cursor interaction sequence diagrams ### Changed - **Rule Organization**: Reorganized cursor rule numbering system for better categorization - **Documentation**: Significantly improved README and development guides (#74, #90) - **Maven Plugins**: Improved cursor rules for Maven plugins with better examples and guidance (#54, #56) +- **Modularization**: Improved project structure to make cursor rules more modular (#105) ### Removed - **Cache Files**: Removed Maven cache files that were not useful for daily development work (#44) -- **Logging**: Removed unnecessary MDC behavior (#89) +- **Logging**: Removed unnecessary MDC behavior that added complexity without clear criteria (#89) +- **Redundant Rules**: Removed or consolidated several cursor rules for better organization + - Removed `@122-java-integration-testing` (consolidated into other testing rules) + - Removed framework-specific rules to separate repositories: + - `@301-framework-spring-boot` (moved to separate Spring Boot rules project) (#105) + - `@304-java-rest-api-design` (moved to separate Spring Boot rules project) + - `@500-sql` (moved to Spring Boot rules) ## [0.6.0] 30/5/2025 diff --git a/README.md b/README.md index 3a877ea8..cfbddb1c 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,8 @@ Modern Java IDEs, such as **Cursor AI**, provide ways to customize how the `Agen A system prompt is a set of instructions given to an AI model that defines how it should behave, what role it should take on, and what guidelines it should follow when responding to users. Think of it as the "operating manual" that shapes the AI's personality, capabilities, and boundaries. +[Further information](./docs/cursor-interaction-sequence.png) + ## How to use the Cursor rules? Using the Cursor rules is straightforward: simply `drag and drop` the cursor rule that you need into the chat textbox where you are typing your `User prompt`. @@ -23,54 +25,54 @@ Using the Cursor rules is straightforward: simply `drag and drop` the cursor rul | Cursor Rule | Description | Prompt | Notes | |-------------|-------------|--------|-------| -| [110-java-maven-best-practices](.cursor/rules/110-java-maven-best-practices.mdc) | Maven Best Practices | `Help me to review the pom.xml following the best practices for dependency management and directory structure use the cursor rule @110-java-maven-best-practices` | Add in the context the `pom.xml` which you want to generate the documentation | -| [111-java-maven-deps-and-plugins](.cursor/rules/111-java-maven-deps-and-plugins.mdc) | Maven Dependencies & Plugins | `Can you improve the pom.xml using the cursor rule @111-java-maven-deps-and-plugins` | Add in the context the `pom.xml` which you want to generate the documentation. Conversational approach | -| [112-java-maven-documentation](.cursor/rules/112-java-maven-documentation.mdc) | Maven Documentation | `Generate developer documentation with essential Maven commands using @112-java-maven-documentation` | Add in the context the `pom.xml` which you want to generate the documentation | +| [110-java-maven-best-practices](.cursor/rules/110-java-maven-best-practices.mdc) | Analyze your `pom.xml` and apply Maven best practices | **Prompt:** `Help me to review the pom.xml following the best practices for dependency management and directory structure use the cursor rule @110-java-maven-best-practices` **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. | +| [111-java-maven-deps-and-plugins](.cursor/rules/111-java-maven-deps-and-plugins.mdc) | Update your `pom.xml` with Maven Dependencies & Plugins | **Prompt:** `Can you improve the pom.xml using the cursor rule @111-java-maven-deps-and-plugins` **Note:** Add in the context the `pom.xml` which you want to generate the documentation. | Using a Conversational approach, the Software engineer will interact with the cursor rule to update the `pom.xml`. | +| [112-java-maven-documentation](.cursor/rules/112-java-maven-documentation.mdc) | Create a Maven Documentation with the file `README-DEV.md` | **Prompt:** `Generate developer documentation with essential Maven commands using @112-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.mdc) | Object Oriented Design | `Review my code for object-oriented design using the cursor rule @121-java-object-oriented-design` | Add in the context a package to improve the design | -| [122-java-type-design](.cursor/rules/122-java-type-design.mdc) | Type Design | `Help me improve my type design using the cursor rule @122-java-type-design` | Add in the context a package to improve the design | +| [121-java-object-oriented-design](.cursor/rules/121-java-object-oriented-design.mdc) | Take another point of view with an Object Oriented Design of your development | **Prompt:** `Review my code for object-oriented design using the cursor rule @121-java-object-oriented-design` **Note:** Add in the context a package to improve the design. | This cursor rule is applied automatically without any interaction with the Software engineer. It is an interesting prompt to see what alternatives offer the model for your package. | +| [122-java-type-design](.cursor/rules/122-java-type-design.mdc) | Review the Type Design in your development | **Prompt:** `Help me improve my type design using the cursor rule @122-java-type-design` **Note:** Add in the context a package to improve the design. | This cursor rule is applied automatically without any interaction with the Software engineer. It is an interesting prompt to see what alternatives offer the model for your package. | ### Coding rules | Cursor Rule | Description | Prompt | Notes | |-------------|-------------|--------|-------| -| [123-java-general-guidelines](.cursor/rules/123-java-general-guidelines.mdc) | General Java Guidelines | `Review my code for general Java best practices using the cursor rule @123-java-general-guidelines` | | -| [124-java-secure-coding](.cursor/rules/124-java-secure-coding.mdc) | Secure Java Coding | `Check my code for security issues using the cursor rule @124-java-secure-coding` | | -| [125-java-concurrency](.cursor/rules/125-java-concurrency.mdc) | Concurrency | `Review my code for concurrency best practices using the cursor rule @125-java-concurrency` | | -| [126-java-logging](.cursor/rules/126-java-logging.mdc) | Logging Guidelines | `Help me improve logging using the cursor rule @126-java-logging` | | +| [123-java-general-guidelines](.cursor/rules/123-java-general-guidelines.mdc) | Apply general purpose Java guidelines | **Prompt:** `Review my code for general Java best practices using the cursor rule @123-java-general-guidelines` **Note:** Add a package in the context. | Non conversational cursor rule. | +| [124-java-secure-coding](.cursor/rules/124-java-secure-coding.mdc) | Review your coide with Secure Java Coding rules | **Prompt:** `Check my code for security issues using the cursor rule @124-java-secure-coding` **Note:** Add a package in the context. | Non conversational cursor rule. | +| [125-java-concurrency](.cursor/rules/125-java-concurrency.mdc) | Improve your code with Concurrency rules | **Prompt:** `Review my code for concurrency best practices using the cursor rule @125-java-concurrency` **Note:** Add a class or package which consider that it could bye improved by the cursor rule. | Non conversational cursor rule. | +| [126-java-logging](.cursor/rules/126-java-logging.mdc) | Apply logging guidelines in your development | **Prompt:** `Help me improve logging using the cursor rule @126-java-logging` **Note:** Add a class or package which consider that it could bye improved by the cursor rule. | This cursor rule is applied automatically without any interaction with the Software engineer. | ### Testing rules | Cursor Rule | Description | Prompt | Notes | |-------------|-------------|--------|-------| -| [131-java-unit-testing](.cursor/rules/131-java-unit-testing.mdc) | Unit Testing | `Can improve the unit tests using the cursor rule @131-java-unit-testing` | Add in the context a Test Class or the package | +| [131-java-unit-testing](.cursor/rules/131-java-unit-testing.mdc) | Apply Unit Testing best practices | **Prompt:** `Can improve the unit tests using the cursor rule @131-java-unit-testing` **Note:** Add a class or package which consider that it could bye improved by the cursor rule. | This cursor rule is applied automatically without any interaction with the Software engineer. | ### Refactoring rules | Cursor Rule | Description | Prompt | Notes | |-------------|-------------|--------|-------| -| [141-java-refactoring-with-modern-features](.cursor/rules/141-java-refactoring-with-modern-features.mdc) | Add Modern Java Features | `Refactor my code to use modern Java features using the cursor rule @141-java-refactoring-with-modern-features` | | -| [142-java-functional-programming](.cursor/rules/142-java-functional-programming.mdc) | Functional Programming | `Refactor my code to use functional programming using the cursor rule @142-java-functional-programming` | | -| [143-java-data-oriented-programming](.cursor/rules/143-java-data-oriented-programming.mdc) | Data Oriented Programming | `Refactor my code to use data oriented programming using the cursor rule @143-java-data-oriented-programming` | | +| [141-java-refactoring-with-modern-features](.cursor/rules/141-java-refactoring-with-modern-features.mdc) | Add Modern Java Features in your development | **Prompt:** `Refactor my code to use modern Java features using the cursor rule @141-java-refactoring-with-modern-features` **Note:** Add a class or package which consider that it could bye improved by the cursor rule. | Non conversational cursor rule. | +| [142-java-functional-programming](.cursor/rules/142-java-functional-programming.mdc) | Add Functional Programming style in your development | **Prompt:** `Refactor my code to use functional programming using the cursor rule @142-java-functional-programming` **Note:** Add a class or package which consider that it could bye improved by the cursor rule. | This cursor rule is applied automatically without any interaction with the Software engineer. | +| [143-java-data-oriented-programming](.cursor/rules/143-java-data-oriented-programming.mdc) | Add Data Oriented Programmin in your development | **Prompt:** `Refactor my code to use data oriented programming using the cursor rule @143-java-data-oriented-programming` **Note:** Add a class or package which consider that it could bye improved by the cursor rule. | This cursor rule is applied automatically without any interaction with the Software engineer. | ### Performance rule (Jmeter) | Activity | Description | Prompt | Notes | |----------|------|--------|-------| -| [151-java-performance-jmeter](.cursor/rules/151-java-performance-jmeter.mdc) | Run a peformance test with Jmeter | `Add JMeter performance testing to this project using @151-java-performance-jmeter.mdc` | 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?` | +| [151-java-performance-jmeter](.cursor/rules/151-java-performance-jmeter.mdc) | Run a peformance test with Jmeter | **Prompt:** `Add JMeter performance testing to this project using @151-java-performance-jmeter.mdc` **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) | Activity | Description | Prompt | Notes | |----------|-------------|--------|-------| -| [161-java-profiling-detect](.cursor/rules/161-java-profiling-detect.mdc) | Measure problems | `My Java application has performance issues - help me set up comprehensive profiling process using @161-java-profiling-detect.mdc and use the location YOUR-DEVELOPMENT/profiler` | Replace YOUR-DEVELOPMENT with your actual development path. Example: examples/spring-boot-memory-leak-demo/profiler | -| [162-java-profiling-analyze](.cursor/rules/162-java-profiling-analyze.mdc) | Analyze results | `Analyze the results located in YOUR-DEVELOPMENT/profiler and use the cursor rule @162-java-profiling-analyze` | Replace YOUR-DEVELOPMENT with your actual development path. Example: examples/spring-boot-memory-leak-demo/profiler | -| - | Code Refactoring | `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.mdc) | Analyze results | `Review if the problems was solved with last refactoring using the reports located in @/results with the cursor rule 154-java-profiling-compare.mdc` | Put in the context the folder with the results | +| [161-java-profiling-detect](.cursor/rules/161-java-profiling-detect.mdc) | 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.mdc 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. | +| [162-java-profiling-analyze](.cursor/rules/162-java-profiling-analyze.mdc) | 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.mdc) | 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 154-java-profiling-compare.mdc` **Note:** Put in the context the folder with the results | This cursor rule is applied automatically without any interaction with the Software engineer. | ## Getting started diff --git a/docs/MAINTENANCE.md b/docs/MAINTENANCE.md index 1da96438..cf87fc91 100644 --- a/docs/MAINTENANCE.md +++ b/docs/MAINTENANCE.md @@ -4,12 +4,12 @@ ```bash ## Prompt to update some cursor rules with ideas included in JEPS -reviewing the table of content, can you review all jeps from @All-JEPS.md and see what jeps could be interested to be added to this cursor rule: @102-java-functional-programming.mdc +Reviewing the table of content, can you review all jeps from @All-JEPS.md and see what jeps could be interested to be added to this cursor rule: @102-java-functional-programming.mdc Can you propose new rules? # Prompt to update the list -review that the list doesn´t any broken link to @/.cursor with .mdc files +Review that the list doesn´t any broken link to @/.cursor with .mdc files # Prompt to provide a release changelog -can you compare current branch with tag 0.6.0 and create a small summary following the format from: @https://keepachangelog.com/en/1.1.0/ +Can you update the current changelog for 0.7.0 comparing commits in relation to 0.6.0 tag. Use @https://keepachangelog.com/en/1.1.0/ rules ``` \ No newline at end of file diff --git a/docs/NOTES.md b/docs/NOTES.md deleted file mode 100644 index 5292caa4..00000000 --- a/docs/NOTES.md +++ /dev/null @@ -1,2 +0,0 @@ ---- -*(Optional Section: Add other relevant top-level sections if they apply globally across rules, such as "Key Concepts", "General Principles", "Anti-Patterns to Avoid", etc.)* \ No newline at end of file diff --git a/docs/cursor-interaction-sequence.png b/docs/cursor-interaction-sequence.png new file mode 100644 index 00000000..08e6a133 Binary files /dev/null and b/docs/cursor-interaction-sequence.png differ diff --git a/docs/cursor-interaction-sequence.puml b/docs/cursor-interaction-sequence.puml new file mode 100644 index 00000000..126def7d --- /dev/null +++ b/docs/cursor-interaction-sequence.puml @@ -0,0 +1,127 @@ +@startuml +!define RECTANGLE class + +skinparam backgroundColor white +skinparam monochrome false +skinparam shadowing false + +title Cursor AI Assistant Interaction Flow (Enhanced) + +actor "Software Engineer" as SE +participant "Cursor IDE" as Cursor +participant "System Prompt\nProcessor" as SystemPrompt +participant "Context Manager" as Context +participant "Memory System" as Memory +participant "AI Model\n(Claude/GPT-4/etc.)" as AI +participant "Tool Executor" as Tools +participant "Web Search" as Web +participant "Git Integration" as Git +participant "Linter/Error\nChecker" as Linter + +== Prompt Initiation == +SE -> Cursor: Enter prompt/query in chat +activate Cursor + +== Context & Memory Gathering == +Cursor -> Context: Gather current context +activate Context +Context -> Context: Collect open files\ncursor position\nproject structure +Context -> Context: Analyze recent edits\nand file history +Context --> Cursor: Return context data +deactivate Context + +Cursor -> Memory: Retrieve relevant memories +activate Memory +Memory -> Memory: Search for related\nconversation history +Memory --> Cursor: Return memory context +deactivate Memory + +== System Prompt Processing == +Cursor -> SystemPrompt: Process user query with context +activate SystemPrompt +SystemPrompt -> SystemPrompt: Apply workspace rules\nand coding guidelines +SystemPrompt -> SystemPrompt: Format system instructions\n(tool usage, constraints) +SystemPrompt -> SystemPrompt: Combine user query +\nsystem prompt + context + memories +SystemPrompt --> Cursor: Return formatted prompt +deactivate SystemPrompt + +== AI Model Selection & Interaction == +Cursor -> AI: Send complete prompt with:\n- System instructions\n- User query\n- Context data\n- Available tools\n- Memory context +activate AI + +AI -> AI: Select appropriate model\n(Claude Sonnet, GPT-4, etc.) +AI -> AI: Process prompt and determine\nrequired actions + +== Parallel Tool Execution == +alt Multiple Tools Required + AI -> Tools: Execute file operations\n(read_file, edit_file, etc.) + activate Tools + Tools --> AI: Return file results + deactivate Tools + + AI -> Web: Search for real-time info + activate Web + Web --> AI: Return search results + deactivate Web + + AI -> Git: Fetch PR/commit info + activate Git + Git --> AI: Return Git data + deactivate Git + + AI -> AI: Process all tool results\nand synthesize response +end + +== Error Detection & Correction == +alt Code Changes Made + AI -> Linter: Check for linting errors + activate Linter + Linter --> AI: Return error status + deactivate Linter + + alt Errors Found + AI -> AI: Plan error corrections + AI -> Tools: Apply fixes (up to 3 iterations) + activate Tools + Tools --> AI: Confirm fixes applied + deactivate Tools + end +end + +== Memory Management == +AI -> Memory: Update/create memories\nif new insights gained +activate Memory +Memory -> Memory: Store relevant information\nfor future conversations +deactivate Memory + +AI --> Cursor: Return AI response with:\n- Code suggestions\n- Explanations\n- Next steps\n- Memory updates +deactivate AI + +== Response Delivery == +Cursor -> Cursor: Format response for display +Cursor -> SE: Display AI response in chat +deactivate Cursor + +== Code Application & Iteration == +alt Code Changes Suggested + SE -> Cursor: Accept/Apply code changes + activate Cursor + Cursor -> Cursor: Apply edits to files + Cursor -> SE: Confirm changes applied + deactivate Cursor + + alt Further Clarification Needed + SE -> Cursor: Follow-up questions/refinements + note right: Multi-turn conversation continues\nwith maintained context and memory + activate Cursor + Cursor -> Context: Update context with new changes + Cursor -> AI: Process follow-up with updated context + note over AI: Iterative refinement cycle\ncan repeat multiple times + deactivate Cursor + end +end + +== Background Processes == +note over Tools: Some operations can run\nin background (long-running tasks) + +@enduml \ No newline at end of file