general-vs-special

Evaluate software interfaces for unnecessary specialization and representation leakage.

11|Updated Feb 25, 2026
One-click install
npx skills add https://github.com/codybrom/clairvoyance --skill general-vs-special
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: general-vs-special
Source: https://github.com/codybrom/clairvoyance/tree/main/skills/general-vs-special
Command: npx skills add https://github.com/codybrom/clairvoyance --skill general-vs-special

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill identifies over-specialized interfaces, caller-specific logic, unnecessary parameters, and getters or setters that expose internal representation, helping software teams build simpler and more reusable modules.

Core Features & Use Cases

  • Generality Assessment: Evaluates whether an interface is general enough for current needs without becoming unnecessarily broad.
  • Specialization Detection: Finds caller-specific branches, one-off parameters, and policy decisions embedded in lower-level modules.
  • Encapsulation Review: Audits getters, setters, and defaults for representation leakage and decisions that should remain inside the module.
  • Use Case: Apply it during a code review of a utility or API to determine whether its interface hides complexity or merely passes caller-specific decisions through.

Quick Start

Use the general-vs-special review lens to analyze the specified file or module for over-specialization, representation leakage, and missing defaults.

Frequently Asked Questions about general-vs-special

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

FAQPage Schema
How do I detect representation leakage in my API design?

Representation leakage in API design occurs when getters, setters, or defaults expose internal module details. You detect it by auditing interfaces for unnecessary parameters and policy decisions that should remain encapsulated inside the module rather than being passed through.

What is the best way to find caller-specific logic in a utility module during code review?

Caller-specific logic in a module appears as conditional branches, one-off parameters, or policy decisions embedded in lower-level code. Identify the general mechanism, separate the caller-specific branches, and simplify the interface to improve module reusability.

How do I assess if an interface is too specialized for current needs?

Assessing interface specialization involves evaluating whether the interface handles current requirements without unnecessary breadth. Look for unnecessary parameters and conditional branches that embed caller-specific policies, then separate that logic to make the interface more general.

Why does over-specialization make software modules harder to reuse?

Over-specialization makes modules harder to reuse because caller-specific branches and unnecessary parameters embed one-off policy decisions directly in lower-level logic. This prevents the interface from acting as a general mechanism, reducing its applicability across different contexts.

When should I not use a general interface for my API?

You should avoid a general interface when it becomes unnecessarily broad for current needs. If generalizing an API requires adding complex conditional branches or parameters to anticipate unknown future callers, it is better to keep the interface simple and specific.

How do I simplify an API interface that exposes too many parameters?

Simplify an API interface with too many parameters by identifying the general mechanism and moving caller-specific decisions inside the module. Apply deeper encapsulation by replacing unnecessary parameters and exposed setters with sensible internal defaults.