cupid-code-reviewlisted
Install: claude install-skill Habitat-Thinking/ai-literacy-superpowers
# CUPID as a Code Review and Refactoring Lens
## Overview
CUPID is a set of five properties — **C**omposable, **U**nix philosophy, **P**redictable, **I**diomatic, **D**omain-based — described by Daniel Terhorst-North as things good code *tends toward*, not rules it must comply with. That makes them ideal review lenses: you are asking "how strongly does this code exhibit this property?" and "what would moving it further in this direction look like?"
Use them as questions, not verdicts.
---
## The Five Lenses
### C — Composable: plays well with others
Code is composable when it can be combined with other code in many contexts without modification.
**Review questions:**
- Can I use this function/module independently, without pulling in unrelated state?
- Is the API surface the minimum needed — no accidental exposure?
- Are dependencies explicit (passed in) rather than implicit (global/ambient)?
- Does it work at multiple call sites, or does it secretly assume one?
**Refactoring signals:**
- Many parameters that describe context rather than the operation itself
- Functions that only make sense when called in a specific order
- Hidden global state or singleton dependencies
- "God object" arguments that carry everything
**Move toward:** Smaller surface area. Dependencies injected. Works in isolation.
---
### U — Unix philosophy: does one thing well
Not just single responsibility — the function does its one thing *completely* and *well*, with a clear, nameable purpose