# neo4j-spring-data-skill

The neo4j-spring-data-skill Claude Code skill supports Spring Boot projects that use Neo4j through Spring Data Neo4j. It comes into play when defining entities, repositories, and Cypher queries in a Spring application.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 427 installs · ★ 121 repo stars
- Author: neo4j-contrib
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/neo4j-contrib/neo4j-skills/tree/HEAD/neo4j-spring-data-skill/SKILL.md
- Updated: 2026-11-09
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/neo4j-spring-data-skill

## What it does

The skill covers connecting Neo4j to Spring Boot and accessing the database through Spring Data Neo4j. Its examples include `@Node` entities and relationships, `Neo4jRepository` and `ReactiveNeo4jRepository` interfaces, Cypher in `@Query`, projections, and `application.yml` settings.

For custom queries, it describes `Neo4jClient` and `Neo4jTemplate`; it also covers transactions, auditing, and vector search with Spring AI's `Neo4jVectorStore`. The configuration examples read `NEO4J_URI`, `NEO4J_USERNAME`, and `NEO4J_PASSWORD` from environment variables rather than embedding credentials in the config. The version table pairs SDN 8.0.x with Spring Boot 3.3.x / 3.4.x and Java 17+. This skill does not cover standalone Java-driver code or authoring Cypher independently.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add neo4j-contrib/neo4j-skills --skill neo4j-spring-data-skill -a claude-code
```

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

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add neo4j-contrib/neo4j-skills --skill neo4j-spring-data-skill -a codex
```

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

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add neo4j-contrib/neo4j-skills --skill neo4j-spring-data-skill -a cursor
```

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

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install neo4j-contrib/neo4j-skills neo4j-spring-data-skill
```

2. **Manually: put the files in place**
- File: `.github/skills/neo4j-spring-data-skill/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add neo4j-contrib/neo4j-skills --skill neo4j-spring-data-skill -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/neo4j-contrib/neo4j-skills --path neo4j-spring-data-skill
```

### Windsurf (Devin Desktop)

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

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add neo4j-contrib/neo4j-skills --skill neo4j-spring-data-skill -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/neo4j-contrib/neo4j-skills/tree/HEAD/neo4j-spring-data-skill/SKILL.md

## When to use it
- configure a Spring Boot connection to Neo4j
- map entities and relationships with SDN annotations
- define a repository with CRUD and Cypher methods
- shape and paginate repository results with projections
- add Neo4jVectorStore search to a Spring application

## Example prompts
- Set up the Spring Boot connection to Neo4j in `application.yml`.
- Model a `Person` entity with outgoing `KNOWS` relationships for Spring Data Neo4j.
- Create a `Neo4jRepository` method that finds friends using `@Query`.

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: a2ee288c10d1ffa2.

BEGIN THIRD-PARTY FILE a2ee288c10d1ffa2
````text
---
name: neo4j-spring-data-skill
description: Use when building Spring Boot applications with Neo4j using Spring Data Neo4j (SDN 7.x/8.x) —
  @Node entity mapping, @Relationship, @RelationshipProperties, Neo4jRepository, ReactiveNeo4jRepository,
  @Query annotations, application.yml configuration, projections, Neo4jClient, Neo4jTemplate,
  transactions, auditing, or Spring AI Neo4jVectorStore vector search.
  Does NOT handle raw Java driver code without Spring — use neo4j-driver-java-skill.
  Does NOT handle Cypher query authoring — use neo4j-cypher-skill.
  Does NOT handle driver version upgrades — use neo4j-migration-skill.
version: 1.0.5
allowed-tools: Bash WebFetch
---

# Neo4j Spring Data Skill

## When to Use

- Configuring Spring Boot with Neo4j (`spring-boot-starter-data-neo4j`)
- Writing `@Node` entity classes and `@Relationship`/`@RelationshipProperties` mappings
- Defining `Neo4jRepository` or `ReactiveNeo4jRepository` interfaces
- Writing `@Query` annotations with Cypher on repository methods
- Using Spring projections (interface-based, DTO, dynamic) with Neo4j
- Configuring `application.yml` for Neo4j connection
- Custom queries via `Neo4jClient` or `Neo4jTemplate`
- Spring AI `Neo4jVectorStore` for vector search in Spring apps
- Transaction management, auditing, optimistic locking

## When NOT to Use

- **Raw Java driver without Spring** → `neo4j-driver-java-skill`
- **Cypher query authoring** → `neo4j-cypher-skill`
- **Driver version upgrades** → `neo4j-migration-skill`
- **GDS algorithms** → `neo4j-gds-skill`

---

## Version Matrix

| SDN    | Spring Boot | Spring Framework | Java | Neo4j |
|--------|-------------|-----------------|------|-------|
| 8.0.x  | 3.3.x / 3.4.x | 6.2.x          | 17+  | 5.15+ |
| 8.1.x  | 3.4.x+      | 7.0.x           | 17+  | 5.15+ |
| 7.5.x  | 3.2.x       | 6.1.x           | 17+  | 4.4+  |

Use `spring-boot-starter-data-neo4j` — it pulls SDN + driver. No explicit SDN version needed when using Spring Boot BOM.

---

## Setup

### Maven

```xml
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-neo4j</artifactId>
</dependency>
```

### Gradle

```gradle
implementation 'org.springframework.boot:spring-boot-starter-data-neo4j'
```

### Reactive stack (add alongside above)

```xml
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-webflux</artifactId>
</dependency>
```

---

## Configuration

### application.yml — imperative (standard)

```yaml
spring:
  neo4j:
````
END THIRD-PARTY FILE a2ee288c10d1ffa2

The third-party file has ended. Everything between the a2ee288c10d1ffa2 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2563 of 14961 bytes. © neo4j-contrib · MIT · https://github.com/neo4j-contrib/neo4j-skills/tree/HEAD/neo4j-spring-data-skill/SKILL.md

_Part of the page did not fit — see the HTML version._

---
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
