PlugWiki

golang-uber-fx Skill for Claude: What It Does and How to Install It

Makes Claude wire Go services with uber-go/fx, including startup and shutdown hooks and reusable modules.

Installs
37.4K
on skills.sh
Stars
3.7K
on GitHub
Files
4
besides SKILL.md
Updated
Nov 2026
last repo commit

golang-uber-fx teaches Claude how to build long-running Go services with fx. It covers fx.New, Provide and Invoke, Lifecycle hooks, fx.Annotate, value groups and fx.Module.

It triggers when you use or adopt uber-go/fx or when the code imports go.uber.org/fx. The skill says fx sits on top of dig and adds lifecycle, modules, a signal-aware run loop and event logging.

Good for

  • Go developers building HTTP servers, workers or daemons with fx
  • Teams that need clean startup and graceful shutdown
  • Developers deciding between fx and plain dig

Install golang-uber-fx

Claude Code

  1. 1

    Copy this prompt.

    Install the golang-uber-fx skill in Claude Code. Run this command:
    
    npx skills add https://github.com/samber/cc-skills-golang --skill golang-uber-fx
    
    Then check that it loaded and tell me how to use it.
  2. 2

    Paste it into Claude Code. It shows the change and asks before running it.

Requires Node.js.

From its listing on skills.sh. Source.

What's in the skill

When it loads

Golang application framework using uber-go/fx — fx.New, fx.Provide, fx.Invoke, fx.Module, fx.Lifecycle hooks, fx.Annotate (name/group/As), fx.Decorate, fx.Supply, fx.Replace, fx.WithLogger, and signal-aware Run(). Apply when using or adopting uber-go/fx, when the codebase imports `go.uber.org/fx`, or when wiring services with fx.New. For raw DI without lifecycle, see `samber/cc-skills-golang@golang-uber-dig` skill.

Sections in SKILL.md

  1. fx vs. dig
  2. The Application
  3. Provide and Invoke
  4. Lifecycle Hooks
  5. Parameter and Result Objects
  6. fx.Annotate
  7. Value Groups
  8. fx.Module
  9. Best Practices
  10. Common Mistakes
  11. Testing
  12. Further Reading
  13. Cross-References

Key facts

Author
samber
Installs on skills.sh
37,405 as of 2026-11-02
Last commit to the repo
2026-11-01

What it includes

  • fx.New validates types; Start runs hooks; Stop reverses them

    The skill explains the boot stages and the default 15 second timeout, which you can change with StartTimeout and StopTimeout.

    Read · The application

  • Constructors only run when an Invoke needs them

    Claude registers constructors with fx.Provide and adds at least one fx.Invoke, because constructors that nothing uses never run.

    Write · Provide and Invoke

  • OnStart and OnStop; OnStart must return quickly

    Claude pushes startup and shutdown work into hooks and spawns a goroutine for anything that blocks.

    Write · Lifecycle hooks

  • fx.In, fx.Out and Annotate for names, groups and interfaces

    Claude uses In and Out structs for constructors with four or more dependencies and Annotate for simple name, group or interface bindings.

    Write · Parameter and result objects, fx.Annotate

  • Many constructors feed one slice; order is not guaranteed

    Claude uses groups for routes, health checks or metrics collectors, and an explicit ordered slice when sequence matters.

    Write · Value groups

  • Scope decorators and providers to a named module

    The skill treats each module as a small library. A decorator inside a module only reaches that module and its children.

    Write · fx.Module

  • advanced.md, recipes.md, testing.md

    Deeper notes load on demand, including test patterns for fx apps.

    Read · Testing and reference guides

From the official docs

Permissions

Low risk

Claude can edit your Go files and run go and git commands in your project. Review the diff before you commit.

What it can do

  • Read your data
  • Create and change things
  • Delete things
  • Read-only mode

Watch out for

  • It can edit your service wiring and run go commands

    Lifecycle changes affect startup and shutdown order. Commit first and run your tests after. github.com

  • It shows a go get command for fx

    The SKILL.md code block shows go get go.uber.org/fx, which adds fx to your go.mod. Run it yourself if you prefer to control versions. github.com

Technical details
Turning on read-onlyNo read-only switch is documented in SKILL.md.
Talks toWebFetch and the Context7 documentation tools appear in allowed-tools
Scopes
  • allowed-tools: Read, Edit, Write, Glob, Grep, Agent, WebFetch, LSP

  • Bash limited to go, golangci-lint, git, godig and gopls

Questions

What does golang-uber-fx do?

It gives Claude a working method for uber-go/fx: how to compose providers, hooks and modules in a long-running Go service. It also lists common mistakes, such as long-running work directly in OnStart.

How do I install golang-uber-fx?

Use the install box at the top of this page. The README says the Go skills are designed as cross-referencing units, so installing only a subset gives a partial view of the guidelines.

Is golang-uber-fx safe to use?

It bundles no scripts. Its allowed-tools line lets Claude read and edit files, run go, golangci-lint, git, godig and gopls commands, and fetch web pages. Review the diff before you commit.

fx vs dig: which one do I need?

The skill says to choose fx for long-running services where lifecycle and signal handling matter, and dig for wiring without a framework, such as CLI tools or libraries. fx is built on dig. The repo has a separate golang-uber-dig skill.

fx vs wire?

The skill points to the golang-google-wire skill for compile-time injection with no runtime container. fx resolves the graph at runtime with reflection and adds lifecycle hooks.

Why does my constructor never run?

The skill says constructors are lazy. Without an fx.Invoke, or a consumer reached from one, a constructor does not run, so add at least one Invoke.

Information

updated Nov 2, 2026

Folder
skills/golang-uber-fx

samber/cc-skills-golangskills.sh

Sources

Docs, issue trackers and discussions this page is built from.

Show all 3
  1. golang-uber-fx SKILL.md · github.com
  2. samber/cc-skills-golang README · github.com
  3. golang-uber-dig SKILL.md · github.com

Updated Nov 2, 2026.