accept-interfaces-return-structs

Accept interfaces and return concrete structs in Go constructors.

3|Updated Nov 28, 2025
One-click install
npx skills add https://github.com/JamesPrial/claudefiles --skill accept-interfaces-return-structs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: accept-interfaces-return-structs
Source: https://github.com/JamesPrial/claudefiles/tree/main/skills/golang/interfaces/design
Command: npx skills add https://github.com/JamesPrial/claudefiles --skill accept-interfaces-return-structs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The core pattern of accepting interfaces and returning concrete structs to maximize flexibility and testability.

Core Features & Use Cases

  • Concrete Returns: Avoid returning interfaces unnecessarily to keep method sets explicit.
  • Testability: Easier to mock concrete types in tests.

Quick Start

Write a constructor that accepts an interface and returns a concrete type.