
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
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 onlymainpackages with minimal logic, and business code kept ininternal/orpkg/ - 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 -yInstalls 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- Golang Documentation42.4K
- Golang Modernize42.4K
- Golang Lint42.3K
- Golang Data Structures42.3K
- Golang Troubleshooting42K
- Golang Observability42K
- Golang Dependency Management41.8K
- Golang Structs Interfaces41.7K
- Golang Cli41.5K
- Golang Benchmark41.5K
- Golang Dependency Injection41.4K
- Golang Popular Libraries41.4K
- Golang Stretchr Testify41.3K
- Golang Continuous Integration41.3K
- Golang Grpc41.1K
- Golang Samber Lo40.4K
- Golang Stay Updated40.3K
- Golang Samber Do40.2K
- Golang Samber Slog40.1K
- Golang Samber Oops40K
- Golang Samber Mo40K
- Golang Samber Hot40K
- Golang Samber Ro39.9K
- Golang Spf13 Cobra39K
Similar to Golang Project Layout
More Go
go-packagescxuu/golang-skills1.3K installsGuidance for structuring Go packages, grouping imports, and avoiding init and os.Exit outside main.
golang-dependency-managementsamber/cc-skills-golang41.8K installsGo module dependency workflow covering adds, upgrades, vulnerability scans, and go.work workspaces, with stdlib-first vetting.
python-project-structurewshobson/agents15.6K installsOpinionated guide for Python project layout, module cohesion, and explicit public APIs with __all__.
golang-namingsamber/cc-skills-golang43K installsGo naming conventions covering packages, constructors, errors, booleans, acronyms, and enums, with the rationale for each.
astro-developerwithastro/astro602 installsContext-loading guide for developing in the Astro monorepo, routing tasks to architecture, debugging, testing, and constraints docs.
gomindrally/skills800 installsExpert Go guidance covering idiomatic APIs, clean architecture, concurrency, testing, and DevOps practices.