Agent skill

Neo4j Cypher Skill

by neo4j-contrib in neo4j-contrib/neo4j-skills

Generates, optimizes, and validates Cypher 25 queries for Neo4j 2025.x and 2026.x.

MITAuto-check passedDocuments & Office

Install Neo4j Cypher Skill

skills CLI
$ npx skills add neo4j-contrib/neo4j-skills --skill neo4j-cypher-skill -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install neo4j-contrib/neo4j-skills neo4j-cypher-skill --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/neo4j-contrib/neo4j-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/neo4j-cypher-skill .claude/skills/neo4j-cypher-skill && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
neo4j-cypher-skill
GitHub stars
114
Used in
1 other repo
Token cost
~6.1k tokens
SKILL.md length
2,075 words
Files
13 (incl. scripts, references)
Skills in repo
28
Repo updated
First seen
Licence
MIT

At a glance

Generates, optimizes, and validates Cypher 25 queries for Neo4j 2025.x and 2026.x.

  • Works in 12 steps: CYPHER 25 — first token; never repeat… → Schema first — inspect before writing;… → MERGE on constrained key only; rel MERGE… → …
  • Writing new Cypher queries
  • SKILL.md covers When to Use, When NOT to Use, Pre-flight and Defaults — apply every query, plus 11 more sections
  • Runs Python scripts from its folder; calls curl; reaches neo4j.com

What it does

Neo4j Cypher Skill is an agent skill from neo4j-contrib/neo4j-skills. Generates, optimizes, and validates Cypher 25 queries for Neo4j 2025.x and 2026.x. Use when writing new Cypher queries, optimizing slow queries, graph pattern matching, vector or fulltext search, subqueries, or batch writes. Covers MATCH, MERGE, CREATE, WITH, RETURN, CALL, UNWIND, FOREACH, LOAD CSV, SEARCH, expressions, functions, indexes, and subqueries. Does NOT handle driver migration or API changes — use neo4j-migration-skill. Does NOT cover DB administration or server ops — use neo4j-cli-tools-skill.

Its SKILL.md is about 6.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 14 other files, including scripts and reference files (for example `README.md`, `references/advanced-patterns.md` and `references/apoc.md`). Compatibility notes: Neo4j = 2025.01 (safe baseline); Cypher 25

It sits in Documents & Office, covering Query optimization and CSV and tabular files. It works with Neo4j. The repository describes itself as: Neo4j Skills for Coding and other Agents including Cypher. The licence is MIT.

When your agent uses it

  • Writing new Cypher queries
  • Optimizing slow queries
  • Graph pattern matching
  • Fulltext search

Example prompts

  • “/neo4j-cypher-skill”

Requirements

  • Python 3
  • Compatibility (from SKILL.md): Neo4j >= 2025.01 (safe baseline); Cypher 25

Workflow steps

