tell-dont-ask

Refactor getter-based conditionals into object-owned tell methods.

81|3|Updated Jan 14, 2026
One-click install
npx skills add https://github.com/j5ik2o/okite-ai --skill tell-dont-ask
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tell-dont-ask
Source: https://github.com/j5ik2o/okite-ai/tree/main/.agent/skills/tell-dont-ask
Command: npx skills add https://github.com/j5ik2o/okite-ai --skill tell-dont-ask

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Transforms getter-based decision logic into object-driven actions to reduce leaking responsibilities and strengthen encapsulation by moving behavior into the data-owning objects.

Core Features & Use Cases

  • Enforces encapsulation by replacing external state checks with object-owned decisions.
  • Guides code reviews and refactoring to reduce getter abuse and improve maintainability across languages.
  • Proven across Java, Kotlin, Scala, TypeScript, Python, Ruby, Go, Rust to align with OOP principles.
  • Use Case: when you encounter patterns like if (obj.getX()) { ... } or a chain of getters, refactor to call a tell-method on the object.

Quick Start

Identify a getter + if pattern and refactor it so the object encapsulates the decision and exposes a tell-method to perform the action.

Frequently Asked Questions about tell-dont-ask

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is the Tell Don't Ask principle in OOP refactoring?

To refactor getter abuse, identify patterns like if (obj.getX()) { ... } and replace them with a tell-method on the object, allowing the object to encapsulate the decision and perform the action directly for safer code reviews.

Why does relying on getters and conditionals weaken encapsulation?

Relying on getters and conditionals weakens encapsulation because external state checks leak object responsibilities, whereas Tell Don't Ask moves behavior into data-owning objects to maintain safe, maintainable OOP design.

Can I apply Tell Don't Ask refactoring to Kotlin, Python, and Go codebases?

Yes, you can apply Tell Don't Ask refactoring to Kotlin, Python, and Go codebases. This approach is proven across Java, Scala, TypeScript, Ruby, and Rust to align with OOP principles and reduce scattered conditional logic.

How do I refactor scattered conditional logic into object-driven behavior?

To refactor scattered conditional logic into object-driven behavior, replace external state checks with object-owned decisions by exposing a tell-method, which encapsulates the action and improves maintainability across multiple programming languages.

When should I avoid replacing getter-based decision logic with tell-methods?

You should avoid replacing getter-based decision logic when a class serves as a simple data transfer object without inherent behavior, as forcing tell-methods in such contexts can unnecessarily complicate the design and violate the intended architecture.