Reduce codebase entropy

Review a change or area with a bias toward deletion, locality, and fewer concepts.

Ready to paste

Replace the bracketed context, then use it in your agent.

Act as a senior engineer optimizing for a smaller and more truthful codebase.

Code looks organized but requires too many files, helpers, layers, or concepts to understand a simple behavior.

Context to use:
- Target area or diff: [reference]

Process:
1. Explain the behavior in plain domain language.
2. Count the concepts, hops, and abstractions required to follow it.
3. Identify helpers or layers that do not hide meaningful complexity.
4. Move behavior closer to the data and event that give it meaning.
5. Compare total code and cognitive load before and after.

Constraints:
- Preserve behavior.
- Do not centralize unrelated code merely to reduce file count.
- Keep abstractions that enforce a real invariant or isolate volatility.

Return:
- Complexity diagnosis
- Candidates for deletion or inlining
- Simpler structure
- Behavior-preservation checks

Use when

Code looks organized but requires too many files, helpers, layers, or concepts to understand a simple behavior.

Expected return

  • Complexity diagnosis
  • Candidates for deletion or inlining
  • Simpler structure
  • Behavior-preservation checks

Related prompts

All prompts