unipds-engenharia-de-ia-aplicada/engenharia-de-software-com-ia-aplicada/neo4j-cypher-guide
Claude Code and agent skill by unipds-engenharia-de-ia-aplicada/engenharia-de-software-com-ia-aplicada
- community
Checking that the SKILL.md file is still in the repository.
Comprehensive guide for writing modern Neo4j Cypher read queries. Essential for text2cypher MCP tools and LLMs generating Cypher queries. Covers removed/deprecated syntax, modern replacements, CALL subqueries for reads, COLLECT patterns, sorting best practices, and Quantified Path Patterns (QPP) for efficient graph traversal.
Install
npx vskill@latest install unipds-engenharia-de-ia-aplicada/engenharia-de-software-com-ia-aplicada/neo4j-cypher-guideSKILL.md
The same SKILL.md was published earlier as unipds-engenharia-de-ia-aplicada/engenharia-de-software-com-ia-aplicada/neo4j-cypher-guide.
Neo4j Modern Cypher Query Guide
This skill helps generate Neo4j Cypher read queries using modern syntax patterns and avoiding deprecated features. It focuses on efficient query patterns for graph traversal and data retrieval.
Quick Compatibility Check
When generating Cypher queries, immediately avoid these REMOVED features:
- ❌
id()function → UseelementId() - ❌ Implicit grouping keys → Use explicit WITH clauses
- ❌ Pattern expressions for lists → Use pattern comprehension or COLLECT subqueries
- ❌ Repeated relationship variables → Use unique variable names
- ❌ Automatic list to boolean coercion → Use explicit checks
Core Principles for Query Generation
- Use modern syntax patterns - QPP for complex traversals, CALL subqueries for complex reads
- Optimize during traversal - Filter early within patterns, not after expansion
- Always filter nulls when sorting - Add IS NOT NULL checks for sorted properties
- Explicit is better than implicit - Always use explicit grouping and type checking
Critical Sorting Rule
ALWAYS filter NULL values when sorting:
Query Pattern Selection Guide
For Simple Queries
Use standard Cypher patterns with modern syntax:
For Variable-Length Paths
Consider Quantified Path Patterns (QPP) for better performance:
For Aggregations
Use COUNT{}, EXISTS{}, and COLLECT{} subqueries:
For Complex Read Operations
Use CALL subqueries for sophisticated data retrieval:
Common Query Transformations
Counting Patterns
Checking Existence
Element IDs
Sorting with Null Handling
When to Load Reference Documentation
Load the appropriate reference file when:
references/deprecated-syntax.md
- Migrating queries from older Neo4j versions
- Encountering syntax errors with legacy queries
- Need complete list of removed/deprecated features
references/subqueries.md
- Working with CALL subqueries for reads
- Using COLLECT or COUNT subqueries
- Handling complex aggregations
- Implementing sorting with null filtering
references/qpp.md
- Optimizing variable-length path queries
- Need early filtering during traversal
- Working with paths longer than 3-4 hops
- Complex pattern matching requirements
Query Generation Checklist
Before finalizing any generated query:
- ✅ No deprecated functions (id, btree indexes, etc.)
- ✅ Explicit grouping for aggregations
- ✅ NULL filters for all sorted properties
- ✅ Appropriate subquery patterns for reads
- ✅ Consider QPP for paths with filtering needs
- ✅ Use COUNT{} instead of size() for pattern counting
- ✅ Variable scope clauses in CALL subqueries
- ✅ Unique variable names for relationships
Error Resolution Patterns
"Implicit grouping key" errors
"id() function not found"
"Repeated variable" errors
Performance Tips
- Start with indexed properties - Always anchor patterns with indexed lookups
- Filter early in QPP - Apply WHERE clauses within the pattern
- Filter nulls before sorting - Prevent unexpected results and improve performance
- Limit expansion depth - Use reasonable upper bounds in quantifiers
- Use EXISTS for existence checks - More efficient than counting
- Profile queries - Use PROFILE to identify bottlenecks
Modern Cypher Features
Label Expressions
Type Predicates
Subquery Patterns for Reads
- COUNT{} - Count patterns efficiently
- EXISTS{} - Check pattern existence
- COLLECT{} - Collect complex results
- CALL{} - Execute subqueries for complex reads
Quantified Path Patterns
- Inline filtering during traversal
- Access to nodes and relationships in patterns
- Significant performance improvements (up to 1000x)
- Support for complex, multi-hop patterns
Always prefer modern syntax patterns for better performance and maintainability.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingmodulo03-mcp-na-pratica/04-skills/.agents/skills/neo4j-cypher-guide/SKILL.md
Popularity
- Repository stars
- 1,034
- Repository forks
- 529
- 7-day trend score
- 35
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/unipds-engenharia-de-ia-aplicada/engenharia-de-software-com-ia-aplicada/neo4j-cypher-guide)