---
name: "neo4j-cypher-graph-query-opt"
description: "Traverse complex relationships and network topologies in sub-milliseconds using Neo4j Cypher."
metadata:
  author: "Neo4j"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "write cypher graph query"
  - "optimize neo4j cypher query"
  - "create neo4j relationship index"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Neo4j Cypher Graph Queries & Index Tuning

Designs graph schemas in Neo4j: writing expressive Cypher queries with MATCH and WHERE, configuring schema indexes and fulltext search, profiling execution plans with PROFILE/EXPLAIN, and preventing Cartesian products.

## When to Invoke
Invoke this skill whenever you need to:
- write cypher graph query
- optimize neo4j cypher query
- create neo4j relationship index

## Execution SOP & Rules
1. Write parameterized Cypher queries: MATCH (u:User {id: $userId})-[:FRIEND*1..3]->(f:User) RETURN f.
2. Create range and point indexes: CREATE INDEX FOR (p:Person) ON (p.email).
3. Inspect query execution plans with PROFILE to ensure db hits are minimized and indexes are utilized.
4. Use APOC (Awesome Procedures on Cypher) library procedures for complex graph batching and refactoring.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
