Skip to content

Commit 76513fa

Browse files
authored
Improving AGENTS.md (#329)
1 parent d7d47f8 commit 76513fa

16 files changed

Lines changed: 4310 additions & 174 deletions

AGENTS.md

Lines changed: 174 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,39 +6,191 @@ A collection of `System prompts` for Java Enterprise development.
66

77
### Repository Layout
88

9-
- `.cursor/rules`: a collection of `System prompts` for Java Enterprise development. The main outcome of this project.
10-
- `system-prompts-generator`: a Java project designed to build the System prompts based on XML documents.
11-
- `examples`: a collection of Java examples designed to test with the different System prompts.
12-
- `site-generator`: JBake project designed to autogenerate public site in `docs` folder
13-
- `documentation`: Diverse documentation about the project
9+
```
10+
java-cursor-rules/
11+
├── .cursor/rules/ # 🎯 25 System prompts for Java Enterprise development (main output)
12+
├── system-prompts-generator/ # 🏗️ Java transformation engine (XML → Markdown cursor rules)
13+
│ ├── src/main/resources/ # XML rule definitions + XSLT stylesheets
14+
│ └── src/test/java/ # Automated testing for rule generation
15+
├── examples/ # 🧪 9 comprehensive demo projects
16+
│ ├── spring-boot-demo/ # Complete agile workflow with requirements
17+
│ ├── spring-boot-*-demo/ # Performance, memory leak, JMeter demos
18+
│ ├── quarkus-demo/ # Supersonic Subatomic Java framework
19+
│ ├── aws-lambda-hello-world/ # Serverless Java on AWS
20+
│ ├── azure-function-hello-world/ # Serverless Java on Azure
21+
│ └── maven-demo*/ # Testing scenarios (working + broken)
22+
├── site-generator/ # 📚 JBake-powered educational website generator
23+
│ ├── content/ # Blog posts, courses, documentation
24+
│ ├── templates/ # 18 FreeMarker templates for different content types
25+
│ └── assets/ # CSS, JS, images for website
26+
├── documentation/ # 📖 Comprehensive documentation ecosystem
27+
│ ├── adr/ # Architectural Decision Records (3 ADRs)
28+
│ ├── reviews/ # AI tool compatibility matrices & evaluations
29+
│ ├── jeps/ # Java Enhancement Proposals tracking
30+
│ ├── dvbe25/ # 🎤 Conference presentation (Reveal.js)
31+
│ └── excalidraw/ # System diagrams and visual documentation
32+
└── docs/ # 🌐 Generated static website (GitHub Pages)
33+
├── courses/java-generics/ # 5-module structured learning course
34+
├── blog/ # Technical articles and release notes
35+
└── tags/ # 23 topic-based content organization
36+
```
1437

15-
## Build and test commands
38+
## Modules
1639

17-
- Improve current tests to generate better System prompts encoded in Markdown format
18-
- Develop or Refactor current System prompts with new Examples
40+
### 🎯 .cursor/rules/
41+
The main output of the project - a collection of 25 system prompts for Java Enterprise development. These Markdown files are automatically generated from XML sources and provide AI coding assistance across build systems, design patterns, testing, profiling, and documentation.
1942

20-
When you add new code, format the code before testing:
43+
### 🏗️ system-prompts-generator/
44+
Java transformation engine that converts XML rule definitions into Markdown cursor rules using XSLT. Features a 4-stage functional pipeline with XInclude support for modularity, automated testing, and Maven integration for deployment to `.cursor/rules/`.
2145

22-
```bash
23-
./mvnw clean spotless:apply
24-
```
46+
### 🧪 examples/
47+
Nine comprehensive demo projects showcasing different Java frameworks and scenarios:
48+
- **Spring Boot demos**: Complete agile workflows, performance testing, memory leak analysis, JMeter integration
49+
- **Quarkus demo**: Supersonic Subatomic Java framework demonstration
50+
- **Cloud demos**: AWS Lambda and Azure Functions serverless examples
51+
- **Maven demos**: Both working and intentionally broken projects for testing cursor rules
52+
53+
### 📚 site-generator/
54+
JBake-powered static site generator that transforms Markdown content into a professional documentation website. Features 18 specialized FreeMarker templates, structured learning courses (like the 5-module Java Generics course), blog system with tagging, and automated deployment to GitHub Pages.
55+
56+
### 📖 documentation/
57+
Comprehensive documentation ecosystem including:
58+
- **ADRs**: 3 Architectural Decision Records documenting technical choices
59+
- **Reviews**: AI tool compatibility matrices and evaluations
60+
- **JEPs**: Java Enhancement Proposals tracking for language evolution
61+
- **Conference Materials**: Reveal.js presentation for conferences and meetups
62+
- **Visual Documentation**: Excalidraw diagrams and system visualizations
63+
64+
### 🌐 docs/
65+
Generated static website deployed to GitHub Pages, containing structured courses, technical blog posts, and topic-based navigation with 23 different tags for content organization.
66+
67+
## Development Guidelines
68+
69+
- **Rule Editing**: Don't update files in `.cursor/rules` directly - find the XML source files in `system-prompts-generator/src/main/resources/`
70+
- **Java Version**: The project is based on Java 24
71+
- **Build Workflow**: Use the XML-to-Markdown transformation pipeline to generate cursor rules from XML sources
72+
- **Testing**: Always run tests before promoting changes to ensure rule generation works correctly
73+
74+
## The Comprehensive Documentation Ecosystem
75+
76+
The repository includes a sophisticated documentation framework with multiple specialized components:
77+
78+
### 1. Architectural Decision Records (ADRs)
79+
- **Location**: `documentation/adr/`
80+
- **Purpose**: Formal documentation of technical decisions with rationale and consequences
81+
- **Content**: 3 ADRs covering major architectural choices:
82+
- XML-based rule generation approach
83+
- Manual scope configuration
84+
- Website generation strategy
85+
86+
### 2. Tool Compatibility & Review System
87+
- **Location**: `documentation/reviews/`
88+
- **Purpose**: Systematic evaluation of AI coding assistants
89+
- **Content**: Detailed comparison matrices of 6+ AI tools (Cursor, JetBrains, GitHub Copilot, etc.)
90+
- **Metrics**: Usability, response speed, reasoning, model support, context windows
91+
92+
### 3. Java Enhancement Proposals (JEPs) Tracking
93+
- **Location**: `documentation/jeps/`
94+
- **Purpose**: Continuous monitoring of Java language evolution from Java 8 to Java 25
95+
- **Integration**: Analysis of how new JEPs could improve existing cursor rules
96+
- **Value**: Keeps the project current with Java language developments
97+
98+
## System Architecture
2599

26-
Run the tests:
100+
### The Transformation Pipeline
27101

102+
The repository implements a sophisticated XML-to-Markdown transformation system that powers the entire cursor rules generation process through a multi-stage pipeline:
103+
104+
#### Core Architecture
105+
- **XML Schema-Based Rule Definitions**: 25+ structured XML files defining complete cursor rules following a common vocabulary defined by [pml.xsd](https://jabrena.github.io/pml/schemas/0.1.0-SNAPSHOT/pml.xsd) (see [system-prompts-generator/src/main/resources/](system-prompts-generator/src/main/resources/))
106+
- **XSLT Transformation Engine**: Single unified stylesheet (`cursor-rules.xsl`) converting XML to Markdown
107+
- **Java Processing Pipeline**: 4-stage functional pipeline with XInclude support for modularity
108+
- **Modular Fragment System**: 13 reusable templates and automation scripts
109+
110+
#### Transformation Flow
111+
```
112+
XML Rule Definitions → XInclude Processing → XSLT Transformation → Markdown Cursor Rules
113+
```
114+
115+
#### Key Benefits
116+
- **Consistency at Scale**: All 25+ cursor rules follow identical structure and formatting
117+
- **Domain-Specific Language**: Structured approach to prompt engineering with reusable components
118+
- **Enterprise Maintainability**: Single source of truth with automated testing and deployment
119+
- **Build Integration**: Maven-driven automation with automatic deployment to `.cursor/rules/`
120+
121+
This pipeline essentially functions as a **compiler for cursor rules**, transforming high-level XML specifications into deployable Markdown files while ensuring consistency, maintainability, and scalability across the entire rule set.
122+
123+
### Site Generation & Public Documentation System
124+
125+
The repository includes a comprehensive **JBake-powered static site generator** that transforms Markdown content into a professional documentation website deployed at `https://jabrena.github.io/cursor-rules-java/`.
126+
127+
#### Architecture & Integration
128+
- **Technology Stack**: JBake 2.7.0-rc.7 with FreeMarker templates and Maven integration
129+
- **Build Integration**: Dedicated Maven module (`site-generator`) with specialized profile (`site-update`)
130+
- **Output Location**: Generates static HTML/CSS/JS files in the `docs/` directory for GitHub Pages deployment
131+
- **Content Pipeline**: Markdown → JBake → Static HTML → GitHub Pages
132+
133+
#### Content Organization
134+
- **Blog System**: Technical articles with date-based organization and tagging
135+
- Release announcements and changelogs
136+
- Technical deep-dives (e.g., "The Three-Node Quality Framework for AI Prompts")
137+
- Feature explanations and tutorials
138+
- **Course Generation**: Structured learning modules with progressive complexity
139+
- **Java Generics Course**: 5-module comprehensive course with assessments
140+
- **Module Structure**: Foundations → Wildcards → Advanced → Real-world → Assessment
141+
- **Interactive Elements**: FAQ sections, code examples, and practical exercises
142+
- **Tag-Based Navigation**: Semantic organization by topics (generics, type-safety, performance, etc.)
143+
144+
#### Template System
145+
- **18 Specialized Templates**: Custom FreeMarker templates for different content types
146+
- **Responsive Design**: Bootstrap-based responsive layout with custom styling
147+
- **Content Types**: Posts, courses, pages, archives, tag listings, and RSS feeds
148+
- **Dynamic CSS Generation**: Template-driven CSS compilation for consistent theming
149+
150+
#### Build Commands
28151
```bash
29-
./mvnw clean verify -pl system-prompts-generator
152+
# Generate and deploy the website
153+
./mvnw clean generate-resources -pl site-generator -P site-update
154+
155+
# Local development server
156+
jwebserver -p 8000 -d "$(pwd)/docs"
30157
```
31158

32-
If the tests passes, you could promote the changes to `.cursor/rules`:
159+
#### Key Features
160+
- **Automated Course Generation**: Transforms cursor rule content into structured learning paths
161+
- **SEO Optimization**: Proper meta tags, sitemaps, and RSS feeds
162+
- **Analytics Integration**: Google Analytics and social media integration
163+
- **Asset Management**: Optimized handling of images, CSS, and JavaScript resources
164+
165+
#### Content Strategy
166+
The site serves multiple purposes:
167+
1. **Public Documentation**: User-facing guides and tutorials
168+
2. **Educational Content**: Structured courses for learning Java concepts
169+
3. **Project Updates**: Release notes and development progress
170+
4. **Community Engagement**: Blog posts and technical articles
171+
172+
This system transforms the repository from a simple rule collection into a **comprehensive educational platform** that supports both immediate cursor rule usage and long-term Java learning objectives.
173+
174+
## Build/Test Commands
175+
176+
- Java 24 required
33177

34178
```bash
179+
./mvnw clean verify
180+
./mvnw clean verify -pl system-prompts-generator
35181
./mvnw clean install -pl system-prompts-generator
182+
./mvnw clean generate-resources -pl site-generator -P site-update
36183
```
37184

38-
## General Guidance
185+
## Common Tasks
39186

40-
- Don´t update any file from the path `.cursor/rules`, find the XML file in the path `generator/src/main/resources`.
41-
- The project is based on Java 24.
187+
- Adding new cursor rule: Edit XML in system-prompts-generator/src/main/resources/
188+
- Updating website: Modify content in site-generator/content/
189+
- Running examples: Each example has its own README-DEV.md
190+
191+
## File Editing Guidelines
192+
- Don't edit .cursor/rules/ directly - edit XML sources in system-prompts-generator/src/main/resources/
193+
- Always run tests before promoting changes
42194

43195
## Commit Messages and Pull Requests
44196

@@ -49,3 +201,7 @@ If the tests passes, you could promote the changes to `.cursor/rules`:
49201
- **Why?**
50202
- **Breaking changes?**
51203
- Comments should be complete sentences and end with a period.
204+
205+
## References
206+
207+
- https://agents.md/

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The repository was designed to offer support for Cursor, but other tools have ev
2020

2121
A system prompt is a set of instructions given to an AI model that defines how it should behave, what role it should take on, and what guidelines it should follow when responding to users. Think of it as the "operating manual" that shapes the AI's personality, capabilities, and boundaries.
2222

23-
![](./documentation/prompts.png)
23+
![](./documentation/images/prompts.png)
2424

2525
### Types of System prompts
2626

@@ -38,25 +38,25 @@ The repository provides System prompts that can behave interactively or non-inte
3838

3939
Adding AI tools to the Java development workflow can increase the possibilities of implementing software specifications on time and with quality.
4040

41-
![](./documentation/workflow.png)
41+
![](./documentation/images/workflow.png)
4242

4343
**Note:** Remember that if you use models and ask questions about recent topics like *Java 25*, it is probable that models will not provide accurate answers.
4444

4545
## Getting started
4646

47-
New to this repository? Start with our [comprehensive guide](./GETTING-STARTED.md) for a quick introduction to setting up and using the Cursor rules.
47+
New to this repository? Start with our [comprehensive guide](./documentation/GETTING-STARTED.md) for a quick introduction to setting up and using the Cursor rules.
4848

4949
## How to use a System prompt in your development?
5050

51-
Learn [how to integrate System prompts](./HOW-TO-USE.md) into your development workflow and maximize their effectiveness in your daily coding tasks.
51+
Learn [how to integrate System prompts](./documentation/HOW-TO-USE.md) into your development workflow and maximize their effectiveness in your daily coding tasks.
5252

5353
## How many System prompts include this repository?
5454

5555
Explore the [complete catalog of available System prompts](./CURSOR-RULES-JAVA.md) to discover the full range of capabilities and find the perfect rules for your specific use cases.
5656

5757
## Constraints, Output format & Safety guards
5858

59-
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.
59+
The cursor rules in this repository follow [The Three-Node Quality Framework for AI Prompts](https://jabrena.github.io/cursor-rules-java/blog/2025/prompt-quality-framework.html), 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.
6060

6161
The **constraints** act as gate-keeping mechanisms that define hard requirements and blocking conditions before any work begins - essentially asking "Can I start?" The **output-format** provides prescriptive guidance during execution, ensuring comprehensive coverage and organized responses by defining "What should I deliver?" Finally, **safeguards** implement protective measures throughout and after execution, continuously asking "Did it work safely?" This temporal flow from pre-execution validation to structured execution to continuous monitoring ensures quality at every stage.
6262

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ If you are interested in getting the benefits of these cursor rules for Java, yo
88

99
This view has a big green button with the text: `<> Code`. If you click on it, you will see the tab `Local` and you will see the link for: `Download Zip`.
1010

11-
![](./documentation/getting-started-github.png)
11+
![](./images/getting-started-github.png)
1212

1313
Once you have downloaded it, go to the `Downloads` folder in your system and you should see the zip file: `cursor-rules-java-main.zip`. Unzip it and copy the folder `.cursor` into the Java repository where you want to use these Cursor rules.
1414

@@ -40,7 +40,7 @@ jbang --fresh setup@jabrena init --cursor https://github.com/jabrena/cursor-rule
4040

4141
Once you have installed the cursor rules in the path `.cursor/rules`, type the following prompt in the cursor chat:
4242

43-
![](./documentation/getting-started-prompt.png)
43+
![](./images/getting-started-prompt.png)
4444

4545
```bash
4646
Create a document with all cursor rules for Java using the cursor rule @100-java-cursor-rules-list
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# How to use a system prompt in your development
22

33

4-
![](./documentation/prompts.png)
4+
![](./images/prompts.png)
55

66
Using a system prompt in your development is straightforward. If you are using a modern IDE that includes AI features, such as Cursor, open the chat:
77

8-
![](./documentation/cursor-chat1.png)
8+
![](./images/cursor-chat1.png)
99

1010
and type your own **user prompt**, such as the following example:
1111

@@ -17,24 +17,24 @@ and drag and drop the system prompt that you need into the chat along with the p
1717

1818
The result should be:
1919

20-
![](./documentation/cursor-chat2.png)
20+
![](./images/cursor-chat2.png)
2121

2222
---
2323

2424
Another way to interact with models has recently emerged: using CLI tools. The approach is exactly the same.
2525

2626
Starting from a clean session in [Cursor CLI](https://cursor.com/cli):
2727

28-
![](./documentation/cursor-cli1.png)
28+
![](./images/cursor-cli1.png)
2929

3030
Type your user prompt in the text area:
3131

3232
```
3333
Improve the pom.xml using the cursor rule @112-java-maven-plugins
3434
```
3535

36-
![](./documentation/cursor-cli2.png)
36+
![](./images/cursor-cli2.png)
3737

3838
and finally select the file to which you want to apply the process:
3939

40-
![](./documentation/cursor-cli3.png)
40+
![](./images/cursor-cli3.png)

0 commit comments

Comments
 (0)