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
1 change: 1 addition & 0 deletions .cursor/rules/126-java-observability-logging.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
name: 126-java-observability-logging
description: Use when you need to implement or improve Java logging and observability — including selecting SLF4J with Logback/Log4j2, applying proper log levels, parameterized logging, secure logging without sensitive data exposure, environment-specific configuration, log aggregation and monitoring, or validating logging through tests.
license: Apache-2.0
metadata:
author: Juan Antonio Breña Moral
Expand Down
1 change: 1 addition & 0 deletions .cursor/rules/151-java-performance-jmeter.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
name: 151-java-performance-jmeter
description: Use when you need to set up JMeter performance testing for a Java project — including creating the run-jmeter.sh script from the exact template, configuring load tests with loops, threads, and ramp-up, or running performance tests from the project root.
license: Apache-2.0
metadata:
author: Juan Antonio Breña Moral
Expand Down
1 change: 1 addition & 0 deletions .cursor/rules/161-java-profiling-detect.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
name: 161-java-profiling-detect
description: Use when you need to set up Java application profiling to detect and measure performance issues — including automated async-profiler v4.0 setup, problem-driven profiling (CPU, memory, threading, GC, I/O), interactive profiling scripts, or collecting profiling data with flamegraphs and JFR recordings.
license: Apache-2.0
metadata:
author: Juan Antonio Breña Moral
Expand Down
1 change: 1 addition & 0 deletions .cursor/rules/162-java-profiling-analyze.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
name: 162-java-profiling-analyze
description: Use when you need to analyze Java profiling data collected during the detection phase — including interpreting flamegraphs, memory allocation patterns, CPU hotspots, threading issues, systematic problem categorization, evidence documentation, or prioritizing fixes using Impact/Effort scoring.
license: Apache-2.0
metadata:
author: Juan Antonio Breña Moral
Expand Down
1 change: 1 addition & 0 deletions .cursor/rules/163-java-profiling-refactor.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
name: 163-java-profiling-refactor
description: Use when you need to refactor Java code based on profiling analysis findings — including reviewing profiling-problem-analysis and profiling-solutions documents, identifying specific performance bottlenecks, and implementing targeted code changes to address them.
license: Apache-2.0
metadata:
author: Juan Antonio Breña Moral
Expand Down
1 change: 1 addition & 0 deletions .cursor/rules/164-java-profiling-verify.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
name: 164-java-profiling-verify
description: Use when you need to verify Java performance optimizations by comparing profiling results before and after refactoring — including baseline validation, post-refactoring report generation, quantitative before/after metrics comparison, side-by-side flamegraph analysis, or creating profiling-comparison-analysis and profiling-final-results documentation.
license: Apache-2.0
metadata:
author: Juan Antonio Breña Moral
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

## Goal

The project provides a curated collection of `System prompts` & `Skills` for moden `SDLC` that help software engineers and pipelines in their daily work for Java Enterprise development.
The project provides a curated collection of `System prompts` & `Skills` for modern `SDLC` that help software engineers and pipelines in their daily work for Java Enterprise development.

The project add support for:

