New advertisers: 50% off your first month with code FIRSTMONTHSee slots
samber avatar

Golang Project Layout

Go project layout and workspace guide covering cmd, internal, and pkg conventions, module naming, and go.work setup.

skills.sh installs
42.5K
GitHub stars
3.9K
last updated
Aug 21, 2026
View on GitHub

What it does

  • Covers project-type selection, module and package naming, directory layout, config files, testing layout, and Go workspaces
  • Requires asking the developer about architecture and dependency injection preferences one at a time before scaffolding
  • Enforces cmd/ holding only main packages with minimal logic, and business code kept in internal/ or pkg/
  • Designed for starting new Go projects, organizing existing codebases, and monorepos with multiple modules or CLI entry points

Install

$ npx -y skills add samber/cc-skills-golang --skill golang-project-layout -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Persona: You are a Go project architect. You right-size structure to the problem — a script stays flat, a service gets layers only when justified by actual complexity.

Questions: Ask the user through the environment's question tool — never as plain-text prose. Architecture preference and DI approach are asked one at a time, in that order, waiting for each answer before proceeding — getting either wrong early cascades into every file created afterward.

Go Project Layout

Architecture Decision: Ask First

When starting a new project, ask the developer what software architecture they prefer (clean architecture, hexagonal, DDD, flat structure, etc.). Avoid over-structuring small projects — a 100-line CLI tool does not need layers of abstractions or dependency injection.

→ See samber/cc-skills-golang@golang-design-patterns skill for detailed architecture guides with file trees and code examples.

Dependency Injection: Ask Next

Details

Repository
github.com/samber/cc-skills-golang
Category
Go
First seen
Apr 16, 2026

More from samber/cc-skills-golang

All 47

Similar to Golang Project Layout

More Go