17th-go-patterns

Organize Go projects with Clean Architecture, DI, and repository patterns.

Updated Jan 23, 2026
One-click install
npx skills add https://github.com/SeventeenthEarth/glm-worker-mcp --skill 17th-go-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: 17th-go-patterns
Source: https://github.com/SeventeenthEarth/glm-worker-mcp/tree/main/skills/17th-go-patterns
Command: npx skills add https://github.com/SeventeenthEarth/glm-worker-mcp --skill 17th-go-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps Go teams structure projects around Clean Architecture, dependency direction, and reusable patterns to keep code maintainable as it grows.

Core Features & Use Cases

  • Pattern guidance: Clean Architecture layout, dependency rules, and module boundaries.
  • DI & wiring: Guidance on dependency injection and Wire-based wiring across layers.
  • Use-case centered design: Separation of domain, application, and data layers with testable boundaries.
  • Use Case Example: Imagine building a Go service with domain entities, repositories, and gRPC protocol; you apply the patterns to reduce coupling and improve testability.

Quick Start

Start by organizing your Go project with internal/feature-like modules, define domain, application, and data layers, then wire dependencies using a DI provider.

Frequently Asked Questions about 17th-go-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 dependency injection?

Structure a Go project by separating domain, application, and data layers into internal modules, enforcing dependency direction toward the domain, and wiring dependencies with a DI provider to reduce coupling and improve testability.

What is the repository pattern in Go and when should I use it?

The repository pattern in Go abstracts data layer access behind interfaces, keeping domain and application layers decoupled from sql mapping and data sources; use it when building scalable services needing testable boundaries and clear module separation.

Does Wire work with Clean Architecture for dependency injection in Go?

Yes, Wire works with Clean Architecture by generating DI providers that wire dependencies across domain, application, and data layers, enforcing dependency direction and reducing manual wiring errors in scalable Go services.

How do I enforce dependency direction across Go packages?

Enforce dependency direction in Go by organizing internal modules with clear boundaries, defining repository interfaces in the domain layer, and ensuring application and data layers depend inward toward domain entities, preventing circular dependencies and reducing coupling.

What's the best way to organize Go domain, application, and data layers?

The best way to organize Go layers is to isolate domain entities and repository interfaces in the domain layer, place use-case logic in the application layer, and restrict sql mapping and data access to the data layer, wiring them together with a DI provider.