Skip to content

Commit 5f31ca4

Browse files
authored
Feature/renaming from mdc to md (#277)
* Renaming rules to offer better readability * Moving from mdc to md
1 parent da5967e commit 5f31ca4

36 files changed

Lines changed: 153 additions & 153 deletions
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
---
2+
author: Juan Antonio Breña Moral
3+
version: 0.10.0-SNAPSHOT
4+
---
5+
# Create a Checklist with all Java steps to use with cursor rules for Java
6+
7+
## Role
8+
9+
You are a Senior software engineer with extensive experience in Java software development
10+
11+
## Goal
12+
13+
Your task is to create a comprehensive step-by-step guide that follows the exact format
14+
and structure defined in the embedded template below. Create a markdown file named
15+
`CURSOR-RULES-JAVA.md` with the following content:
16+
17+
```markdown
18+
# Cursor rules Java
19+
20+
Use the following set of Java Cursor Rules to improve your Java development.
21+
22+
## Build system rules (Maven)
23+
24+
| Cursor Rule | Description | Prompt | Notes |
25+
|-------------|-------------|--------|-------|
26+
| [110-java-maven-best-practices](.cursor/rules/110-java-maven-best-practices.md) | Analyze your `pom.xml` and apply Maven best practices | **Prompt:** `Review the pom.xml following the best practices showing several alternatives thanks to the cursor rule @110-java-maven-best-practices` **Note:** Add in the context the `pom.xml` which you want to generate the documentation. | Using an Interactive approach, the rule will add pom.xml best practices. |
27+
| [111-java-maven-dependencies](.cursor/rules/111-java-maven-dependencies.md) | Add Maven dependencies for improved code quality | **Prompt:** `Add essential Maven dependencies for code quality using @111-java-maven-dependencies` **Note:** Add in the context the `pom.xml` which you want to enhance with quality dependencies. | Using a 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. |
28+
| [112-java-maven-plugins](.cursor/rules/112-java-maven-plugins.md) | Update your `pom.xml` with Maven Dependencies & Plugins | **Prompt:** `Can you improve the pom.xml using the cursor rule @112-java-maven-plugins` **Note:** Add in the context the `pom.xml` which you want to generate the documentation. | Using a Interactive approach, the Software engineer will interact with the cursor rule to update the `pom.xml`. |
29+
| [113-java-maven-documentation](.cursor/rules/113-java-maven-documentation.md) | Create a Maven Documentation with the file `README-DEV.md` | **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. |
30+
31+
## Design rules
32+
33+
| Cursor Rule | Description | Prompt | Notes |
34+
|-------------|-------------|--------|-------|
35+
| [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 | **Prompt:** `Review my code for object-oriented design showing several alternatives thanks to the cursor rule @121-java-object-oriented-design` **Note:** Add in the context a package to improve the design. | Using an Interactive approach, the rule will propose multiple alternatives to improve the OOP design. |
36+
| [122-java-type-design](.cursor/rules/122-java-type-design.md) | Review the Type Design in your development | **Prompt:** `Review my code for type design showing several alternatives thanks to the cursor rule @122-java-type-design` **Note:** Add in the context a package to improve the design. | Using an Interactive approach, the rule will propose multiple alternatives to improve the Type design. |
37+
38+
## Coding rules
39+
40+
| Cursor Rule | Description | Prompt | Notes |
41+
|-------------|-------------|--------|-------|
42+
| [123-java-general-guidelines](.cursor/rules/123-java-general-guidelines.md) | Apply general purpose Java guidelines | **Prompt:** `Review my code for general Java best practices showing several alternatives thanks to the cursor rule @123-java-general-guidelines` **Note:** Add a package in the context. | Interactive cursor rule. |
43+
| [124-java-secure-coding](.cursor/rules/124-java-secure-coding.md) | Review my code for Secure Java Coding rules | **Prompt:** `Review my code for secure coding showing several alternatives thanks to the cursor rule @124-java-secure-coding` **Note:** Add a package in the context. | Interactive cursor rule. |
44+
| [125-java-concurrency](.cursor/rules/125-java-concurrency.md) | Improve your code with Concurrency rules | **Prompt:** `Review my code for concurrency best practices showing several alternatives thanks to the cursor rule @125-java-concurrency` **Note:** Add a class or package which consider that it could bye improved by the cursor rule. | Interactive cursor rule. |
45+
| [126-java-logging](.cursor/rules/126-java-logging.md) | Apply logging guidelines in your development | **Prompt:** `Review my code for logging showing several alternatives thanks to the cursor rule @126-java-logging` **Note:** Add a class or package which consider that it could bye improved by the cursor rule. | Interactive cursor rule. |
46+
| [127-java-functional-exception-handling](.cursor/rules/127-java-functional-exception-handling.md) | Apply functional programming approaches for error handling using Optional and VAVR Either types | **Prompt:** `Review my code for functional exception handling showing several alternatives thanks to the cursor rule @127-java-functional-exception-handling` **Note:** Add a class or package that uses traditional exception handling for business logic failures. | Interactive cursor rule. It promotes using monads like Optional<T> and Either<L,R> instead of exceptions for predictable failures. |
47+
48+
## Testing rules
49+
50+
| Cursor Rule | Description | Prompt | Notes |
51+
|-------------|-------------|--------|-------|
52+
| [131-java-unit-testing](.cursor/rules/131-java-unit-testing.md) | Apply Unit Testing best practices | **Prompt:** `Review my testing code for unit testing showing several alternatives thanks to the cursor rule @131-java-unit-testing` **Note:** Add a class or package which consider that it could bye improved by the cursor rule. | Interactive cursor rule. |
53+
54+
## Refactoring rules
55+
56+
| Cursor Rule | Description | Prompt | Notes |
57+
|-------------|-------------|--------|-------|
58+
| [141-java-refactoring-with-modern-features](.cursor/rules/141-java-refactoring-with-modern-features.md) | Add Modern Java Features in your development | **Prompt:** `Review my code for using modern Java features showing several alternatives thanks to 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. | Interactive cursor rule. |
59+
| [142-java-functional-programming](.cursor/rules/142-java-functional-programming.md) | Add Functional Programming style in your development | **Prompt:** `Review my code for using functional programming showing several alternatives thanks to the cursor rule @142-java-functional-programming` **Note:** Add a class or package which consider that it could bye improved by the cursor rule. | Interactive cursor rule. |
60+
| [143-java-data-oriented-programming](.cursor/rules/143-java-data-oriented-programming.md) | Add Data Oriented Programmin in your development | **Prompt:** `Review my code for using data oriented programming showing several alternatives thanks to 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. | Interactive cursor rule. |
61+
62+
## Performance rule (Jmeter)
63+
64+
| Activity | Description | Prompt | Notes |
65+
|----------|------|--------|-------|
66+
| [151-java-performance-jmeter](.cursor/rules/151-java-performance-jmeter.md) | Run a peformance test with Jmeter | **Prompt:** `Add JMeter performance testing to this project using @151-java-performance-jmeter.md` **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. |
67+
68+
## Profiling rules (Async profiler, jps, jstack, jcmd & jstat)
69+
70+
| Activity | Description | Prompt | Notes |
71+
|----------|-------------|--------|-------|
72+
| [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.md 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` |
73+
| [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. |
74+
| - | 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 |
75+
| [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 154-java-profiling-compare.md` **Note:** Put in the context the folder with the results | This cursor rule is applied automatically without any interaction with the Software engineer. |
76+
77+
---
78+
79+
**Note:** This guide is self-contained and portable. Copy it into any Java project to get started with Cursor Rules for Java development.
80+
81+
```
82+
83+
## Constraints
84+
85+
**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:
86+
87+
- **DO NOT** create additional steps beyond what's shown in the template
88+
- **DO NOT** add cursor rules that are not explicitly listed in the embedded template
89+
- **DO NOT** expand or elaborate on sections beyond what the template shows
90+
- **ONLY** use cursor rules that appear in the embedded template
91+
- **ONLY** use the exact wording and structure from the template
92+
- If a cursor rule exists in the workspace but is not in the template, **DO NOT** include it
93+
94+
## Output Format
95+
96+
- **File Creation**: Generate the complete markdown file named `CURSOR-RULES-JAVA.md` in the project root directory
97+
- **Template Adherence**: Follow the embedded template structure and content exactly - no additions, modifications, or omissions
98+
- **File Handling**: If `CURSOR-RULES-JAVA.md` already exists, overwrite it completely with the new generated content

0 commit comments

Comments
 (0)