j5ik2o-tell-dont-ask
Installation
SKILL.md
Tell, Don't Ask
Tell the object what you want done; do not ask for its state and make the decision elsewhere.
Workflow
-
Find code that gets state, branches on it, then updates or commands the same object.
-
Name the intention behind the external decision.
-
Move that behavior to the object that owns the state.
-
Replace getters with intention-revealing methods where possible.
-
Keep DTO, serialization, logging, and UI projection exceptions explicit.
Checks
- Getter plus
ifplus setter is a strong smell.