golang-structs-interfaces Skill for Claude Code: Go Structs and Interfaces
Makes Claude design Go structs and interfaces: small interfaces, composition, type assertions, field tags and receivers.
- Installs
- 40.6K
- on skills.sh
- Stars
- 3.7K
- on GitHub
- Files
- 3
- besides SKILL.md
- Updated
- Nov 2026
- last repo commit
golang-structs-interfaces makes Claude keep interfaces small, define them where they are used, accept interfaces and return structs, and avoid creating an interface before a second implementation exists. It also covers embedding, type assertions, field tags and pointer versus value receivers.
It bundles two reference files, on struct fields and type assertions, and no scripts. Its first line sets a persona: a Go type system designer who designs for testability and clarity, not abstraction for its own sake.
Good for
- Go developers designing types and APIs
- Reviewers checking interface size, receivers and struct tags
- Teams cleaning up large interfaces and premature abstractions
Install golang-structs-interfaces
Claude Code
- 1
Copy this prompt.
Install the golang-structs-interfaces skill in Claude Code. Run this command: /plugin marketplace add samber/cc /plugin install cc-skills-golang@samber Then check that it loaded and tell me how to use it.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Pick one route, not several. The README says the skills cross-reference each other and a subset gives a partial and potentially inconsistent view, so the plugin or the whole-set CLI command is the better choice. The plugin installs the repo's 46 skill folders; its manifest declares no hooks, commands or MCP servers. Claude Code names plugin skills /plugin-name:skill-name, so after the plugin install the full name is /cc-skills-golang:golang-structs-interfaces. The samber/cc marketplace lists seven plugins; the second command installs only cc-skills-golang.
From the project README. Source.
What's in the skill
When it loads
Golang struct and interface design patterns — composition, embedding, type assertions, type switches, interface segregation, dependency injection via interfaces, struct field tags, and pointer vs value receivers. Use this skill when designing Go types, defining or implementing interfaces, embedding structs or interfaces, writing type assertions or type switches, adding struct field tags for JSON/YAML/DB serialization, or choosing between pointer and value receivers. Also use when the user asks about "accept interfaces, return structs", compile-time interface checks, or composing small interfaces into larger ones.
Sections in SKILL.md
- Interface Design Principles
- Keep Interfaces Small
- Define Interfaces Where They're Consumed
- Accept Interfaces, Return Structs
- Don't Create Interfaces Prematurely
- Make the Zero Value Useful
- Avoid any / interface{} When a Specific Type Will Do
- Key Standard Library Interfaces
- Compile-Time Interface Check
- Type Assertions & Type Switches
- Struct & Interface Embedding
- Struct Embedding
- When to Embed vs Named Field
- Dependency Injection via Interfaces
- Struct Field Tags
- Pointer vs Value Receivers
Key facts
- Installs on skills.sh
- 40,620 as of 2026-11-02
- Last repo commit
- 2026-11-01
What it includes
1-3 methods, defined by the consumer, accept interfaces and return structs
Small interfaces are easier to implement, mock and compose.
Read ·
Interface design principlesMake zero values useful; prefer generics over any
Use any only at true boundaries such as JSON decoding.
Read ·
Zero value and anyA blank identifier assignment near the type
Fails the build if a type stops satisfying an interface.
Write ·
Compile-time interface checkComma-ok form only; see references/type-assertions.md
The single-value form panics on a mismatch.
Read ·
Type assertions and switchesEmbed to promote the inner API, use a named field to keep it internal
A table of when to use each.
Read ·
EmbeddingTag all exported fields in serialized structs
See references/struct-fields.md for the tag table and the omitempty vs omitzero trap.
Write ·
Struct field tagsKeep receivers consistent; embed noCopy for lock-bearing structs
go vet copylocks reports value copies.
Runs code ·
Receivers and noCopyTwelve mistakes with fixes
From large interfaces to missing field tags.
Read ·
Common mistakes
From the official docs
Permissions
Low risk
Claude can edit your Go files and run go and git commands while this skill is active. Work on a branch and read the diff before you commit.
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only mode
Watch out for
It edits files and runs commands in your project
The frontmatter lists Edit, Write and these shell commands: go:*, golangci-lint:*, git:*. Work on a branch and read the diff before you commit. github.com
The recommended plugin route installs the whole repo
The plugin route and the --all skills CLI command add all 46 skill folders in the repo, not only this one. The plugin manifest (.claude-plugin/plugin.json, version 2.0.1) declares a name, description, author, license and keywords, and lists no hooks, commands or MCP servers. The skills CLI docs say --all installs every skill into every agent it supports without prompts. github.com
Technical details
| Sign-in and keys | SKILL.md names no account or API key. |
|---|---|
| Scopes |
|
Questions
What does golang-structs-interfaces do?
It makes Claude design Go structs and interfaces: small interfaces defined by the consumer, composition and embedding, comma-ok type assertions, struct field tags and consistent pointer or value receivers.
How do I install golang-structs-interfaces?
Install the whole golang set, not only this skill. The README calls the skills atomic, cross-referencing units and says a partial install gives a potentially inconsistent view. The install box lists the Claude Code plugin (/plugin marketplace add samber/cc, then /plugin install cc-skills-golang@samber), the skills CLI for the whole set or for this skill alone, and the README's Codex, Gemini CLI, Cursor and OpenCode routes. The README documents no Claude app route, so none is listed.
Do I need the other golang skills with golang-structs-interfaces?
Installing the set is the safer choice. SKILL.md hands neighboring topics to other skills: golang-naming, golang-design-patterns, golang-dependency-injection, golang-code-style, golang-gopls. The README says to install the general-purpose skills together, and the whole-set install does that.
What does golang-structs-interfaces need on my machine?
The frontmatter names these programs: go. SKILL.md names no API key or account.
Is golang-structs-interfaces safe?
It is instruction text and reference files, and the folder bundles no scripts. When you use it, Claude can edit files and run go, golangci-lint and git commands in your project, as its frontmatter allows. Work on a branch, read the diff and approve commands you do not recognize.
golang-structs-interfaces vs golang-design-patterns?
This skill covers the type system: interfaces, structs, embedding and receivers. SKILL.md points to golang-design-patterns for functional options, constructors and builder patterns.
Does golang-structs-interfaces work in Codex, Cursor or the Claude app?
The SKILL.md compatibility field says it is designed for Claude Code, Codex or a similar harness, and the README says the skills are built for Claude Code, Codex, Gemini, Copilot, Antigravity and Cursor. The install box covers Claude Code, Codex, Gemini CLI, Cursor, OpenCode and the skills CLI. The README documents no Claude app route.
Information
updated Nov 2, 2026
- Repository
- samber/cc-skills-golang
- Folder
skills/golang-structs-interfaces
Sources
Docs, issue trackers and discussions this page is built from.
Show all 6Hide
- cc-skills-golang README · github.com
- skills CLI commands · github.com
- cc-skills-golang plugin.json · github.com
- samber/cc marketplace.json · github.com
- Claude Code skills · code.claude.com
- golang-structs-interfaces SKILL.md · github.com