Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Clod Stack Cypher?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/jasonwarrenuk-clod-stack-cypher)
---
name: "Stack: Cypher"
description: "Neo4j and Cypher: graph schema design, query patterns, performance optimisation, PostgreSQL integration."
when_to_use: "When writing or reviewing Cypher queries, designing a graph schema or bridging Neo4j with a relational store; the Cypher can live in .cypher files or embedded strings."
user-invocable: false
metadata:
family: clod-stack
goblin-spinner: traversing the graph|matching nodes|writing cypher
# No paths gate: Cypher mostly lives inside .ts strings, not .cypher files, so
# file identity is an unreliable proxy for relevance
allowed-tools:
- Read
- Glob
- Grep
---
# Neo4j and Cypher
The basics (`MATCH`, `CREATE`, `SET`, `DELETE`, `RETURN`) are assumed. This file holds the conventions and the mistakes that are easy to make; the worked patterns are in the supporting files.
## Conventions
- Relationship types are UPPERCASE: `FOLLOWS`, `MEMBER_OF`.
- An entity that lives in both PostgreSQL and Neo4j carries the same UUID in each.
## Gotchas
**`MERGE` matches on the entire pattern.** Merge on the unique key alone, then set the rest:
```cypher
// ✗ Matches on ALL properties
MERGE (u:User {id: 'user-123', name: 'Alice'})
// ✓ Match on the unique key only
MERGE (u:User {id: 'user-123'})
ON CREATE SET u.createdAt = datetime()
ON MATCH SET u.lastSeen = datetime()
SET u.name = 'Alice'
```
**`DELETE` only removes a node that has no relationships.** `DETACH DELETE` removes the node and its relationships together.
**Bound every variable-length traversal.** `[:FOLLOWS*1..3]`, never a bare `[:FOLLOWS*]`.
**Two disconnected patterns make a Cartesian product.** `MATCH (a:User), (b:User)` pairs every user with every other; join them through a relationship or a shared node.
## Additional resources
Worked query patterns and mechanical detail, loaded only when needed:
- [query-patterns.md](query-patterns.md): social graph (followers, blocking), hierarchy (org charts, categories), recommendation (collaborative/content-based filtering), path-finding (shortest path, Dijkstra), access control
- [performance-and-schema.md](performance-and-schema.md): indexes/constraints, PROFILE-driven optimisation tips, batch operations with UNWIND/APOC, schema modelling guidelines (relationships vs properties, multiple labels)
- [postgres-integration.md](postgres-integration.md): shared-key and event-driven sync patterns with Supabase, hybrid query examples
## Success Criteria
Neo4j implementation is successful when:
- Queries leverage graph traversal strengths
- Indexes on frequently queried properties
- Bounded traversals (not unbounded `*`)
- Clear distinction between nodes/relationships/properties
- Integration with relational database clean
- Performance acceptable for use case
- Schema supports future requirements