Use when you need to generate Java project diagrams — including UML sequence diagrams, UML class diagrams, C4 model diagrams, UML state machine diagrams, UML Deployment Diagrams, ER (Entity Relationship) diagrams, and bounded-context diagrams — through a modular, step-based interactive process that adapts to your specific visualization needs. This should trigger for requests such as Generate UML diagram; Create sequence diagram; Create class diagram; Create state machine diagram; Create deployment diagram; Create C4 diagram; Create bounded-context diagram; Create context-map diagram. Part of cursor-rules-java project
75
—
Does it follow best practices?
Impact
—
No eval scenarios have been run
Passed
No known issues
Generate comprehensive Java project diagrams through a modular, step-based interactive process that covers UML sequence diagrams, UML class diagrams, C4 model diagrams, UML state machine diagrams, UML Deployment Diagrams, ER (Entity Relationship) diagrams, and bounded-context diagrams using PlantUML syntax. This is an interactive SKILL.
What is covered in this Skill?
plantuml/plantuml imageBefore applying any diagram generation, ensure the project validates. If validation fails, stop immediately — do not proceed until all validation errors are resolved.
./mvnw validate or mvn validate before applying any diagram generation!include URLs for C4 or icon librariesRun ./mvnw validate or mvn validate before applying any diagram generation.
Step constraints:
Run this XML-included question flow before reading any diagram-family implementation reference. Ask questions one-by-one in strict order, wait for the user's answer to each question, and record selected diagram families, C4 scope, bounded-context repository scope, output organization, file format, and documentation preference before continuing.
IMPORTANT: You MUST ask these questions in the exact order and wording shown here. The very first question to the user MUST be "Question 1: What diagrams do you want to generate?". Do not ask any other questions prior to it.
Diagrams Selection
Conditional Flow Rules:
Question 1: What diagrams do you want to generate?
Options:
Question 2: For UML sequence diagrams, which types would you like to generate? Ask this question only if you selected "UML sequence diagrams" or "All diagrams" in Question 1.
Options:
Question 3: For UML class diagrams, which scope would you like to cover? Ask this question only if you selected "UML class diagrams" or "All diagrams" in Question 1.
Options:
Question 4: For UML class diagrams, what level of detail do you prefer? Ask this question only if you selected "UML class diagrams" or "All diagrams" in Question 1 and did not select "Skip" in Question 3.
Options:
Question 5: For C4 model diagrams, which levels would you like to generate? Ask this question only if you selected "C4 model diagrams" or "All diagrams" in Question 1.
Options:
Question 6: For UML state-machine diagrams, which types would you like to generate? Ask this question only if you selected "UML state-machine diagrams" or "All diagrams" in Question 1.
Options:
Question 7: For ER diagrams, which schema scope would you like to cover? Ask this question only if you selected "ER diagrams (Entity Relationship)" or "All diagrams" in Question 1.
Options:
Question 8: For bounded-context diagrams, which repositories should be represented? Ask this question only if you selected "Bounded-context diagrams" or "All diagrams" in Question 1.
Options:
For each repository in scope, collect what is available: repository name or path, bounded context, domain or subdomain, owning team, application type, owned data store, exposed interfaces, consumed interfaces, and known relationships.
Question 9: For UML Deployment Diagrams, what source material should be used first? Ask this question only if you selected "UML Deployment Diagrams" or "All diagrams" in Question 1.
Options:
When a deployment image or system description file is provided, use it as source material before asking fallback questions. Ask only for missing or ambiguous deployment facts such as actors, services, CI/CD systems, runtime nodes, execution environments, deployed artifacts or components, external systems, data stores, queues, protocols, ports, relationships, and infrastructure or network boundaries.
Question 10: How would you like to organize the generated diagram files?
Options:
Question 11: What file format would you prefer for the diagrams?
Options:
Question 12: Would you like to include explanatory documentation with the diagrams?
Options:
After all applicable questions are answered, confirm the selections and map them to references:
references/033-architecture-diagrams-uml-sequence.md.references/033-architecture-diagrams-uml-class.md.references/033-architecture-diagrams-c4.md.references/033-architecture-diagrams-state-machine.md.references/033-architecture-diagrams-deployment.md.references/033-architecture-diagrams-er.md.references/033-architecture-diagrams-bounded-context.md.Create requested diagrams in PlantUML syntax using only the selected focused references, project inputs, and repository context.
Check generated diagrams for syntax correctness and consistency with selected scope before final delivery.
When Docker is available, use the official plantuml/plantuml image to validate and render generated .puml files without requiring a local PlantUML, Java, or Graphviz installation.
Validate PlantUML syntax without generating images:
docker run --rm -v "$PWD:/data" plantuml/plantuml --check-syntax /data/diagramsRender PNG images:
docker run --rm -v "$PWD:/data" plantuml/plantuml --png /data/diagramsRender SVG images:
docker run --rm -v "$PWD:/data" plantuml/plantuml --svg /data/diagramsUse the path mounted under /data to point at the directory or .puml file containing generated diagrams. This workflow uses the CLI-oriented PlantUML image, not the PlantUML server image.
For detailed guidance, examples, and constraints, see:
86eb63d
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.