agentleFS
allemaarallemaar/open-skills/skills/design-an-interface/SKILL.md

design-an-interface

Skill14 starsChanged 4 months agoApache-2.0View on GitHub

Generate multiple radically different interface designs for a module, then compare and synthesize. Use when the user wants to design an API, explore interface options, compare module shapes, or says "design it twice" / "give me options" / "what should this interface look like". Also trigger proactively when a user is about to implement something non-trivial and hasn't locked in an interface yet. Not /insight-explore (brainstorms approaches as prose) or /plan-create (turns a chosen design into a phased plan) — this produces concrete, comparable interface designs.

30 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use request-refactor-plan, edit-article and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • kayamanSkill

    request-refactor-plan

    Guides creating a detailed refactor plan with tiny commits via user interview, then files it as a GitHub issue. Use when user wants to plan a refactor, create a refactoring RFC, or break a refactor into safe incremental steps.

    Also in 21 projects that use this

  • kayamanSkill

    edit-article

    Edit and improve articles by restructuring sections, improving clarity, and tightening prose. Use when user wants to edit, revise, or improve an article draft.

    Also in 19 projects that use this

  • kennethkeimSkill

    ubiquitous-language

    Extract a DDD-style ubiquitous language glossary from the current conversation, flagging ambiguities and proposing canonical terms. Saves to UBIQUITOUS_LANGUAGE.md. Use when user wants to define domain terms, build a glossary, harden terminology, create a ubiquitous language, or mentions "domain model" or "DDD".

    Also in 20 projects that use this

  • qhuang20Skill

    migrate-to-shoehorn

    Migrate test files from `as` type assertions to @total-typescript/shoehorn. Use when user mentions shoehorn, wants to replace `as` in tests, or needs partial test data.

    Also in 16 projects that use this

  • AnasX7Skill

    scaffold-exercises

    Create exercise directory structures with sections, problems, solutions, and explainers that pass linting. Use when user wants to scaffold exercises, create exercise stubs, or set up a new course section.

    Also in 16 projects that use this

  • AnasX7Skill

    setup-pre-commit

    Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo. Use when user wants to add pre-commit hooks, set up Husky, configure lint-staged, or add commit-time formatting/typechecking/testing.

    Also in 19 projects that use this

  • +1 more from kayaman

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 29 edited versions we read keep these.

  • 7

    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:

    Don't proceed until you have real answers.

    line 39
  2. Distinctive:

    If you have a Task tool: spawn all three designs simultaneously.

    line 43
  3. Distinctive:

    If you don't have Task: run them sequentially, but commit fully to each design before moving to the next.

    line 45
  4. Distinctive:

    Use these lenses to force divergence:

    line 49
  5. Distinctive:

    Add a 4th for domain-specific shapes (event-driven, streaming, builder, type-state) when relevant.

    line 57
  6. Distinctive:

    Write the synthesized design — concrete signatures, not description.

    line 88
  7. Distinctive:

    Use these during Step 3. Don't apply them during generation.

    line 97

“Common” is measured: kept by at least 6 in 10 of the 29 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

From "Design It Twice" (Ousterhout): your first idea is rarely the best. The value is in contrast — not in any single design.

Step 1 — Gather Requirements

Shallow intake produces shallow designs. Ask these specifically — not just "what does it do?":

  1. What is the one-sentence job of this module?
  2. Who are the callers? (other modules, end users, tests, CLI, external systems)
  3. Walk me through the happy path in code — what does the call site actually look like?
  4. What are the failure modes? What can go wrong, and who handles it?
  5. What must the interface hide? What should callers never need to know about?
  6. Any hard constraints? (performance, compatibility with existing patterns, language idioms)
  7. Is there a "most common case" that should be especially ergonomic?

Don't proceed until you have real answers. One vague sentence is not enough.

Step 2 — Generate Designs

If you have a Task tool: spawn all three designs simultaneously. Each agent gets the requirements plus its assigned lens and must produce a design that would surprise the others. Brief them to actively resist the obvious answer.

If you don't have Task: run them sequentially, but commit fully to each design before moving to the next. Don't let later designs learn from earlier ones — write each as if it were your only attempt.

Produce 3 radically different designs. Radically different means different information hiding boundaries — not just different method names or parameter orders. Three designs that all accept a config struct and return a result are not radically different, even if the method names differ.

Use these lenses to force divergence:

DesignConstraintCore question
Minimal1–3 operations maxWhat is the smallest surface that covers all cases?
Caller-empoweringExpose primitives; let caller composeWhat if we trust the caller with more control?
Common-case-firstOptimize the happy path to one lineWhat if the 95% case has zero friction, even if edge cases are awkward?

Add a 4th for domain-specific shapes (event-driven, streaming, builder, type-state) when relevant.

For each design, produce:

  • Interface — concrete method signatures, types, function signatures. Not schematic.
  • Usage example — real call-site code for: happy path, error case, one awkward case.
  • What this hides — complexity that lives inside, invisible to callers.
  • What this exposes — decisions or knowledge pushed onto the caller.
  • Where it shines / breaks down — 1–3 honest sentences.

Step 3 — Compare

Fill this table, then write prose.

DimensionDesign 1Design 2Design 3
# of operations
Caller knowledge requiredlow/med/high
Error handling locationinside / outside
Composabilityy/n
Fits most common case

The table shows what. The prose explains why it matters. Go deep on where the designs diverge most — depth, misuse resistance, evolution over time, and the awkward case each design can't handle cleanly. Don't soften it. Say which designs have real problems.

Apply the Evaluation Criteria from the Reference section below.

Step 4 — Synthesize

This is the highest-value output. Produce something concrete:

  1. State your recommendation and why, referencing the comparison.
  2. Write the synthesized design — concrete signatures, not description. If one design wins outright, restate it as a clean spec. If the answer is "take X's shape, borrow Y's error handling, add Z's escape hatch," write that out.
  3. Name the one thing to get right — the decision that, if wrong, causes the most pain later.

Close by asking: "Does this fit your primary use case? Anything from the other designs worth keeping?"


Reference

Use these during Step 3. Don't apply them during generation.

Evaluation Criteria (APOSD)

  • Interface simplicity — fewer methods, simpler params → easier to learn, harder to misuse.
  • Depth — small interface hiding large complexity = deep module (good). Large interface over thin implementation = shallow module (avoid).
  • General-purpose vs. specialized — can it handle adjacent use cases without changes? Beware over-generalization, but also beware interfaces that lock in today's assumptions.
  • Implementation efficiency — does the interface allow an efficient implementation, or force awkward internals?
  • Ease of correct use — the best interfaces make the right thing the natural thing.

Anti-Patterns

  • Convergent designs — if all three designs are the same module with different names, you've failed. Start over with harder constraints.
  • Skipping comparison — generating without comparing is just brainstorming. The value is in the contrast.
  • Implementing — this skill is about interface shape. Don't write internals.
  • Premature synthesis — don't merge designs during generation. Let them stay fully different until Step 4.
  • Vague trade-offs — "more flexible" means nothing. More flexible how, for whom, at what cost?

Human output. This skill's handler-facing output obeys the human-output contract (human-output/SKILL.md).

Next skills. On completion, run the Next Skills protocol (next-skills/SKILL.md): surface the next-skills recommendations from front-matter for the caller to pick. Offer only — never auto-invoke.

Self-improvement. On completion, run the Self-Improvement Protocol (self-improve/SKILL.md): if this run surfaced a concrete, blocking-or-recurring weakness in this skill, propose a specific fix for the handler to approve. Conservative — silent otherwise. Never auto-apply.

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.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

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.