---
name: "wire-compile-time-dependency-injection"
description: "Generate clean, readable, compile-time dependency initialization code using Google Wire."
metadata:
  author: "Google"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "setup google wire go"
  - "wire providerset"
  - "generate wire_gen.go"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Google Wire Compile-Time Dependency Injection for Go

Configures Google Wire: defining Provider functions, organizing providers into ProviderSets, declaring injector functions in wire.go, and compiling deterministic dependency graphs without runtime reflection.

## When to Invoke
Invoke this skill whenever you need to:
- setup google wire go
- wire providerset
- generate wire_gen.go

## Execution SOP & Rules
1. Define provider functions returning initialized structs and errors: func NewDB(...) (*sql.DB, error).
2. Create wire.go declaring injector signature: func InitializeApp() (*App, error) { wire.Build(...) }.
3. Compile dependencies: run wire to emit wire_gen.go containing plain standard Go initialization.
4. Verify zero runtime reflection or interface overhead during application execution.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
