KiroGraph’s architecture tools expose the macro-level structure of your codebase as queryable data: package graphs, layer assignments, coupling metrics, and community detection. All tools in this group requireDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/davide-desio-eleva/kirograph/llms.txt
Use this file to discover all available pages before exploring further.
enableArchitecture: true in .kirograph/config.json. The index must be rebuilt after enabling the flag — run kirograph index to populate architecture data.
Architecture data is derived from manifest files (
package.json, Cargo.toml, pyproject.toml, go.mod, etc.) combined with the import graph extracted during indexing. No static analysis configuration is required.kirograph_architecture
Get the full architecture overview: detected packages, layer assignments, and the dependency graph between them. The level parameter controls whether you see packages, layers, or both.
What to return:
packages, layers, or both (default).When
true, appends a File → Package mapping (truncated at 50 entries). Defaults to false.Project root path. Defaults to the current working directory.
Example: full overview
Example output
kirograph_coupling
Compute coupling metrics for every package. Returns Ca (afferent — how many packages depend on this one), Ce (efferent — how many packages this one depends on), and instability (Ce / (Ca + Ce)). An instability score near 1.0 means the package is highly dependent on others and hard to change independently; a score near 0.0 means it is a stable foundation.
Sort the results by
instability (default), afferent, or efferent.Maximum packages to return. Defaults to
20.Project root path. Defaults to the current working directory.
Example: find the most unstable packages
Example output
kirograph_package
Inspect a single package in detail: path, source manifest, version, language, coupling scores, inbound and outbound package dependencies, external npm/PyPI/crates dependencies, and the files it contains.
Package name, path prefix, or ID. Partial matches are accepted.
List the files belonging to this package (up to 30, then truncated). Defaults to
true.Project root path. Defaults to the current working directory.
Example: inspect the service package
Example output
kirograph_communities
Detect logical communities within the codebase using graph modularity. Communities represent clusters of symbols that talk to each other more than to the rest of the graph — often aligning with domain boundaries even when package structure doesn’t enforce them.
Maximum communities to return. Defaults to
15.Louvain resolution parameter. Higher values produce more, smaller communities. Defaults to
1.0.Project root path. Defaults to the current working directory.
Example
kirograph_manifest
List all packages declared in manifest files across the workspace, with optional version drift detection and per-package dependency drill-down.
Package name or path for a per-package deep dive (external deps, version, license).
Filter to a specific ecosystem by language keyword (e.g.
typescript, python, rust).When
true, reports packages declared in multiple places with differing versions.Project root path. Defaults to the current working directory.
Refactor Planning Example
Usekirograph_coupling to locate high-instability packages before starting a refactor, then drill into them with kirograph_package to understand exactly what depends on them.
Find the most unstable packages
Identify packages with instability scores above Any package with
0.8 — these are the hardest to change safely:I > 0.8 should be reviewed before the refactor touches it.Drill into a high-instability package
For each flagged package, inspect its inbound and outbound dependencies:The
Depends on section shows what needs to remain stable; Depended on by shows who will be broken if the package’s interface changes.