# neo4j-cypher-guide

neo4j-cypher-guide guides AI agents in writing current Neo4j Cypher read queries, choosing read subqueries, and traversing graphs with modern path patterns.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 1 install · ★ 1649 repo stars
- Author: tomasonjo
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/tomasonjo/blogs/tree/HEAD/claude-skills/neo4j-cypher-guide/neo4j-cypher-guide/SKILL.md
- Updated: 2025-12-27
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/neo4j-cypher-guide

## What it does

This skill guides Neo4j read-query generation with current Cypher syntax. It replaces `id()` with `elementId()`, makes aggregation grouping explicit through `WITH`, and uses `COUNT{}`, `EXISTS{}`, and `COLLECT{}` subqueries where they fit. Complex reads can be organized with `CALL` subqueries and explicit variable scope.

The guide covers Quantified Path Patterns for variable-length traversal, including predicates applied inside the pattern. It also recommends anchoring matches on indexed properties, bounding expansion depth, and checking plans with `PROFILE`. A sorted property that can contain `null` should be filtered before `ORDER BY`; otherwise the result may contain `null`. Reference material is split across deprecated syntax, subqueries, and QPP topics.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add tomasonjo/blogs --skill neo4j-cypher-guide -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/neo4j-cypher-guide/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/neo4j-cypher-guide/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add tomasonjo/blogs --skill neo4j-cypher-guide -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/neo4j-cypher-guide/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add tomasonjo/blogs --skill neo4j-cypher-guide -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/neo4j-cypher-guide/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install tomasonjo/blogs claude-skills/neo4j-cypher-guide/neo4j-cypher-guide
```

2. **Manually: put the files in place**
- File: `.github/skills/neo4j-cypher-guide/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add tomasonjo/blogs --skill neo4j-cypher-guide -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/tomasonjo/blogs --path claude-skills/neo4j-cypher-guide/neo4j-cypher-guide
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/neo4j-cypher-guide/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add tomasonjo/blogs --skill neo4j-cypher-guide -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/tomasonjo/blogs/tree/HEAD/claude-skills/neo4j-cypher-guide/neo4j-cypher-guide/SKILL.md

## When to use it
- modernize Neo4j queries that use removed syntax
- replace `id()` with `elementId()`
- structure complex reads with `CALL` and `COLLECT{}`
- filter nullable values before sorting
- rewrite variable-length traversal with QPP

## Example prompts
- Rewrite this Neo4j read query with current Cypher and replace `id()`.
- Build a department query with `CALL`, return the three highest salaries, and collect their names with `COLLECT{}`.
- Refactor this one-to-five-hop traversal so node filters run inside a QPP.

## Similar
- [neo4j-cypher-skill](https://affpapa.org/en/nevibecode/skills/neo4j-cypher-skill.md) — skill · 1600 installs
- [mcp-neo4j-cypher](https://affpapa.org/en/nevibecode/mcp/mcp-neo4j-cypher.md) — MCP server · ★ 991 repo stars
- [Neo4j](https://affpapa.org/en/nevibecode/mcp/neo4j.md) — MCP server
- [spring-data-neo4j](https://affpapa.org/en/nevibecode/skills/spring-data-neo4j.md) — skill · 4000 installs
- [neo4j-expert](https://affpapa.org/en/nevibecode/agents/neo4j-expert.md) — subagent · ★ 1029 repo stars
- [graph-database-expert](https://affpapa.org/en/nevibecode/skills/graph-database-expert.md) — skill · 271 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
