CtrlK
BlogDocsLog inGet started
Tessl Logo

golang-dependency-injection

Comprehensive guide for dependency injection (DI) in Golang. Covers why DI matters (testability, loose coupling, separation of concerns, lifecycle management), manual constructor injection, and DI library comparison (google/wire, uber-go/dig, uber-go/fx, samber/do). Use this skill when designing service architecture, setting up dependency injection, refactoring tightly coupled code, managing singletons or service factories, or when the user asks about inversion of control, service containers, or wiring dependencies in Go.

87

1.05x
Quality

82%

Does it follow best practices?

Impact

99%

1.05x

Average score across 3 eval scenarios

SecuritybySnyk

Passed

No known issues

SKILL.md
Quality
Evals
Security

Evaluation results

98%

14%

Notification Platform Service

samber/do generics API and lifecycle shutdown

Criteria
Without context
With context

do.New() injector

100%

100%

do.Provide() registration

100%

100%

Generic MustInvoke syntax

70%

100%

Internal dependency resolution

100%

100%

Injector not passed to services

100%

100%

Stateful singletons

100%

100%

Graceful shutdown

100%

100%

Correct import path

0%

100%

Constructor injection in services

50%

80%

No global variables

100%

100%

No reflection-based alternative

100%

100%

100%

E-Commerce Backend Service Wiring

Manual DI layered initialization order

Criteria
Without context
With context

Infrastructure initialized first

100%

100%

Repositories after infrastructure

100%

100%

Services after repositories

100%

100%

Transport initialized last

100%

100%

No DI library used

100%

100%

Constructor injection

100%

100%

No global service variables

100%

100%

Wiring centralized in main

100%

100%

Interfaces accepted at boundaries

100%

100%

Config initialized before infrastructure

100%

100%

Graceful shutdown wired

100%

100%

100%

Analytics Pipeline Service Refactor

fx module domain organization and lifecycle

Criteria
Without context
With context

fx.Module for domain grouping

100%

100%

Separate infra module

100%

100%

Separate service/domain module

100%

100%

fx.Lifecycle in provider

100%

100%

OnStart hook registered

100%

100%

OnStop hook registered

100%

100%

Context parameter in hooks

100%

100%

Modules composed in fx.New

100%

100%

No per-request container

100%

100%

app.Run() for lifecycle

100%

100%

No global service variables

100%

100%

Repository
samber/cc-skills-golang
Evaluated
Agent
Claude Code
Model
Claude Sonnet 4.6

Table of Contents

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.