spring-data-neo4j
Provides Spring Data Neo4j integration patterns for Spring Boot applications. Use when you need to work with a graph database, Neo4j nodes and relationships, Cypher queries, or Spring Data Neo4j. Creates node entities with @Node annotation, defines relationships with @Relationship, writes Cypher queries using @Query, configures imperative and reactive Neo4j repositories, implements graph traversal patterns, and sets up testing with embedded databases.
Security Assessment
About spring-data-neo4j
This skill provides Spring Data Neo4j integration patterns for Spring Boot applications working with graph databases. It addresses the mapping and querying concerns specific to Neo4j: modeling domain objects as nodes and relationships, choosing identifier strategies, and writing Cypher queries idiomatically within the Spring Data repository abstraction.
It guides an assistant through setup (adding the spring-boot-starter-data-neo4j dependency, configuring the bolt connection and credentials in application.properties, and setting the Cypher-DSL dialect), defining node entities with the @Node, @Relationship, @Property, @Id, and @GeneratedValue annotations, and choosing between business-key and generated identifiers with immutable entity design. It covers both imperative (Neo4jRepository) and reactive (ReactiveNeo4jRepository) repositories, query derivation for simple lookups, and custom Cypher via the @Query annotation with named parameters. A dedicated testing section uses @DataNeo4jTest with the Neo4j Harness embedded database and Cypher fixtures. The examples reference file includes complete worked scenarios: a movie database with actors and directors, a social network, an e-commerce product catalog, custom and reactive query examples, and projections. Validation checkpoints throughout suggest connection and constraint checks.
The target users are Java and Spring Boot developers adopting Neo4j for graph-shaped data such as recommendations, social graphs, knowledge graphs, or catalogs. Use cases include mapping relationship-rich domains, writing graph traversal queries, and setting up repository integration tests against an embedded Neo4j instance.
FAQ
Does it support both imperative and reactive access?
Yes. It covers Neo4jRepository for imperative operations and ReactiveNeo4jRepository for reactive operations.
How are entities and relationships mapped?
Entity classes are annotated with @Node, relationships with @Relationship (including direction), custom property names with @Property, and identifiers with @Id or @Id @GeneratedValue; immutable entities with final fields are recommended.
How are custom queries written?
Simple queries use Spring Data query derivation from method names; complex queries use the @Query annotation with raw Cypher and $paramName / @Param named parameters.
How is testing set up?
Using @DataNeo4jTest with test slicing, the Neo4j Harness embedded database, and Cypher fixtures loaded via withFixture(), with cleanup between tests.
What connection configuration is needed?
A bolt URI (for example bolt://localhost:7687) plus Neo4j username and password in application.properties; the skill documents these as standard config values, not secrets to exfiltrate.
Install spring-data-neo4j
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
giuseppe-trisciuoglio/developer-kit