go-create-usecase

Generate Go use-case implementations with ports, validation, tracing, and metrics.

Updated Jan 4, 2026
One-click install
npx skills add https://github.com/cristiano-pacheco/ai-rules --skill go-create-usecase
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-create-usecase
Source: https://github.com/cristiano-pacheco/ai-rules/tree/main/skills/go-create-usecase
Command: npx skills add https://github.com/cristiano-pacheco/ai-rules --skill go-create-usecase

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Generates Go use-case implementations that depend on ports (interfaces) rather than concrete implementations, enabling consistent, maintainable orchestration of domain actions.

Core Features & Use Cases

  • Produces a dedicated file per operation named <operation>_usecase.go under internal/modules/<module>/usecase/, following the standard naming conventions described in the skill.
  • Enforces consistent use-case structure: input/output DTOs, a use-case struct, constructor, public Execute with metrics, and a private execute with tracing.
  • Coordinates workflows through ports-based interfaces, repository/service orchestration, and optional instrumentation via OpenTelemetry tracing and metrics.

Quick Start

Provide the operation name and module path to generate a complete use case file named <operation>_usecase.go wired for Fx integration.

Frequently Asked Questions about go-create-usecase

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

FAQPage Schema
How do I structure Go use cases with ports-based dependency injection?

You structure Go use cases by defining input/output DTOs, a use-case struct, a constructor, and a public Execute method. This structure orchestrates repositories via ports-based interfaces, keeping domain actions maintainable and decoupled.

How do I add OpenTelemetry tracing and metrics to a Go use case?

You add OpenTelemetry tracing and metrics by implementing a private execute method for tracing and a public Execute method for metrics collection. This pattern enforces consistent instrumentation across your Go domain action orchestration.

What is the standard file structure for Go use case implementations?

The standard file structure places a dedicated file per operation named <operation>_usecase.go under internal/modules/<module>/usecase/. This enforces consistent naming conventions for domain actions such as create, update, list, or delete.

Can I use Fx dependency injection wiring for Go use cases?

Yes, you can use Fx dependency injection wiring for Go use cases. The generated implementations are explicitly wired for Fx integration, coordinating workflows through ports-based interfaces and standard constructors.

Does ports-based architecture require input validation in Go use cases?

Ports-based architecture requires input validation in Go use cases. The generation process enforces validation alongside OpenTelemetry tracing and metrics collection to ensure robust and consistent domain action orchestration.