Golang Dependency Injection
Go DI guide with a project-size decision table for manual injection vs wire, dig/fx, or samber/do.
Test report
- Verdict
- Tested · Works
- Score
- Tested
- Jul 13, 2026
- Environment
- Claude Code 2.x (agent harness)
- Upstream re-checked
- Aug 10, 2026 · 040f2a1
Fed it a 4-service Go app wired with globals and init(): the skill's own decision table (<10 services -> stay manual) and 'never over-engineer' persona kept the answer from reflexively reaching for wire/fx, and it produced a concrete NewXxx-constructor refactor plus mock-boundary test code matching its documented pattern exactly.
Scored on four weighted criteria — install, triggering, output vs. baseline, docs. How scoring works
- Installs cleanly 5/5
- Triggers reliably 5/5
- Output vs. baseline 8/10
- Docs & honesty 5/5
What Golang Dependency Injection does
Teaches dependency injection patterns in Go, from manual constructor injection to library-based containers (google/wire, uber-go/dig+fx, samber/do), with a decision table keyed on service count and lifecycle needs. Triggers when designing service architecture, refactoring globals/init()-based wiring, or choosing a Go DI library, and explicitly hands off to sibling per-library skills for deep dives.
How to install Golang Dependency Injection
git clone https://github.com/samber/cc-skills-golang
cd cc-skills-golang
mkdir -p ~/.claude/skills
cp -r skills/golang-dependency-injection ~/.claude/skills/golang-dependency-injection
Skills live in ~/.claude/skills/ (global) or .claude/skills/
(per-project). Restart Claude Code after installing.
Commands — how to trigger Golang Dependency Injection
-
/golang-dependency-injectionGo DI guide with a project-size decision table for manual injection vs wire, dig/fx, or samber/do.
It also activates on plain-language prompts like these:
-
Should I use wire or dig for dependency injection in this Go service -
Help me refactor these Go globals and init() wiring into proper DI -
What's the right DI approach for a Go project this size, manual or a library
Frequently asked questions
- Is the Golang Dependency Injection skill free?
- Yes. The skill itself is free from samber/cc-skills-golang. SkillProof publishes the install command and an independent test verdict at no cost.
- Does Golang Dependency Injection work with Claude Code?
- We tested it with Claude Code 2.x (agent harness) on Jul 13, 2026. Verdict: Tested · Works. Fed it a 4-service Go app wired with globals and init(): the skill's own decision table (<10 services -> stay manual) and 'never over-engineer' persona kept the answer from reflexively reaching for wire/fx, and it produced a concrete NewXxx-constructor refactor plus mock-boundary test code matching its documented pattern exactly.
- What is the Golang Dependency Injection SkillProof Score?
- 9.2/10 — installs cleanly 5/5, triggers reliably 5/5, output vs. baseline 8/10, docs & honesty 5/5.
- How do I install Golang Dependency Injection?
- Copy the install command from this page, run it in your terminal, and restart Claude Code. Skills live in ~/.claude/skills/ (global) or .claude/skills/ inside a project.
- Can I use Golang Dependency Injection with Cursor, Copilot, Gemini CLI, Codex or other AI tools?
- The SKILL.md format is native to Claude (Claude Code, Desktop, claude.ai). The instructions inside adapt to other assistants: Cursor rules, GitHub Copilot instructions, Windsurf rules, Custom GPTs, AGENTS.md for OpenAI Codex, and GEMINI.md for Google Gemini CLI — our conversion guides cover each, and the free converter on the tools page does the wrapping for you.