Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .cursor/rules/110-java-maven-best-practices.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ alwaysApply: false
---
# Maven Best Practices

## System prompt characterization

Role definition: You are a Senior software engineer with extensive experience in Java software development

## Description

Effective Maven usage involves robust dependency management via `<dependencyManagement>` and BOMs, adherence to the standard directory layout, and centralized plugin management. Build profiles should be used for environment-specific configurations. POMs must be kept readable and maintainable with logical structure and properties for versions. Custom repositories should be declared explicitly and their use minimized, preferably managed via a central repository manager.

## Table of contents
Expand Down
6 changes: 6 additions & 0 deletions .cursor/rules/111-java-maven-deps-and-plugins.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ alwaysApply: false
---
# Update pom.xml to add Maven dependencies & plugins

## System prompt characterization

Role definition: You are a Senior software engineer with extensive experience in Java software development

## Description

This rule provides a comprehensive, conversational approach to updating Maven pom.xml files with properties, dependencies, plugins, and profiles. It MUST ask questions first to understand the project needs and then conditionally add only relevant components.

**⚠️ CRITICAL: NO CACHING OF QUESTIONS ⚠️**
Expand Down
6 changes: 6 additions & 0 deletions .cursor/rules/112-java-maven-documentation.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ alwaysApply: false
---
# Create README-DEV.md with information about how to use the Maven project

## System prompt characterization

Role definition: You are a Senior software engineer with extensive experience in Java software development

## Description

When creating a README-DEV.md file for a Maven project, include ONLY the following sections with the specified Maven goals. Do NOT add any additional sections, explanations, or content beyond what is explicitly listed below.

## STRICT Structure for README-DEV.md (Template):
Expand Down
6 changes: 6 additions & 0 deletions .cursor/rules/121-java-object-oriented-design.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ alwaysApply: false
---
# Java Object-Oriented Design Guidelines

## System prompt characterization

Role definition: You are a Senior software engineer with extensive experience in Java software development

## Description

This document provides comprehensive guidelines for robust Java object-oriented design and refactoring. It emphasizes core principles like SOLID, DRY, and YAGNI, best practices for class and interface design including favoring composition over inheritance and designing for immutability. The rules also cover mastering encapsulation, inheritance, and polymorphism, and finally, identifying and refactoring common object-oriented design code smells such as God Classes, Feature Envy, and Data Clumps to promote maintainable, flexible, and understandable code.

## Implementing These Principles
Expand Down
6 changes: 6 additions & 0 deletions .cursor/rules/122-java-type-design.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ alwaysApply: false
---
# Type Design Thinking in Java

## System prompt characterization

Role definition: You are a Senior software engineer with extensive experience in Java software development

## Description

Type design thinking in Java applies typography principles to code structure and organization. Just as typography creates readable, accessible text, thoughtful type design in Java produces maintainable, comprehensible code.

## Implementing These Principles
Expand Down
6 changes: 6 additions & 0 deletions .cursor/rules/123-java-general-guidelines.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ alwaysApply: false
---
# Java General Guidelines

## System prompt characterization

Role definition: You are a Senior software engineer with extensive experience in Java software development

## Description

This document outlines general Java coding guidelines covering fundamental aspects such as naming conventions for packages, classes, methods, variables, and constants; code formatting rules including indentation, line length, brace style, and whitespace usage; standards for organizing import statements; best practices for Javadoc documentation; and comprehensive error and exception handling with a strong focus on security, including avoiding sensitive information exposure, catching specific exceptions, and secure resource management.

## Implementing These Principles
Expand Down
6 changes: 6 additions & 0 deletions .cursor/rules/124-java-secure-coding.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ alwaysApply: false
---
# Java Secure coding guidelines

## System prompt characterization

Role definition: You are a Senior software engineer with extensive experience in Java software development

## Description

This document provides essential Java secure coding guidelines, focusing on five key areas: validating all untrusted inputs to prevent attacks like injection and path traversal; protecting against injection attacks (e.g., SQL injection) by using parameterized queries or prepared statements; minimizing the attack surface by adhering to the principle of least privilege and reducing exposure; employing strong, current cryptographic algorithms for hashing, encryption, and digital signatures while avoiding deprecated ones; and handling exceptions securely by avoiding the exposure of sensitive information in error messages to users and logging detailed, non-sensitive diagnostic information for developers.

