CtrlK
BlogDocsLog inGet started
Tessl Logo
SkillPublic

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. For a specific DI library, → See `samber/cc-skills-golang@golang-google-wire`, `samber/cc-skills-golang@golang-uber-dig`, `samber/cc-skills-golang@golang-uber-fx`, or `samber/cc-skills-golang@golang-samber-do` skills.

75

1.00x
Quality

79%

Does it follow best practices?

Impact

100%

1.00x

2 of 3 eval scenarios. Add 1 more for a full score.

SecuritybySnyk

Passed

No findings from the security scan

Fix and improve this skill with Tessl

tessl review fix ./skills/golang-dependency-injection/SKILL.md
SKILL.md
Quality
Evals
Security

Quality

Content

61%Weight 40%Scale 1-5

Reviews the quality of instructions and guidance provided to agents. Good implementation is clear, handles edge cases, and produces reliable results.

The content delivers strong, concrete guidance — executable Go examples, a genuinely useful library decision table, and well-verified one-level-deep references. The main gaps are instructional: the Why-DI explanatory material duplicates what Claude already knows, Best Practices and Common Mistakes overlap, and neither mode includes a validation/verification checkpoint, which the rubric caps at 3 for batch refactoring workflows.

Suggestions

Add an explicit verification checkpoint to both modes, e.g. 'After generating wiring code or the migration plan, run `go build ./...` and `go test ./...` and fix failures before presenting the result' — this addresses the workflow_clarity cap for batch refactoring operations.

Cut the opening DI definition and the 'Why Dependency Injection?' table (or move them to a reference) — Claude already knows why dependency injection matters; keep the high-value decision table, code contrasts, and mistakes table.

Merge the overlapping entries of the Best Practices Summary and Common Mistakes tables (globals, init(), container-passing appear in both), and move the two testing sections into a testing reference file to reduce SKILL.md's inline weight.

DimensionReasoningScore

Conciseness

Mostly efficient, but the opening definition ("Dependency injection (DI) means passing dependencies to a component rather than having it create or find them") and the six-row "Why Dependency Injection?" table re-explain concepts Claude already knows, and the Best Practices Summary duplicates content that reappears in Common Mistakes (globals, init(), container-passing). Matches anchor 3 (some unnecessary explanation, could be tightened); more than the 'minor instances' of anchor 4, far leaner than the padded verbosity of anchor 2.

3 / 5

Actionability

Concrete, idiomatic Go code throughout — good/bad manual DI constructors, the manual-vs-container wiring comparison, a complete mock-based test, and a samber/do clone-and-override test — plus a decisive library decision table. Anchor 4 fits: guidance is mostly executable with minor gaps (e.g. the do-test example never provides a Mailer so MustInvoke[*UserService] would fail, and snippets reference undefined types like NewAPI/UserStore). Not 5 because a few examples are not fully copy-paste runnable as written.

4 / 5

Workflow Clarity

Both modes give a clear sequence (Design: assess → recommend → generate; Refactor: 3 parallel sub-agents → consolidate → migration plan), but neither includes any validation checkpoint — no 'run go build/vet/tests' gate after generating wiring code or refactoring a coupled codebase, and the refactoring workflow is a batch operation across many files. Per the rubric's cap, missing validation in batch operations caps this at 3, which also matches anchor 3 (sequence present, checkpoints missing or implicit) rather than anchor 4's 'most checkpoints present'.

3 / 5

Progressive Disclosure

Good structure: well-organized sections, and per-library wiring examples plus the full manual-DI application are correctly split into four real, clearly-signaled reference files (all exist in references/ and are one level deep, verified). Not 5 because the body is ~240 lines with substantial inline material that belongs in references — the two testing sections (~60 lines) and the decision table could be offloaded — leaving SKILL.md heavier than an overview.

4 / 5

Total

14

/

20

Passed

Description

91%Weight 40%Scale 1-5

Based on the skill's description, can an agent find and select it at the right time? Clear, specific descriptions lead to better discovery.

A strong description: explicit what-and-when with rich, natural trigger terms and third-person voice, plus explicit routing to library-specific siblings. The only weaknesses are framing coverage as topics rather than actions, the 'Comprehensive guide' filler opener, and inherent overlap with the four library-specific sibling skills it deliberately references.

DimensionReasoningScore

Specificity

Lists several specific concrete items — "manual constructor injection, and DI library comparison (google/wire, uber-go/dig, uber-go/fx, samber/do)" and enumerated concerns ("testability, loose coupling, separation of concerns, lifecycle management") — but frames them as topics covered ("Covers why DI matters...") rather than actions, and the opener "Comprehensive guide" is mild fluff. Anchor 4 (several specific actions, minor gaps) fits better than 5, whose exemplars are direct action verbs; it is clearly above anchor 3's '1-2 concrete actions'.

4 / 5

Completeness

Explicitly answers both: what ("Covers why DI matters... manual constructor injection, and DI library comparison") and when ("Use this skill when designing service architecture, setting up dependency injection, refactoring tightly coupled code... or when the user asks about inversion of control, service containers, or wiring dependencies in Go"), plus routing to library-specific skills. Matches anchor 5's exemplar structure exactly; not 4, since the 'when' clause is already explicit and trigger-phrase-rich rather than needing more specificity.

5 / 5

Trigger Term Quality

Comprehensive natural-term coverage with synonyms: "dependency injection", "DI", "Golang"/"Go", "inversion of control", "service containers", "wiring dependencies", "singletons", "service factories", plus all four library names users would actually name. Matches anchor 5 (comprehensive natural terms including synonyms); no common phrasing is missing.

5 / 5

Distinctiveness Conflict Risk

Clear niche (DI in Go) with mostly distinct triggers, but a query about a specific library (e.g. uber-go/fx) could plausibly trigger both this skill and its four library-specific siblings — real overlap with closely related skills, matching anchor 4. The explicit routing sentence ("For a specific DI library, → See...") reduces the risk, but not to anchor 5's minimal-conflict level given the sibling skills share the library names in this description.

4 / 5

Total

18

/

20

Passed

Validation

87%

Checks the skill against the spec for correct structure and formatting. All validation checks must pass before discovery and implementation can be scored.

Validation — 14 / 16 Passed

Validation for skill structure

CriteriaDescriptionResult

metadata_field

'metadata' should map string keys to string values

Warning

relative_links

Relative link issues: 4 missing

Warning

Total

14

/

16

Passed

Repository

samber/cc-skills-golang

Path

skills/golang-dependency-injection/SKILL.md

Reviewed

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.