install
source · Clone the upstream repo
git clone https://github.com/ComeOnOliver/skillshub
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ComeOnOliver/skillshub "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/pproenca/dot-skills/graph-schema" ~/.claude/skills/comeonoliver-skillshub-graph-schema && rm -rf "$T"
manifest:
skills/pproenca/dot-skills/graph-schema/SKILL.mdsource content
dot-skills Graph Database Schema Design Best Practices
Comprehensive graph database data modeling guide for property graphs (Neo4j, Memgraph, Amazon Neptune, etc.). Contains 46 rules across 8 categories, prioritized by modeling impact from critical (entity classification, relationship design) to incremental (scale and evolution). Each rule includes detailed explanations, real-world Cypher examples comparing incorrect vs. correct models, and specific impact descriptions.
Philosophy: Data modeling correctness first, performance second. Always ask "what is the user trying to achieve?" before choosing structure.
When to Apply
Reference these guidelines when:
- Designing a new graph database schema from domain requirements
- Translating a relational schema to a graph model
- Deciding whether something should be a node, relationship, or property
- Reviewing an existing graph schema for modeling errors
- Refactoring a graph that produces awkward or slow queries
- Planning for schema evolution and data growth
Rule Categories by Priority
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Entity Classification | CRITICAL | |
| 2 | Relationship Design | CRITICAL | |
| 3 | Property Placement | HIGH | |
| 4 | Query-Driven Refinement | HIGH | |
| 5 | Structural Patterns | HIGH | |
| 6 | Anti-Patterns | MEDIUM | |
| 7 | Constraints & Integrity | MEDIUM | |
| 8 | Scale & Evolution | LOW-MEDIUM | |
Quick Reference
1. Entity Classification (CRITICAL)
- Model multi-participant events as first-class nodesentity-events
- Promote shared property values to nodesentity-shared-values
- Use specific labels over generic onesentity-specific-labels
- Qualify entities with multiple labelsentity-multi-label
- Separate identity from mutable stateentity-identity-state
- Reify lifecycle actions into nodesentity-reify-actions
- Avoid kitchen-sink entity nodesentity-avoid-god-nodes
2. Relationship Design (CRITICAL)
- Use specific relationship types over generic onesrel-specific-types
- Choose semantically meaningful directionrel-meaningful-direction
- Follow UPPER_SNAKE_CASE for relationship typesrel-naming-conventions
- Don't create redundant reverse relationshipsrel-no-redundant-reverse
- Put data on relationships only when it describes the connectionrel-properties-scope
- One relationship type per semantic meaningrel-single-semantic
- Prefer typed relationships over generic + property filterrel-typed-over-filtered
3. Property Placement (HIGH)
- Don't embed foreign keys as propertiesprop-no-foreign-keys
- Promote frequently-queried values to nodesprop-promote-to-node
- Use appropriate data types for propertiesprop-correct-data-types
- Don't use property arrays when you need relationshipsprop-no-arrays-for-connections
- Know when data belongs on relationship vs. nodeprop-relationship-vs-node-data
4. Query-Driven Refinement (HIGH)
- Design for your most critical traversals firstquery-critical-traversals
- Add shortcut relationships for frequent multi-hop queriesquery-shortcut-relationships
- Denormalize for read-heavy pathsquery-denormalize-reads
- Use relationship properties to filter traversalsquery-filter-by-rel-props
- Test model against real queries before deployingquery-test-before-deploy
5. Structural Patterns (HIGH)
- Use intermediary nodes for multi-entity relationshipspattern-intermediary-nodes
- Model hierarchies with category nodes and depth relationshipspattern-hierarchy
- Use linked lists for ordered sequencespattern-linked-list
- Apply timeline trees for temporal datapattern-timeline-tree
- Fan-out pattern for event streams and activity feedspattern-fan-out
- Use bipartite structure for many-to-many with contextpattern-bipartite
6. Anti-Patterns (MEDIUM)
- Don't model relational join tables as nodesanti-join-table-nodes
- Don't use generic RELATED_TO or CONNECTED relationshipsanti-generic-relationships
- Don't port relational schemas directly to graphanti-relational-porting
- Don't make everything a nodeanti-over-modeling
- Don't duplicate data instead of creating relationshipsanti-duplicate-data
- Don't encode structured data as delimited stringsanti-string-encoded-structure
7. Constraints & Integrity (MEDIUM)
- Define uniqueness constraints on natural identifiersconstraint-unique-identifiers
- Use existence constraints for required propertiesconstraint-existence
- Create indexes on traversal entry point propertiesconstraint-index-traversals
- Don't over-index — each index has a write costconstraint-no-over-index
- Use composite node keys for natural multi-part identifiersconstraint-node-key
8. Scale & Evolution (LOW-MEDIUM)
- Mitigate supernodes with fan-out or partitioningscale-supernode-mitigation
- Separate current state from historical statescale-temporal-versioning
- Plan for label and relationship type evolutionscale-schema-migration
- Use APOC or batched queries for schema refactoringscale-batch-refactoring
- Monitor and detect emerging supernodesscale-dense-node-detection
How to Use
Read individual reference files for detailed explanations and code examples:
- Section definitions - Category structure and impact levels
- Rule template - Template for adding new rules
Reference Files
| File | Description |
|---|---|
| references/_sections.md | Category definitions and ordering |
| assets/templates/_template.md | Template for new rules |
| metadata.json | Version and reference information |