## Implementing These Principles
Expand Down
6 changes: 6 additions & 0 deletions .cursor/rules/125-java-concurrency.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ alwaysApply: false
---
# Java rules for Concurrency objects

## System prompt characterization

Role definition: You are a Senior software engineer with extensive experience in Java software development

## Description

Effective Java concurrency relies on understanding thread safety fundamentals, using `java.util.concurrent` utilities, and managing thread pools with `ExecutorService`. Key practices include implementing concurrent design patterns like Producer-Consumer, leveraging `CompletableFuture` for asynchronous tasks, and ensuring thread safety through immutability and safe publication. Performance aspects like lock contention and memory consistency must be considered. Thorough testing, including stress tests and thread dump analysis, is crucial. Modern Java offers virtual threads for enhanced scalability, structured concurrency for simplified task management, and scoped values for safer thread-shared data as alternatives to thread-locals.

## Implementing These Principles
Expand Down
6 changes: 6 additions & 0 deletions .cursor/rules/126-java-logging.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ alwaysApply: false
---
# Java Logging Best Practices

## System prompt characterization

Role definition: You are a Senior software engineer with extensive experience in Java software development

## Description

Effective Java logging involves selecting a standard framework (SLF4J with Logback/Log4j2), using appropriate log levels (ERROR, WARN, INFO, DEBUG, TRACE),
and adhering to core practices like parameterized logging, proper exception handling, and avoiding sensitive data exposure.
Configuration should be environment-specific with clear output formats.
Expand Down
6 changes: 6 additions & 0 deletions .cursor/rules/131-java-unit-testing.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ alwaysApply: false
---
# Java Unit testing guidelines

## System prompt characterization

Role definition: You are a Senior software engineer with extensive experience in Java software development

## Description

Effective Java unit testing involves using JUnit 5 annotations and AssertJ for fluent assertions. Tests should follow the Given-When-Then structure with descriptive names for clarity. Each test must have a single responsibility, be independent, and leverage parameterized tests for data variations. Mocking dependencies with frameworks like Mockito is crucial for isolating the unit under test. While code coverage is a useful guide, the focus should be on meaningful tests for critical logic and edge cases. Test classes and methods should typically be package-private. Strategies for code splitting include small test methods and helper functions. Anti-patterns like testing implementation details, hard-coded values, and ignoring failures should be avoided. Proper state management involves isolated state and immutable objects, and error handling should include testing for expected exceptions and their messages.

## Implementing These Principles
Expand Down
6 changes: 6 additions & 0 deletions .cursor/rules/141-java-refactoring-with-modern-features.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ alwaysApply: false
---
# Modern Java Development Guidelines (Java 8+)

## System prompt characterization

Role definition: You are a Senior software engineer with extensive experience in Java software development

## Description

Modern Java development (Java 8+) emphasizes leveraging lambda expressions and functional interfaces over anonymous classes, and using the Stream API for declarative collection processing. The `Optional` API should be used for handling potentially absent values gracefully, and the `java.time` API for all date/time operations. Default methods allow non-breaking interface evolution. Local Variable Type Inference (`var`) can improve readability when used judiciously. Unmodifiable collection factory methods (`List.of()`, etc.) provide concise immutable collections. `CompletableFuture` facilitates composable asynchronous programming. The Java Platform Module System (JPMS, Java 9+) enables strong encapsulation. Performance implications of new features should be considered and profiled. Testing strategies need to adapt to these modern features, and text blocks (Java 15+) offer improved readability for multi-line strings.

## Implementing These Principles
Expand Down
6 changes: 6 additions & 0 deletions .cursor/rules/142-java-functional-programming.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ alwaysApply: false
---
# Java Functional Programming rules

## System prompt characterization

Role definition: You are a Senior software engineer with extensive experience in Java software development

## Description

Java functional programming revolves around immutable objects and state transformations, ensuring functions are pure (no side effects, depend only on inputs). It leverages functional interfaces, concise lambda expressions, and the Stream API for collection processing. Core paradigms include function composition, `Optional` for null safety, and higher-order functions. Modern Java features like Records enhance immutable data transfer, while pattern matching (for `instanceof` and `switch`) and switch expressions improve conditional logic. Sealed classes and interfaces enable controlled, exhaustive hierarchies, and upcoming Stream Gatherers will offer advanced custom stream operations.

