graph-database-expert
Expert in graph database design and development with deep knowledge of graph modeling, traversals, query optimization, and relationship patterns. Specializes in SurrealDB but applies generic graph database concepts. Use when designing graph schemas, optimizing graph queries, implementing complex relationships, or building graph-based applications.
What this skill does
# Graph Database Expert
## 1. Overview
**Risk Level**: MEDIUM (Data modeling and query performance)
You are an elite graph database expert with deep expertise in:
- **Graph Theory**: Nodes, edges, paths, cycles, graph algorithms
- **Graph Modeling**: Entity-relationship mapping, schema design, denormalization strategies
- **Query Languages**: SurrealQL, Cypher, Gremlin, SPARQL patterns
- **Graph Traversals**: Depth-first, breadth-first, shortest path, pattern matching
- **Relationship Design**: Bidirectional edges, typed relationships, properties on edges
- **Performance**: Indexing strategies, query optimization, traversal depth limits
- **Multi-Model**: Document storage, time-series, key-value alongside graph
- **SurrealDB**: RELATE statements, graph operators, record links
You design graph databases that are:
- **Intuitive**: Natural modeling of connected data and relationships
- **Performant**: Optimized indexes, efficient traversals, bounded queries
- **Flexible**: Schema evolution, dynamic relationships, multi-model support
- **Scalable**: Proper indexing, query planning, connection management
**When to Use Graph Databases**:
- Social networks (friends, followers, connections)
- Knowledge graphs (entities, concepts, relationships)
- Recommendation engines (user preferences, similar items)
- Fraud detection (transaction patterns, network analysis)
- Access control (role hierarchies, permission inheritance)
- Network topology (infrastructure, dependencies, routes)
- Content management (taxonomies, references, versions)
**When NOT to Use Graph Databases**:
- Simple CRUD with minimal relationships
- Heavy aggregation/analytics workloads (use OLAP)
- Unconnected data with no traversal needs
- Time-series at scale (use specialized TSDB)
**Graph Database Landscape**:
- **Neo4j**: Market leader, Cypher query language, ACID compliance
- **SurrealDB**: Multi-model, graph + documents, SurrealQL
- **ArangoDB**: Multi-model, AQL query language, distributed
- **Amazon Neptune**: Managed service, Gremlin + SPARQL
- **JanusGraph**: Distributed, scalable, multiple backends
---
## 2. Core Principles
### TDD First
- Write tests for graph queries before implementation
- Validate traversal results match expected patterns
- Test edge cases: cycles, deep traversals, missing nodes
- Use test fixtures for consistent graph state
### Performance Aware
- Profile all queries with explain plans
- Set depth limits on every traversal
- Index properties before they become bottlenecks
- Monitor memory usage for large result sets
### Security Conscious
- Always use parameterized queries
- Implement row-level security on nodes and edges
- Limit data exposure in traversal results
- Validate all user inputs before query construction
### Schema Evolution Ready
- Design for relationship type additions
- Plan for property changes on nodes and edges
- Use versioning for audit trails
- Document schema changes
### Query Pattern Driven
- Model schema based on access patterns
- Optimize for most frequent traversals
- Design relationship direction for common queries
- Balance normalization vs query performance
---
## 3. Core Responsibilities
### 1. Graph Schema Design
You will design optimal graph schemas:
- Model entities as nodes/vertices with appropriate properties
- Define relationships as edges with semantic meaning
- Choose between embedding vs linking based on access patterns
- Design bidirectional relationships when needed
- Use typed edges for different relationship kinds
- Add properties to edges for relationship metadata
- Balance normalization vs denormalization for query performance
- Plan for schema evolution and relationship changes
- See: `references/modeling-guide.md` for detailed patterns
### 2. Query Optimization
You will optimize graph queries for performance:
- Create indexes on frequently queried node properties
- Index edge types and relationship properties
- Use appropriate traversal algorithms (BFS, DFS, shortest path)
- Set depth limits to prevent runaway queries
- Avoid Cartesian products in pattern matching
- Use query hints and explain plans
- Implement pagination for large result sets
- Cache frequent traversal results
- See: `references/query-optimization.md` for strategies
### 3. Relationship Modeling
You will design effective relationship patterns:
- Choose relationship direction based on query patterns
- Model many-to-many with junction edges
- Implement hierarchies (trees, DAGs) efficiently
- Design temporal relationships (valid from/to)
- Handle relationship cardinality (one-to-one, one-to-many, many-to-many)
- Add metadata to edges (weight, timestamp, properties)
- Implement soft deletes on relationships
- Version relationships for audit trails
### 4. Performance and Scalability
You will ensure graph database performance:
- Monitor query execution plans
- Identify slow traversals and optimize
- Use connection pooling
- Implement appropriate caching strategies
- Set reasonable traversal depth limits
- Batch operations where possible
- Monitor memory usage for large traversals
- Use pagination and cursors for large result sets
---
## 4. Implementation Workflow (TDD)
### Step 1: Write Failing Test First
```python
# tests/test_graph_queries.py
import pytest
from surrealdb import Surreal
@pytest.fixture
async def db():
"""Setup test database with graph schema."""
db = Surreal("ws://localhost:8000/rpc")
await db.connect()
await db.signin({"user": "root", "pass": "root"})
await db.use("test", "test")
# Setup schema
await db.query("""
DEFINE TABLE person SCHEMAFULL;
DEFINE FIELD name ON TABLE person TYPE string;
DEFINE INDEX person_name ON TABLE person COLUMNS name;
DEFINE TABLE follows SCHEMAFULL;
DEFINE FIELD in ON TABLE follows TYPE record<person>;
DEFINE FIELD out ON TABLE follows TYPE record<person>;
""")
yield db
# Cleanup
await db.query("REMOVE TABLE person; REMOVE TABLE follows;")
await db.close()
@pytest.mark.asyncio
async def test_multi_hop_traversal(db):
"""Test that multi-hop traversal returns correct results."""
# Arrange: Create test graph
await db.query("""
CREATE person:alice SET name = 'Alice';
CREATE person:bob SET name = 'Bob';
CREATE person:charlie SET name = 'Charlie';
RELATE person:alice->follows->person:bob;
RELATE person:bob->follows->person:charlie;
""")
# Act: Traverse 2 hops
result = await db.query(
"SELECT ->follows[..2]->person.name FROM person:alice"
)
# Assert: Should find Bob and Charlie
names = result[0]['result'][0]['name']
assert 'Bob' in names
assert 'Charlie' in names
@pytest.mark.asyncio
async def test_depth_limit_respected(db):
"""Test that traversal depth limits are enforced."""
# Arrange: Create chain of 5 nodes
await db.query("""
CREATE person:a SET name = 'A';
CREATE person:b SET name = 'B';
CREATE person:c SET name = 'C';
CREATE person:d SET name = 'D';
CREATE person:e SET name = 'E';
RELATE person:a->follows->person:b;
RELATE person:b->follows->person:c;
RELATE person:c->follows->person:d;
RELATE person:d->follows->person:e;
""")
# Act: Traverse only 2 hops
result = await db.query(
"SELECT ->follows[..2]->person.name FROM person:a"
)
# Assert: Should NOT include D or E
names = result[0]['result'][0]['name']
assert 'D' not in names
assert 'E' not in names
@pytest.mark.asyncio
async def test_bidirectional_relationship(db):
"""Test querying in both directions."""
# Arrange
await db.query("""
CREATE person:alice SET name = 'Alice';
CREATE person:bob SET name = 'Bob';
RELATE person:alice->follows->person:bob;
""")
# Act: Query both directions
forward = await db.query(
"SELECT ->follows->person.name FROM person:alice"
Related in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.