Skip to content

Commit f6d13bb

Browse files
authored
Merge pull request #1 from jabrena/feature/evolution-1
Evolution 1 for Java rules
2 parents 845d36e + fd136cd commit f6d13bb

11 files changed

Lines changed: 84 additions & 41 deletions
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1+
---
2+
description: General java rules
3+
globs: .java
4+
alwaysApply: true
5+
---
6+
17
# AI Developer Profile
8+
29
ai_persona:
310
role: Senior Java Developer
411
principles:
@@ -12,6 +19,7 @@ ai_persona:
1219
- DDD
1320

1421
# Technical Stack
22+
1523
tech_stack:
1624
framework: Spring Boot
1725
build_tool: Maven
@@ -25,4 +33,4 @@ tech_stack:
2533
- JQwik
2634
- JMH
2735
language: English
28-
code_comments: English
36+
code_comments: English
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
---
2+
description: Extension to java rules from the book Effective Java
3+
globs: .java
4+
alwaysApply: true
5+
---
6+
17
# Development Guidelines
28
effective_java_notes:
39
chapter_2:
@@ -132,4 +138,4 @@ effective_java_notes:
132138
- "Consider using a custom serialized form"
133139
- "Write readObject methods defensively"
134140
- "For instance control, prefer enum types to readResolve"
135-
- "Consider serialization proxies instead of serialized instances"
141+
- "Consider serialization proxies instead of serialized instances"

.cursor/rules/03-concurrency.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

.cursor/rules/03-concurrency.mdc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
description: Extension to java rules for Concurrency objects
3+
globs: .java
4+
alwaysApply: true
5+
---
6+
7+
# concurrency_guidelines:
8+
9+
- Use thread-safe data structures
10+
- Use thread-safe collections
11+
- Use thread-safe classes
12+
- Use thread-safe methods
13+
- Use thread-safe objects
14+
- Use thread-safe variables
15+
- Use thread-safe methods
16+
- Use thread-safe objects
17+
- Use thread-safe variables

.cursor/rules/04-functional-programming.md

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
description: Extension to java rules for Functional programming
3+
globs: .java
4+
alwaysApply: true
5+
---
6+
7+
# functional_programming_guidelines:
8+
9+
- Try to use immutable objects
10+
- Try to not mutate the state of the objects
11+
- Try to use pure functions
12+
- Try to use functional interfaces
13+
- Try to use lambda expressions
14+
- Try to use streams
15+
- Try to use functional programming paradigms

.cursor/rules/05-data-oriented-programming.md

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
description: Extension to java rules when develop features for Modern Java
3+
globs: .java
4+
alwaysApply: true
5+
---
6+
7+
# Data oriented programming pillars:
8+
9+
- Separate code from data
10+
- Represent data with generic data structures
11+
- Data should be immutable
12+
- Use pure functions to manipulate data
13+
- Keep data flat and denormalized
14+
- Keep data generic until it needs to be specific
15+
- Data integrity is maintained through validation functions
16+
- Data access should be flexible and generic
17+
- Data transformation should be explicit and traceable
18+
- Data flow should be unidirectional

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
.DS_Store
1+
.DS_Store
2+
tmp

README.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,25 @@
11
# Java Cursor AI rules
22

3-
A collection of cursor rules for Java space
3+
A collection of Cursor rules for Java space.
4+
5+
![](./docs/cursor-settings.png)
46

57
## Rules
68

7-
- [Java](.cursor/rules/01-java.md)
8-
- [Effective Java](.cursor/rules/02-effective-java.md)
9-
- [Concurrency](.cursor/rules/03-concurrency.md)
10-
- [Functional Programming](.cursor/rules/04-functional-programming.md)
11-
- [Data oriented programming](.cursor/rules/05-data-oriented-programming.md)
12-
- [Spring boot](.cursor/rules/06-spring-boot.md)
9+
- [Java](.cursor/rules/01-java.mdc)
10+
- [Effective Java](.cursor/rules/02-effective-java.mdc)
11+
- [Concurrency](.cursor/rules/03-concurrency.mdc)
12+
- [Functional Programming](.cursor/rules/04-functional-programming.mdc)
13+
- [Data oriented programming](.cursor/rules/05-data-oriented-programming.mdc)
14+
- [Spring boot](.cursor/rules/06-spring-boot.mdc)
1315

1416
## References
1517

1618
- https://www.cursor.com/
17-
- https://docs.cursor.com/context/rules-for-ai
19+
- https://docs.cursor.com/context/rules-for-ai
20+
- https://docs.cursor.com/context/%40-symbols/%40-cursor-rules
21+
22+
### Articles
23+
24+
- https://dev.to/dpaluy/mastering-cursor-rules-a-developers-guide-to-smart-ai-integration-1k65
25+
- https://www.instructa.ai/en/blog/how-to-use-cursor-rules-in-version-0-45

0 commit comments

Comments
 (0)