[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6CFNVGEZSTMZT2ZQSQQSXN3":3,"skill-same:01M6CFNVGEZSTMZT2ZQSQQSXN3":102},{"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":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":60,"commitSha":61,"skillDirectory":62,"forksCount":63,"repositoryHtmlUrl":64,"repositoryHomepageUrl":6,"ownerHtmlUrl":65,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":66,"install":67,"resources":79},"01M6CFNVGEZSTMZT2ZQSQQSXN3","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 `golang-uber-dig` skill.","rockcookies\u002Fskills","rockcookies","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F3498265?v=4","01M6CF9C16X3SDSKZX6ANH7HQM","Jacob He","01M6CF9C53JP821FCW6R9B00AJ",1,"MIT","https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fsamber-golang\u002Fgolang-uber-fx\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"golang uber fx","golang","lifecycle","context7","hooks","webfetch","write","read","projects","gopls","Bash","MCP","services","https","harness","code","lint","run","codex","github","2026-11-10 10:12:30",false,"---\nname: golang-uber-fx\ndescription: >-\n  Golang application framework using uber-go\u002Ffx — fx.New, fx.Provide, fx.Invoke,\n  fx.Module, fx.Lifecycle hooks, fx.Annotate (name\u002Fgroup\u002FAs), fx.Decorate,\n  fx.Supply, fx.Replace, fx.WithLogger, and signal-aware Run(). Apply when using\n  or adopting uber-go\u002Ffx, when the codebase imports `go.uber.org\u002Ffx`, or when\n  wiring services with fx.New. For raw DI without lifecycle, see\n  `golang-uber-dig` skill.\nuser-invocable: true\nlicense: MIT\ncompatibility: >-\n  Designed for Claude Code, Codex or similar harness, and for projects using\n  Golang.\nmetadata:\n  author: samber\n  version: 1.2.0\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: >-\n  Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent\n  WebFetch mcp__context7__resolve-library-id mcp__context7__query-docs\n  Bash(godig:*) Bash(gopls:*) LSP mcp__gopls__*\npaths:\n  - '**\u002F*.go'\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 `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 `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 `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 `golang-uber-dig` skill for the underlying container, `dig.In`\u002F`dig.Out`, and DI without lifecycle\n- → See `golang-dependency-injection` skill for DI concepts and library comparison\n- → See `golang-samber-do` skill for a generics-based alternative without reflection\n- → See `golang-google-wire` skill for compile-time DI (no runtime container)\n- → See `golang-structs-interfaces` skill for interface design patterns\n- → See `golang-context` skill for context propagation in OnStart\u002FOnStop hooks\n- → See `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 `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 `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 `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 `golang-uber-dig` skill for the underlying container, `dig.In`\u002F`dig.Out`, and DI without lifecycle\n- → See `golang-dependency-injection` skill for DI concepts and library comparison\n- → See `golang-samber-do` skill for a generics-based alternative without reflection\n- → See `golang-google-wire` skill for compile-time DI (no runtime container)\n- → See `golang-structs-interfaces` skill for interface design patterns\n- → See `golang-context` skill for context propagation in OnStart\u002FOnStop hooks\n- → See `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,"paths":44,"license":15,"metadata":46,"description":7,"allowed-tools":57,"compatibility":58,"user-invocable":59},[45],"**\u002F*.go",{"author":47,"version":48,"openclaw":49},"samber","1.2.0",{"emoji":50,"install":51,"homepage":52,"requires":53,"skill-library-version":56},"?",[],"https:\u002F\u002Fgithub.com\u002Fsamber\u002Fcc-skills-golang",{"bins":54},[55],"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, Codex or similar harness, and for projects using Golang.",true,"main","c349be0704bffe54a7191d1412faf564b08983ca","skills\u002Fsamber-golang\u002Fgolang-uber-fx",0,"https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills","https:\u002F\u002Fgithub.com\u002Frockcookies","2026-11-12 14:42:52",{"source":8,"skillName":5,"commands":68,"prompt":78,"zipAvailable":59},[69,72,75],{"tool":70,"command":71},"npx","npx skills add rockcookies\u002Fskills --skill golang-uber-fx",{"tool":73,"command":74},"bunx","bunx skills add rockcookies\u002Fskills --skill golang-uber-fx",{"tool":76,"command":77},"pnpm","pnpm dlx skills add rockcookies\u002Fskills --skill golang-uber-fx","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fsamber-golang\u002Fgolang-uber-fx\u002FSKILL.md",[80,86,90,94,98],{"path":81,"resourceType":82,"resourceTypeDesc":83,"sizeBytes":84,"sourceHtmlUrl":85},"evals\u002Fevals.json","REFERENCE","参考文档",12825,"https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fsamber-golang\u002Fgolang-uber-fx\u002Fevals\u002Fevals.json",{"path":87,"resourceType":82,"resourceTypeDesc":83,"sizeBytes":88,"sourceHtmlUrl":89},"README.md",5406,"https:\u002F\u002Fgithub.com\u002Fcompozy\u002Fcompozy\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fhumanizer\u002FREADME.md",{"path":91,"resourceType":82,"resourceTypeDesc":83,"sizeBytes":92,"sourceHtmlUrl":93},"references\u002Fadvanced.md",5011,"https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fsamber-golang\u002Fgolang-uber-fx\u002Freferences\u002Fadvanced.md",{"path":95,"resourceType":82,"resourceTypeDesc":83,"sizeBytes":96,"sourceHtmlUrl":97},"references\u002Frecipes.md",8118,"https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fsamber-golang\u002Fgolang-uber-fx\u002Freferences\u002Frecipes.md",{"path":99,"resourceType":82,"resourceTypeDesc":83,"sizeBytes":100,"sourceHtmlUrl":101},"references\u002Ftesting.md",4240,"https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fsamber-golang\u002Fgolang-uber-fx\u002Freferences\u002Ftesting.md",[103,135,159,180,206,220],{"skillNo":104,"name":105,"nameZh":106,"description":107,"descriptionZh":108,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":109,"sourceHtmlUrl":110,"categories":111,"keywords":122,"publishedAt":134},"01M6CFPKHRH0GD3W2GTGWE9WGP","kami","Kami 专业文档排版","Typeset professional documents with Kami templates: resumes, one-pagers, white papers, letters, portfolios, and slide decks. Use when asked to 做 PDF \u002F 排版 \u002F 简历 \u002F 一页纸 \u002F PPT \u002F slides, or to create a Kami landing page. Not for auditing or restyling an existing product site.","使用 Kami 模板排版专业文档：简历、一页纸、白皮书、信件、作品集和幻灯片。当用户要求做 PDF \u002F 排版 \u002F 简历 \u002F 一页纸 \u002F PPT \u002F slides，或创建 Kami 落地页时使用。不适用于审查或重新设计现有产品网站。","https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Ftw93-kami\u002Fkami\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Ftw93-kami\u002Fkami\u002FSKILL.md",[112,117],{"categoryNo":113,"categoryName":114,"taxonomyType":115,"taxonomyTypeDesc":116},"01M8BQ6TK1MPB82068236GSXDE","文档处理","SCENARIO","使用场景",{"categoryNo":118,"categoryName":119,"taxonomyType":120,"taxonomyTypeDesc":121},"01M8C55A3R2M9C8CAKG3W16HTA","内容创作者","PROFESSION","适用职业",[105,123,124,125,126,127,128,129,130,131,132,133],"create","PDF","pptx","slides","product","page","landing","templates","site","use","documents","2026-11-12 13:55:43",{"skillNo":136,"name":137,"nameZh":6,"description":138,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":139,"categories":140,"keywords":141,"publishedAt":39},"01M6WMNKD3Y4H9FGM8Q901F507","hierarchical-agents-md","层级 AGENTS.md \u002F README.md：init、update、audit、reorganize、trim。 初始化 Agent 指令、代码改动后同步文档、检查文档漂移、重组仓库文档层级、精简规则与 Skills。 Not for 写业务代码或生成文档站点。","https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcustom\u002Fhierarchical-agents-md\u002FSKILL.md",[],[142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158],"hierarchical agents md","agents md","packages","change","maintenance","初始化","audit","for","README","update","python","init","git","true","party","third-party","文档",{"skillNo":160,"name":161,"nameZh":162,"description":163,"descriptionZh":164,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":165,"categories":166,"keywords":173,"publishedAt":39},"01M6CFS6BRTQPFZCDHQP97HYXR","vueuse-functions","VueUse 组合式函数应用","Apply VueUse composables where appropriate to build concise, maintainable Vue.js \u002F Nuxt features.","在合适的地方应用 VueUse 组合式函数（composables），以构建简洁、可维护的 Vue.js \u002F Nuxt 功能。","https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fvueuse\u002Fvueuse-functions\u002FSKILL.md",[167,170],{"categoryNo":168,"categoryName":169,"taxonomyType":120,"taxonomyTypeDesc":121},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师",{"categoryNo":171,"categoryName":172,"taxonomyType":115,"taxonomyTypeDesc":116},"01M8BRASNPVNJVQQJ4KZX8XM5D","前端开发与界面实现",[174,175,176,32,177,178,38,179],"vueuse functions","functions","nuxt","vue","build","js",{"skillNo":181,"name":182,"nameZh":183,"description":184,"descriptionZh":185,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":186,"categories":187,"keywords":194,"publishedAt":39},"01M6CFS34MDQXZPAWQFE5D7VGT","vue-testing-best-practices","Vue.js 测试最佳实践","Use for Vue.js testing. Covers Vitest, Vue Test Utils, component testing, mocking, testing patterns, and Playwright for E2E testing.","用于 Vue.js 测试。涵盖 Vitest、Vue Test Utils、组件测试、模拟（mocking）、测试模式，以及用于 E2E 测试的 Playwright。","https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fvuejs-ai\u002Fvue-testing-best-practices\u002FSKILL.md",[188,191],{"categoryNo":189,"categoryName":190,"taxonomyType":120,"taxonomyTypeDesc":121},"01M8BQGD5WG86P4AQ5GPSSKBFR","测试工程师",{"categoryNo":192,"categoryName":193,"taxonomyType":115,"taxonomyTypeDesc":116},"01M8BQJH394GT47X57A9Q8G7HX","测试与质量保障",[195,196,197,177,198,179,199,200,132,201,202,203,38,204,205],"vue testing best practices","testing","testing best practices","best practices","e2e testing","playwright","test","testing patterns","component","vitest","e2e",{"skillNo":207,"name":208,"nameZh":209,"description":210,"descriptionZh":211,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":212,"categories":213,"keywords":216,"publishedAt":39},"01M6CFS0N19MSJNTVM9AEQ7Z73","vue-router-best-practices","Vue Router 路由最佳实践","Vue Router 4 patterns, navigation guards, route params, and route-component lifecycle interactions.","Vue Router 4 模式、导航守卫、路由参数以及路由与组件生命周期的交互。","https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fvuejs-ai\u002Fvue-router-best-practices\u002FSKILL.md",[214,215],{"categoryNo":168,"categoryName":169,"taxonomyType":120,"taxonomyTypeDesc":121},{"categoryNo":171,"categoryName":172,"taxonomyType":115,"taxonomyTypeDesc":116},[198,217,177,218,203,38,219,21],"vue router best practices","router","navigation",{"skillNo":221,"name":222,"nameZh":223,"description":224,"descriptionZh":225,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":226,"categories":227,"keywords":230,"publishedAt":39},"01M6CFRYN31RFQFTE41Z6DCGKE","vue-pinia-best-practices","Pinia 状态管理最佳实践","Pinia stores, state management patterns, store setup, and reactivity with stores.","Pinia store、状态管理模式、store 配置以及 store 的响应式处理。","https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fvuejs-ai\u002Fvue-pinia-best-practices\u002FSKILL.md",[228,229],{"categoryNo":168,"categoryName":169,"taxonomyType":120,"taxonomyTypeDesc":121},{"categoryNo":171,"categoryName":172,"taxonomyType":115,"taxonomyTypeDesc":116},[231,198,177,232,38,233,234,235,236],"vue pinia best practices","pinia","state","state management","management","setup"]