david-li0406/meta-skill-evloving/accept-interfaces-return-structs
Claude Code and agent skill by david-li0406/meta-skill-evloving
Trust tier 3
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Core pattern for flexible, testable Go APIs
Install
npx vskill@latest install david-li0406/meta-skill-evloving/accept-interfaces-return-structsSKILL.md
The same SKILL.md was published earlier as majiayu000/claude-skill-registry-data/accept-interfaces-return-structs.
Accept Interfaces, Return Structs
The fundamental Go interface design principle: functions should accept interfaces but return concrete types.
The Pattern
CORRECT - Accept interface, return concrete
WRONG - Return interface unnecessarily
Why This Works
Accepting interfaces:
- Caller controls abstraction
- Easy to mock/test
- Flexible composition
Returning concrete types:
- No hidden behaviors
- All methods visible
- Can add methods without breaking compatibility
When to Deviate
Return interface when:
Return interfaces only when:
- Using stdlib interfaces (io.Writer, io.Reader)
- Multiple implementations chosen at runtime
- Interface already well-established in ecosystem
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskill-flow/data/skills-refined-skillclaw-36k/skillsmp/accept-interfaces-return-structs/SKILL.md
Popularity
- Repository stars
- 2
- Repository forks
- 1
- 7-day trend score
- 10
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/david-li0406/meta-skill-evloving/accept-interfaces-return-structs)