Workspace — AI teams that work for you 24/7
Explore

c011abs/design-an-interface

Skill

Generate multiple radically different interface designs for a module using parallel sub-agents. Use when user wants to design an API, explore interface options, compare module shapes, or mentions "design it twice".

SKILL.md
11
Based on "Design It Twice" from "A Philosophy of Software Design": your first idea is unlikely to be the best. Generate multiple radically different designs, then compare.
15
From "A Philosophy of Software Design":
16

17
**Interface simplicity**: Fewer methods, simpler params = easier to learn and use correctly.
18

19
**General-purpose**: Can handle future use cases without changes. But beware over-generalization.
20

21
**Implementation efficiency**: Does interface shape allow efficient implementation? Or force awkward internals?
22

23
**Depth**: Small interface hiding significant complexity = deep module (good). Large interface with thin implementation = shallow module (avoid).
27
- Don't let sub-agents produce similar designs - enforce radical difference
28
- Don't skip comparison - the value is in contrast
29
- Don't implement - this is purely about interface shape
30
- Don't evaluate based on implementation effort
34

36
Before designing, understand:
37

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

44
Ask: "What does this module need to do? Who will use it?"
48
Spawn 3+ sub-agents simultaneously using Task tool. Each must produce a **radically different** approach.
49

50
```
51
Prompt template for each sub-agent:
52

53
Design an interface for: [module description]
54

55
Requirements: [gathered requirements]
56

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

63
Output format:
64
1. Interface signature (types/methods)
65
2. Usage example (how caller uses it)
66
3. What this design hides internally
67
4. Trade-offs of this approach
68
```
72
Show each design with:
73

74
1. **Interface signature** - types, methods, params
75
2. **Usage examples** - how callers actually use it in practice
76
3. **What it hides** - complexity kept internal
77

78
Present designs sequentially so user can absorb each approach before comparison.
82
After showing all designs, compare them on:
83

84
- **Interface simplicity**: fewer methods, simpler params
85
- **General-purpose vs specialized**: flexibility vs focus
86
- **Implementation efficiency**: does shape allow efficient internals?
87
- **Depth**: small interface hiding significant complexity (good) vs large interface with thin implementation (bad)
88
- **Ease of correct use** vs **ease of misuse**
89

90
Discuss trade-offs in prose, not tables. Highlight where designs diverge most.
94
Often the best design combines insights from multiple options. Ask:
95

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