Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

general-vs-special一般与特殊

Agent Skill

general-vs-special 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

194

周安装

8

GitHub Stars

4

下载量

63
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:general-vs-special(一般与特殊)
来源仓库:https://github.com/codybrom/clairvoyance
仓库路径:skills/general-vs-special
安装命令:
npx skills add https://github.com/codybrom/clairvoyance --skill general-vs-special
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/codybrom/clairvoyance --skill general-vs-special

简介

用于查找、检索和筛选相关信息,支持一般与特殊对比分析场景。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中根据关键词快速定位候选结果。
  • 通过 npx skills add 命令从指定仓库安装,需确认权限和维护状态。
  • 使用前应检查是否会触发联网、命令执行或文件读写操作。
  • 建议结合原始 README 核验具体用法和功能边界。

SKILL.md

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.

Getters/Setters as Representation Leakage

Declaring a field private then providing getFoo/setFoo does not constitute information hiding. The variable's existence, type, and name are fully visible. Callers depend on the representation.

Before writing a getter or setter: should callers know about this property at all? A rename() method absorbs related logic and hides the representation. The goal is for the module to do work, not expose data.

Defaults as a Depth Tool

Every sensible default is one less decision pushed to callers. If nearly every user of a class needs a behavior, it belongs inside the class by default.

Gatekeeping question: "Will callers be able to determine a better value than we can determine here?" The answer is usually no.

The Default Position

When unsure, err on the side of slightly more general. A slightly-too-general interface has unused capabilities (low cost). A slightly-too-special interface requires a rewrite when the second use case arrives (high cost).

But "slightly more general" means one step, not three. Generality should come from simplifying the interface, not from adding parameters.

Review Process

  1. Identify the general mechanism: What is the core operation?
  2. Separate special from general: Is caller-specific logic in the core? Special-case if branches that could be eliminated?
  3. Apply the generality test: Simplest interface that covers all current needs?
  4. Audit getters/setters: Exposing representation or abstraction?
  5. Review defaults: Could required parameters become optional?
  6. Recommend: Push specialization to edges. Deepen with defaults.

Red flag signals for generality are cataloged in red-flags (Special-General Mixture, Overexposure).

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.41%
按下载量换算23

Claude

26.76%
按下载量换算17

Cursor

17.61%
按下载量换算11

Gemini CLI

9.72%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills