← knowledge.oriz.in

Grill on LOC removal >= 50 lines per sweep (TIGHTENED 2026-06-22 evening)

rule rulededuprefactoringloc-thresholdcontent-vs-patterngrilltightened

Grill on LOC removal >= 50 lines per sweep

Rule

Before deleting =1000 lines of code in a dedup/consolidation sweep, the agent MUST:

  1. Surface the delta explicitly — which files, which lines, what purpose.
  2. Ask the user 20+ questions (split across rounds if needed) covering:
    • Per-app content (finance sidebar vs PDF sidebar vs tools sidebar — are they different?)
    • Design pattern vs content distinction (can this consolidate as a slot, or is it app-specific logic?)
    • LOC breakdown per app (user wants to see diffs before deciding)
    • Restoration paths (restore all? partial? selective?)
  3. Get explicit user confirmation BEFORE deletion.
  4. If user wants to see diffs, show git show <commit>:<file> for each app's changes.

Why

Sweeps #3 + #4 consolidated chrome (Header/Footer/Sidebar/BottomBar) into @chirag127/astro-chrome assuming slot-based props would wire per-app content. But:

These are NOT content that can be passed via isOpen props or slots. They are structural differences in the navigation tree.

Design patterns CAN consolidate (all sidebars have the same CSS, drawer toggle at <768px, etc.). Content CANNOT.

The distinction

Threshold

=1000 LOC = enough to hide substantive changes. <1000 LOC = probably safe, but still consider asking.

Cross-refs