12 steps, taken from the first numbered list in SKILL.md.

  1. CYPHER 25 — first token; never repeat after UNION or inside subqueries
  2. Schema first — inspect before writing; if schema in prompt, use it directly
  3. MERGE on constrained key only; rel MERGE on already-bound endpoints only
  4. Label-free MATCH (n) forbidden unless bound or followed by WHERE n:$($label)
  5. LIMIT 25 default on all exploratory reads; push WITH n LIMIT before high-cardinality operations (variable-length traversals, fan-out…
  6. Comments: // only — -- is SQL, invalid
  7. REPEATABLE ELEMENTS / DIFFERENT RELATIONSHIPS go after MATCH, not end of pattern
  8. SHOW commands: YIELD before WHERE; combinable with general Cypher clauses incl. UNION/RETURN [2026.05] — SHOW DATABASES still requires…
  9. Inline node predicates (:Label WHERE p=x) — valid in MATCH only
  10. WHERE cannot follow bare UNWIND — use WITH x WHERE
  11. (a)-[:R]-(b) — undirected matches both directions, double-counts; use directed unless unknown
  12. DETACH DELETE — plain DELETE throws if node has relationships

What it can do on your machine

Read from SKILL.md and the folder at commit bb30e1f. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 3 files in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • curl

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • neo4j.com

    Also links to:

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Neo4j >= 2025.01 (safe baseline); Cypher 25

    From compatibility in the SKILL.md frontmatter.

Context cost

Neo4j Cypher Skill loads about 6.1k tokens when it runs, and up to ~28k if it reads all its reference files. Until then it costs about 132 tokens; SKILL.md has 2,075 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~132
When it runs · the whole SKILL.md, loaded when a task matches
~6.1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~28k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from neo4j-contrib/neo4j-skills at commit bb30e1f, republished under its MIT licence (© neo4j-contrib). 2,075 words, ~6,100 tokens.

Download SKILL.mdSave it as .claude/skills/neo4j-cypher-skill/SKILL.md (or your agent's skills folder). This skill also uses 12 other files; get the full folder from GitHub.
name
neo4j-cypher-skill
description
Generates, optimizes, and validates Cypher 25 queries for Neo4j 2025.x and 2026.x. Use when writing new Cypher queries, optimizing slow queries, graph pattern matching, vector or fulltext search, subqueries, or batch writes. Covers MATCH, MERGE, CREATE, WITH, RETURN, CALL, UNWIND, FOREACH, LOAD CSV, SEARCH, expressions, functions, indexes, and subqueries. Does NOT handle driver migration or API changes — use neo4j-migration-skill. Does NOT cover DB administration or server ops — use neo4j-cli-tools-skill.
compatibility
Neo4j >= 2025.01 (safe baseline); Cypher 25
version
1.0.27

When to Use

  • Writing, optimizing, or debugging Cypher queries
  • Graph pattern matching, QPEs, variable-length paths
  • Vector/fulltext search, subqueries, batch writes, LOAD CSV

When NOT to Use

  • Driver migration/API changes → neo4j-migration-skill
  • DB admin (users, config, backups) → neo4j-cli-tools-skill
  • Hybrid search that combines vector with fulltext or other ranked sources → neo4j-vector-index-skill

GQL conformance note: LET, FINISH, FILTER, and INSERT are valid Cypher 25 clauses (introduced via GQL conformance, mostly in Neo4j 2025.06). On older versions, fall back to WITH / (omit RETURN) / WHERE / CREATE. INSERT requires &-separated multi-labels and does not support dynamic labels/types.


Pre-flight

?KnownUnknown
<db-name>-schema.json found in projectUse it directly — skip live inspection—
Schema (from context or live DB)Use directlyRun Schema-First Protocol
Neo4j versionUse version featuresDefault to 2025.01 safe set
Executing (not generating)?Use EXPLAIN + write gateState query is unvalidated

Schema unknown + no tool → produce non-executable sketch outside a code block:

(<SOURCE_LABEL> {<KEY>: $value})-[:<REL_TYPE>]->(<TARGET_LABEL>)

Never fill guessed names — realistic guesses get copied blindly.


Defaults — apply every query

  1. CYPHER 25 — first token; never repeat after UNION or inside subqueries
  2. Schema first — inspect before writing; if schema in prompt, use it directly
  3. MERGE on constrained key only; rel MERGE on already-bound endpoints only
  4. Label-free MATCH (n) forbidden unless bound or followed by WHERE n:$($label)
  5. LIMIT 25 default on all exploratory reads; push WITH n LIMIT before high-cardinality operations (variable-length traversals, fan-out MATCH, Cartesian products)
  6. Comments: // only — -- is SQL, invalid
  7. REPEATABLE ELEMENTS / DIFFERENT RELATIONSHIPS go after MATCH, not end of pattern
  8. SHOW commands: YIELD before WHERE; combinable with general Cypher clauses incl. UNION/RETURN [2026.05] — SHOW DATABASES still requires system db (use USE system). CALL on system db: YIELD then WHERE [2026.07]
  9. Inline node predicates (:Label WHERE p=x) — valid in MATCH only
  10. WHERE cannot follow bare UNWIND — use WITH x WHERE
  11. (a)-[:R]-(b) — undirected matches both directions, double-counts; use directed unless unknown
  12. DETACH DELETE — plain DELETE throws if node has relationships

Style

ElementConvention
Node labelsPascalCase :Person
Rel typesSCREAMING_SNAKE_CASE :KNOWS
Properties/varscamelCase firstName
ClausesUPPERCASE MATCH
Booleans/nulllowercase true false null
Stringssingle-quoted; double only if contains '

Schema is truth. :Person, :KNOWS, name in examples are illustrative — substitute real names from schema.


Schema-First Protocol

Priority order:

  1. <db-name>-schema.json anywhere in project → read directly, state file name + schema_retrieved_at, skip live inspection. If significantly outdated and DB reachable, offer re-fetch. Full rules: references/schema-guardrail.md.

    • Existence — labels/rel-types/properties must be in schema; try synonym resolution before asking
    • Property type — reason about intent first (e.g. string vs INTEGER may be null check); ask only if unclear
    • Relationship direction — wrong direction → correct silently and note
    • Synonym mapping — unambiguous → resolve silently; ambiguous → pick most likely, note; ask if unresolvable

    Scripts: generate_schema.py (live DB + APOC), define_schema.py (no DB), import_neo4j_schema.py (converts neo4j-graphrag-python, graph-schema-introspector, graph-schema-json-js-utils, mcp-neo4j-data-modeling).

  2. Schema in context → use it, skip inspection.

  3. Schema missing → run:

cypher
CALL db.schema.visualization() YIELD nodes, relationships RETURN nodes, relationships;
SHOW INDEXES YIELD name, type, labelsOrTypes, properties, state WHERE state = 'ONLINE';
SHOW CONSTRAINTS YIELD name, type, labelsOrTypes, properties;
SHOW PROCEDURES YIELD name RETURN split(name,'.')[0] AS namespace, count(*) AS procedures;

Property types per label — check APOC first:

cypher
// If APOC available (preferred — use this):
CALL apoc.meta.schema() YIELD value RETURN value;

// No APOC AND database ≤ 100k nodes/rels only (expensive on large graphs):
CALL db.schema.nodeTypeProperties() YIELD nodeType, propertyName, propertyTypes, mandatory;
CALL db.schema.relTypeProperties() YIELD relType, propertyName, propertyTypes, mandatory;

Validate before returning any query: label exists · rel type+direction correct · property on that label · index ONLINE.


Key Patterns

MERGE
cypher
// MERGE on constrained key; set extras in ON CREATE/ON MATCH
CYPHER 25
MATCH (a:Person {id: $a}) MATCH (b:Person {id: $b})
MERGE (a)-[r:KNOWS]->(b)
  ON CREATE SET r.since = date()
  ON MATCH  SET r.lastSeen = date()

SET n = {} replaces all props. SET n += {} merges (safe partial update). Use += for updates.

WITH scope
cypher
CYPHER 25
MATCH (a:Person)-[:KNOWS]->(b:Person)
WITH a, count(*) AS friends   // b dropped here
WHERE friends > 5
RETURN a.name, friends ORDER BY friends DESC

Every var not listed in WITH is dropped. WITH * carries all forward.

Subqueries — cheat sheet
EXISTS { (a)-[:R]->(b) }                           // boolean check
COUNT  { (a)-[:R]->(b) WHERE a.x > 0 }             // count
COLLECT { MATCH (a)-[:R]->(b) RETURN b.name }       // collect list (full MATCH+RETURN required)
CALL (p) { MATCH (p)-[:ACTED_IN]->(m) RETURN m }    // correlated subquery (explicit import)
OPTIONAL CALL (p) { ... }                           // nullable subquery

CALL { WITH x ... } deprecated → CALL (x) { ... }. COLLECT {} returns exactly one column.

CALL IN TRANSACTIONS (bulk writes)
cypher
CYPHER 25
LOAD CSV WITH HEADERS FROM 'file:///data.csv' AS row
CALL (row) {
  MERGE (p:Person {id: row.id}) SET p += row
} IN TRANSACTIONS OF 1000 ROWS ON ERROR CONTINUE REPORT STATUS AS s

Input stream must be outside subquery. Auto-commit only — never wrap in beginTransaction(). PERIODIC COMMIT deprecated.

DISJOINT BY [2026.06, Cypher 25] on IN CONCURRENT TRANSACTIONS prevents deadlocks by scheduling batches that share lock-prone resources sequentially — use when importing relationships:

cypher
CYPHER 25
LOAD CSV WITH HEADERS FROM 'file:///rels.csv' AS line
CALL (line) {
  MATCH (a:Movie {id: line.movieId}), (b:Person {id: line.personId})
  MERGE (b)-[:ACTED_IN]->(a)
} IN CONCURRENT TRANSACTIONS OF 1000 ROWS DISJOINT BY (line.movieId, line.personId)

DISJOINT BY (expr,...) declares lock keys (outer-query variables only); DISJOINT BY AUTO infers them via static analysis; DISJOINT BY NONE disables. Overrides dbms.cypher.transactions.default_subquery_batch_strategy. EXPLAIN/PROFILE shows keys in DISJOINT BY (...) on TransactionForeach.

QPE basics
cypher
CYPHER 25
MATCH SHORTEST 1 (a:Person {name:'Alice'})(()-[:KNOWS]->()){1,}(b:Person {name:'Bob'})
RETURN b.name

// ACYCLIC [2026.03] — no repeated nodes within a path (prevents cycles)
CYPHER 25
MATCH p = ACYCLIC (start:Router {name: $from})-[:LINK]-+(end:Router {name: $to})
RETURN [n IN nodes(p) | n.name] AS route
ORDER BY length(p) LIMIT 5

Quantifier outside group: (pattern){N,M}. Groups start+end with node. REPEATABLE ELEMENTS needs bounded {m,n}. ACYCLIC implies nodes cannot repeat within a path (stronger than default DIFFERENT RELATIONSHIPS).

Match mode — add after MATCH:

  • DIFFERENT RELATIONSHIPS (default) — each rel traversed once per path
  • REPEATABLE ELEMENTS [2025.x] — nodes/rels revisitable; use for circular routes, weight-optimized paths, constrained backtracking; requires bounded {m,n}
Conditional CALL subqueries [2025.06]
cypher
CYPHER 25
MATCH (move:Item {id: $id})
OPTIONAL MATCH (insertBefore:Item {id: $before})
OPTIONAL MATCH (insertAfter:Item  {id: $after})
CALL (move, insertBefore, insertAfter) {
  WHEN insertBefore IS NULL THEN {
    MATCH (last:Item) WHERE NOT (last)-[:NEXT]->() AND last <> move
    CREATE (last)-[:NEXT]->(move)
  }
  WHEN insertAfter IS NULL THEN {
    CREATE (move)-[:NEXT]->(insertBefore)
  }
  ELSE {
    CREATE (insertAfter)-[:NEXT]->(move)
    CREATE (move)-[:NEXT]->(insertBefore)
  }
}

Use WHEN…THEN…ELSE for if-else-if write logic; mutually exclusive (first match wins). Not available pre-2025.06.

Dynamic relationship types [2025.x]
cypher
// Create/match/merge with dynamic rel type (must resolve to exactly one STRING)
CYPHER 25 CREATE (a:Node)-[:$($relType)]->(b:Node)
CYPHER 25 MATCH  (a:Node)-[:$($relType)]->(b:Node) RETURN a.name, b.name
String interpolation [2026.08, Cypher 25]
cypher
CYPHER 25
MATCH (p:Person {id: $id})
RETURN s"Hello, {p.name}, age {p.age}" AS greeting   // S"..." and s'...' equivalent
  • Each {expr} converts with toString()
  • MAP, LIST, NODE, PATH, RELATIONSHIP rejected
  • Escape literal braces with \{ and \}
  • Interpolated strings can nest
  • Never interpolate untrusted values into Cypher text passed to apoc.cypher.run*(); pass $parameters instead
UUID type [2026.08, Cypher 25]
cypher
CYPHER 25
CREATE (sess:Session {sessionId: uuid()});            // random UUID value

CYPHER 25
MATCH (sess:Session {sessionId: uuid($uuidString)})   // STRING 8-4-4-4-12 → UUID
RETURN toString(sess.sessionId) AS sessionId, uuid.mostSignificantBits(sess.sessionId) AS msb

UUID properties require Neo4j 2026.08+. Older drivers may return a placeholder MAP plus warning 03N95 Neo.ClientNotification.UnknownType — check the per-driver skill for exact support (neo4j-driver-python-skill needs >= 6.3); otherwise keep randomUUID() STRING ids.

Spatial / Point
cypher
// WGS84 geographic point
SET n.coords = point({longitude: $lon, latitude: $lat})

// Distance in metres; requires POINT index for performance
MATCH (a:Place {name: $origin}) MATCH (b:Place)
RETURN b.name, point.distance(a.coords, b.coords) AS distM
ORDER BY distM LIMIT 10

// Bounding-box pre-filter (uses POINT index) then distance
MATCH (b:Place)
WHERE point.withinBBox(b.coords,
        point({longitude: $west, latitude: $south}),
        point({longitude: $east, latitude: $north}))
RETURN b.name, point.distance(b.coords, $origin) AS distM

Create POINT index: CREATE POINT INDEX name IF NOT EXISTS FOR (n:Place) ON (n.coords)

Aggregation grouping keys

Non-aggregating expressions in RETURN/WITH are implicit grouping keys — GROUP BY optional:

cypher
// actor + director are grouping keys; count(*) is the aggregate
MATCH (a:Person)-[:ACTED_IN]->(m:Movie)<-[:DIRECTED]-(d:Person)
RETURN a.name, d.name, count(*) AS collaborations
ORDER BY collaborations DESC

Explicit GROUP BY subclause on WITH/RETURN [2026.07, Cypher 25] states grouping keys explicitly — GQL-aligned alternative to implicit grouping; implicit grouping stays valid:

cypher
MATCH (a:Person)-[:ACTED_IN]->(m:Movie)<-[:DIRECTED]-(d:Person)
RETURN a.name, d.name, count(*) AS collaborations GROUP BY a.name, d.name
ORDER BY collaborations DESC

GROUP BY () = no grouping keys (one row); GROUP BY ALL = every non-aggregating return item is a key. Grouping keys absent from the projection are not returned. Rules → references/cypher-syntax.md.

count(n) counts non-null; count(*) counts rows including nulls. collect(DISTINCT expr) deduplicates. count() is faster than size(collect()) — count() reads the internal store; collect() builds a list first.

ORDER BY/WHERE subclause expressions referencing a projection item more complex than a variable or var.prop are deprecated [2026.07] — alias the expression in the projection and order by the alias. Same for names that shadow an incoming variable. ORDER BY/WHERE may now call aggregation functions absent from the projection list when the projection clause already aggregates.


Common Syntax Traps (top causes of broken queries)

WrongRight
ORDER BY n.prop AS x DESCORDER BY n.prop DESC
ORDER BY preAggVar after agg RETURNUse RETURN alias
count(r WHERE r.x=5)sum(CASE WHEN r.x=5 THEN 1 ELSE 0 END)
UNWIND list AS x WHERE x>5UNWIND list AS x WITH x WHERE x>5
least(a,b) / greatest(a,b)CASE WHEN a<b THEN a ELSE b END
-- comment// comment
shortestPath((a)-[*]->(b)) (still valid)Prefer SHORTEST 1 (a)(()-[]->()){1,}(b)
id(n)elementId(n)
[:REL*1..5] (still valid)Prefer (()-[:REL]->()){1,5}
CALL { WITH x ... }CALL (x) { ... }
COLLECT { (a)-[:R]->(b) }COLLECT { MATCH ... RETURN b }
SET n = {k:v} partial updateSET n += {k:v}
DELETE n with relationshipsDETACH DELETE n
WHERE n.x = nullWHERE n.x IS NULL
toInteger(null) throwstoIntegerOrNull(null)
n.$key dynamic propertyn[$key]
SET n:$labelSET n:$($label)
ZONED DATETIME >= date(...) → 0 rowsUse datetime(...) or .year accessor
ISO string with Z suffix stored/compared as UTCZ ≠ UTC in Neo4j — Z is parsed as an offset, not the UTC timezone; planner and range indexes treat them differently. Explicitly coerce: datetime({datetime: datetime('2025-09-10T03:43:00Z'), timezone: 'UTC'}) (neo4j#13519)
FOREACH ... RETURNUNWIND ... RETURN

Full trap table → references/syntax-traps.md


Output Mode and Write Gate

Default: parameterized queries. Return named properties, not full nodes or RETURN *.

cypher
// RIGHT: agent gets named fields it can reason over
CYPHER 25 MATCH (n:Organization {name: $name}) RETURN n.name, n.founded, n.industry LIMIT 10

// WRONG: full node object wastes tokens, leaks all properties, agent can't extract fields cleanly
CYPHER 25 MATCH (n:Organization {name: $name}) RETURN n LIMIT 10

Exception: schema/diagnostic queries (CALL db.schema.visualization(), SHOW INDEXES YIELD *, EXPLAIN) where the object is the point.

Validation workflow:

  1. EXPLAIN before any write — catches syntax errors, missing indexes
  2. New read: test with LIMIT 1 first
  3. Write: verify read half as RETURN before replacing with SET/CREATE/DELETE
  4. PROFILE to measure db hits; check for AllNodesScan, CartesianProduct, Eager

Query API v2 (no driver needed — works for schema inspection, EXPLAIN, reads, writes):

bash
curl -X POST https://<instance>.databases.neo4j.io/db/<database>/query/v2 \
  -u <user>:<password> -H "Content-Type: application/json" \
  -d '{"statement": "EXPLAIN MATCH (n:Person {name: $name}) RETURN n", "parameters": {"name": "Alice"}}'
# Local: http://localhost:7474/db/<database>/query/v2
# Response: {"data": {"fields": [...], "values": [...]}}  — prefix EXPLAIN to plan without executing

Write execution gate — only when agent executes (MCP/cypher-shell/HTTP), NOT when generating for code/scripts/user to run:

  1. Run EXPLAIN → report estimated rows affected
  2. Wait for user confirmation before executing

Show full SKILL.md (857 more words)Show less

Version Gates

Default to 2025.01-safe features when version unknown.

FeatureMin versionFallback
CYPHER 25, QPEs, CALL (x) {}2025.01require 2025+
Match modes (DIFFERENT RELATIONSHIPS, REPEATABLE ELEMENTS)2025.01require 2025+
Dynamic labels $($expr), coll.sort()2025.01APOC or app-side
CONCURRENT TRANSACTIONS, REPORT STATUS2025.01drop / omit
SEARCH clause — VECTOR INDEX2026.01CALL db.index.vector.queryNodes(...) (deprecated 2026.04)
SEARCH clause — FULLTEXT INDEX (WITH ANALYZER, SKIP/OFFSET)2026.09CALL db.index.fulltext.queryNodes(...) / queryRelationships(...)
ACYCLIC path mode (no repeated nodes in path)2026.03post-filter with size(nodes(p)) = size(apoc.coll.toSet(nodes(p)))
string.indexOf(), string.join(), string.regexReplace()2026.05apoc.text.* or app-side
GQL aliases: FOR=UNWIND, PROPERTY_EXISTS=IS NOT NULL, IS [NOT] LABELED=n:Label; function aliases (local_time, zoned_datetime, duration_between, collect_list, etc.)2026.02–04GQL compliance only — use Cypher equivalents; full list → references/cypher-syntax.md
GRAPH TYPE schema DDL (ALTER CURRENT GRAPH TYPE SET/ADD/ALTER/DROP, SHOW CURRENT GRAPH TYPE)2026.02 (preview), GA 2026.06Use individual CREATE CONSTRAINT / CREATE INDEX
GROUP BY subclause on WITH/RETURN (explicit grouping keys, GQL alignment)2026.07Implicit grouping — list non-aggregating expressions in the projection
cardinality() — keys in a MAP, elements in a LIST, nodes+rels in a PATH2026.07size() for LIST/MAP keys, length() for PATH
Aggregation functions in ORDER BY/WHERE that are not projection items (aggregating projection only)2026.07Project the aggregate as an alias, then order/filter on the alias
WHERE after YIELD in procedure calls on the system database2026.07YIELD + RETURN, filter client-side
String interpolation s"...{expr}..." / S"…"2026.08+ concatenation with toString() or string.join()
UUID type; uuid(), uuid(name), uuid(mostSigBits, leastSigBits), uuid.mostSignificantBits(), uuid.leastSignificantBits()2026.08randomUUID() STRING property
null / 0 returns null instead of raising division-by-zero2026.08CASE WHEN d = 0 THEN null ELSE n / d END
Map comprehension {k: v IN map | keyExpr: valueExpr}2026.09apoc.map.fromPairs([k IN keys(m) | [k, m[k]]])
toString(), toStringList(), toStringOrNull() on LIST, MAP, NODE, RELATIONSHIP, PATH2026.09convert scalar components individually, then string.join()

Performance

EXPLAIN/PROFILE red flags: AllNodesScan CartesianProduct NodeByLabelScan Eager

Fix Eager — three approaches (choose simplest that works):

  1. Add specific labels to MATCH nodes to eliminate read/write ambiguity: MATCH (x:CallingPoint) instead of bare MATCH (x) when writing :City nodes
  2. Collect first, then write: WITH collect(u) AS users UNWIND users AS u ...
  3. CALL IN TRANSACTIONS: isolates each batch in its own transaction

Label inference — when planner underestimates selectivity on multi-label queries: [Neo4j 5]

cypher
CYPHER inferSchemaParts = most_selective_label
MATCH (admin:Administrator {name: $name}), (resource:Resource {name: $res})
MATCH p=(admin)-[:MEMBER_OF]->()-[:ALLOWED_INHERIT]->(company)
RETURN count(p)

Index anchors: every MATCH/MERGE/WHERE on a property needs an index on the lookup property or Neo4j scans all nodes. Index only activates when the node has a label — MATCH (n {prop: $v}) never uses an index; MATCH (n:Label {prop: $v}) does. MERGE without a constraint has no atomicity guarantee (two concurrent MERGEs can create duplicates). CONTAINS/ENDS WITH → TEXT index (RANGE does not support them). Force a plan with USING INDEX n:Label(prop) when EXPLAIN shows a scan. Chained OPTIONAL MATCH for nested data → replace with COLLECT { MATCH ... RETURN }. Dynamic labels ($($label)) → AllNodesScan+Filter; use static labels when possible.

Full anti-patterns → references/performance.md


Failure Recovery

  • 0 results: check param types, remove WHERE predicates one-by-one, EXPLAIN for index use
  • TypeErrors: use toIntegerOrNull()/toFloatOrNull(); guard with IS NOT NULL
  • Variable out of scope: not listed in WITH → use count(*) not count(droppedVar)
  • Timeouts: fix AllNodesScan → add early LIMIT → CALL IN TRANSACTIONS OF 1000 ROWS
  • Long-running query progress [2026.03]: SHOW TRANSACTIONS YIELD currentQuery, status, currentQueryProgress
  • DateTime mismatch: ZONED DATETIME >= date(...) → 0 rows; use datetime() or .year
  • Z suffix ≠ UTC timezone: ISO strings with Z are stored as a UTC-offset, not the UTC zone — range queries across Z and UTC stored values return 0 rows. Coerce on write: datetime({datetime: datetime($isoStr), timezone: 'UTC'})
  • Duration: duration.between(d1,d2).days = days component (Jan 1 → Mar 15: 14), not total. Total days: duration.inDays(d1,d2).days (73); same for inMonths, inSeconds. .inDays is not an accessor on duration values
  • Cannot merge node using null property value: MERGE key resolved to null — validate params first
  • IndexNotFoundError: SHOW INDEXES YIELD name, state WHERE state <> 'ONLINE'

References

Load on demand:

  • references/indexes.md — index types (RANGE/TEXT/FULLTEXT/POINT/COMPOSITE/LOOKUP), constraints, MERGE lock semantics, fulltext Lucene syntax, import pre-flight
  • references/cypher-syntax.md — full syntax reference: WITH, DELETE, ORDER BY, CASE, null, lists, strings, dates, spatial/point, LOAD CSV, subqueries, QPEs, dynamic labels, SEARCH (vector [2026.01], fulltext [2026.09]); conditional CALL (WHEN/THEN/ELSE); label pattern expressions; allReduce; NEXT clause; compact CASE WHEN; normalize(); string interpolation; UUID type + uuid() functions [2026.08]; map comprehension [2026.09]; index/constraint types table; functions annotated with version introduced
  • references/syntax-traps.md — 40+ syntax trap table
  • references/performance.md — anti-patterns, text vs fulltext indexes, Eager (3 fix strategies), label inference, batching best practices, parallel runtime
  • references/advanced-patterns.md — REPEATABLE ELEMENTS patterns, allReduce stateful traversal, multi-stop QPE, route planning simulation, DAG critical path, temporal fraud detection component graph, cycle detection, OPTIONAL CALL
  • references/apoc.md — APOC Core: refactoring, virtual graph, merge helpers, path expanders, triggers, collections, conditional execution
  • references/graph-type.md — GRAPH TYPE DDL (GA 2026.06): ALTER CURRENT GRAPH TYPE SET/ADD/ALTER/DROP, SHOW CURRENT GRAPH TYPE [AS GRAPH], element type syntax, property types, constraints, label implications, relationship type enforcement, required privileges

WebFetch

NeedURL
Clause semanticshttps://neo4j.com/docs/cypher-manual/25/clauses/{clause}/
Function signatureshttps://neo4j.com/docs/cypher-manual/25/functions/{type}/
QPE / pathshttps://neo4j.com/docs/cypher-manual/25/patterns/
Spatial/point functionshttps://neo4j.com/docs/cypher-manual/25/functions/spatial/
Index/constraint referencehttps://neo4j.com/docs/cypher-manual/25/indexes/
Full cheat sheethttps://neo4j.com/docs/cypher-cheat-sheet/25/all/

Checklist

  • Schema inspected or confirmed in context
  • CYPHER 25 prefix on every top-level query
  • $parameters used (not literals)
  • LIMIT on exploratory reads (default 25)
  • EXPLAIN run; red flags resolved
  • Write half verified as RETURN before executing
  • Write execution gate applied if agent is executing (not generating)
  • MERGE on constrained key only
  • No label-free MATCH (n)
  • Schema ops not inside explicit transaction

© neo4j-contrib, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 12 other files (scripts, references) in neo4j-cypher-skill of neo4j-contrib/neo4j-skills.

  • SKILL.md
  • README.md
  • references/advanced-patterns.md
  • references/apoc.md
  • references/cypher-syntax.md
  • references/graph-type.md
  • references/indexes.md
  • references/performance.md
  • references/schema-guardrail.md
  • references/syntax-traps.md
  • scripts/define_schema.py
  • scripts/generate_schema.py
  • scripts/import_neo4j_schema.py

Open the folder on GitHubat commit bb30e1f

Used in 1 other repository

We found 3 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in neo4j-contrib/neo4j-skills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Neo4j Cypher Skill next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Neo4j Cypher Skill compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Neo4j Cypher Skill this skillneo4j-contrib/neo4j-skills1141 repos~6.1kAutomated safety check: PassMIT
Alumni Re Hire Trackersickn33/agentic-awesome-skills47k1 repos~3.4kAutomated safety check: PassMIT
Announcement Boardsickn33/agentic-awesome-skills47k1 repos~3.4kAutomated safety check: PassMIT
Asset It Managementsickn33/agentic-awesome-skills47k1 repos~4kAutomated safety check: PassMIT
Attendancesickn33/agentic-awesome-skills47k1 repos~3.5kAutomated safety check: PassMIT
Import LeadsOthmane-Khadri/YALC-the-GTM-operating-system318—~465Automated safety check: NotesMIT

Similar skills

  • Alumni Re Hire Tracker

    sickn33/agentic-awesome-skills

    Alumni and re-hire register: former role, last working day, re-hire eligibility, current employer and re-engagement date, as CSV, SQL, JSON Schema or Notion on request.

    47k GitHub starsUsed in 1 repo~3.4k tokens
    Documents & OfficeAuto-check passed
  • Announcement Board

    sickn33/agentic-awesome-skills

    Announcement board: author, category, department, priority, audience, publish and expiry dates, status and acknowledgements, as CSV, SQL, JSON Schema or Notion on request.

    47k GitHub starsUsed in 1 repo~3.4k tokens
    Documents & OfficeAuto-check passed
  • Asset It Management

    sickn33/agentic-awesome-skills

    Asset and IT register: serial, model, condition, assignee, location, purchase value, warranty expiry and return date, as CSV, SQL, JSON Schema or Notion on request.

    47k GitHub starsUsed in 1 repo~4k tokens
    Documents & OfficeAuto-check passed
  • Attendance

    sickn33/agentic-awesome-skills

    Daily attendance register: check-in and check-out, hours worked, work mode, late minutes, leave and regularisation flags, as CSV, SQL, JSON Schema or Notion on request.

    47k GitHub starsUsed in 1 repo~3.5k tokens
    Documents & OfficeAuto-check passed
  • Import Leads

    Othmane-Khadri/YALC-the-GTM-operating-system

    Import a batch of leads from CSV, JSON, or a Notion DB into the local SQLite database without running the qualification pipeline.

    318 GitHub stars~465 tokensUpdated 1 mo ago
    Documents & OfficeAuto-check: notes
  • Replicate Paper

    brycewang-stanford/Auto-Empirical-Research-Skills

    Run a full 6-phase autonomous replication of a biomedical/epidemiology paper against UK Biobank or similar cohort data, producing Python and R scripts plus a validated replication report.

    4.6k GitHub stars~1.9k tokensUpdated 5 days ago
    Documents & OfficeAuto-check: notes

More from neo4j-contrib/neo4j-skills

All 28 skills in this repo
  • Neo4j Aura Agent Skill

    neo4j-contrib/neo4j-skills

    Manages Neo4j Aura Agents via the v2beta1 REST API — create, list, get, update, delete, and invoke Aura agents backed by an AuraDB instance.

    114 GitHub stars~4.4k tokensUpdated yesterday
    Auto-check: notes
  • Neo4j Aura Graph Analytics Skill

    neo4j-contrib/neo4j-skills

    Serverless Aura Graph Analytics (AGA) GDS Sessions — covers GdsSessions, AuraGraphDataScience, AuraAPICredentials, DbmsConnectionInfo, SessionMemory, getorcreate, remote graph projection with…

    114 GitHub stars~4.6k tokensUpdated yesterday
    Auto-check: notes
  • Neo4j Getting Started Skill

    neo4j-contrib/neo4j-skills

    Orchestrates zero-to-running-app in 8 stages — prerequisites → context → provision → model → load → explore → query → build.

    114 GitHub stars~4.3k tokensUpdated yesterday
    Auto-check: warnings
  • Neo4j Aura Provisioning Skill

    neo4j-contrib/neo4j-skills

    Provisions and manages Neo4j Aura instances via CLI (aura-cli v1.7+) or REST API.

    114 GitHub stars~3.7k tokensUpdated yesterday
    Auto-check: notes
  • Neo4j Driver Dotnet Skill

    neo4j-contrib/neo4j-skills

    Neo4j .NET Driver v6 — IDriver lifecycle, DI registration (singleton), ExecutableQuery fluent API, ExecuteReadAsync/ExecuteWriteAsync managed transactions, IResultCursor (FetchAsync/ ToListAsync)…

    114 GitHub stars~4.5k tokensUpdated yesterday
    Auto-check: notes
  • Neo4j Driver Go Skill

    neo4j-contrib/neo4j-skills

    Covers the Neo4j Go Driver v6 — driver lifecycle, ExecuteQuery, managed and explicit transactions, session config, error handling, data type mapping, and connection tuning.

    114 GitHub stars~3.8k tokensUpdated yesterday
    Auto-check: notes

Works with

Questions about Neo4j Cypher Skill

What does Neo4j Cypher Skill do?

Generates, optimizes, and validates Cypher 25 queries for Neo4j 2025.x and 2026.x. Neo4j Cypher Skill is an agent skill from neo4j-contrib/neo4j-skills.x.

When should I use Neo4j Cypher Skill?

Neo4j Cypher Skill fits situations like: writing new Cypher queries; optimizing slow queries; graph pattern matching; fulltext search.

How do I install Neo4j Cypher Skill in Claude Code?

Run `npx skills add neo4j-contrib/neo4j-skills --skill neo4j-cypher-skill -a claude-code`. Or copy the skill folder (neo4j-cypher-skill in neo4j-contrib/neo4j-skills) into .claude/skills/neo4j-cypher-skill in your project. Claude Code loads it when a task matches its description.

How do I install Neo4j Cypher Skill in Codex?

Run `npx skills add neo4j-contrib/neo4j-skills --skill neo4j-cypher-skill -a codex`. Or copy the skill folder (neo4j-cypher-skill in neo4j-contrib/neo4j-skills) into .agents/skills/neo4j-cypher-skill in your project. Codex loads it when a task matches its description.

Can I use Neo4j Cypher Skill in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add neo4j-contrib/neo4j-skills --skill neo4j-cypher-skill -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/neo4j-cypher-skill, .gemini/skills/neo4j-cypher-skill, .github/skills/neo4j-cypher-skill and .opencode/skills/neo4j-cypher-skill in your project.

What does Neo4j Cypher Skill need to run?

Going by SKILL.md and its folder, Neo4j Cypher Skill needs Python for the scripts in its folder and the command-line tools its instructions call (curl). Our summary lists: Python 3. Compatibility (from SKILL.md): Neo4j >= 2025.01 (safe baseline); Cypher 25.

Does Neo4j Cypher Skill access the network?

SKILL.md names 2 domains. In commands or code: neo4j.com; the agent is likely to contact it when it follows the instructions. As links in the text: github.com. This is read from the text; nothing was executed.

Is Neo4j Cypher Skill safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Neo4j Cypher Skill use?

Neo4j Cypher Skill is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Neo4j Cypher Skill use?

About 6.1k tokens (SKILL.md is roughly 24k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 22k tokens, read only when the agent opens those files.

What are the alternatives to Neo4j Cypher Skill?

Skills that share tags, products or a category with Neo4j Cypher Skill: Alumni Re Hire Tracker (sickn33/agentic-awesome-skills, 47k stars), Announcement Board (sickn33/agentic-awesome-skills, 47k stars), Asset It Management (sickn33/agentic-awesome-skills, 47k stars) and Attendance (sickn33/agentic-awesome-skills, 47k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Neo4j Cypher Skill?

neo4j-contrib (a GitHub organization) maintains it in neo4j-contrib/neo4j-skills, which has 114 GitHub stars. The repository holds 28 skills in this directory. The repository was last updated on October 9, 2026.

Source: neo4j-contrib/neo4j-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.