Skip to content

Commit fa1d50e

Browse files
jabrenacursoragent
andauthored
Create new rule from exception examples (#265)
* Initial iteration about Generics * Refactoring from GPT5 * New examples * Add comprehensive Java exception handling guidelines document Co-authored-by: bren <bren@juanantonio.info> * Now the rule is stable * Improving rule * Adding examples * Update in documentation --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
1 parent 0727d62 commit fa1d50e

9 files changed

Lines changed: 5732 additions & 4 deletions

File tree

.cursor/rules/127-java-exception-handling.mdc

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

CURSOR-RULES-JAVA.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Use the following set of Java Cursor Rules to improve your Java development.
2626
| [124-java-secure-coding](.cursor/rules/124-java-secure-coding.mdc) | Review my code for Secure Java Coding rules | **Interactive User Prompt:** `Review my code for secure coding showing several alternatives thanks to the cursor rule @124-java-secure-coding` **User Prompt:** `Improve the solution applying the system prompt @124-java-secure-coding.mdc without any question` (Example) **Note:** Add a package in the context. | It is possible to apply the System prompt in an interactive and non interactive way. |
2727
| [125-java-concurrency](.cursor/rules/125-java-concurrency.mdc) | Improve your code with Concurrency rules | **Interactive User Prompt:** `Review my code for concurrency best practices showing several alternatives thanks to the cursor rule @125-java-concurrency` **User Prompt:** `Improve the solution applying the system prompt @125-java-concurrency.mdc without any question` (Example) **Note:** Add a class or package which consider that it could be improved by the cursor rule. | It is possible to apply the System prompt in an interactive and non interactive way. |
2828
| [126-java-logging](.cursor/rules/126-java-logging.mdc) | Apply logging guidelines in your development | **Interactive User Prompt:** `Review my code for logging showing several alternatives thanks to the cursor rule @126-java-logging` **User Prompt:** `Improve the solution applying the system prompt @126-java-logging.mdc without any question` (Example) **Note:** Add a class or package which consider that it could be improved by the cursor rule. | It is possible to apply the System prompt in an interactive and non interactive way. |
29+
| [127-java-exception-handling](.cursor/rules/127-java-exception-handling.mdc) | Add Exception handling | **Interactive User Prompt:** `Review my code to show several alternatives to apply Java Exception handling with the cursor rule @127-java-exception-handling` **User Prompt:** `Improve the solution applying the system prompt @127-java-exception-handling.mdc without any question` (Example) **Note:** Add a class or package which consider that it could be improved by the cursor rule. | It is possible to apply the System prompt in an interactive and non interactive way. |
2930
| [128-java-generics](.cursor/rules/128-java-generics.mdc) | Apply generics in a class | **Interactive User Prompt:** `Review my code to show several alternatives to apply Java Generics with the cursor rule @128-java-generics` **User Prompt:** `Apply Java Generics in the class with @128-java-generics without any question` **Note:** Add a class in the context | It is possible to apply the System prompt in an interactive and non interactive way. |
3031

3132
## Testing rules

GETTING-STARTED.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
If you are interested in getting the benefits of this cursor rules for Java, you have different alternatives like: `Using this Git repository`, `Using the Zipped rules from latest release` or using a `JBang CLI` specialized in this task.
44

5-
Read [the following document](./GETTING-STARTED.md) to start using this set of Cursor rules.
6-
75
## Install the rules
86

97
### Using the Git repository

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,25 @@ A system prompt is a set of instructions given to an AI model that defines how i
2626

2727
![](./docs/prompts.png)
2828

29-
## How to use a System prompt in your development?
29+
### Types of System prompts
3030

31-
Read [the following document](./HOW-TO-USE.md) to understand how to use System prompts in development
31+
The repository provides System prompts that can behave interactively or non-interactively, depending on how the user employs them.
32+
33+
- **Interactive tests:** `Review my code to show several alternatives to apply Java Generics with the cursor rule @128-java-generics` or `Review my testing code for unit testing showing several alternatives thanks to the cursor rule @131-java-unit-testing`
34+
- **Pure system prompt:** `Create a UML class diagram with @170-java-documentation.mdc without any question` or `Add Maven Enforcer plugin only from the rule @112-java-maven-plugins.mdc without any question`
3235

3336
## Getting started
3437

3538
If you are interested in using this repository, please read [the following document](./GETTING-STARTED.md) to get started.
3639

40+
## How to use a System prompt in your development?
41+
42+
Read [the following document](./HOW-TO-USE.md) to understand how to use System prompts in development
43+
44+
## How many System prompts include this repository?
45+
46+
Read [the following document](./CURSOR-RULES-JAVA.md) take a look about the inventory of System prompts.
47+
3748
## Constraints, Output format & Safety guards
3849

3950
The cursor rules in this repository follow [The Three-Node Quality Framework for AI Prompts](./docs/articles/prompt-quality-framework.md), which ensures both comprehensive responses and safe execution. This framework consists of three distinct pillars: **constraints**, **output-format** and **safeguards**. Each node operates at different phases of the AI interaction timeline, creating a defense-in-depth strategy.

0 commit comments

Comments
 (0)