--- name: plantuml-entity-relationship-diagram description: Generate and refine entity-relationship diagrams (DER/ERD) in PlantUML from data requirements, schemas, SQL, ORM models, or architecture notes. Use for entidades, tablas, attributes, primary and foreign keys, identifying relationships, optionality, and cardinalities. Do not model software components, runtime deployment, class methods/inheritance, or temporal message flows. --- # PlantUML Entity-Relationship Diagram Model persistent data structure, identity, references, and cardinality. ## Workflow 1. Choose conceptual, logical, or physical data level and state it. 2. Extract entities/tables, attributes/columns, identifiers, and relationships. 3. Mark PK, FK, and unique constraints only when supported. 4. Determine minimum and maximum cardinality independently on both ends. 5. Resolve many-to-many relationships with an associative entity only for a logical/physical model or when the source defines it. 6. Apply [conventions.md](references/conventions.md). Apply [LANG-001 and LANG-002](references/language.md) to every user-visible label and response field. 7. Render and inspect cardinality placement and crossings. 8. Return one `@startuml ... @enduml` block plus assumptions. ## Hard rules - DER is a data model, not a UML class diagram. - Generate all user-visible content in Spanish. Preserve exact schema identifiers when translation would break traceability. - Do not add methods, services, APIs, nodes, queues, or message order. - Do not infer an `id` column, surrogate key, FK, cascade rule, nullability, or cardinality merely from naming. - Preserve composite and natural keys when stated. - Use Crow's Foot cardinalities consistently. - Use unique aliases and no remote includes. When user feedback is reusable, update `references/conventions.md`.