design-an-interface by mattpocock/skills
npx skills add https://github.com/mattpocock/skills --skill design-an-interface基于《软件设计哲学》中的“设计两次”理念:你的第一个想法很可能不是最好的。生成多个截然不同的设计方案,然后进行比较。
在设计之前,需要理解:
提问:“这个模块需要做什么?谁会使用它?”
使用 Task 工具同时生成 3 个以上的子代理。每个子代理必须提出一个截然不同的方法。
每个子代理的提示模板:
为以下模块设计一个接口:[模块描述]
需求:[收集到的需求]
此设计的约束条件:[为每个代理分配不同的约束]
- 代理 1:“最小化方法数量 - 目标最多 1-3 个方法”
- 代理 2:“最大化灵活性 - 支持多种用例”
- 代理 3:“针对最常见情况进行优化”
- 代理 4:“从[特定范式/库]中汲取灵感”
输出格式:
1. 接口签名(类型/方法)
2. 使用示例(调用者如何使用它)
3. 此设计在内部隐藏了什么
4. 这种方法的权衡取舍
展示每个设计,包括:
按顺序展示设计方案,以便用户在比较之前能够理解每种方法。
展示完所有设计后,从以下方面进行比较:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
用文字讨论权衡取舍,不要用表格。重点突出设计方案差异最大的地方。
通常,最好的设计会结合多个方案的见解。提问:
来自《软件设计哲学》:
接口简洁性:方法更少、参数更简单 = 更容易学习和正确使用。
通用性:能够处理未来的用例而无需更改。但要警惕过度泛化。
实现效率:接口形态是否允许高效的实现?还是会迫使内部实现变得笨拙?
深度:隐藏了显著复杂性的小接口 = 深度模块(好)。实现单薄的大接口 = 浅层模块(应避免)。
每周安装量
1.3K
代码仓库
GitHub 星标数
9.5K
首次出现
2026年2月13日
安全审计
安装于
opencode1.3K
codex1.3K
gemini-cli1.3K
github-copilot1.3K
kimi-cli1.3K
amp1.3K
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.
Before designing, understand:
Ask: "What does this module need to do? Who will use it?"
Spawn 3+ sub-agents simultaneously using 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
Show each design with:
Present designs sequentially so user can absorb each approach before comparison.
After showing all designs, compare them on:
Discuss trade-offs in prose, not tables. Highlight where designs diverge most.
Often the best design combines insights from multiple options. Ask:
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 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).
Weekly Installs
1.3K
Repository
GitHub Stars
9.5K
First Seen
Feb 13, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode1.3K
codex1.3K
gemini-cli1.3K
github-copilot1.3K
kimi-cli1.3K
amp1.3K
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
102,200 周安装
AI智能体长期记忆系统 - 精英级架构,融合6种方法,永不丢失上下文
1,200 周安装
AI新闻播客制作技能:实时新闻转对话式播客脚本与音频生成
1,200 周安装
Word文档处理器:DOCX创建、编辑、分析与修订痕迹处理全指南 | 自动化办公解决方案
1,200 周安装
React Router 框架模式指南:全栈开发、文件路由、数据加载与渲染策略
1,200 周安装
Nano Banana AI 图像生成工具:使用 Gemini 3 Pro 生成与编辑高分辨率图像
1,200 周安装
SVG Logo Designer - AI 驱动的专业矢量标识设计工具,生成可缩放品牌标识
1,200 周安装