Three more static code analysis sensors

Birgitta BΓΆckeler (published on martinfowler.com) Β· rss Β· 2026-05-20 source β†— Reader πŸ–₯️

Agent SkillsCode QualityEvolutionary Architecture & Fitness FunctionsFeedback LoopsModularity & Coupling
For maintainability concerns that cross file and module boundaries, computational static-analysis sensors (dependency rules, coupling metrics) can usefully enforce a few structural invariants but cannot judge what coupling is appropriate; the most productive sensor is an inferential, prompt-driven AI modularity review that reads the code itself, with the deterministic tools relegated to enforcement of known rules and to triage of review attention.

practical Β· mixed β€” An experience report that argues for a practical position: how to combine computational and inferential sensors for cross-module maintainability when AI is doing the coding. Mostly expository/narrative ('here is what I tried') but with clear normative takeaways.

Structure

PartRole
Framing: from in-file linting to cross-module sensorscontext
Sensor 1 β€” Dependency rules via dependency-cruiser (layered module structure, custom error messages that double as self-correction guidance for the agent)evidence (case 1)
Sensor 2 β€” Custom coupling-data CLI (vibe-coded with a TypeScript-compiler-based analyser; two interfaces: web visualisations for humans, CLI output for agents)evidence (case 2, mostly negative)
Sensor 3 β€” Inferential 'AI modularity review' using Vlad Khononov's Modularity Skills, run against the codebase itself (not just metrics)evidence (case 3, positive)
Cross-cutting observations: repeat the analysis to surface more, grounding inferential review in deterministic data added little, computational sensors alone are insufficientsynthesis
Forward pointer to next installment on regression testing, coverage, and mutation testing as sensorscontext

Key terms

Propositions

Arguments

Computational dependency rules are worth adopting in an AI-coding harness despite their narrow expressive range. strength: high
Explicit premises:
Implicit premises:
Inferences:
Raw coupling metrics are not, on their own, a useful sensor for an AI agent. strength: high
Explicit premises:
Implicit premises:
Inferences:
An LLM modularity review that reads the actual code, driven by a curated skill pack, is the best available sensor for cross-module maintainability under AI-assisted development. strength: high
Explicit premises:
Implicit premises:
Inferences:
Computational and inferential sensors are not substitutes; they belong in different parts of the harness.
Explicit premises:
Implicit premises:
Inferences:

Narratives

Questions addressed

Gaps

Closes gaps elsewhere

Related documents