go-project-structure

Generate Go service skeletons with a four-layer Clean Architecture layout.

1|Updated Jun 20, 2026
One-click install
npx skills add https://github.com/shafibabar/SDLC-Artifact-Factory --skill go-project-structure-shafibabar
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-project-structure
Source: https://github.com/shafibabar/SDLC-Artifact-Factory/tree/main/skills/go-project-structure
Command: npx skills add https://github.com/shafibabar/SDLC-Artifact-Factory --skill go-project-structure-shafibabar

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill eliminates architectural drift and navigation overhead in Go microservices by enforcing a consistent, layered project layout that ensures dependencies always point inward.

Core Features & Use Cases

  • Canonical Layout: Implements a standardized directory structure (cmd, internal/domain, application, infrastructure, handlers) for every Go service.
  • Automated Fitness Functions: Provides mechanical enforcement of the Dependency Rule via Makefile targets to prevent architectural violations.
  • Use Case: When starting a new backend service, use this Skill to generate the entire project skeleton, ensuring the domain layer remains pure and testable while infrastructure concerns are properly isolated.

Quick Start

Use the go-project-structure skill to generate a new service skeleton named order-processing-service in the current directory.

Frequently Asked Questions about go-project-structure

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

FAQPage Schema
How do I enforce Clean Architecture and inward-only dependencies in a Go service?

Enforce Clean Architecture in Go by adopting a four-layer project structure (domain, application, infrastructure, handlers) where dependencies always point inward. This keeps the domain layer pure and isolates infrastructure concerns for better testability.

What is the best way to standardize a Go backend project layout across multiple microservices?

Standardize a Go backend project layout by applying a canonical directory structure with separate cmd, internal/domain, application, infrastructure, and handlers packages. This eliminates architectural drift and ensures consistent, maintainable service structures.

How do I prevent architectural drift in Go microservices automatically?

Prevent architectural drift in Go microservices by using automated architectural fitness functions. These are Makefile targets that mechanically enforce the Dependency Rule, preventing violations before they enter the codebase.

How do I generate a new Go service skeleton that follows SOLID principles and Clean Architecture?

Generate a Go service skeleton following SOLID principles by creating a standardized directory layout that separates domain logic from infrastructure. This ensures consumer-defined interfaces and strict package separation for maintainable code.

Does this four-layer Go project structure work for existing backend services or only new ones?

This four-layer Go project structure is designed for starting new backend services, generating the entire project skeleton to ensure the domain layer remains pure and testable while properly isolating infrastructure concerns.