kgraph-cli

Query code dependency graphs to trace call chains, blast radius, and spec-to-test traceability.

Updated May 16, 2026
One-click install
npx skills add https://github.com/michalo1334/ScenarioImpactDSL --skill kgraph-cli-michalo1334
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: kgraph-cli
Source: https://github.com/michalo1334/ScenarioImpactDSL/tree/main/.opencode/skills/kgraph-cli
Command: npx skills add https://github.com/michalo1334/ScenarioImpactDSL --skill kgraph-cli-michalo1334

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Answering questions about code relationships—like what breaks when a method changes, which classes lack tests, or which requirements have no implementation—cannot be done reliably with plain text search. This Skill uses the KGraph knowledge graph CLI to answer relationship, absence, and multi-hop traversal questions across code, docs, specs, and tests. ## Core Features & Use Cases - Blast Radius & Impact Analysis: Traverse Calls, Implements, and ProjectReference edges to find everything affected by a code change before refactoring. - Coverage & Traceability Validation: Run negation queries to find classes without tests, requirements without implementations, or handlers that never publish events. - Cross-Artifact Investigation: Join specs, code, tests, and markdown docs through typed edges like ImplementsRequirement, Verifies, and LinksTo. - Use Case: Before renaming a core interface like IGraphStore, ask the Skill to list every implementing class, its owning project, and the tests that verify it, so the refactor plan covers all downstream impact. ## Quick Start Ask the assistant to use the kgraph skill to find the blast radius of changing a specific method, making sure the Memgraph container is running and the repository has been indexed first.

Frequently Asked Questions about kgraph-cli

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find the blast radius of a code change?▼

Use the kgraph cypher or traverse command to walk Calls edges outward from the changed method. For example, match the class and method, then follow downstream Calls relationships to list impacted types and their owning projects.

How to find classes with no tests using a knowledge graph?▼

Run a cypher query with OPTIONAL MATCH on the Tests edge, then filter WHERE the test node IS NULL. This negation pattern reliably lists classes lacking linked tests, which plain grep cannot express.

When should I use KGraph instead of grep or ripgrep?▼

Use KGraph for relationship, absence, or multi-hop questions like reverse dependencies, call chains, and spec traceability. Use ripgrep only for literal string lookup in a single file or quick symbol searches.

Why does my KGraph query return zero results?▼

Empty results usually mean the graph is stale or was indexed without the needed packages. Run kgraph status, then re-index with packages like Roslyn, TestLink, or SpecLink before concluding that coverage or linkage is absent.

Does KGraph require a running database?▼

Yes, KGraph stores the graph in Memgraph, typically started with docker compose up -d memgraph. You then index the repository with kgraph index before running query, traverse, or cypher commands.