Skip to content

Commit ab284e0

Browse files
jabrenacursoragent
andauthored
Implement cursor rules java issue 319 (#321)
* Checkpoint before follow-up message Co-authored-by: bren <bren@juanantonio.info> * Updating README.md * Updating diverse documentation --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
1 parent 8726fdc commit ab284e0

14 files changed

Lines changed: 3127 additions & 2332 deletions

.cursor/rules/100-java-cursor-rules-list.md

Lines changed: 22 additions & 21 deletions
Large diffs are not rendered by default.

.cursor/rules/170-java-documentation.md

Lines changed: 160 additions & 1756 deletions
Large diffs are not rendered by default.

.cursor/rules/171-java-diagrams.md

Lines changed: 1980 additions & 0 deletions
Large diffs are not rendered by default.

AGENTS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ A collection of `System prompts` for Java Enterprise development.
66

77
### Repository Layout
88

9-
- `./cursor/rules`: a collection of `System prompts` for Java Enterprise development. The main outcome of this project.
9+
- `.cursor/rules`: a collection of `System prompts` for Java Enterprise development. The main outcome of this project.
1010
- `system-prompts-generator`: a Java project designed to build the System prompts based on XML documents.
1111
- `examples`: a collection of Java examples designed to test with the different System prompts.
1212
- `site-generator`: JBake project designed to autogenerate public site in `docs` folder
@@ -29,15 +29,15 @@ Run the tests:
2929
./mvnw clean verify -pl system-prompts-generator
3030
```
3131

32-
If the tests passes, you could promote the changes to `./cursor/rules`:
32+
If the tests passes, you could promote the changes to `.cursor/rules`:
3333

3434
```bash
3535
./mvnw clean install -pl system-prompts-generator
3636
```
3737

3838
## General Guidance
3939

40-
- Don´t update any file from the path `./cursor/rules`, find the XML file in the path `generator/src/main/resources`.
40+
- Don´t update any file from the path `.cursor/rules`, find the XML file in the path `generator/src/main/resources`.
4141
- The project is based on Java 24.
4242

4343
## Commit Messages and Pull Requests

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ If you have the idea to contribute, review the whole process in detail:
1010
```bash
1111
cd generator
1212
./mvnw clean verify # Pass tests
13-
./mvnw clean install # Pass tests & copy new .md files into ./cursor/rules (The way to promote changes)
13+
./mvnw clean install # Pass tests & copy new .md files into .cursor/rules (The way to promote changes)
1414
```
1515

1616
When you feel confident with the process, fork the repository and try to create new XML documents. Models will help you because an XML file is more rigid than natural language and it has `a common vocabulary` to create prompts.

CURSOR-RULES-JAVA.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,13 @@ Use the following collection of System prompts of Java to improve your Java deve
6565
| - | 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 |
6666
| [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` **Note:** Put in the context the folder with the results | This cursor rule is applied automatically without any interaction with the Software engineer. |
6767

68-
## Documentation rule
68+
## Documentation rules
6969

7070
| Activity | Description | Prompt | Notes |
7171
|----|----|-----|----|
72-
| [170-java-documentation](.cursor/rules/170-java-documentation.md) | Generate Java project documentation & diagrams including README.md and package-info.java files using a modular step-based approach | **Interactive User Prompt:** `Generate technical documentation & diagrams about the project with the cursor rule @170-java-documentation` **User Prompt:** `Create a UML class diagram 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. | It is possible to apply the System prompt in an interactive and non interactive way. If you are thinking to create Diagrams, I recommend to run the Jbang tool `jbang puml-to-png@jabrena --watch .` in order to generate on fly the diagrams in png format |
72+
| [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 |
73+
| [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 |
74+
7375

7476
---
7577

GETTING-STARTED.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,25 @@ This view has a big green button with the text: `<> Code`. If you click on it, y
1010

1111
![](./documentation/getting-started-github.png)
1212

13-
Once you have downloaded it, go to the `Downloads` folder in your system and you should see the zip file: `cursor-rules-java-main.zip`. Unzip it and copy the folder `./cursor` into the Java repository where you want to use these Cursor rules.
13+
Once you have downloaded it, go to the `Downloads` folder in your system and you should see the zip file: `cursor-rules-java-main.zip`. Unzip it and copy the folder `.cursor` into the Java repository where you want to use these Cursor rules.
1414

1515
**Note:** ⚠️ Using this approach, you are using the main branch which is not released yet.
1616

1717
### Using the latest tagged zipped rules
1818

19-
Downloading the zipped release is the safest approach if you are interested in using the latest well-tested release. Go to [the latest release](https://github.com/jabrena/cursor-rules-java/releases) and download the zip assets included in the latest release. As in the previous case, download the zip, unzip it and copy the folder `./cursor` into the Java repository where you want to use these Cursor rules.
19+
Downloading the zipped release is the safest approach if you are interested in using the latest well-tested release. Go to [the latest release](https://github.com/jabrena/cursor-rules-java/releases) and download the zip assets included in the latest release. As in the previous case, download the zip, unzip it and copy the folder `.cursor` into the Java repository where you want to use these Cursor rules.
2020

2121
### Using a JBang CLI program specialized in this task
2222

2323
**JBang** is a tool that lets you run Java code as scripts without the need for traditional project setup, compilation, or build tools - just write Java and run it directly.
2424

25-
Using JBang, you can delegate the action to put the `./cursor/rules` from this repository into the Java repository where you want to use these Cursor rules.
25+
Using JBang, you can delegate the action to put the `.cursor/rules` from this repository into the Java repository where you want to use these Cursor rules.
2626

2727
Execute the following commands to use it:
2828

2929
```bash
3030
sdk install jbang
31-
# Add cursor rules for Java in ./cursor/rules
31+
# Add cursor rules for Java in .cursor/rules
3232
jbang --fresh setup@jabrena init --cursor https://github.com/jabrena/cursor-rules-java
3333
```
3434

@@ -38,7 +38,7 @@ jbang --fresh setup@jabrena init --cursor https://github.com/jabrena/cursor-rule
3838
|-------------|-------------|--------|-------|
3939
| [100-java-cursor-rules-list](.cursor/rules/100-java-cursor-rules-list.md) | Create a comprehensive step-by-step guide for using cursor rules for Java | `Create a Java development guide using the cursor rule @100-java-cursor-rules-list` | This cursor rule is applied automatically without any interaction with the software engineer. |
4040

41-
Once you have installed the cursor rules in the path `./cursor/rules`, type the following prompt in the cursor chat:
41+
Once you have installed the cursor rules in the path `.cursor/rules`, type the following prompt in the cursor chat:
4242

4343
![](./documentation/getting-started-prompt.png)
4444

README-DEV.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Developer notes
22

3-
```
3+
```bash
44
./mvnw clean verify
55
./mvnw clean verify -pl system-prompts-generator
66
./mvnw clean install -pl system-prompts-generator

0 commit comments

Comments
 (0)