KURAL
Commands

kural audit

Run structural audits on a codebase snapshot and print categorized findings

Runs the 14 statistical checks against the current snapshot and prints findings grouped by category — outliers, merge candidates, containments, misplaced nodes, duplicates, vocabulary bleed, incoherent containers, weak identities, and incomplete docs.

Synopsis

kural audit [flags]

audit reads the snapshot database in the current working directory. Generate it first with kural snapshot generate.

Flags

FlagShortTypeDescription
--sensitivity <n>-knumberStandard deviations from mean to flag a value. Default 2.0. Higher values = stricter.
--filter <list>-fstringComma-separated audit categories to show (e.g. outliers,duplicates). Matches against section titles.
--disable <list>-dstringComma-separated audit names to skip entirely (e.g. incomplete-docs,vocabulary-bleed).
--expand-ebooleanShow every finding per audit — disables the default truncation.
--jsonbooleanEmit machine-readable JSON instead of the formatted report.

The sensitivity and disable defaults also come from .kural/config.json under the audits key — CLI flags override project config. See Configuration.

Examples

Run all audits at default sensitivity:

kural audit

Show only outlier and misplaced findings, with every match expanded:

kural audit --filter outliers,misplaced --expand

Stricter threshold, skipping documentation checks:

kural audit -k 3.0 -d incomplete-docs

Emit JSON for downstream tooling:

kural audit --json > audit.json

When to use it

  • After regenerating a snapshot, to see what structural issues the new state introduces.
  • Before a refactor, to pick the highest-value target — outliers and duplicates surface move-or-merge candidates directly.
  • In CI, via --json — consume the report to fail builds on newly introduced findings.
  • Concept: Audits — what each of the 14 checks computes and why.
  • Suppression: Kural Params@kuralResidual, @kuralBound, and @kuralHelper suppress specific audits by design.
  • Companion: kural score — aggregate health numbers that cross-validate with audit findings.

On this page