From thinking-frameworks-skills
Creates rigorous, validated models of entities, relationships, and constraints for database schemas, knowledge graphs, ontologies, API data models, and taxonomies. Covers relational, document, graph, event/time-series, and dimensional patterns with lifecycle modeling, soft deletes, polymorphic associations, and hierarchies.
How this skill is triggered — by the user, by Claude, or both
Slash command
/thinking-frameworks-skills:data-schema-knowledge-modelingThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
- [Overview](#overview)
This skill formally defines entities, attributes, relationships, constraints, and cardinality to produce unambiguous data models that prevent inconsistencies and enable correct implementation.
Quick example: E-commerce schema:
Copy this checklist and track your progress:
Data Schema & Knowledge Modeling Progress:
- [ ] Step 1: Gather domain requirements and scope
- [ ] Step 2: Identify entities and attributes
- [ ] Step 3: Define relationships and cardinality
- [ ] Step 4: Specify constraints and invariants
- [ ] Step 5: Validate and document the model
Step 1: Gather domain requirements and scope
Ask user for domain description, core use cases (what queries/operations will this support), existing data (if migration/integration), performance/scale requirements, and technology constraints (SQL vs NoSQL vs graph database). Understanding use cases shapes the model - OLTP vs OLAP vs graph traversal require different designs. See Schema Types for guidance.
Step 2: Identify entities and attributes
Extract nouns from requirements (those are candidate entities). For each entity, list attributes with types and nullability. Use resources/template.md for systematic entity identification. Verify each entity represents a distinct concept with independent lifecycle. Document entity purpose and examples.
Step 3: Define relationships and cardinality
Map connections between entities (one-to-one, one-to-many, many-to-many). For many-to-many, identify junction tables/entities. Specify relationship directionality and optionality (can X exist without Y?). Use resources/methodology.md for complex relationship patterns like hierarchies, polymorphic associations, and temporal relationships.
Step 4: Specify constraints and invariants
Define uniqueness constraints, foreign key relationships, check constraints, and business rules. Document domain invariants (rules that must hold true at all times). Identify derived/computed attributes vs stored. Use resources/methodology.md for advanced constraint patterns and validation strategies.
Step 5: Validate and document the model
Create data-schema-knowledge-modeling.md file with complete schema definition. Validate against use cases - can the schema support required queries/operations? Check for normalization (eliminate redundancy) or denormalization (optimize for specific queries). Self-assess using resources/evaluators/rubric_data_schema_knowledge_modeling.json. Minimum standard: Average score ≥ 3.5.
Choose based on use case and technology:
Relational (SQL) Schema
Document/NoSQL Schema
Graph Schema (Ontology)
Event/Time-Series Schema
Dimensional (Data Warehouse) Schema
Pattern: Entity Lifecycle Modeling Track entity state changes explicitly. Example: Order (draft → pending → confirmed → shipped → delivered → completed/cancelled). Include status field, timestamps for each state, and transitions table if history needed.
Pattern: Soft Deletes
Never physically delete records - add deletedAt timestamp. Allows data recovery, audit compliance, and referential integrity. Filter WHERE deletedAt IS NULL in queries.
Pattern: Polymorphic Associations Entity relates to multiple types. Example: Comment can be on Post or Photo. Options: (1) separate foreign keys (commentableType + commentableId), (2) junction tables per type, (3) single table inheritance.
Pattern: Temporal/Historical Data Track changes over time. Options: (1) Effective/expiry dates per record, (2) separate history table, (3) event sourcing (store all changes as events). Choose based on query patterns.
Pattern: Multi-tenancy Isolate data per customer. Options: (1) Separate databases (strong isolation), (2) Shared schema with tenantId column (efficient), (3) Separate schemas in same DB (balance). Add tenantId to all queries if shared.
Pattern: Hierarchies Model trees/nested structures. Options: (1) Adjacency list (parentId), (2) Nested sets (left/right values), (3) Path enumeration (materialized path), (4) Closure table (all ancestor-descendant pairs). Trade-offs between read/write performance.
✓ Do:
✗ Don't:
Resources:
resources/template.md - Structured process for entity identification, relationship mapping, and constraint definitionresources/methodology.md - Advanced patterns: temporal modeling, graph ontologies, schema evolution, normalization strategiesresources/examples/ - Worked examples showing complete schema designs with validationresources/evaluators/rubric_data_schema_knowledge_modeling.json - Quality assessment before deliveryWhen to choose which resource:
Expected deliverable:
data-schema-knowledge-modeling.md file containing: domain description, complete entity definitions with attributes and types, relationship mappings with cardinality, constraint specifications, diagram (ERD/graph visualization), validation against use cases, and implementation notes.
Common schema notations:
npx claudepluginhub lyndonkl/claude --plugin thinking-frameworks-skillsCreates ERDs, data dictionaries, and conceptual/logical/physical models to document data structures, entities, relationships, attributes, and constraints.
Covers data modeling patterns across paradigms: ER (Chen, Crow's Foot, UML), document (embedding/referencing, polymorphic, bucket), graph (LPG, RDF), time-series, event sourcing, dimensional (star/snowflake, SCD), Data Vault. Use for schema design and paradigm selection.
Designs and documents database schemas with entity relationships, table definitions, constraints, indexes, and access patterns. Useful when modeling entities or planning data models.