[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79AZ6TPRD8V01Y79NPFQ40M":3,"skill-same:01M79AZ6TPRD8V01Y79NPFQ40M":77},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":38,"commitSha":39,"skillDirectory":40,"forksCount":41,"repositoryHtmlUrl":42,"repositoryHomepageUrl":6,"ownerHtmlUrl":43,"ownerBlogUrl":44,"ownerDescription":6,"updatedAt":45,"install":46,"resources":58},"01M79AZ6TPRD8V01Y79NPFQ40M","golang-uber-fx",null,"Golang application framework using uber-go\u002Ffx — fx.New, fx.Provide, fx.Invoke, fx.Module, fx.Lifecycle hooks, fx.Annotate (name\u002Fgroup\u002FAs), fx.Decorate, fx.Supply, fx.Replace, fx.WithLogger, and signal-aware Run(). Apply when using or adopting uber-go\u002Ffx, when the codebase imports `go.uber.org\u002Ffx`, or when wiring services with fx.New. For raw DI without lifecycle, see `samber\u002Fcc-skills-golang@golang-uber-dig` skill.","CCH-HQ\u002Fcchp-automation","CCH-HQ","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F253065381?v=4","01M79AG9QPRTJEVTCT1ZS7TM9J","CCH HQ","01M79AG9RNM4TAB3PJQH71X62P",2,"MIT","https:\u002F\u002Fgithub.com\u002FCCH-HQ\u002Fcchp-automation\u002Fblob\u002Fmain\u002Fskills-backup\u002Fskills\u002Fgolang-uber-fx\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: golang-uber-fx\ndescription: \"Golang application framework using uber-go\u002Ffx — fx.New, fx.Provide, fx.Invoke, fx.Module, fx.Lifecycle hooks, fx.Annotate (name\u002Fgroup\u002FAs), fx.Decorate, fx.Supply, fx.Replace, fx.WithLogger, and signal-aware Run(). Apply when using or adopting uber-go\u002Ffx, when the codebase imports `go.uber.org\u002Ffx`, or when wiring services with fx.New. For raw DI without lifecycle, see `samber\u002Fcc-skills-golang@golang-uber-dig` skill.\"\nuser-invocable: true\nlicense: MIT\ncompatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang.\nmetadata:\n  author: samber\n  version: \"1.1.3\"\n  openclaw:\n    emoji: \"🏭\"\n    homepage: https:\u002F\u002Fgithub.com\u002Fsamber\u002Fcc-skills-golang\n    requires:\n      bins:\n        - go\n    install: []\n    skill-library-version: \"1.24.0\"\nallowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent WebFetch mcp__context7__resolve-library-id mcp__context7__query-docs Bash(godig:*) Bash(gopls:*) LSP mcp__gopls__*\n---\n\n**Persona:** You are a Go architect building a long-running service with fx. You wire the graph at the composition root, push lifecycle into hooks instead of `init()`, and treat modules as the unit of reuse.\n\n# Using uber-go\u002Ffx for Application Wiring in Go\n\nApplication framework combining a reflection-based DI container (built on `uber-go\u002Fdig`) with a lifecycle, module system, signal-aware run loop, and structured event logging. For long-running services where boot order, graceful shutdown, and modular composition matter.\n\n**Official Resources:**\n\n- [pkg.go.dev\u002Fgo.uber.org\u002Ffx](https:\u002F\u002Fpkg.go.dev\u002Fgo.uber.org\u002Ffx)\n- [uber-go.github.io\u002Ffx](https:\u002F\u002Fuber-go.github.io\u002Ffx\u002F)\n- [github.com\u002Fuber-go\u002Ffx](https:\u002F\u002Fgithub.com\u002Fuber-go\u002Ffx)\n\nThis skill is not exhaustive. Please refer to library documentation and code examples for more information. For Go package docs, symbols, versions, importers, and known vulnerabilities, → See `samber\u002Fcc-skills-golang@golang-pkg-go-dev` skill (`godig`) — prefer it over Context7 for Go package facts. To navigate this library's usage in your own code (definitions, call sites, diagnostics), → See `samber\u002Fcc-skills-golang@golang-gopls` skill (`gopls`). Context7 remains a fallback for docs not indexed on pkg.go.dev.\n\n```bash\ngo get go.uber.org\u002Ffx\n```\n\n## fx vs. dig\n\nfx is built on top of dig and shares the same reflection-based container engine. The DI primitives (`Provide`, `Invoke`, `In`\u002F`Out` structs, named values, value groups) are identical — `fx.In`\u002F`fx.Out` are re-exports of `dig.In`\u002F`dig.Out`.\n\nWhat fx adds on top:\n\n| Concern | dig | fx |\n| --- | --- | --- |\n| DI container | ✅ `dig.New()` | ✅ (embedded) |\n| Lifecycle hooks | ❌ | ✅ `fx.Lifecycle` OnStart\u002FOnStop |\n| Module system | ❌ | ✅ `fx.Module` with scoped decorators |\n| Signal-aware run loop | ❌ | ✅ `app.Run()` blocks on SIGINT\u002FSIGTERM |\n| Structured event logging | ❌ | ✅ `fx.WithLogger` \u002F `fxevent` |\n| Startup\u002Fshutdown timeout | ❌ | ✅ `fx.StartTimeout` \u002F `fx.StopTimeout` |\n\n**Choose fx** for long-running services (HTTP servers, workers, daemons) — lifecycle and signal handling are mandatory there, and modules make large service graphs manageable.\n\n**Choose raw dig** when you need wiring without a framework: CLI tools, libraries that expose a container to callers, test harnesses, or embedding DI into an existing app that manages its own lifecycle. See `samber\u002Fcc-skills-golang@golang-uber-dig` skill.\n\n## The Application\n\n```go\nimport \"go.uber.org\u002Ffx\"\n\napp := fx.New(\n    fx.Provide(NewLogger, NewDatabase, NewServer),\n    fx.Invoke(RegisterRoutes),\n)\napp.Run() \u002F\u002F blocks until SIGINT\u002FSIGTERM, then runs OnStop hooks\n```\n\nBoot stages: `fx.New` validates types (constructors do not run); `app.Start(ctx)` runs each `fx.Invoke` and fires OnStart hooks in topological order; main blocks on `app.Done()`; `app.Stop(ctx)` fires OnStop hooks in reverse order. Default timeout is **15 seconds** — override with `fx.StartTimeout` \u002F `fx.StopTimeout`.\n\n## Provide and Invoke\n\n```go\nfx.New(\n    fx.Provide(NewLogger, NewDatabase, NewServer),  \u002F\u002F lazy\n    fx.Invoke(RegisterRoutes, StartMetricsExporter), \u002F\u002F always run during Start\n)\n```\n\n`fx.Provide` registers constructors; `fx.Invoke` is the trigger — without an Invoke (directly or transitively) referencing a type, its constructor never runs.\n\n## Lifecycle Hooks\n\nInject `fx.Lifecycle` and append hooks. Constructors should return quickly; long-running work belongs in `OnStart`.\n\n```go\nfunc NewHTTPServer(lc fx.Lifecycle, log *zap.Logger, cfg *Config) *http.Server {\n    srv := &http.Server{Addr: cfg.Addr}\n\n    lc.Append(fx.Hook{\n        OnStart: func(ctx context.Context) error {\n            ln, err := net.Listen(\"tcp\", srv.Addr)\n            if err != nil { return err }\n            go srv.Serve(ln)         \u002F\u002F blocking work in a goroutine\n            return nil\n        },\n        OnStop: func(ctx context.Context) error {\n            return srv.Shutdown(ctx)\n        },\n    })\n    return srv\n}\n```\n\nBoth callbacks receive a context bounded by `StartTimeout`\u002F`StopTimeout` — respect cancellation. **OnStart must return quickly** — spawn a goroutine for blocking work; otherwise startup hangs and dependent hooks never fire.\n\n`fx.StartHook` \u002F `fx.StopHook` \u002F `fx.StartStopHook` adapt simpler signatures (no context, no error, or both):\n\n```go\nlc.Append(fx.StartStopHook(srv.Start, srv.Stop))   \u002F\u002F matched pair\n```\n\n## Parameter and Result Objects\n\nfx re-exports dig's `dig.In` \u002F `dig.Out` as `fx.In` \u002F `fx.Out`. Use them when a constructor has 4+ dependencies, or when you need `name`\u002F`group`\u002F`optional` tags.\n\n```go\ntype ServerParams struct {\n    fx.In\n\n    Logger *zap.Logger\n    DB     *sql.DB\n    Cache  *redis.Client     `optional:\"true\"`\n    Routes []http.Handler    `group:\"routes\"`\n}\n\nfunc NewServer(p ServerParams) *Server { \u002F* ... *\u002F }\n```\n\n## fx.Annotate\n\n`fx.Annotate` wraps a constructor to add tags or interface bindings without a `fx.Out` struct. Prefer it for ergonomic name\u002Fgroup\u002FAs bindings:\n\n```go\nfx.Provide(\n    fx.Annotate(NewPrimaryDB, fx.ResultTags(`name:\"primary\"`)),\n    fx.Annotate(NewPostgresDB, fx.As(new(Database))),    \u002F\u002F expose interface\n    fx.Annotate(NewUserHandler,\n        fx.As(new(http.Handler)),\n        fx.ResultTags(`group:\"routes\"`),\n    ),\n)\n```\n\n## Value Groups\n\nMany constructors, one consumer slice — typical for routes, health checks, metrics collectors:\n\n```go\ntype RouteResult struct {\n    fx.Out\n    Handler http.Handler `group:\"routes\"`\n}\n\ntype ServerParams struct {\n    fx.In\n    Routes []http.Handler `group:\"routes\"`\n}\n```\n\nAppend `,flatten` (`group:\"routes,flatten\"`) to unwrap a slice instead of nesting it. Order is **not guaranteed** — provide an explicit ordered slice when sequence matters.\n\n## fx.Module\n\n`fx.Module` groups providers, invokes, and decorators under a name. Modules **scope decorators** to themselves and their children — a logger renamed in `fx.Module(\"db\", ...)` only appears renamed for code inside that module.\n\n```go\nvar DatabaseModule = fx.Module(\"database\",\n    fx.Provide(NewConnection, NewUserRepository),\n    fx.Decorate(func(log *zap.Logger) *zap.Logger {\n        return log.Named(\"db\")\n    }),\n)\n\nfunc main() {\n    fx.New(\n        fx.Provide(NewConfig, NewLogger),\n        DatabaseModule,\n        HTTPModule,\n    ).Run()\n}\n```\n\nTreat each module as a small library that can be lifted into another app — its public surface is the types it Provides.\n\nFor `fx.Supply`\u002F`fx.Replace`\u002F`fx.Decorate`, optional deps, custom logging, manual lifecycle, and Quick Reference, see [advanced.md](.\u002Freferences\u002Fadvanced.md).\n\n## Best Practices\n\n1. Keep `main()` thin — providers, modules, and a single `Run()`. Push real work into modules so each can be tested in isolation.\n2. Use lifecycle hooks instead of `init()` or goroutines launched from constructors — Start\u002FStop ordering depends on graph topology, but `init()` goroutines do not, which leads to races and leaks.\n3. OnStart must return promptly — long work goes in a goroutine inside the hook. A blocking OnStart hangs the rest of the boot.\n4. Respect `ctx.Done()` in hooks — a hook that ignores cancellation is reported as a timeout failure but its goroutine continues, leaking resources.\n5. Group by module, not by layer — a module owns the providers, lifecycle, and decorators for one concern (HTTP, DB, metrics).\n6. Use `fx.Annotate` for tags rather than wrapping a constructor in an `fx.Out` struct — keeps the constructor reusable outside fx.\n7. Replace `fx.Provide` with `fx.Supply` for pre-built values (config, command-line flags). Shorter, signals intent.\n8. Validate the graph in CI by booting under `fx.New(...).Err()` — catches missing providers and cycles before deploy.\n\n## Common Mistakes\n\n| Mistake | Fix |\n| --- | --- |\n| Long-running work directly in OnStart | Spawn a goroutine inside OnStart; the hook itself must return quickly so dependent hooks can run. |\n| `fx.Provide` something that should be `fx.Supply` | Pre-built values (config, secrets) belong in `fx.Supply` — clearer and avoids a no-op constructor. |\n| Module decorator leaking to siblings | Decorate inside `fx.Module(...)` — decorators flow only to descendants. A top-level `fx.Decorate` is global. |\n| Group order assumed | Groups are unordered. If order matters, provide an ordered slice from one constructor. |\n| Constructors with side effects | Side effects belong in OnStart — constructors should be cheap and pure-ish, since they may run concurrently and lazily. |\n| Forgotten `fx.Invoke` | Without an Invoke (or downstream consumer), constructors never run. Add at least one Invoke per app. |\n\n## Testing\n\nUse `go.uber.org\u002Ffx\u002Ffxtest` to integrate fx with `*testing.T` (failures call `t.Fatal`, `RequireStop` registers as `t.Cleanup`). `fx.Populate(&target)` pulls values out of the graph; `fx.Replace` swaps real dependencies for fakes. Full patterns in [testing.md](.\u002Freferences\u002Ftesting.md).\n\n## Further Reading\n\n- [advanced.md](.\u002Freferences\u002Fadvanced.md) — Supply\u002FReplace\u002FDecorate, optional deps, custom event logging, manual lifecycle, full Quick Reference\n- [recipes.md](.\u002Freferences\u002Frecipes.md) — full HTTP service with database\u002Fmetrics, background workers with graceful drain, multiple impls of the same interface, manual lifecycle for CLI embedding\n- [testing.md](.\u002Freferences\u002Ftesting.md) — fxtest patterns, `fx.Replace`, `fx.Populate`, isolated lifecycle tests, CI graph validation\n\n## Cross-References\n\n- → See `samber\u002Fcc-skills-golang@golang-uber-dig` skill for the underlying container, `dig.In`\u002F`dig.Out`, and DI without lifecycle\n- → See `samber\u002Fcc-skills-golang@golang-dependency-injection` skill for DI concepts and library comparison\n- → See `samber\u002Fcc-skills-golang@golang-samber-do` skill for a generics-based alternative without reflection\n- → See `samber\u002Fcc-skills-golang@golang-google-wire` skill for compile-time DI (no runtime container)\n- → See `samber\u002Fcc-skills-golang@golang-structs-interfaces` skill for interface design patterns\n- → See `samber\u002Fcc-skills-golang@golang-context` skill for context propagation in OnStart\u002FOnStop hooks\n- → See `samber\u002Fcc-skills-golang@golang-testing` skill for general testing patterns\n\nIf you encounter a bug or unexpected behavior in uber-go\u002Ffx, open an issue at \u003Chttps:\u002F\u002Fgithub.com\u002Fuber-go\u002Ffx\u002Fissues>.\n","**Persona:** You are a Go architect building a long-running service with fx. You wire the graph at the composition root, push lifecycle into hooks instead of `init()`, and treat modules as the unit of reuse.\n\n# Using uber-go\u002Ffx for Application Wiring in Go\n\nApplication framework combining a reflection-based DI container (built on `uber-go\u002Fdig`) with a lifecycle, module system, signal-aware run loop, and structured event logging. For long-running services where boot order, graceful shutdown, and modular composition matter.\n\n**Official Resources:**\n\n- [pkg.go.dev\u002Fgo.uber.org\u002Ffx](https:\u002F\u002Fpkg.go.dev\u002Fgo.uber.org\u002Ffx)\n- [uber-go.github.io\u002Ffx](https:\u002F\u002Fuber-go.github.io\u002Ffx\u002F)\n- [github.com\u002Fuber-go\u002Ffx](https:\u002F\u002Fgithub.com\u002Fuber-go\u002Ffx)\n\nThis skill is not exhaustive. Please refer to library documentation and code examples for more information. For Go package docs, symbols, versions, importers, and known vulnerabilities, → See `samber\u002Fcc-skills-golang@golang-pkg-go-dev` skill (`godig`) — prefer it over Context7 for Go package facts. To navigate this library's usage in your own code (definitions, call sites, diagnostics), → See `samber\u002Fcc-skills-golang@golang-gopls` skill (`gopls`). Context7 remains a fallback for docs not indexed on pkg.go.dev.\n\n```bash\ngo get go.uber.org\u002Ffx\n```\n\n## fx vs. dig\n\nfx is built on top of dig and shares the same reflection-based container engine. The DI primitives (`Provide`, `Invoke`, `In`\u002F`Out` structs, named values, value groups) are identical — `fx.In`\u002F`fx.Out` are re-exports of `dig.In`\u002F`dig.Out`.\n\nWhat fx adds on top:\n\n| Concern | dig | fx |\n| --- | --- | --- |\n| DI container | ✅ `dig.New()` | ✅ (embedded) |\n| Lifecycle hooks | ❌ | ✅ `fx.Lifecycle` OnStart\u002FOnStop |\n| Module system | ❌ | ✅ `fx.Module` with scoped decorators |\n| Signal-aware run loop | ❌ | ✅ `app.Run()` blocks on SIGINT\u002FSIGTERM |\n| Structured event logging | ❌ | ✅ `fx.WithLogger` \u002F `fxevent` |\n| Startup\u002Fshutdown timeout | ❌ | ✅ `fx.StartTimeout` \u002F `fx.StopTimeout` |\n\n**Choose fx** for long-running services (HTTP servers, workers, daemons) — lifecycle and signal handling are mandatory there, and modules make large service graphs manageable.\n\n**Choose raw dig** when you need wiring without a framework: CLI tools, libraries that expose a container to callers, test harnesses, or embedding DI into an existing app that manages its own lifecycle. See `samber\u002Fcc-skills-golang@golang-uber-dig` skill.\n\n## The Application\n\n```go\nimport \"go.uber.org\u002Ffx\"\n\napp := fx.New(\n    fx.Provide(NewLogger, NewDatabase, NewServer),\n    fx.Invoke(RegisterRoutes),\n)\napp.Run() \u002F\u002F blocks until SIGINT\u002FSIGTERM, then runs OnStop hooks\n```\n\nBoot stages: `fx.New` validates types (constructors do not run); `app.Start(ctx)` runs each `fx.Invoke` and fires OnStart hooks in topological order; main blocks on `app.Done()`; `app.Stop(ctx)` fires OnStop hooks in reverse order. Default timeout is **15 seconds** — override with `fx.StartTimeout` \u002F `fx.StopTimeout`.\n\n## Provide and Invoke\n\n```go\nfx.New(\n    fx.Provide(NewLogger, NewDatabase, NewServer),  \u002F\u002F lazy\n    fx.Invoke(RegisterRoutes, StartMetricsExporter), \u002F\u002F always run during Start\n)\n```\n\n`fx.Provide` registers constructors; `fx.Invoke` is the trigger — without an Invoke (directly or transitively) referencing a type, its constructor never runs.\n\n## Lifecycle Hooks\n\nInject `fx.Lifecycle` and append hooks. Constructors should return quickly; long-running work belongs in `OnStart`.\n\n```go\nfunc NewHTTPServer(lc fx.Lifecycle, log *zap.Logger, cfg *Config) *http.Server {\n    srv := &http.Server{Addr: cfg.Addr}\n\n    lc.Append(fx.Hook{\n        OnStart: func(ctx context.Context) error {\n            ln, err := net.Listen(\"tcp\", srv.Addr)\n            if err != nil { return err }\n            go srv.Serve(ln)         \u002F\u002F blocking work in a goroutine\n            return nil\n        },\n        OnStop: func(ctx context.Context) error {\n            return srv.Shutdown(ctx)\n        },\n    })\n    return srv\n}\n```\n\nBoth callbacks receive a context bounded by `StartTimeout`\u002F`StopTimeout` — respect cancellation. **OnStart must return quickly** — spawn a goroutine for blocking work; otherwise startup hangs and dependent hooks never fire.\n\n`fx.StartHook` \u002F `fx.StopHook` \u002F `fx.StartStopHook` adapt simpler signatures (no context, no error, or both):\n\n```go\nlc.Append(fx.StartStopHook(srv.Start, srv.Stop))   \u002F\u002F matched pair\n```\n\n## Parameter and Result Objects\n\nfx re-exports dig's `dig.In` \u002F `dig.Out` as `fx.In` \u002F `fx.Out`. Use them when a constructor has 4+ dependencies, or when you need `name`\u002F`group`\u002F`optional` tags.\n\n```go\ntype ServerParams struct {\n    fx.In\n\n    Logger *zap.Logger\n    DB     *sql.DB\n    Cache  *redis.Client     `optional:\"true\"`\n    Routes []http.Handler    `group:\"routes\"`\n}\n\nfunc NewServer(p ServerParams) *Server { \u002F* ... *\u002F }\n```\n\n## fx.Annotate\n\n`fx.Annotate` wraps a constructor to add tags or interface bindings without a `fx.Out` struct. Prefer it for ergonomic name\u002Fgroup\u002FAs bindings:\n\n```go\nfx.Provide(\n    fx.Annotate(NewPrimaryDB, fx.ResultTags(`name:\"primary\"`)),\n    fx.Annotate(NewPostgresDB, fx.As(new(Database))),    \u002F\u002F expose interface\n    fx.Annotate(NewUserHandler,\n        fx.As(new(http.Handler)),\n        fx.ResultTags(`group:\"routes\"`),\n    ),\n)\n```\n\n## Value Groups\n\nMany constructors, one consumer slice — typical for routes, health checks, metrics collectors:\n\n```go\ntype RouteResult struct {\n    fx.Out\n    Handler http.Handler `group:\"routes\"`\n}\n\ntype ServerParams struct {\n    fx.In\n    Routes []http.Handler `group:\"routes\"`\n}\n```\n\nAppend `,flatten` (`group:\"routes,flatten\"`) to unwrap a slice instead of nesting it. Order is **not guaranteed** — provide an explicit ordered slice when sequence matters.\n\n## fx.Module\n\n`fx.Module` groups providers, invokes, and decorators under a name. Modules **scope decorators** to themselves and their children — a logger renamed in `fx.Module(\"db\", ...)` only appears renamed for code inside that module.\n\n```go\nvar DatabaseModule = fx.Module(\"database\",\n    fx.Provide(NewConnection, NewUserRepository),\n    fx.Decorate(func(log *zap.Logger) *zap.Logger {\n        return log.Named(\"db\")\n    }),\n)\n\nfunc main() {\n    fx.New(\n        fx.Provide(NewConfig, NewLogger),\n        DatabaseModule,\n        HTTPModule,\n    ).Run()\n}\n```\n\nTreat each module as a small library that can be lifted into another app — its public surface is the types it Provides.\n\nFor `fx.Supply`\u002F`fx.Replace`\u002F`fx.Decorate`, optional deps, custom logging, manual lifecycle, and Quick Reference, see [advanced.md](.\u002Freferences\u002Fadvanced.md).\n\n## Best Practices\n\n1. Keep `main()` thin — providers, modules, and a single `Run()`. Push real work into modules so each can be tested in isolation.\n2. Use lifecycle hooks instead of `init()` or goroutines launched from constructors — Start\u002FStop ordering depends on graph topology, but `init()` goroutines do not, which leads to races and leaks.\n3. OnStart must return promptly — long work goes in a goroutine inside the hook. A blocking OnStart hangs the rest of the boot.\n4. Respect `ctx.Done()` in hooks — a hook that ignores cancellation is reported as a timeout failure but its goroutine continues, leaking resources.\n5. Group by module, not by layer — a module owns the providers, lifecycle, and decorators for one concern (HTTP, DB, metrics).\n6. Use `fx.Annotate` for tags rather than wrapping a constructor in an `fx.Out` struct — keeps the constructor reusable outside fx.\n7. Replace `fx.Provide` with `fx.Supply` for pre-built values (config, command-line flags). Shorter, signals intent.\n8. Validate the graph in CI by booting under `fx.New(...).Err()` — catches missing providers and cycles before deploy.\n\n## Common Mistakes\n\n| Mistake | Fix |\n| --- | --- |\n| Long-running work directly in OnStart | Spawn a goroutine inside OnStart; the hook itself must return quickly so dependent hooks can run. |\n| `fx.Provide` something that should be `fx.Supply` | Pre-built values (config, secrets) belong in `fx.Supply` — clearer and avoids a no-op constructor. |\n| Module decorator leaking to siblings | Decorate inside `fx.Module(...)` — decorators flow only to descendants. A top-level `fx.Decorate` is global. |\n| Group order assumed | Groups are unordered. If order matters, provide an ordered slice from one constructor. |\n| Constructors with side effects | Side effects belong in OnStart — constructors should be cheap and pure-ish, since they may run concurrently and lazily. |\n| Forgotten `fx.Invoke` | Without an Invoke (or downstream consumer), constructors never run. Add at least one Invoke per app. |\n\n## Testing\n\nUse `go.uber.org\u002Ffx\u002Ffxtest` to integrate fx with `*testing.T` (failures call `t.Fatal`, `RequireStop` registers as `t.Cleanup`). `fx.Populate(&target)` pulls values out of the graph; `fx.Replace` swaps real dependencies for fakes. Full patterns in [testing.md](.\u002Freferences\u002Ftesting.md).\n\n## Further Reading\n\n- [advanced.md](.\u002Freferences\u002Fadvanced.md) — Supply\u002FReplace\u002FDecorate, optional deps, custom event logging, manual lifecycle, full Quick Reference\n- [recipes.md](.\u002Freferences\u002Frecipes.md) — full HTTP service with database\u002Fmetrics, background workers with graceful drain, multiple impls of the same interface, manual lifecycle for CLI embedding\n- [testing.md](.\u002Freferences\u002Ftesting.md) — fxtest patterns, `fx.Replace`, `fx.Populate`, isolated lifecycle tests, CI graph validation\n\n## Cross-References\n\n- → See `samber\u002Fcc-skills-golang@golang-uber-dig` skill for the underlying container, `dig.In`\u002F`dig.Out`, and DI without lifecycle\n- → See `samber\u002Fcc-skills-golang@golang-dependency-injection` skill for DI concepts and library comparison\n- → See `samber\u002Fcc-skills-golang@golang-samber-do` skill for a generics-based alternative without reflection\n- → See `samber\u002Fcc-skills-golang@golang-google-wire` skill for compile-time DI (no runtime container)\n- → See `samber\u002Fcc-skills-golang@golang-structs-interfaces` skill for interface design patterns\n- → See `samber\u002Fcc-skills-golang@golang-context` skill for context propagation in OnStart\u002FOnStop hooks\n- → See `samber\u002Fcc-skills-golang@golang-testing` skill for general testing patterns\n\nIf you encounter a bug or unexpected behavior in uber-go\u002Ffx, open an issue at \u003Chttps:\u002F\u002Fgithub.com\u002Fuber-go\u002Ffx\u002Fissues>.\n",{"name":5,"license":15,"metadata":24,"description":7,"allowed-tools":35,"compatibility":36,"user-invocable":37},{"author":25,"version":26,"openclaw":27},"samber","1.1.3",{"emoji":28,"install":29,"homepage":30,"requires":31,"skill-library-version":34},"🏭",[],"https:\u002F\u002Fgithub.com\u002Fsamber\u002Fcc-skills-golang",{"bins":32},[33],"go","1.24.0","Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent WebFetch mcp__context7__resolve-library-id mcp__context7__query-docs Bash(godig:*) Bash(gopls:*) LSP mcp__gopls__*","Designed for Claude Code or similar AI coding agents, and for projects using Golang.",true,"main","a93764baed707eda5a68d91e19e5719368e6335e","skills-backup\u002Fskills\u002Fgolang-uber-fx",0,"https:\u002F\u002Fgithub.com\u002FCCH-HQ\u002Fcchp-automation","https:\u002F\u002Fgithub.com\u002FCCH-HQ","https:\u002F\u002Fclaude-code-hub.app\u002F","2026-11-09 20:50:54",{"source":8,"skillName":5,"commands":47,"prompt":57,"zipAvailable":37},[48,51,54],{"tool":49,"command":50},"npx","npx skills add CCH-HQ\u002Fcchp-automation --skill golang-uber-fx",{"tool":52,"command":53},"bunx","bunx skills add CCH-HQ\u002Fcchp-automation --skill golang-uber-fx",{"tool":55,"command":56},"pnpm","pnpm dlx skills add CCH-HQ\u002Fcchp-automation --skill golang-uber-fx","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FCCH-HQ\u002Fcchp-automation\u002Fblob\u002Fmain\u002Fskills-backup\u002Fskills\u002Fgolang-uber-fx\u002FSKILL.md",[59,65,69,73],{"path":60,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":63,"sourceHtmlUrl":64},"evals\u002Fevals.json","REFERENCE","参考文档",12825,"https:\u002F\u002Fgithub.com\u002FCCH-HQ\u002Fcchp-automation\u002Fblob\u002Fmain\u002Fskills-backup\u002Fskills\u002Fgolang-uber-fx\u002Fevals\u002Fevals.json",{"path":66,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":67,"sourceHtmlUrl":68},"references\u002Fadvanced.md",5011,"https:\u002F\u002Fgithub.com\u002FCCH-HQ\u002Fcchp-automation\u002Fblob\u002Fmain\u002Fskills-backup\u002Fskills\u002Fgolang-uber-fx\u002Freferences\u002Fadvanced.md",{"path":70,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":71,"sourceHtmlUrl":72},"references\u002Frecipes.md",8118,"https:\u002F\u002Fgithub.com\u002FCCH-HQ\u002Fcchp-automation\u002Fblob\u002Fmain\u002Fskills-backup\u002Fskills\u002Fgolang-uber-fx\u002Freferences\u002Frecipes.md",{"path":74,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":75,"sourceHtmlUrl":76},"references\u002Ftesting.md",4240,"https:\u002F\u002Fgithub.com\u002FCCH-HQ\u002Fcchp-automation\u002Fblob\u002Fmain\u002Fskills-backup\u002Fskills\u002Fgolang-uber-fx\u002Freferences\u002Ftesting.md",[78,85,92,99,106,113],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M79B44RKSB6Z0GENGYFCCZYA","writing-skills","Use when creating new skills, editing existing skills, or verifying skills work before deployment","https:\u002F\u002Fgithub.com\u002FCCH-HQ\u002Fcchp-automation\u002Fblob\u002Fmain\u002Fskills-backup\u002Fskills\u002Fwriting-skills\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M79B410BHDSNHZ7MKAYXWJHS","writing-plans","Use when you have a spec or requirements for a multi-step task, before touching code","https:\u002F\u002Fgithub.com\u002FCCH-HQ\u002Fcchp-automation\u002Fblob\u002Fmain\u002Fskills-backup\u002Fskills\u002Fwriting-plans\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":19},"01M79B3XK29MCD5HGD50YGYXQZ","wizard","Generate an interactive bash wizard that walks a human through steps only they can perform. Use when provisioning infrastructure, setting up credentials or CI secrets, walking an unfamiliar third-party dashboard, or running a one-off migration or cutover. Don't invoke this for steps the agent can perform itself.","https:\u002F\u002Fgithub.com\u002FCCH-HQ\u002Fcchp-automation\u002Fblob\u002Fmain\u002Fskills-backup\u002Fskills\u002Fwizard\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":19},"01M79B3TFQEXXM2KK5V44H64DV","wayfinder","Plan a huge chunk of work — more than one agent session can hold — as a shared map of decision tickets on your issue tracker, and resolve them one at a time until the way to the destination is clear.","https:\u002F\u002Fgithub.com\u002FCCH-HQ\u002Fcchp-automation\u002Fblob\u002Fmain\u002Fskills-backup\u002Fskills\u002Fwayfinder\u002FSKILL.md",[],[],{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":19},"01M79B3Q3WTMJDM6NNGG1X4NYK","verification-before-completion","Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always","https:\u002F\u002Fgithub.com\u002FCCH-HQ\u002Fcchp-automation\u002Fblob\u002Fmain\u002Fskills-backup\u002Fskills\u002Fverification-before-completion\u002FSKILL.md",[],[],{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":19},"01M79B3GW8YCKT7W489HKWFMNC","vercel-react-best-practices","React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React\u002FNext.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.","https:\u002F\u002Fgithub.com\u002FCCH-HQ\u002Fcchp-automation\u002Fblob\u002Fmain\u002Fskills-backup\u002Fskills\u002Fvercel-react-best-practices\u002FSKILL.md",[],[]]