
Description
A codebase grows, modules start reaching into each other, one struct's fields get poked from half a dozen files, and soon nobody can tell what a single change will break. Let an AI agent write the code and it gets worse, because it puts things wherever is handiest. deslop-please goes after exactly that kind of structural debt. Run one command in a Rust project and it reports field leaks, module cycles and friends in compiler-style errors, down to file and line, with a little tree showing which modules are crossing the line.
It judges code by one rule borrowed from A Philosophy of Software Design: deep modules, narrow interfaces. Formatting and naming are not its business, architecture is. The authors suggest adding it to AGENTS.md so coding agents like Claude Code or Codex run it after every change and fix what it flags by rethinking the design, not by shuffling code around until the warning goes quiet.
module-cycle: finds modules that depend on each other and points at the constant or function living on the wrong layer, so moving it breaks the loop.
tangle: flags types in a parent module and its child that know about each other even when no cycle exists, nudging the coordination up into one place.
field-leak: counts how many outside modules and call sites touch a struct's fields directly, lists every one, and pushes you toward methods that keep the fields private.
shallow-module: warns when callers need most of a module's functions, a sign the interface is too wide and the details should hide behind a few entry points.
Allow list for legacy code: hundreds of errors on day one are fine. --update-allow writes a list that mutes the existing ones so you only watch new problems.
Compiler-style output: paths, line and column numbers and notes in the same shape as rustc, readable by editors and agents alike, with SARIF output for code scanning pipelines.
Easy install: cargo install deslop-please, or cargo binstall for prebuilt binaries. MIT licensed.
It judges code by one rule borrowed from A Philosophy of Software Design: deep modules, narrow interfaces. Formatting and naming are not its business, architecture is. The authors suggest adding it to AGENTS.md so coding agents like Claude Code or Codex run it after every change and fix what it flags by rethinking the design, not by shuffling code around until the warning goes quiet.
Features
module-cycle: finds modules that depend on each other and points at the constant or function living on the wrong layer, so moving it breaks the loop.
tangle: flags types in a parent module and its child that know about each other even when no cycle exists, nudging the coordination up into one place.
field-leak: counts how many outside modules and call sites touch a struct's fields directly, lists every one, and pushes you toward methods that keep the fields private.
shallow-module: warns when callers need most of a module's functions, a sign the interface is too wide and the details should hide behind a few entry points.
Allow list for legacy code: hundreds of errors on day one are fine. --update-allow writes a list that mutes the existing ones so you only watch new problems.
Compiler-style output: paths, line and column numbers and notes in the same shape as rustc, readable by editors and agents alike, with SARIF output for code scanning pipelines.
Easy install: cargo install deslop-please, or cargo binstall for prebuilt binaries. MIT licensed.

