[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7595Y01X02Z7XCPFNSPNN2Q":3,"skill-same:01M7595Y01X02Z7XCPFNSPNN2Q":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":6,"ownerDescription":44,"updatedAt":45,"install":46,"resources":58},"01M7595Y01X02Z7XCPFNSPNN2Q","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.","davidcoachdev\u002Fdcfiles","davidcoachdev","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F69812733?v=4","01M758C4BR16TAV1N47W319E9V","David H. Caycedo Blum.","01M758C4CCZA2ZYGA0BGMXCDRH",1,"MIT","https:\u002F\u002Fgithub.com\u002Fdavidcoachdev\u002Fdcfiles\u002Fblob\u002Fmain\u002Fconfig\u002F.config\u002Fopencode\u002Fskills\u002Fgolang-uber-fx\u002FSKILL.md",[],[],"2026-11-12 13:55:43",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 `golang-uber-dig` skill.\"\nuser-invocable: true\nlicense: MIT\ncompatibility: Designed for OpenCode or similar AI coding agents, and for projects using Golang.\nmetadata:\n  author: gentleman-programming\n  version: \"1.1.3\"\n  openclaw:\n    emoji: \"🏭\"\n    homepage: https:\u002F\u002Fgithub.com\u002Fgentleman-programming\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 `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,"license":15,"metadata":24,"description":7,"allowed-tools":35,"compatibility":36,"user-invocable":37},{"author":25,"version":26,"openclaw":27},"gentleman-programming","1.1.3",{"emoji":28,"install":29,"homepage":30,"requires":31,"skill-library-version":34},"🏭",[],"https:\u002F\u002Fgithub.com\u002Fgentleman-programming",{"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 OpenCode or similar AI coding agents, and for projects using Golang.",true,"main","5dc86f90a5cbe45db3acd917825461b3ed6937fb","config\u002F.config\u002Fopencode\u002Fskills\u002Fgolang-uber-fx",0,"https:\u002F\u002Fgithub.com\u002Fdavidcoachdev\u002Fdcfiles","https:\u002F\u002Fgithub.com\u002Fdavidcoachdev","🌐 Apasionado por crear soluciones web escalables y eficientes. \r\n🧑‍🏫 Coach Dev.\r\n💻 Frontend Dev. \r\n🎚️Backend Dev.\r\n📊 Agile\u002FScrum.\r\n🚀100% remoto.","2026-08-26 07:28:05",{"source":8,"skillName":5,"commands":47,"prompt":57,"zipAvailable":37},[48,51,54],{"tool":49,"command":50},"npx","npx skills add davidcoachdev\u002Fdcfiles --skill golang-uber-fx",{"tool":52,"command":53},"bunx","bunx skills add davidcoachdev\u002Fdcfiles --skill golang-uber-fx",{"tool":55,"command":56},"pnpm","pnpm dlx skills add davidcoachdev\u002Fdcfiles --skill golang-uber-fx","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fdavidcoachdev\u002Fdcfiles\u002Fblob\u002Fmain\u002Fconfig\u002F.config\u002Fopencode\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\u002Fdavidcoachdev\u002Fdcfiles\u002Fblob\u002Fmain\u002Fconfig\u002F.config\u002Fopencode\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\u002Fdavidcoachdev\u002Fdcfiles\u002Fblob\u002Fmain\u002Fconfig\u002F.config\u002Fopencode\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\u002Fdavidcoachdev\u002Fdcfiles\u002Fblob\u002Fmain\u002Fconfig\u002F.config\u002Fopencode\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\u002Fdavidcoachdev\u002Fdcfiles\u002Fblob\u002Fmain\u002Fconfig\u002F.config\u002Fopencode\u002Fskills\u002Fgolang-uber-fx\u002Freferences\u002Ftesting.md",[78,86,93,100,107,114],{"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":82,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M7740FETMZY1VTYAEFY1TWY7","zustand-5","Zustand 5 state management patterns. Trigger: When managing React state with Zustand.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fdavidcoachdev\u002Fdcfiles\u002Fblob\u002Fmain\u002Fconfig\u002F.config\u002Fopencode\u002Fskills\u002Fzustand-5\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":82,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M773ZZM9V68SA1AKP4WF4J29","zod-4","Zod 4 schema validation patterns. Trigger: When using Zod for validation - breaking changes from v3.","https:\u002F\u002Fgithub.com\u002Fdavidcoachdev\u002Fdcfiles\u002Fblob\u002Fmain\u002Fconfig\u002F.config\u002Fopencode\u002Fskills\u002Fzod-4\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":82,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":19},"01M773ZJFR90CQAY0N9QR40QVP","x-bookmark-quote-posts","Workflow para revisar bookmarks de X\u002FTwitter y convertirlos en drafts de quote posts. Accede a la sección de bookmarks vía browser headless, extrae posts recientes, y genera drafts con voz personal del usuario. No publica ni muta X — solo genera contenido para revisión. Trigger: X bookmarks, Twitter bookmarks, quote posts, bookmark automation, crear quote posts, revisar bookmarks, growth content X.","https:\u002F\u002Fgithub.com\u002Fdavidcoachdev\u002Fdcfiles\u002Fblob\u002Fmain\u002Fconfig\u002F.config\u002Fopencode\u002Fskills\u002Fx-bookmark-quote-posts\u002FSKILL.md",[],[],{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":19},"01M773Z2RGV3786FV310SDB0YD","writing-skills","Use when creating new skills, editing existing skills, or verifying skills work before deployment","https:\u002F\u002Fgithub.com\u002Fdavidcoachdev\u002Fdcfiles\u002Fblob\u002Fmain\u002Fconfig\u002F.config\u002Fopencode\u002Fskills\u002Fwriting-skills\u002FSKILL.md",[],[],{"skillNo":108,"name":109,"nameZh":6,"description":110,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":111,"categories":112,"keywords":113,"publishedAt":19},"01M773YJH3KDSW467CSS63CSRJ","writing-plans","Use when you have a spec or requirements for a multi-step task, before touching code","https:\u002F\u002Fgithub.com\u002Fdavidcoachdev\u002Fdcfiles\u002Fblob\u002Fmain\u002Fconfig\u002F.config\u002Fopencode\u002Fskills\u002Fwriting-plans\u002FSKILL.md",[],[],{"skillNo":115,"name":116,"nameZh":6,"description":117,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":82,"licenseFileUrl":6,"sourceHtmlUrl":118,"categories":119,"keywords":120,"publishedAt":19},"01M773Y3S3H2CPRK5S8YFHWB5C","work-unit-commits","Plan commits as reviewable work units. Trigger: implementation, commit splitting, chained PRs, or keeping tests and docs with code.","https:\u002F\u002Fgithub.com\u002Fdavidcoachdev\u002Fdcfiles\u002Fblob\u002Fmain\u002Fconfig\u002F.config\u002Fopencode\u002Fskills\u002Fwork-unit-commits\u002FSKILL.md",[],[]]