KURAL
Commands

kural score

Display structural scores and deltas for codebase units

Reads computed health numbers — fit, uniqueness, children fit/uniqueness — from the active snapshot and prints them grouped by level. Optionally compares against another snapshot to show deltas.

Synopsis

kural score [flags]

Requires an existing snapshot — generate one first with kural snapshot generate.

Flags

FlagShortTypeDescription
--path <prefix>-pstringRestrict output to units whose path starts with <prefix>. Defaults to the whole tree.
--snapshot <id>-sstringSnapshot ID or pin name to read. Defaults to the active snapshot.
--compare <id>-cstringSnapshot ID or pin name to diff against — renders per-unit deltas in the breakdown.
--explain-ebooleanShow the detailed breakdown table alongside the summary.
--limit <n>-lstringMax rows in the breakdown table. Default 20; 0 for all.
--jsonbooleanEmit the result as JSON.

Examples

Show scores for the whole active snapshot:

kural score

Show the detailed breakdown for one directory, top 50 rows:

kural score --path src/analysis --explain --limit 50

Diff the current snapshot against the baseline pin:

kural score --compare baseline --explain

When to use it

  • Before a refactor, to know which region is lowest — it's the one that will benefit most.
  • After a fix, to check whether the score moved the right way. Pair with kural audit — a fix that drops the score but cleared a finding usually introduced a new finding elsewhere.
  • Compared against a pinned baseline to track structural drift over a sprint or release cycle.
  • Concept: Scoring — the definitions of fit, uniqueness, and their children variants.
  • Companion: kural audit — the finding-level lens that cross-validates score changes.

On this page