general-vs-special

general-vs-special is a skill for Claude Code from codybrom/clairvoyance. It costs 65 tokens per session (925 once invoked), scanned A, original, MIT.

A review method for checking whether an interface is general enough for its current needs without being tied to one specific caller.

In plain words
What is it for?
Use it when designing or reviewing APIs, modules, utilities, or interfaces whose behavior appears tailored to a single use case.
Why use it?
It helps prevent APIs and modules from collecting special-case options, branches, or accessors that make them harder to reuse and understand.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the clairvoyance plugin — 16 skills, 1 agent shipped together

Good fit Use it when designing or reviewing APIs, modules, utilities, or interfaces whose behavior appears tailored to a single use case.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/codybrom/clairvoyance/general-vs-special
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add codybrom/clairvoyance --skill general-vs-special
Clone the repo
git clone --depth 1 https://github.com/codybrom/clairvoyance

Made for: Claude Code.

Or install clairvoyance, the plugin that ships this one along with the rest of its 16 skills, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for general-vs-special

README.md
[![agentmods](https://agentmods.dev/badge/skills/codybrom/clairvoyance/general-vs-special.svg)](https://agentmods.dev/skills/codybrom/clairvoyance/general-vs-special)
Your own site
<a href="https://agentmods.dev/skills/codybrom/clairvoyance/general-vs-special"><img src="https://agentmods.dev/badge/skills/codybrom/clairvoyance/general-vs-special.svg" alt="Measured on agentmods" height="20"></a>
Per session 65 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 925 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00065 $0.00925
Opus 5 $0.00032 $0.00463
Sonnet 5 $0.00013 $0.00185
Haiku 4.5 $0.00006 $0.00093

Measured 8d ago against content hash 2e9b6a8ff81a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

general-vs-special scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/general-vs-special/SKILL.md · 77 lines

How it starts

The opening of the file, as written. The whole thing — 77 lines — stays where its author put it; the contents beside it link to each section on GitHub.

General vs. Special-Purpose Review Lens

When invoked with $ARGUMENTS, focus the analysis on the specified file or module. Read the target code first, then apply the checks below.

General-purpose modules are surprisingly simpler, deeper and less effort to build. They produce better information hiding and can even provide these benefits when used in a single context. Because a general-purpose interface doesn't need to know about specific callers, the knowledge always stays where it belongs.

When to Apply

  • Designing a new module, API, or utility
  • When a module has use-case-specific logic embedded in it
  • When a module's interface is cluttered with rarely-used parameters
  • When deciding between a flexible API and a specific one

Core Principles

The Generality Test

"What is the simplest interface that will cover all my current needs?" — John Ousterhout, A Philosophy of Software Design

Not "the most general interface possible." The target is somewhat general-purpose.

  • Functionality: Scoped to current needs. Doesn't build features you don't need.
  • Interface: General enough to support multiple uses. Doesn't tie it only to today's caller.

A general-purpose interface is usually simpler than a special-purpose one. Fewer methods means lower cognitive load. Fewer methods per capability is the signal of increasing generality.

Two companion questions:

  • In how many situations will this method be used? If exactly one, it's over-specialized.
  • Is this API easy to use for my current needs? If callers must write loops or compose many calls for basic tasks, the abstraction level is wrong.

Special-General Mixture

Special-purpose code mixed into a general-purpose module makes it shallower. Two forms:

At the Interface

Methods or parameters that only serve specific callers. The interface widens, and policy decisions from a higher layer get encoded in a lower one.

Inside Method Bodies

Special cases tend to show up as extra if statements. Instead of adding more of them, try to create a design where they disappear. A search function that returns null when nothing is found forces every caller to check for null before using the result. If you return an empty list instead, the check loop runs zero times on its own with no extra check required.

Read the full file on GitHub · 77 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 77 lines · 65 tokens per session scan A 2e9b6a8ff81a

Subscribe to this mod's changes

general-vs-special is a skill published in the GitHub repository codybrom/clairvoyance (12 stars, last pushed 1mo ago), licensed MIT. It adds 65 tokens to every session and 925 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

agent-design-best-practices

Best practices for designing Claude Code agent files (.claude/agents/.md). This skill should be used when writing or reviewing agent markdown files to ensure proper design with focused domains, correct tool access, reusable definitions, and separation of capabilities from lifecycle. Combines Anthropic's official…

majiayu000/claude-skill-registry · 73 tokens

agent-cross-review

Structured cross-review protocol between specialized agents. Ensures scope alignment, priority calibration, and domain-aware feedback. Use when one agent reviews another's work, during handoffs, or when validating cross-cutting concerns.

majiayu000/claude-skill-registry · 46 tokens

neo-code-review

Use this skill when the user asks to review or audit source code, a PR, diff, commit, or recent changes for bugs, security, performance, tests, compatibility, or maintainability, duplicated code or logic across files, or hard-coded values. Also use it after an AI agent finishes modifying code to inspect the current…

Benknightdark/neo-skills · 87 tokens

neo-pr

Use this skill when the user asks to create, draft, review, format, or generate a Pull Request (PR) title and description, specify target or source branches for a repository, or convert git branch diffs into concise, high-impact, non-AI-slop PR content.

Benknightdark/neo-skills · 60 tokens

neo-rust

Use this skill when writing, refactoring, debugging, or auditing Rust code. Trigger for .rs files, Cargo projects, ownership/borrowing/lifetime issues, Result/Option error handling, unnecessary clone/performance work, unsafe code review, or modern Rust architecture.

Benknightdark/neo-skills · 58 tokens

go-code-review

Use when reviewing Go code for performance, concurrency safety, security vulnerabilities, or readability issues.

unix2dos/skills · 21 tokens