Expand Down
4 changes: 2 additions & 2 deletions docs/2/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
<div class="page-heading">
<h1>Cursor rules and Skills for Java</h1>
<hr class="small">
<span class="page-subheading">A curated collection of System prompts and Skills for Java Enterprise development that help software engineers in their daily programming work & pipelines.</span>
<span class="page-subheading">A curated collection of System prompts & Skills for modern SDLC that help software engineers and pipelines in their daily work for Java Enterprise development</span>
</div>
</div>
</div>
Expand All @@ -93,7 +93,7 @@ <h1>Cursor rules and Skills for Java</h1>
<div class="page-heading">
<h1>Cursor rules and Skills for Java</h1>
<hr class="small">
<span class="page-subheading">A curated collection of System prompts and Skills for Java Enterprise development that help software engineers in their daily programming work & pipelines.</span>
<span class="page-subheading">A curated collection of System prompts & Skills for modern SDLC that help software engineers and pipelines in their daily work for Java Enterprise development</span>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/feed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<feed xmlns='http://www.w3.org/2005/Atom' xml:lang='en'>
<id>https://jabrena.github.io/cursor-rules-java/</id>
<title>Cursor rules and Skills for Java</title>
<updated>2026-03-09T08:27:24+0100</updated>
<updated>2026-03-17T21:07:38+0100</updated>
<link rel="alternate" type="text/html" href="https://jabrena.github.io/cursor-rules-java/" />
<link rel='self' type='application/atom+xml' href='https://jabrena.github.io/cursor-rules-java//feed.xml' />
<entry>
Expand Down
4 changes: 2 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
<div class="page-heading">
<h1>Cursor rules and Skills for Java</h1>
<hr class="small">
<span class="page-subheading">A curated collection of System prompts and Skills for Java Enterprise development that help software engineers in their daily programming work & pipelines.</span>
<span class="page-subheading">A curated collection of System prompts & Skills for modern SDLC that help software engineers and pipelines in their daily work for Java Enterprise development</span>
</div>
</div>
</div>
Expand All @@ -93,7 +93,7 @@ <h1>Cursor rules and Skills for Java</h1>
<div class="page-heading">
<h1>Cursor rules and Skills for Java</h1>
<hr class="small">
<span class="page-subheading">A curated collection of System prompts and Skills for Java Enterprise development that help software engineers in their daily programming work & pipelines.</span>
<span class="page-subheading">A curated collection of System prompts & Skills for modern SDLC that help software engineers and pipelines in their daily work for Java Enterprise development</span>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<version>0.13.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>cursor-rules-java</name>
<description>The project provides a curated collection of System prompts and Skills for moden
<description>The project provides a curated collection of System prompts and Skills for modern
SDLC that help software engineers and pipelines in their daily work for Java Enterprise
development.</description>

Expand Down
2 changes: 1 addition & 1 deletion site-generator/jbake.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ server.contextPath=/cursor-rules-java
site.lang=en

site.title=Cursor rules and Skills for Java
site.subtitle=A curated collection of System prompts and Skills for Java Enterprise development that help software engineers in their daily programming work & pipelines.
site.subtitle=A curated collection of System prompts & Skills for modern SDLC that help software engineers and pipelines in their daily work for Java Enterprise development
site.avatar=images/avatar-icon.png

index.bigimg=images/jwst-image-rawpixel.jpg
Expand Down
7 changes: 7 additions & 0 deletions skills-generator/src/main/resources/skill-inventory.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,19 @@
{"id": "123", "xml": true},
{"id": "124", "xml": true},
{"id": "125", "xml": true},
{"id": "126", "xml": true},
{"id": "128", "xml": true},
{"id": "131", "xml": true},
{"id": "132", "xml": true},
{"id": "141", "xml": true},
{"id": "142", "xml": true},
{"id": "143", "xml": true},
{"id": "144", "xml": true},
{"id": "151", "xml": true},
{"id": "161", "xml": true},
{"id": "162", "xml": true},
{"id": "163", "xml": true},
{"id": "164", "xml": true},
{"id": "170", "xml": true},
{"id": "171", "xml": true},
{"id": "172", "xml": true},
Expand Down
40 changes: 40 additions & 0 deletions skills-generator/src/main/resources/skills/126-skill.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<skill xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../schemas/skill.xsd"
id="126-java-observability-logging">
<metadata>
<author>Juan Antonio Breña Moral</author>
<version>0.13.0-SNAPSHOT</version>
<license>Apache-2.0</license>
</metadata>

<title>Java Logging Best Practices</title>
<description>Use when you need to implement or improve Java logging and observability — including selecting SLF4J with Logback/Log4j2, applying proper log levels (ERROR, WARN, INFO, DEBUG, TRACE), parameterized logging, secure logging without sensitive data exposure, environment-specific configuration, log aggregation and monitoring, or validating logging through tests.</description>
<goal><![CDATA[
Implement effective Java logging following standardized frameworks, meaningful log levels, core practices (parameterized logging, exception handling, no sensitive data), flexible configuration, security-conscious logging, monitoring and alerting, and comprehensive logging validation through testing.

**What is covered in this Skill?**

- Standardized framework selection: SLF4J facade with Logback or Log4j2
- Meaningful and consistent log levels: ERROR, WARN, INFO, DEBUG, TRACE
- Core practices: parameterized logging, proper exception handling, avoiding sensitive data
- Configuration: environment-specific (logback.xml, log4j2.xml), output formats, log rotation
- Security: mask sensitive data, control log access, secure transmission, GDPR/HIPAA compliance
- Log monitoring and alerting: centralized aggregation (ELK, Splunk, Loki), automated alerts
- Logging validation through testing: assert log messages, verify formats, test levels, measure performance impact

**Scope:** The reference is organized by examples (good/bad code patterns) for each core area. Apply recommendations based on applicable examples.
]]></goal>

