# Go interface design

> Go interface design is an open-source agent skill for developer tools. Guides Go agents in designing small, consumer-side interfaces and checking compliance. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/eduardo-sl/go-agent-skills/tree/main/skills/(architecture)/go-interface-design
- **Repository:** https://github.com/eduardo-sl/go-agent-skills
- **GitHub stars:** 90
- **License:** MIT
- **Skill name:** go-interface-design
- **Collection:** https://github.com/eduardo-sl/go-agent-skills
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-02

## About

This skill gives an AI coding agent a set of Go interface design rules to apply when shaping packages and contracts. It covers defining interfaces where they are consumed, keeping them small and composable, returning concrete types, and avoiding pointers to interfaces and needless empty interfaces. It also points out anti-patterns such as premature abstractions and interface pollution, and recommends compile-time compliance checks using blank identifier assignments.

The skill works as a decision checklist the agent can walk through: whether an interface is warranted at all, where it belongs, how many methods it should have, and whether compliance is verified. A separate reference file covers embedding versus named fields, test fakes built from embedded interfaces, optional capabilities through type assertions, and sealed interfaces, and the agent reads it only when the summary is insufficient.

It expects a Go codebase and the Go toolchain. The allowed tools include reading, editing and searching files, along with go and gofmt commands. It does not cover HTTP handler patterns or general code review, which are handled by other skills.

## When your agent uses it

> Go interface design patterns: implicit interfaces, consumer-side definition, interface compliance verification, composition, the accept-interfaces-return-structs principle, and common pitfalls. Use when designing interfaces, decoupling packages, defining contracts, reviewing interface usage, or refactoring for testability. Trigger examples: "design interface", "accept interfaces return structs", "interface compliance", "consumer-side interface", "interface composition". Not for: HTTP handler patterns (go-api-design), general review (go-code-review).

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/eduardo-sl/go-agent-skills/tree/HEAD/skills/(architecture)/go-interface-design)
- [Asks for: Read, Edit, Write, Glob, Grep, Bash(go:*), Bash(gofmt:*)](https://github.com/eduardo-sl/go-agent-skills/blob/HEAD/skills/(architecture)/go-interface-design/SKILL.md)
- [License: MIT](https://github.com/eduardo-sl/go-agent-skills/tree/HEAD/skills/(architecture)/go-interface-design)

## Features

- **Consumer-side interface definition:** Shows how to declare narrow interfaces in the package that uses them rather than the package that implements them.
- **Small interface composition:** Guides keeping interfaces to a few methods and combining smaller ones into larger contracts.
- **Accept interfaces, return structs:** Explains when function parameters should be interfaces and when return values should be concrete types.
- **Compile-time compliance checks:** Describes asserting that a type satisfies an interface using blank identifier assignments.
- **Interface anti-patterns:** Flags premature interfaces, interface pollution, pointers to interfaces and overuse of empty interfaces.
- **Embedding and assertions reference:** Provides an on-demand reference on embedding trade-offs, test fakes, optional capabilities and sealed interfaces.

## Good for

- Design a narrow interface for a service's storage dependency
- Refactor a package to depend on an interface for testability
- Review whether a Go interface has too many methods
- Decide whether a constructor should return a struct or an interface
- Add compile-time checks that types implement required interfaces

## Install

### Any agent

Download the skill folder from https://github.com/eduardo-sl/go-agent-skills and copy it into your agent's skills folder.

## FAQ

### What does Go interface design need to run?

It requires the Go toolchain. The skill is designed for Claude Code or similar AI coding agents working on Go projects.

### When does Go interface design trigger?

It applies when designing interfaces, decoupling packages, defining contracts, reviewing interface usage or refactoring for testability, with trigger phrases such as design interface or interface compliance.

### Does Go interface design cover HTTP handlers or general code review?

No. HTTP handler patterns are left to a separate go-api-design skill and general review to go-code-review.

### Does Go interface design change my code by itself?

It gives the agent guidance and allows file editing and go commands, so the agent applies these rules when working on your Go code.

### Does Go interface design run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Go interface design?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Go interface design?

The closest alternatives to Go interface design are Go design patterns, Go coding standards, Go defensive coding, Codebase design and Go test quality.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Go design patterns](https://ai-powered.com/skills/go-design-patterns): Go design patterns is an open-source agent skill for developer tools.
- [Go coding standards](https://ai-powered.com/skills/go-coding-standards): Go coding standards is an open-source agent skill for developer tools.
- [Go defensive coding](https://ai-powered.com/skills/go-defensive-coding): Go defensive coding is an open-source agent skill for developer tools.
- [Codebase design](https://ai-powered.com/skills/codebase-design): Codebase design is an open-source agent skill for design and media.
- [Go test quality](https://ai-powered.com/skills/go-test-quality): Go test quality is an open-source agent skill for developer tools.
- [Go data structures](https://ai-powered.com/skills/go-data-structures): Go data structures is an open-source agent skill for developer tools.
- [Go API design](https://ai-powered.com/skills/go-api-design): Go API design is an open-source agent skill for developer tools.
- [Go semantic tools](https://ai-powered.com/skills/go-semantic-tools): Go semantic tools is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/go-interface-design
