golang-project-layout

Structure Go projects with clean architecture and 12-Factor App principles.

Updated May 19, 2026
One-click install
npx skills add https://github.com/monforje/.opencode --skill golang-project-layout-monforje
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-project-layout
Source: https://github.com/monforje/.opencode/tree/main/skills/cc-skills-golang/skills/golang-project-layout
Command: npx skills add https://github.com/monforje/.opencode --skill golang-project-layout-monforje

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill provides essential guidance for setting up and structuring Go projects, from individual projects to monorepos with multiple packages, ensuring maintainability and scalability.

Core Features & Use Cases

  • Project Structure: Defines best practices for Go project architecture, dependency injection, and monorepos.
  • Dependency Injection: Offers insights into various DI approaches and when to use them.
  • 12-Factor App: Follows 12-Factor App principles for scalable services and APIs.
  • Use Case: Ideal for new projects to set up a solid foundation and for codebases requiring restructuring.

Quick Start

Start by initializing a new Golang project and structure it using the guidance in this skill.

Frequently Asked Questions about golang-project-layout

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

FAQPage Schema
What is the best way to structure a Golang project for maintainability?

To structure a Golang monorepo effectively, you should organize multiple packages to maintain clean architecture boundaries. This skill offers best practices for managing monorepos with multiple packages while ensuring dependency injection and scalability.

How do I set up dependency injection in a Go application?

Setting up dependency injection in a Go application requires defining clear boundaries for component instantiation and injection. This skill offers insights into various DI approaches and identifies exactly when to apply them for optimal architecture.

Does Golang project layout need to follow 12-Factor App principles?

Golang project layout should follow 12-Factor App principles when building scalable services and APIs. This skill integrates these principles directly into its project structure guidelines to ensure configuration and environment separation.

When do I need to restructure an existing Go codebase?

You need to restructure an existing Go codebase when maintainability drops or scaling becomes difficult due to poor architecture. This skill provides restructuring guidance to establish a solid foundation using clean architecture and dependency injection.