<constraints>
<constraints-description>Before applying any logging recommendations, ensure the project compiles. Compilation failure is a blocking condition. After applying improvements, run full verification.</constraints-description>
<constraint-list>
<constraint>**MANDATORY**: Run `./mvnw compile` or `mvn compile` before applying any change</constraint>
<constraint>**SAFETY**: If compilation fails, stop immediately — do not proceed until resolved</constraint>
<constraint>**VERIFY**: Run `./mvnw clean verify` or `mvn clean verify` after applying improvements</constraint>
<constraint>**BEFORE APPLYING**: Read the reference for detailed good/bad examples, constraints, and safeguards for each logging pattern</constraint>
</constraint-list>
</constraints>

<reference path="references/126-java-observability-logging.md" />
</skill>
40 changes: 40 additions & 0 deletions skills-generator/src/main/resources/skills/144-skill.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<skill xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../schemas/skill.xsd"
id="144-java-data-oriented-programming">
<metadata>
<author>Juan Antonio Breña Moral</author>
<version>0.13.0-SNAPSHOT</version>
<license>Apache-2.0</license>
</metadata>

<title>Java Data-Oriented Programming Best Practices</title>
<description>Use when you need to apply data-oriented programming best practices in Java — including separating code (behavior) from data structures using records, designing immutable data with pure transformation functions, keeping data flat and denormalized with ID-based references, starting with generic data structures converting to specific types when needed, ensuring data integrity through pure validation functions, and creating flexible generic data access layers.</description>
<goal><![CDATA[
Apply data-oriented programming in Java: separate data from behavior with records, use immutable data structures, pure functions for transformations, flat denormalized structures with ID references, generic-to-specific type conversion when needed, pure validation functions, and flexible generic data access layers. All transformations should be explicit, traceable, and composed of clear pure functional steps.

**What is covered in this Skill?**

- Separation of concerns: data structures (records, POJOs) vs behavior (utility classes, services)
- Immutability: records, final fields, transformations produce new instances
- Pure data transformations: functions depending only on inputs, no side effects
- Flat and denormalized data: ID references instead of deep nesting
- Generic until specific: Map&lt;String,Object&gt; for dynamic data, convert to records when processing
- Data integrity: pure validation functions returning validation results
- Flexible generic data access: generic CRUD interfaces, interchangeable implementations

**Scope:** The reference is organized by examples (good/bad code patterns) for each core area. Apply recommendations based on applicable examples.
]]></goal>

<constraints>
<constraints-description>Before applying any data-oriented programming recommendations, ensure the project compiles. Compilation failure is a blocking condition. After applying improvements, run full verification.</constraints-description>
<constraint-list>
<constraint>**MANDATORY**: Run `./mvnw compile` or `mvn compile` before applying any change</constraint>
<constraint>**SAFETY**: If compilation fails, stop immediately — do not proceed until resolved</constraint>
<constraint>**VERIFY**: Run `./mvnw clean verify` or `mvn clean verify` after applying improvements</constraint>
<constraint>**BEFORE APPLYING**: Read the reference for detailed good/bad examples, constraints, and safeguards for each data-oriented programming pattern</constraint>
</constraint-list>
</constraints>

<reference path="references/144-java-data-oriented-programming.md" />
</skill>
38 changes: 38 additions & 0 deletions skills-generator/src/main/resources/skills/151-skill.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<skill xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../schemas/skill.xsd"
id="151-java-performance-jmeter">
<metadata>
<author>Juan Antonio Breña Moral</author>
<version>0.13.0-SNAPSHOT</version>
<license>Apache-2.0</license>
</metadata>

