golang-clean-architecture

Audit Go services for Clean Architecture violations and dependency rules.

16|2|Updated Jan 21, 2026
One-click install
npx skills add https://github.com/saifoelloh/golang-best-practices-skill --skill golang-clean-architecture
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-clean-architecture
Source: https://github.com/saifoelloh/golang-best-practices-skill/tree/main/clean-architecture
Command: npx skills add https://github.com/saifoelloh/golang-best-practices-skill --skill golang-clean-architecture

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill ensures your Go services adhere to Clean Architecture principles, promoting maintainable, testable, and scalable code by enforcing strict layering and dependency rules.

Core Features & Use Cases

  • Architecture Auditing: Analyzes Go codebases to identify violations of Clean Architecture principles, such as business logic in delivery or repository layers.
  • Dependency Rule Enforcement: Verifies that dependencies flow inward, from outer layers (delivery) to inner layers (domain), preventing tight coupling.
  • Use Case: When reviewing a new microservice, use this Skill to automatically flag any instances where the gRPC handler directly accesses the database or where the domain layer imports infrastructure packages.

Quick Start

Use the golang-clean-architecture skill to audit the Go codebase located in the current directory.

Frequently Asked Questions about golang-clean-architecture

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

FAQPage Schema
How do I audit Go code for Clean Architecture violations?

To enforce dependency rules in Go services, verify that dependencies flow inward from outer delivery layers to inner domain layers, preventing tight coupling and ensuring infrastructure packages are not imported by the domain.

Why does my gRPC handler directly access the database in my Go microservice?

The separation of concerns principle in Go requires dividing your application into layers where delivery handlers manage requests, use cases handle business logic, and repositories manage data, ensuring no layer oversteps its boundaries.

Can I use dependency injection to separate concerns in a Go service?

Yes, you can use dependency injection to separate concerns in a Go service by injecting dependencies from outer layers to inner layers, enforcing the dependency rule where inner layers remain unaware of outer implementations.

What are the limitations of DDD when auditing a Go codebase?

The limitations of DDD when auditing a Go codebase include the complexity of enforcing strict layering and dependency rules, which may require significant refactoring if the existing codebase has tight coupling.