golang-patterns

Organizes Go projects into domain, usecase, and infrastructure layers.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/MoneyForest/dotfiles --skill golang-patterns-moneyforest
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-patterns
Source: https://github.com/MoneyForest/dotfiles/tree/main/claude/skills/golang-patterns
Command: npx skills add https://github.com/MoneyForest/dotfiles --skill golang-patterns-moneyforest

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Golang-patterns provides a structured blueprint for applying Domain-Driven Design and Clean Architecture in Go projects, helping teams organize domain models, use cases, repositories, and infrastructure for scalability and maintainability.

Core Features & Use Cases

  • Domain-driven modeling with clear boundaries and explicit interfaces.
  • Layered architecture with domain, usecase, and infrastructure separation.
  • Practical skeleton layouts and best practices for Go services.

Quick Start

Create a new Go project following the provided domain/usecase/infrastructure skeleton and start implementing a simple order domain with repository and service layers.

Frequently Asked Questions about golang-patterns

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

FAQPage Schema
How do I structure a Go project using clean architecture and domain-driven design?

To structure a Go project with clean architecture and DDD, you separate domain models, use cases, and infrastructure into explicit layers. This blueprint enforces clear boundaries and explicit domain interfaces for scalable services.

What is the best way to refactor an existing Go service into domain-driven layers?

Refactoring a Go service into domain-driven layers involves introducing explicit domain interfaces and infrastructure implementations. You enforce a layered architecture to separate domain logic from infrastructure for better maintainability.

Can I use DDD patterns for new Go services to improve maintainability?

Yes, you can apply DDD patterns to new Go services to improve maintainability. The approach provides a structured skeleton that organizes domain models, use cases, and repositories with clear boundaries for scalable applications.

How do I set up usecase and repository layers in a Go application?

Setting up usecase and repository layers in a Go application requires creating a domain and infrastructure skeleton. You implement a simple domain with repository and service layers following the provided clean architecture layout.

Why does separating domain models from infrastructure matter in Go clean architecture?

Separating domain models from infrastructure matters in Go clean architecture because it enforces a layered structure with explicit domain interfaces. This separation improves maintainability and scalability by keeping business logic isolated.

When should I not use a layered architecture for my Go project?

You should reconsider a layered architecture for your Go project if the application is too simple to require explicit domain interfaces. Complex DDD and clean architecture patterns add structural overhead that may not benefit small, straightforward services.