agentleFS
wachawowachawo/claude-skills/skills/design-api/SKILL.md

design-api

Skill0 starsChanged 6 months agoMITView on GitHub

Generate several radically different interface design options for a module via parallel sub-agents. Use when the user wants to design an API, evaluate interface options, compare module shapes, or mentions "design it twice".

We split this skill into the rules it gives an agent

6 rules. 0 are common, 6 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Ask: "What should this module do?

    line 22
  2. Distinctive:

    After showing all options, compare them by:

    line 60
  3. Distinctive:

    Don't let sub-agents produce similar designs — insist on radical differentiation

    line 91
  4. Distinctive:

    Don't skip the comparison — the value is in the contrast

    line 92
  5. Distinctive:

    Don't implement — this is only about interface shape

    line 93
  6. Distinctive:

    Don't evaluate by implementation effort

    line 94

“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Design an Interface

Built on the "Design It Twice" principle from "A Philosophy of Software Design": your first idea is unlikely to be the best one. Generate several radically different design options, then compare.

Workflow

1. Gather requirements

Before designing, understand:

  • What problem does this module solve?
  • Who calls it? (other modules, external users, tests)
  • What are the key operations?
  • Are there any constraints? (performance, compatibility, existing patterns)
  • What should be hidden internally vs. exposed?

Ask: "What should this module do? Who will use it?"

2. Generate designs (parallel sub-agents)

Launch 3+ sub-agents simultaneously via the Task tool. Each must produce a radically different approach.

Prompt template for each sub-agent:

Design an interface for: [module description]

Requirements: [gathered requirements]

Constraints for this design: [assign a different constraint to each agent]
- Agent 1: "Minimize method count - aim for 1-3 methods max"
- Agent 2: "Maximize flexibility - support many use cases"
- Agent 3: "Optimize for the most common case"
- Agent 4: "Take inspiration from [specific paradigm/library]"

Output format:
1. Interface signature (types/methods)
2. Usage example (how caller uses it)
3. What this design hides internally
4. Trade-offs of this approach

3. Present the designs

Show each design with:

  1. Interface signature — types, methods, parameters
  2. Usage examples — how the calling code actually uses it
  3. What it hides — internal complexity left under the hood

Present the designs sequentially so the user can absorb each approach before comparing.

4. Compare the designs

After showing all options, compare them by:

  • Interface simplicity: fewer methods, simpler parameters
  • Generality vs. specialization: flexibility vs. focus
  • Implementation efficiency: does the shape allow efficient internals?
  • Depth: a small interface that hides significant complexity (good) vs. a large interface with a thin implementation (bad)
  • Easy to use correctly vs. easy to misuse

Discuss trade-offs in prose, not tables. Highlight the points where the designs diverge most.

5. Synthesize

Often the best design combines ideas from several options. Ask:

  • "Which design fits your primary case best?"
  • "Are there elements from other designs worth incorporating?"

Evaluation criteria

From "A Philosophy of Software Design":

Interface simplicity: fewer methods, simpler parameters — easier to learn and use correctly.

Generality: capable of handling future scenarios without changes. But beware of over-generalization.

Implementation efficiency: does the interface shape allow an efficient implementation? Or does it force awkward internals?

Depth: a small interface hiding significant complexity = a deep module (good). A large interface with a thin implementation = a shallow module (avoid).

Anti-patterns

  • Don't let sub-agents produce similar designs — insist on radical differentiation
  • Don't skip the comparison — the value is in the contrast
  • Don't implement — this is only about interface shape
  • Don't evaluate by implementation effort

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.