<title>Run performance tests based on JMeter</title>
<description>Use when you need to set up JMeter performance testing for a Java project — including creating the run-jmeter.sh script from the exact template, configuring load tests with loops, threads, and ramp-up, or running performance tests from the project root with custom or default settings.</description>
<goal><![CDATA[
Provide a complete JMeter performance testing solution by creating the run-jmeter.sh script from the exact template, making it executable, and configuring the project structure for load testing. Supports custom loops, threads, ramp-up, and environment variable overrides.

**What is covered in this Skill?**

- Create run-jmeter.sh in project root from the exact template (no modifications)
- Project structure: src/test/resources/jmeter/load-test.jmx, target/ for results
- Script options: -l (loops), -t (threads), -r (ramp-up), -g (GUI), -h (help)
- Environment variables: JMETER_LOOPS, JMETER_THREADS, JMETER_RAMP_UP
- Verify JMeter is installed and available before proceeding

**Scope:** Copy the script template verbatim. Do not modify, interpret, or enhance the template content.
]]></goal>

<constraints>
<constraints-description>JMeter must be installed and available in PATH. If not available, show a message and exit. Use only the exact template for the run-jmeter.sh script.</constraints-description>
<constraint-list>
<constraint>**PREREQUISITE**: Verify JMeter is installed and accessible via `jmeter --version` before creating the script</constraint>
<constraint>**CRITICAL**: Copy the run-jmeter.sh template exactly — do not modify, interpret, or enhance</constraint>
<constraint>**PERMISSION**: Make the script executable with `chmod +x run-jmeter.sh`</constraint>
<constraint>**BEFORE APPLYING**: Read the reference for the exact script template and usage instructions</constraint>
</constraint-list>
</constraints>

<reference path="references/151-java-performance-jmeter.md" />
</skill>
39 changes: 39 additions & 0 deletions skills-generator/src/main/resources/skills/161-skill.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<skill xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../schemas/skill.xsd"
id="161-java-profiling-detect">
<metadata>
<author>Juan Antonio Breña Moral</author>
<version>0.13.0-SNAPSHOT</version>
<license>Apache-2.0</license>
</metadata>

<title>Java Profiling Workflow / Step 1 / Collect data to measure potential issues</title>
<description>Use when you need to set up Java application profiling to detect and measure performance issues — including automated async-profiler v4.0 setup, problem-driven profiling (CPU, memory, threading, GC, I/O), interactive profiling scripts, JFR integration with Java 25 (JEP 518, JEP 520), or collecting profiling data with flamegraphs and JFR recordings.</description>
<goal><![CDATA[
Set up the Java profiling detection phase: automated environment setup with async-profiler v4.0, problem-driven interactive profiling scripts, and comprehensive data collection for CPU hotspots, memory leaks, lock contention, GC issues, and I/O bottlenecks. Uses JEP 518 (Cooperative Sampling) and JEP 520 (Method Timing) for reduced overhead.

**What is covered in this Skill?**

- Run application with profiling JVM flags (run-java-process-for-profiling.sh)
- Interactive profiling script (profiler/scripts/profile-java-process.sh) — copy exact template
- Directory structure: profiler/scripts/, profiler/results/, profiler/current/
- Automated OS/architecture detection and async-profiler download
- CPU, memory, lock, GC, I/O profiling modes
- Flamegraph and JFR output with timestamped results

**Scope:** Use the exact bash script templates without modification or interpretation.
]]></goal>

<constraints>
<constraints-description>Copy bash scripts exactly from templates. Ensure JVM flags are applied for profiling compatibility. Verify Java processes are running before attaching profiler.</constraints-description>
<constraint-list>
<constraint>**CRITICAL**: Copy the bash script templates exactly — do not modify, interpret, or enhance</constraint>
<constraint>**SETUP**: Create profiler directory structure: profiler/scripts, profiler/results</constraint>
<constraint>**EXECUTABLE**: Make scripts executable with chmod +x</constraint>
<constraint>**BEFORE APPLYING**: Read the reference for exact script templates and setup instructions</constraint>
</constraint-list>
</constraints>

<reference path="references/161-java-profiling-detect.md" />
</skill>
Loading
Loading