boolean-naming-conventions

Installation
SKILL.md

Summary

Boolean variables and functions returning booleans must be named with a Verb Prefix such as is, has, can, or should. This ensures the name clearly indicates a true/false value and reads naturally in control structures.

Rationale

  • Natural Language: Code should read like a sentence. if (isValid) is clearer than if (valid).
  • Ambiguity Reduction: valid could be a validation object or a boolean. isValid is definitely a boolean.

Guidance

  1. Prefixes:
    • is: State or Identity (e.g., isVisible, isAdmin).
    • has: Possession or Containment (e.g., hasPermission, hasChildren).
    • can: Capability (e.g., canEdit, canSubmit).
    • should: Recommendation or Future Action (e.g., shouldRender, shouldRetry).
  2. Scope:
    • Applies to local variables, class properties, and functions.
    • Exception: See Component Props Naming for UI component props (which follow HTML attribute style).

Examples

Installs
1
First Seen
Apr 5, 2026
boolean-naming-conventions — mew-ton/coding-guidelines