@@ -3,7 +3,6 @@ description: General java rules
33globs: .java
44alwaysApply: true
55---
6-
76# AI Developer Profile
87
98ai_persona:
@@ -18,10 +17,10 @@ ai_persona:
1817 - FP
1918 - DDD
2019
21- # Technical Stack
20+ ## Technical Stack
2221
2322tech_stack:
24- framework: Spring Boot
23+ framework: Spring Boot or Quarkus
2524 build_tool: Maven
2625 java_version: 24
2726 dependencies:
@@ -33,4 +32,164 @@ tech_stack:
3332 - JQwik
3433 - JMH
3534 language: English
36- code_comments: English
35+ code_comments: English
36+
37+ ## Code Style Guidelines
38+
39+ code_style:
40+ naming_conventions:
41+ classes:
42+ - "Use PascalCase for class names"
43+ - "Use nouns or noun phrases"
44+ - "Be descriptive and avoid abbreviations"
45+ methods:
46+ - "Use camelCase for method names"
47+ - "Start with verbs"
48+ - "Be descriptive of the action performed"
49+ variables:
50+ - "Use camelCase for variable names"
51+ - "Be descriptive and meaningful"
52+ - "Avoid single letter names except for loops"
53+ constants:
54+ - "Use UPPER_SNAKE_CASE for constants"
55+ - "Be descriptive and clear"
56+ packages:
57+ - "Use lowercase"
58+ - "Use reverse domain name notation"
59+ - "Avoid underscores"
60+
61+ formatting:
62+ indentation: "4 spaces"
63+ line_length: "120 characters maximum"
64+ braces:
65+ - "Opening brace on same line"
66+ - "Closing brace on new line"
67+ whitespace:
68+ - "One blank line between methods"
69+ - "Two blank lines between classes"
70+ - "No trailing whitespace"
71+
72+ ## Architecture Guidelines
73+
74+ architecture:
75+ layers:
76+ presentation:
77+ - "REST controllers"
78+ - "GraphQL resolvers"
79+ - "Request/Response DTOs"
80+ business:
81+ - "Services"
82+ - "Domain models"
83+ - "Business logic"
84+ persistence:
85+ - "Repositories"
86+ - "Entity models"
87+ - "Database operations"
88+
89+ patterns:
90+ recommended:
91+ - "Repository Pattern"
92+ - "Factory Pattern"
93+ - "Builder Pattern"
94+ - "Strategy Pattern"
95+ - "Observer Pattern"
96+ - "Dependency Injection"
97+
98+ antipatterns_to_avoid:
99+ - "God Classes"
100+ - "Golden Hammer"
101+ - "Spaghetti Code"
102+ - "Magic Numbers/Strings"
103+
104+ ## Testing Standards
105+
106+ testing:
107+ unit_tests:
108+ naming: "should_expectedBehavior_when_condition"
109+ coverage_targets:
110+ minimum: "80%"
111+ preferred: "90%"
112+ practices:
113+ - "Use descriptive test names"
114+ - "Follow AAA pattern (Arrange-Act-Assert)"
115+ - "One assertion per test"
116+ - "Use appropriate assertions"
117+ - "Mock external dependencies"
118+
119+ integration_tests:
120+ naming: "should_expectedBehavior_when_condition_IT"
121+ practices:
122+ - "Test component interactions"
123+ - "Use test containers for dependencies"
124+ - "Clean up test data"
125+ - "Use appropriate profiles"
126+
127+ ## Security Guidelines
128+
129+ security:
130+ input_validation:
131+ - "Validate all input data"
132+ - "Use parameterized queries"
133+ - "Sanitize user input"
134+ authentication:
135+ - "Use strong password policies"
136+ - "Implement MFA where appropriate"
137+ - "Use secure session management"
138+ authorization:
139+ - "Implement role-based access control"
140+ - "Follow principle of least privilege"
141+ - "Validate permissions at each layer"
142+ data_protection:
143+ - "Encrypt sensitive data"
144+ - "Use secure communication protocols"
145+ - "Implement proper key management"
146+
147+ ## Performance Guidelines
148+
149+ performance:
150+ optimization:
151+ - "Use appropriate data structures"
152+ - "Optimize database queries"
153+ - "Implement caching where appropriate"
154+ - "Use lazy loading when possible"
155+ - "Minimize object creation"
156+ monitoring:
157+ - "Use appropriate logging levels"
158+ - "Implement metrics collection"
159+ - "Monitor resource usage"
160+ - "Set up alerting"
161+
162+ ## Documentation Standards
163+
164+ documentation:
165+ code_comments:
166+ - "Write self-documenting code"
167+ - "Comment complex algorithms"
168+ - "Explain business rules"
169+ - "Document public APIs"
170+ javadoc:
171+ required_elements:
172+ - "@param for parameters"
173+ - "@return for return values"
174+ - "@throws for exceptions"
175+ - "@since for version tracking"
176+ style:
177+ - "Clear and concise"
178+ - "Complete sentences"
179+ - "Proper grammar"
180+
181+ ## Error Handling
182+
183+ error_handling:
184+ principles:
185+ - "Use specific exceptions"
186+ - "Handle exceptions at appropriate levels"
187+ - "Provide meaningful error messages"
188+ - "Log errors with context"
189+ practices:
190+ - "Don't swallow exceptions"
191+ - "Clean up resources in finally blocks"
192+ - "Use try-with-resources"
193+ - "Implement proper fallback mechanisms"
194+
195+
0 commit comments