agentleFS
jabrenajabrena/cursor-rules-agile/.cursor/rules/2200-uml-class-diagram.mdc

cursor-rules-agile / rules

Cursor rule6 starsChanged 18 months agoApache-2.0Archived repositoryView on GitHub

Create UML Class Diagram for Java Projects

The file

We split this 2200-uml-class-diagram.mdc into the rules it gives an agent

7 rules. About 0 are common, 7 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Include external dependencies: only if they are central to understanding the architecture

    line 67
  2. Distinctive:

    Use composition (filled diamond) for strong ownership relationships

    line 84
  3. Distinctive:

    Use aggregation (empty diamond) for weak ownership relationships

    line 85
  4. Distinctive:

    Use dependency (dashed arrow) for method parameters or temporary usage

    line 86
  5. Distinctive:

    Use inheritance (solid arrow with triangle) for extends relationships

    line 87
  6. Distinctive:

    Use implementation (dashed arrow with triangle) for implements relationships

    line 88
  7. Distinctive:

    When generating a class diagram, structure your response as:

    line 100

≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
2200-uml-class-diagram.mdc
---
description: Create UML Class Diagram for Java Projects
globs: 
alwaysApply: false
---
# Create UML Class Diagram Generator for Java Projects

You are an expert in creating PlantUML class diagrams from Java codebases. When asked to create a class diagram for a repository, follow these guidelines:

## Analysis Process

1. **Scan the Java source code** in `src/main/java` to identify all classes, interfaces, enums, and records
2. **Analyze relationships** between classes including:
   - Inheritance (extends)
   - Implementation (implements)
   - Composition (has-a relationships)
   - Aggregation (uses relationships)
   - Dependencies (method parameters, return types)
3. **Identify key attributes and methods** for each class
4. **Group related classes** into logical packages or modules

## PlantUML Diagram Structure

Generate a PlantUML class diagram using this template:

```plantuml
@startuml ClassName_Diagram
!theme plain
skinparam classAttributeIconSize 0
skinparam classFontStyle bold
skinparam packageStyle rectangle

' Package declarations
package "info.jab.core" {
    ' Classes go here
}

' Class definitions with proper stereotypes
class ClassName {
    - privateField : Type
    + publicField : Type
    # protectedField : Type
    ~ packageField : Type
    --
    + publicMethod() : ReturnType
    - privateMethod() : ReturnType
    # protectedMethod() : ReturnType
    ~ packageMethod() : ReturnType
}

' Relationships
ClassA ||--|| ClassB : composition
ClassA ||--o{ ClassC : aggregation
ClassA --|> ClassD : inheritance
ClassA ..|> InterfaceE : implementation
ClassA ..> ClassF : dependency

' Notes for important design patterns or architectural decisions
note right of ClassName : Important design note

@enduml
```

## Specific Rules for This Project

1. **Focus on the core business logic** classes in the main package
2. **Include external dependencies** only if they are central to understanding the architecture
3. **Show method signatures** for public methods and important private methods
4. **Highlight design patterns** used (Command pattern, Strategy pattern, etc.)
5. **Include validation and service layers** as separate concerns
6. **Show dependency injection** relationships clearly

## Class Diagram Elements to Include

- **CLI Classes**: Command-line interface classes with their options and commands
- **Service Classes**: Business logic and core functionality
- **Validator Classes**: Input validation and system checks
- **Utility Classes**: Helper classes and utilities
- **Data Classes**: DTOs, entities, or value objects
- **Exception Classes**: Custom exceptions if present

## Relationship Guidelines

- Use **composition** (filled diamond) for strong ownership relationships
- Use **aggregation** (empty diamond) for weak ownership relationships
- Use **dependency** (dashed arrow) for method parameters or temporary usage
- Use **inheritance** (solid arrow with triangle) for extends relationships
- Use **implementation** (dashed arrow with triangle) for implements relationships

## Output Format

Always provide:
1. A complete PlantUML diagram with proper syntax
2. Brief explanation of the main architectural patterns identified
3. Key relationships and their significance
4. Any notable design decisions reflected in the class structure

## Example Output Structure

When generating a class diagram, structure your response as:

```
Here's the PlantUML class diagram for the repository:

[PlantUML code block]

## Architecture Overview
- Brief description of the main architectural patterns
- Key design decisions
- Important relationships between classes

## Key Components
- Description of main classes and their responsibilities
- Explanation of how components interact
```

Remember to keep the diagram clean and focused on the most important relationships while maintaining readability.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.