LogoAwesome Skills
  • Search
  • Category
  • Tag
  • Blog
LogoAwesome Skills
LogoAwesome Skills

Discover Open-Source Agent Skills for AI Coding Assistants

Product

  • Search
  • Category
  • Tag
  • Blog

Resources

  • Claude Skill Docs
  • Antigravity Skills Docs

Tools

  • Claude Code
  • OpenCode
  • Cursor
  • Codex
  • Antigravity

Company

  • Privacy Policy
  • Terms of Service
  • Sitemap

©2026 Awesome Skills. All rights reserved.

Privacy PolicyTerms
Back to Skills

golang-google-wire

Compile-time dependency injection in Golang using google/wire — wire.NewSet, wire.Build, wire.Bind (interface→concrete), wire.Struct, wire.Value, wire.InterfaceValue, wire.FieldsOf, cleanup functions, //go:build wireinject injector files, and generated wire_gen.go. Apply when using or adopting google/wire, when the codebase imports `github.com/google/wire`, or when wiring an application graph at compile time via `wire.Build`. For runtime DI with reflection, see `samber/cc-skills-golang@golang-ub

2,225stars141forksUpdated 6/19/2026
Developer Tools#compile-time#google-wire#code-generation#golang#dependency-injection#architecture

Security Assessment

Safe(100/100)
Security Score100/100

About golang-google-wire

The golang-google-wire skill provides expertise in compile-time dependency injection for Go applications using Google's Wire framework. Unlike runtime DI solutions that use reflection and resolve dependencies at application startup, Wire generates plain Go code at compile time through code generation. This means dependency graph errors are caught during the build phase when you run `wire ./...`, not at runtime during the first request. The generated `wire_gen.go` files contain straightforward constructor calls with no magic, making the dependency resolution process transparent and debuggable.

Wire's core capabilities revolve around providers (regular Go functions where inputs are dependencies and outputs are provided types), provider sets that group related providers for reuse, and binding mechanisms that connect interfaces to concrete implementations. The framework supports multiple return signatures including error handling and cleanup functions that are automatically chained in reverse order. It offers primitives like wire.NewSet for grouping providers, wire.Build for defining injector functions, wire.Bind for interface-to-concrete mappings, wire.Struct for field injection, wire.Value for constants, and wire.FieldsOf for extracting struct fields as individual dependencies.

This skill is ideal for Go architects and developers building applications with complex dependency graphs who want compile-time safety and explicit wiring without runtime overhead. It's particularly valuable for microservices, API servers, and large Go applications where catching dependency errors early prevents production issues. The skill targets teams adopting or already using github.com/google/wire in their codebase, especially those migrating from runtime DI frameworks or setting up new projects with strict dependency management requirements. Note that Wire was archived in August 2025 as feature-complete, though bug fixes are still accepted.

FAQ

What's the difference between Wire and runtime DI frameworks like Uber Dig or Fx?

Wire performs dependency resolution at compile time through code generation, while runtime frameworks like Dig and Fx use reflection to resolve dependencies when the application starts. Wire catches errors during `wire ./...` execution, produces no runtime container, and generates plain Go code in wire_gen.go files. Runtime frameworks detect errors at first startup and provide built-in lifecycle hooks, which Wire does not offer natively.

Do I need to commit the generated wire_gen.go files to version control?

Yes, wire_gen.go files should be committed to your repository. They contain the actual dependency injection code that runs in your application and are considered source code, not temporary build artifacts. You should re-run `wire ./...` after every dependency graph change to regenerate these files.

What are the prerequisites for using this skill?

You need Go installed and the Wire CLI tool, which can be installed via `go install github.com/google/wire/cmd/wire@latest`. Your project should import `github.com/google/wire`. The skill is designed for projects using compile-time dependency injection and works with Claude Code or similar AI coding agents.

Can Wire handle cleanup functions and resource lifecycle?

Wire supports cleanup functions through provider signatures that return a cleanup function as the second or third return value (e.g., `func NewRedis() (*redis.Client, func(), error)`). These cleanup functions are automatically chained in reverse order of initialization. However, Wire does not have built-in lifecycle hooks like OnStart/OnStop — for those, consider runtime DI frameworks.

Is Wire still actively maintained since it was archived in 2025?

Wire was archived in August 2025 because it reached feature-complete status, meaning all planned features have been implemented. Bug fixes are still accepted, so the framework remains usable and reliable for production applications, but no new major features are expected.

All Files

5 files
references/testing.md5.0 KB
View
SKILL.md10.4 KB
View
references/advanced.md6.8 KB
View
evals/evals.json14.5 KB
View
references/recipes.md6.4 KB
View

Install golang-google-wire

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill

Repository

samber/cc-skills-golang

Related Skills

short-form-video

14

multi-asset-morning-briefing

7,907

content-strategy

2,901

doherty-threshold

2,901