What problem does it solve?
This Skill eliminates "hybrid coupling" and hidden meanings in variables, which lead to confusion, bugs, and hard-to-read code. It ensures each variable clearly represents a single concept, making code more predictable and easier to understand.
Core Features & Use Cases
- Clarity & Predictability: Enforces that a variable's meaning never changes or has special, hidden interpretations (e.g.,
-1 meaning error).
- Prevents Hybrid Coupling: Guides you to separate concerns, using distinct variables for different purposes (e.g., a count and an error flag).
- Reduces Bugs: Minimizes errors caused by misinterpreting a variable's current state or purpose, improving code reliability.
- Use Case: Instead of having
page_count = -1 to indicate an error, use this skill to create a separate processing_failed = True boolean variable, ensuring page_count always represents a valid count.
Quick Start
Analyze the attached Python function. Identify any variables that serve multiple purposes or have hidden meanings (e.g., special values for errors) and suggest how to refactor them into single-purpose variables.