flatten-fake-layers
Flatten Fake Layers
Operationalizes the delete-fake-layers doctrine with a script instead of prose. The thesis:
a model is bad at finding its own over-abstraction by reading code, but good at judging a
concrete candidate the moment a tool points at it. So this skill does not ask you to scan for
slop — it runs a detector that flags exact violations, and you apply one judgment per item.
What a "fake layer" is
A function/const that exists only to forward to another call, reshape arguments, or inject a
dependency — adding no invariant, validation, lifecycle guarantee, or real ownership. The test
(from delete-fake-layers): what becomes true after this layer runs? If the answer is "same
data, different name" or "same call, different function", it is a fake layer.
Whole-program tools (knip, fallow) find code with zero callers. They cannot find the layer with one caller that should not exist. That is this script's gap to fill.