Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

neo4j-migration-skill

БесплатноБез исполняемых скриптовНе проверен

Migrates Neo4j driver code and Cypher queries from older versions (4.x, 5.x) to current (2025.x/2026.x, Cypher 25). Covers Python, JavaScript/Node.js, Java…

neo4jот neo4j★ 126 звёзд на GitHub

Об этом скилле

When to Use

  • Upgrading driver dependency from 4.x or 5.x to 6.x
  • Migrating Cypher queries to Cypher 25 syntax
  • Fixing deprecated API warnings after a driver or Neo4j version bump
  • Auditing a codebase for removed/deprecated Neo4j APIs before upgrading

When NOT to Use

  • Writing new Cypher queries → neo4j-cypher-skill
  • DB admin (backup, restore, import, cypher-shell) → neo4j-cli-tools-skill
  • Starting fresh → neo4j-getting-started-skill
  • GDS algorithm migration — not covered here; consult GDS release notes

Entry Criteria

Before starting, ask:

  1. Target Neo4j version — needed to select Cypher dialect and driver version
  2. Languages in use — scan package.json, requirements.txt, pom.xml, *.csproj, go.mod
  3. Current driver versions — read from dependency files; do NOT guess

If target is >= 2025.06: ask whether Cypher 5 or Cypher 25 dialect will be used (both supported; Cypher 25 is the new default).


Step 1 — Scan Codebase

# Find Cypher strings (queries embedded in source)
grep -rn "MATCH\|MERGE\|CREATE\|CALL\|RETURN" --include="*.py" --include="*.js" \
  --include="*.ts" --include="*.java" --include="*.cs" --include="*.go" \
  --include="*.cypher" --include="*.cql" . | grep -v ".git"

# Find dependency files
find . -name "requirements*.txt" -o -name "package.json" -o -name "pom.xml" \
  -o -name "*.csproj" -o -name "go.mod" | grep -v ".git" | grep -v node_modules

Collect findings before modifying anything. List all deprecated patterns found.


Step 2 — Cypher Migration (4.x / 5.x → Cypher 25)

Apply to every Cypher string, .cypher file, OGM/SDN @Query annotation, and template literal.

Complete Substitution Table

Old syntax Cypher 25 replacement Notes
id(n) elementId(n) Returns string, not int
CALL { WITH x ... } CALL (x) { ... } Explicit import syntax
PERIODIC COMMIT CALL (...) { ... } IN TRANSACTIONS OF 1000 ROWS Batched writes
-- comment // comment SQL comment invalid
SET n = r (structural val) SET n = properties(r) Extract map first
MERGE (a {x:1})-[:T]->(b {x:a.x}) Rewrite — cross-entity MERGE refs disallowed Split into MATCH+MERGE
CREATE INDEX ... OPTIONS { indexProvider: ... } Remove indexProvider from OPTIONS Provider selection removed
db.create.setVectorProperty(...) Use native VECTOR property type Procedure removed
dbms.upgrade() / dbms.upgradeStatus() Use cypher-shell :sysinfo Procedures removed
USE composite.'1' USE `composite.1` Backtick entire qualified name
RETURN 1 as my$Identifier RETURN 1 as `my$Identifier` $ removed from unescaped ids

Optional Modernisation (not required)

[:REL*], shortestPath() and allShortestPaths() still run in Cypher 25 — not removed or deprecated. Leave them in code that already compiles. Rewrite only when the user asks or needs a QPE-only feature; semantics differ when a WHERE filters the path — re-test results, not just compilation.

Existing syntax QPE / SHORTEST form
[:REL*1..5] (()-[:REL]->()){1,5}
[:REL*] (()-[:REL]->()){1,}
[:REL*0..5] (()-[:REL]->()){0,5}
shortestPath((a)-[*]->(b)) SHORTEST 1 (a)(()-[]->()){1,}(b)
allShortestPaths((a)-[*]->(b)) ALL SHORTEST (a)(()-[]->()){1,}(b)

Vector / Fulltext Index Queries (version-branched)

Version Syntax
Neo4j < 2026.01 CALL db.index.vector.queryNodes(idx, k, $emb) YIELD node, score
Neo4j >= 2026.01 (Cypher 25) MATCH (n:Label) SEARCH n IN (VECTOR INDEX idx FOR $emb LIMIT k) SCORE AS score — SEARCH is a subclause of MATCH; alone it is a syntax error
Neo4j < 2026.09 CALL db.index.fulltext.queryNodes(idx, $q) YIELD node, score
Neo4j >= 2026.09 MATCH (n:Label) SEARCH n IN (FULLTEXT INDEX idx FOR $q LIMIT k) SCORE AS score — procedures deprecated 2026.10

Cypher Dialect Prefix Rule

  • Target >= 2025.06, dialect = Cypher 25: fix removals, then prefix CYPHER 25 (or set the database default language). Don't blanket-prefix code that already compiles unless the user chose this
  • Target >= 2025.06, dialect = Cypher 5: prepend CYPHER 5 (keeps deprecated forms working)
  • Target 4.x or 5.x: no prefix needed; fetch changelog per references/cypher-queries.md

id(n) → elementId(n) Caveats

elementId() returns a string (e.g., "4:abc123:0"), not an integer. Fix downstream code that stores or compares it as int. Do NOT use elementId() values for numeric operations.

- WHERE id(n) = $nodeId   # $nodeId was integer
+ WHERE elementId(n) = $nodeId  # $nodeId must now be string

Step 3 — Driver Migration

Pick the section(s) matching languages found in Step 1.


Python Driver (5.x → 6.x)

Min requirements: Python >= 3.10, neo4j package (6.0.0 released 2025-09-30

Полный SKILL.md на GitHub

Установить neo4j-migration-skill в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

WebFetch
Bash

Вложенные файлы

README.mdreferences/cypher-queries.mdreferences/dotnet-driver.mdreferences/go-driver.mdreferences/java-driver.mdreferences/javascript-driver.mdreferences/python-driver.mdreferences/relational-to-graph.md

FAQ

Что делает скилл neo4j-migration-skill?

Migrates Neo4j driver code and Cypher queries from older versions (4.x, 5.x) to current (2025.x/2026.x, Cypher 25). Covers Python, JavaScript/Node.js, Java, .NET, and Go drivers — package renames, removed APIs, version requirements, diff-ready fixes. Also handles Cypher syntax migration — QPE paths, CALL subqueries, id() → elementId(), PERIODIC COMMIT → CALL IN TRANSACTIONS, and all Cypher 25 removals. Does NOT write new Cypher queries — use neo4j-cypher-skill. Does NOT cover DB administration or server ops — use neo4j-cli-tools-skill. Does NOT provision new Neo4j instances — use neo4j-getting-started-skill.

Как установить скилл neo4j-migration-skill?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл neo4j-migration-skill запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить neo4j-migration-skill с