skills/lenses/redundancy.md
dan fb15000877 refactor: restructure for cross-repo deployment
- Rename reviews/ to lenses/ (clearer terminology)
- Add workflows/ for beads proto templates
- Extract code-review proto to workflows/molecules.jsonl
- Update ai-skills.nix module:
  - Add enableLenses option (deploys to ~/.config/lenses/)
  - Add enableWorkflows option (deploys to ~/.beads/molecules.jsonl)
  - Derive repoRoot from skillsPath for sibling directories
- Update lens paths in proto to use deployed location

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 01:18:19 -05:00

1.7 KiB

Redundancy Review Lens

Review the provided code for duplication, parallel systems, and YAGNI violations.

What to Look For

Logic Duplication

  • Near-identical functions with minor variations
  • Copy-pasted code blocks across files
  • Same validation logic repeated in multiple places
  • Parallel implementations that should be unified

System Redundancy

  • Multiple logging systems (pick one)
  • Multiple HTTP clients or request wrappers
  • Multiple config/env loading mechanisms
  • Multiple error handling patterns
  • Multiple state management approaches
  • Parallel database abstractions

YAGNI (You Ain't Gonna Need It)

  • Abstractions with only one implementation
  • Interfaces extracted prematurely
  • Generic solutions for specific problems
  • Configuration for things that never change
  • Plugin systems with no plugins
  • Extensibility hooks never used

Consolidation Opportunities

  • Utility functions that could be a shared library
  • Constants defined in multiple places
  • Type definitions duplicated across modules
  • Similar data transformations in different contexts

Output Format

For each finding:

[REDUNDANT] <severity:HIGH|MED|LOW> <file:line>
Type: <duplication|parallel-system|yagni|consolidation>
Issue: <what's redundant>
Related: <other locations with same/similar code>
Suggest: <consolidate into X|delete Y and use X|simplify to Z>

Guidelines

  • HIGH = active maintenance burden, divergence risk
  • MED = wasted complexity, cognitive overhead
  • LOW = minor duplication, tolerable
  • Consider: is the duplication intentional? (sometimes 2 similar things should stay separate)
  • For system redundancy: recommend which one to standardize on and why
  • For YAGNI: distinguish "not yet needed" from "will never need"