skills/forge-graph-debug/SKILL.md
[read-only] Diagnose Neo4j knowledge graph issues — orphaned nodes, stale data, missing enrichments, relationship integrity. Use when /forge-graph-status shows anomalies, graph queries return unexpected results, or after a failed /forge-graph-rebuild.
npx skillsauth add quantumbitcz/dev-pipeline forge-graph-debugInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Targeted diagnostic skill for the Neo4j knowledge graph. Provides structured diagnostic recipes without requiring raw Cypher knowledge.
See shared/skill-contract.md for the standard exit-code table.
Before any action, verify:
git rev-parse --show-toplevel 2>/dev/null. If fails: report "Not a git repository. Navigate to a project directory." and STOP.shared/graph/neo4j-health.sh. If unhealthy: report "Neo4j is not available. Run /forge-graph-init first." and STOP./forge-graph-init to build the project graph." and STOP.Nodes with no relationships (potential data quality issue):
MATCH (n {project_id: $project_id})
WHERE NOT (n)--()
RETURN labels(n) AS type, count(n) AS count
LIMIT 50
Nodes not updated since the current HEAD:
MATCH (n {project_id: $project_id})
WHERE n.last_updated_sha <> $current_sha
RETURN labels(n)[0] AS type, n.name AS name, n.last_updated_sha AS stale_sha
LIMIT 50
Expected enrichment properties absent on node types:
MATCH (n:Function {project_id: $project_id})
WHERE n.complexity IS NULL OR n.test_coverage IS NULL
RETURN n.name AS function, n.file_path AS file
LIMIT 50
Check for expected relationship types:
MATCH (n {project_id: $project_id})
WHERE NOT (n)-[:DEFINED_IN]->()
RETURN labels(n)[0] AS type, n.name AS name
LIMIT 50
Quick health overview by label:
MATCH (n {project_id: $project_id})
RETURN labels(n)[0] AS label, count(n) AS count
ORDER BY count DESC
LIMIT 50
shared/graph/neo4j-health.sh/forge-graph-init or Docker troubleshootingproject_id from git remote origin URL/forge-graph-rebuild for widespread staleness, manual fixes for isolated issues| Condition | Action |
|-----------|--------|
| Neo4j container not running | Report status and suggest /forge-graph-init or Docker troubleshooting |
| Neo4j unhealthy | Report error output. Suggest checking container logs |
| Cypher query fails | Display error output. Suggest /forge-graph-init if persistent |
| No project_id derivable (no git remote) | Fall back to basename of project root |
| Query returns too many rows | Enforce LIMIT (max 50 default). Suggest narrowing the diagnostic |
/forge-graph-status -- Quick overview of graph health and node counts/forge-graph-rebuild -- Rebuild the graph when debug shows widespread staleness or corruption/forge-graph-init -- Full initialization when the container is not running/forge-graph-query -- Run custom Cypher queries for deeper investigationdevelopment
[writes] Build, fix, deploy, review, or modify code in this project. Universal entry for the forge pipeline. Auto-bootstraps on first run; brainstorms before planning when given a feature description. Use when you want to take any productive action: implementing features, fixing bugs, reviewing branches, deploying, committing, running migrations.
tools
[writes] Manage forge state and configuration: recovery, abort, config edits, session handoff, automations, playbooks, output compression, knowledge graph maintenance. Use when you need to recover from broken pipeline state, edit settings, or manage long-lived state.
development
[writes] Create, list, show, resume, or search forge session handoffs. Use when context is getting heavy and you want to transfer a forge run or conversation into a fresh Claude Code session, or to resume from a prior handoff artefact. Subcommands - no args (write), list, show, resume, search.
development
[writes] Manage the Neo4j knowledge graph. Subcommands: init, rebuild (writes); status, query <cypher>, debug (read-only). Requires Docker. No default — an explicit subcommand is required. Use when setting up the graph for the first time, rebuilding after major refactors, checking graph health, or running ad-hoc Cypher diagnostics.