interface-design

Design minimal consumer-facing interfaces that support swapping implementations.

Updated Mar 12, 2019
One-click install
npx skills add https://github.com/gustavofsantos/dot-files --skill interface-design-gustavofsantos
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: interface-design
Source: https://github.com/gustavofsantos/dot-files/tree/main/skills/interface-design
Command: npx skills add https://github.com/gustavofsantos/dot-files --skill interface-design-gustavofsantos

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Apply Go-derived interface design principles to design or review abstractions in any language. Use this skill whenever the agent is about to define an interface, protocol, trait, abstract class, or any abstraction boundary — or when reviewing one that already exists. Triggers on phrases like "design an interface", "create an abstraction", "define a contract", "what should this interface look like", "model this as a protocol/trait", "review this interface", "is this a good abstraction", or any time the agent introduces a new type boundary between components. Covers Go, Clojure, Java, Kotlin, TypeScript, and Python.

Core Features & Use Cases

  • Defines interfaces from the consumer's perspective to maximize substitution and testability.
  • Keeps surface area minimal to reduce cognitive load and maintenance.
  • Guides cross-language translation of principles with language-specific idioms in references.

Quick Start

Draft a minimal, consumer-facing interface that captures the required behavior and enables swapping implementations.

Frequently Asked Questions about interface-design

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I design a minimal interface that supports swapping implementations?

To design a minimal interface, identify the consumer need first and draft a contract that captures required behavior while keeping the surface area small. This consumer-first approach maximizes substitution and testability without unnecessary abstraction.

What is consumer-first interface design and when should I apply it?

Consumer-first interface design defines abstractions from the perspective of the code consuming them, rather than the provider. Apply this approach whenever you define a protocol, trait, abstract class, or any new type boundary between components.

Can I apply Go interface design principles in TypeScript, Python, or Kotlin?

Yes, you can apply Go-derived interface design principles across Go, Clojure, Java, Kotlin, TypeScript, and Python. The skill translates core concepts into language-specific idioms to guide concrete outcomes in each context.

What is the best way to review an existing abstraction for data leakage?

The best way to review an existing abstraction is to check for consumer ownership, minimal surface area, and any data leakage. Evaluate whether the interface avoids unneeded abstraction and truly supports swapping implementations.

Why does my TypeScript interface increase cognitive load and maintenance?

Your TypeScript interface likely increases cognitive load because it exposes a large surface area or introduces unneeded abstraction. Designing a minimal, consumer-facing contract reduces maintenance by capturing only the required behavior.

When should I not use an abstract class to model a contract?

You should avoid using an abstract class or any abstraction boundary when there is no genuine need to swap implementations or when it causes data leakage. Introduce a new type boundary only if it serves a concrete consumer need.