## Implementing These Principles
Expand Down
6 changes: 6 additions & 0 deletions .cursor/rules/143-java-data-oriented-programming.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ alwaysApply: false
---
# Java rules to apply data oriented programming style

## System prompt characterization

Role definition: You are a Senior software engineer with extensive experience in Java software development

## Description

Java Data-Oriented Programming emphasizes separating code (behavior) from data structures, which should ideally be immutable (e.g., using records). Data manipulation should occur via pure functions that transform data into new instances. It's often beneficial to keep data structures flat and denormalized (using IDs for references) where appropriate, and to start with generic data representations (like `Map<String, Object>`) converting to specific types only when necessary. Data integrity is ensured through pure validation functions. Flexible, generic data access layers facilitate working with various data types and storage mechanisms. All data transformations should be explicit, traceable, and composed of clear, pure functional steps.

## Implementing These Principles
Expand Down
20 changes: 20 additions & 0 deletions .cursor/rules/151-java-profiling-detect.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,26 @@ alwaysApply: false
---
# Java Profiling Workflow / Step 1 / Collect data to measure potential issues

## System prompt characterization

Role definition: You are a Senior software engineer with extensive experience in Java software development

## Description

This cursor rule provides a comprehensive Java application profiling framework designed to detect and measure performance issues systematically. It serves as the first step in a structured profiling workflow, focusing on data collection and problem identification using async-profiler v4.0.

The rule automates the entire profiling setup process, from detecting running Java processes to downloading and configuring the appropriate profiler tools for your system. It provides interactive scripts that guide you through identifying specific performance problems (CPU hotspots, memory leaks, concurrency issues, GC problems, or I/O bottlenecks) and then executes targeted profiling commands to collect relevant performance data.

Key capabilities include:
- **Automated Environment Setup**: Detects OS/architecture and downloads async-profiler v4.0 automatically
- **Problem-Driven Profiling**: Guides users through identifying specific performance issues before profiling
- **Interactive Workflow**: Provides menu-driven interface for selecting appropriate profiling strategies
- **Comprehensive Data Collection**: Supports CPU profiling, memory allocation tracking, lock contention analysis, GC monitoring, and I/O bottleneck detection
- **Modern Tooling**: Leverages async-profiler v4.0 features including interactive heatmaps, native memory leak detection, and enhanced JFR conversion
- **Organized Results**: Maintains clean directory structure with timestamped results for easy analysis and comparison

The rule ensures consistent, repeatable profiling procedures while providing the flexibility to target specific performance concerns based on your application's behavior and suspected issues.

## ⚠️ CRITICAL INSTRUCTION FOR AI ASSISTANTS ⚠️

**WHEN USING THE PROFILING SCRIPT TEMPLATE:**
Expand Down
20 changes: 20 additions & 0 deletions .cursor/rules/152-java-profiling-analyze.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,26 @@ alwaysApply: false
---
# Java Profiling Workflow / Step 2 / Analyze profiling data

## System prompt characterization

Role definition: You are a Senior software engineer with extensive experience in Java software development

## Description

This cursor rule provides a systematic approach to analyzing Java profiling data collected during the detection phase. It serves as the second step in the structured profiling workflow, focusing on interpreting profiling results, identifying root causes, and documenting findings with actionable solutions.

The rule establishes a comprehensive analysis framework that transforms raw profiling data into meaningful insights. It guides users through systematically examining flamegraphs, memory allocation patterns, CPU hotspots, and threading issues to identify performance bottlenecks and their underlying causes.

Key capabilities include:
- **Systematic Analysis Framework**: Structured approach to examining different types of profiling data (CPU, memory, threading, GC)
- **Problem Categorization**: Clear methodology for classifying issues by severity, impact, and type (memory leaks, CPU hotspots, threading problems)
- **Evidence Documentation**: Standardized templates for documenting findings with specific references to profiling files and quantitative metrics
- **Solution Development**: Framework for creating prioritized, actionable recommendations with implementation effort estimates
- **Cross-Correlation Analysis**: Techniques for correlating multiple profiling results and identifying patterns across different time periods
- **Impact Assessment**: Scoring system for prioritizing fixes based on performance impact and implementation effort

The rule ensures that profiling data is analyzed consistently and thoroughly, with findings documented in a format that enables effective communication with development teams and systematic tracking of performance improvements.

## Project Organization

The profiling setup uses a clean folder structure with everything contained in the profiler directory:
Expand Down
Loading