design-an-interface

द्वारा mattpocock

एक मॉड्यूल के लिए समानांतर उप-एजेंटों का उपयोग करके कई मौलिक रूप से भिन्न इंटरफ़ेस डिज़ाइन तैयार करें। इसका उपयोग तब करें जब उपयोगकर्ता कोई API डिज़ाइन करना चाहता हो, इंटरफ़ेस विकल्पों का अन्वेषण करना चाहता हो, मॉड्यूल आकारों की तुलना करना चाहता हो, या "इसे दो बार डिज़ाइन करें" का उल्लेख करता हो।

npx skills add https://github.com/mattpocock/skills --skill design-an-interface

Design an Interface

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.

Workflow

1. Gather Requirements

Before designing, understand:

  • 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 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 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 user can absorb each approach before comparison.

4. Compare Designs

After showing all designs, compare them on:

  • Interface simplicity: fewer methods, simpler params
  • General-purpose vs specialized: flexibility vs focus
  • Implementation efficiency: does 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 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

mattpocock की और Skills

improve-codebase-architecture
mattpocock
कोडबेस में गहन अवसर खोजें, जो CONTEXT.md में डोमेन भाषा और docs/adr/ में निर्णयों से प्रेरित हो। इसका उपयोग तब करें जब उपयोगकर्ता आर्किटेक्चर में सुधार करना चाहता हो, रीफैक्टरिंग के अवसर खोजना चाहता हो, कसकर जुड़े मॉड्यूल को समेकित करना चाहता हो, या कोडबेस को अधिक परीक्षण योग्य और AI-नेविगेट करने योग्य बनाना चाहता हो।
developmentcode-reviewapi
tdd
mattpocock
लाल-हरा-पुनर्संरचना चक्र के साथ परीक्षण-संचालित विकास। इसका उपयोग तब करें जब उपयोगकर्ता TDD का उपयोग करके सुविधाएँ बनाना या बग ठीक करना चाहता है, "लाल-हरा-पुनर्संरचना" का उल्लेख करता है, एकीकरण परीक्षण चाहता है, या परीक्षण-प्रथम विकास के लिए पूछता है।
developmenttesting
handoff
mattpocock
वर्तमान वार्तालाप को संक्षिप्त करके एक हैंडऑफ दस्तावेज़ तैयार करें, जिसे कोई अन्य एजेंट आगे ले सके।
communicationproject-managementdocument
prototype
mattpocock
एक प्रयोगात्मक प्रोटोटाइप बनाएं ताकि डिज़ाइन को अंतिम रूप देने से पहले उसे विकसित किया जा सके। दो शाखाओं के बीच मार्ग बनाएं — एक चलाने योग्य टर्मिनल ऐप जो स्थिति/व्यावसायिक-तर्क प्रश्नों के लिए हो, या एक मार्ग से टॉगल करने योग्य कई मौलिक रूप से भिन्न UI विविधताएँ। इसका उपयोग तब करें जब उपयोगकर्ता प्रोटोटाइप बनाना चाहता है, डेटा मॉडल या स्टेट मशीन की जाँच करना चाहता है,
developmentdesigncreative
triage
mattpocock
ट्राइएज भूमिकाओं द्वारा संचालित स्टेट मशीन के माध्यम से मुद्दों का ट्राइएज करें। उपयोग तब करें जब उपयोगकर्ता कोई मुद्दा बनाना चाहता हो, मुद्दों का ट्राइएज करना चाहता हो, आने वाले बग या फीचर अनुरोधों की समीक्षा करनी हो, AFK एजेंट के लिए मुद्दे तैयार करने हों, या मुद्दा वर्कफ़्लो प्रबंधित करना हो।
developmentproject-managementcommunication
obsidian-vault
mattpocock
ऑब्सिडियन वॉल्ट में विकिलिंक और इंडेक्स नोट्स के साथ नोट्स खोजें, बनाएं और प्रबंधित करें। जब उपयोगकर्ता ऑब्सिडियन में नोट्स ढूंढना, बनाना या व्यवस्थित करना चाहे तब उपयोग करें।
productivitydocument
edit-article
mattpocock
लेखों के अनुभागों को पुनर्गठित करके, स्पष्टता में सुधार करके और गद्य को संक्षिप्त बनाकर उन्हें संपादित और बेहतर बनाएं। इसका उपयोग तब करें जब उपयोगकर्ता किसी लेख के मसौदे को संपादित, संशोधित या बेहतर बनाना चाहता हो।
documentcreative
writing-great-skills
mattpocock
कौशल को अच्छी तरह लिखने और संपादित करने का संदर्भ — वह शब्दावली और सिद्धांत जो कौशल को पूर्वानुमेय बनाते हैं।
documentdevelopment