Skip to content
Skill

Go interface design

Guides Go agents in designing small, consumer-side interfaces and checking compliance

Go interface design is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

Scripts
None
Platforms
Claude Code, Codex, Cursor
GitHub stars
90
Last commit
License
MIT
Listing updated

Similar skills

About Go interface design

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).

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 2 files (10 KB) on GitHub on 3 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

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

What it does

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

Go interface design 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.

More from eduardo-sl/go-agent-skills

  1. Guides Go agents in designing HTTP REST APIs, handlers, middleware and shutdown

    • Open source
    • 90 GitHub stars
    • Developer tools
  2. Reviews Go project structure, dependency direction and module boundaries

    • Open source
    • 90 GitHub stars
    • Developer tools
  3. Guides an AI agent to build Go command-line tools with clean flags, streams and exit codes

    • Open source
    • 90 GitHub stars
    • Developer tools
  4. Guides Go code toward constructor injection, explicit wiring and no global state

    • Open source
    • 90 GitHub stars
    • Developer tools
  5. Guides Go code toward idiomatic design patterns like functional options and factories

    • Open source
    • 90 GitHub stars
    • Developer tools
  6. Guides building Go GraphQL servers with gqlgen, covering N+1 batching and query limits

    • Open source
    • 90 GitHub stars
    • Developer tools