tell-dont-ask
Installation
SKILL.md
Tell Don't Ask
Core Principle
Tell Don't Ask (TDA) means: instead of asking an object for its data and then acting on it externally, tell the object what to do and let it use its own data internally.
This flows directly from OOP's core idea — bundle data with the behavior that operates on it. Tightly coupled data and behavior belong in the same component.
Identifying "Ask" Style (The Problem)
Watch for this pattern: external code queries an object's state and then makes decisions based on that state.
if (order.status === "pending" && order.total > 1000) {
order.approvalQueue.push(order.id);
order.status = "awaiting_approval";
}
Related skills