AGENT SKILL

design-an-interface

Use when the user wants multiple radically different interface designs for a module, generated by parallel sub-agents. Triggers include "design an API", "design it twice", "explore interface options", "compare module shapes".

License 许可
MIT
所属仓库
max-kharena/nous
最近更新
2026-04-28
Stars
★ 0
Forks
0

01 前言 Front Matter

name
design-an-interface
risk
low
type
planning
version
0.1.0
description
Use when the user wants multiple radically different interface designs for a module, generated by parallel sub-agents. Triggers include "design an API", "design it twice", "explore interface options", "compare module shapes".

03 SKILL.md 正文

Design an Interface

Based on "Design It Twice" from Ousterhout's A Philosophy of Software Design: your first idea is unlikely to be the best. Generate multiple radically different designs in parallel, then compare.

Workflow

1. Gather requirements

Before designing:

  • [ ] What problem does this module solve?
  • [ ] Who are the callers? (other modules, external users, tests)
  • [ ] What are the key operations?
  • [ ] Any constraints? (performance, compatibility, existing patterns)
  • [ ] What should be hidden inside vs exposed?

Ask: "What does this module need to do? Who will use it?"

2. Generate designs (parallel sub-agents)

Spawn 3+ sub-agents simultaneously using the host's parallel primitive (Task tool / dispatching-parallel-agents). Each must produce a radically different approach.

Prompt template per 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 a caller uses it)
3. What this design hides internally
4. Trade-offs of this approach

3. Present designs

Show each design with:

  1. Interface signature — types, methods, params
  2. Usage examples — how callers actually use it in practice
  3. What it hides — complexity kept internal

Present designs sequentially so the user can absorb each before comparison.

4. Compare

Compare on:

  • Interface simplicity — fewer methods, simpler params
  • General-purpose vs specialized — flexibility vs focus
  • Implementation efficiency — does the shape allow efficient internals?
  • Depth — small interface hiding significant complexity (good) vs large interface with thin implementation (bad)
  • Ease of correct use vs ease of misuse

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

5. Synthesize

Often the best design combines insights from multiple options. Ask:

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

Evaluation criteria

From A Philosophy of Software Design:

  • Interface simplicity — fewer methods, simpler params = easier to learn and use correctly.
  • General-purpose — can handle future use cases without changes. But beware over-generalization.
  • Implementation efficiency — does the interface shape allow efficient implementation? Or force awkward internals?
  • Depth — small interface hiding significant complexity = deep module (good). Large interface with thin implementation = shallow module (avoid).

Anti-patterns

  • Don't let sub-agents produce similar designs — enforce radical difference.
  • Don't skip comparison — the value is in contrast.
  • Don't implement — this is purely about interface shape.
  • Don't evaluate based on implementation effort.

Pairing

Use after nous:be-plan, nous:ui-plan, or nous:ultraplan when one of the planned modules deserves "design it twice" treatment. Pairs with improve-codebase-architecture when the chosen design is a deepened module.

Related Skills

This is the divergent-exploration lane (multiple radically different shapes).

  • frontend-design — applied direction for a single committed UI design. Use after design-an-interface has chosen a winner, or when there is no need for multiple alternatives.
  • frontend-design-skill-ultra — pixel-perfect Refactoring UI rule system. Use after the interface shape is decided and the goal is premium visual polish.

design-an-interface runs before committing to a single shape; frontend-design* runs after.

04 同仓库更多 Skills