golang-uber-fx

Build Go applications with uber-go/fx modular composition and lifecycle hooks.

23|1|Updated May 10, 2026
One-click install
npx skills add https://github.com/berksunduri/GOPost --skill golang-uber-fx-berksunduri
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: golang-uber-fx
Source: https://github.com/berksunduri/GOPost/tree/main/.agents/skills/golang-uber-fx
Command: npx skills add https://github.com/berksunduri/GOPost --skill golang-uber-fx-berksunduri

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires go.uber.org/fx, go.uber.org/dig, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the challenge of creating complex Go applications with a focus on modularity, lifecycle management, and signal-awareness, leveraging the uber-go/fx framework.

Core Features & Use Cases

  • Modular Composition: Organize code into reusable modules with scoped decorators.
  • Lifecycle Hooks: Manage application startup and shutdown with hooks instead of init().
  • Signal-Aware Run Loop: Ensure graceful shutdown handling with signal-awareness.
  • Use Case: Ideal for building long-running services like HTTP servers, workers, and daemons where boot order, graceful shutdown, and modular composition are critical.

Quick Start

Use the golang-uber-fx skill to wire your Go application with uber-go/fx, providing necessary dependencies and configuring lifecycle hooks.

Frequently Asked Questions about golang-uber-fx

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage graceful shutdown for long-running Go services?▼

Manage graceful shutdown for long-running Go services by using uber-go/fx to provide a signal-aware run loop. This framework ensures your HTTP servers, workers, and daemons handle startup and shutdown safely without relying on manual signal handling.

What is the best way to handle dependency injection for modular Go applications?▼

Dependency injection for modular Go applications is best handled using uber-go/fx to organize code into reusable modules with scoped decorators. It provides a robust framework for wiring complex dependencies and managing application lifecycles efficiently.

How do I configure lifecycle hooks in a Go application without using init()?▼

Configure lifecycle hooks in a Go application by registering startup and shutdown functions with uber-go/fx instead of using init(). This approach manages boot order and ensures components are initialized and torn down cleanly during application execution.

Do I need go.uber.org/dig to use uber-go/fx for dependency injection?▼

Yes, you need go.uber.org/dig as it is a required dependency for using uber-go/fx. The fx framework builds upon dig to provide modular composition, lifecycle management, and signal-awareness for your Go applications.

When should I use uber-go/fx for wiring my Go application?▼

Use uber-go/fx for wiring your Go application when building long-running services like HTTP servers, workers, and daemons. It is ideal when boot order, graceful shutdown, and modular composition are critical requirements for your architecture.

Can I organize Go code into reusable modules with scoped decorators using dependency injection?▼

Yes, you can organize Go code into reusable modules with scoped decorators by leveraging uber-go/fx. This dependency injection framework enables robust, modular composition to wire complex applications while maintaining lifecycle awareness.