samber avatar

Golang Project Layout

This is a project scaffolding guide that stops you from over-engineering. It asks what architecture you actually need before suggesting structure, which is refreshing. The quick-start table breaks down when to use CLI versus library versus service layouts, and it's opinionated about keeping main packages minimal in cmd/ while business logic lives in internal/. Includes practical templates for Makefile and .gitignore, plus strong opinions on module naming (lowercase, hyphens, match your repo URL). The initialization checklist reminds you to ask about DI preferences and right-size your structure before creating directories. Works well as a first step when spinning up any Go project, especially if you tend to cargo-cult complex layouts onto simple tools.

skills.sh installs
42.1K
GitHub stars
3.8K
last updated
Aug 21, 2026

Install

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

Installs into .claude/skills of the current project.

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

Sponsors

Details

Repository
github.com/samber/cc-skills-golang
Categories
Frontend Development, Documentation, Go, CLI & Terminal
First seen
Apr 16, 2026

More from samber/cc-skills-golang

All 47
1flutter avatarflutter-add-widget-previewflutter/agent-pluginsAdds interactive widget previews to the project using the previews.dart system. Use when creating new UI components or updating existing screens to ensure consi38.7Kskills.sh installs
2callstackincubator avatarreact-native-best-practicescallstackincubator/agent-skillsProvides React Native performance optimization guidelines for FPS, TTI, bundle size, memory leaks, re-renders, and animations. Applies to tasks involving Hermes32Kskills.sh installs
3software-mansion avatarargent-react-native-optimizationsoftware-mansion/argentOptimizes a React Native app by profiling first to find real bottlenecks, then sweeping for mechanical issues. Entry-point for all performance work. Use when th30.2Kskills.sh installs
4software-mansion avatarargent-react-native-app-workflowsoftware-mansion/argentStep-by-step workflows for developing or debugging React Native apps on iOS simulator or Android emulator. Use when starting the app, debugging Metro, fixing bu30Kskills.sh installs
5software-mansion avatarargent-react-native-profilersoftware-mansion/argentProfile a React Native Hermes app to measure re-render and CPU performance using argent profiler tools. Use when optimizing for performance, measuring before/af30Kskills.sh installs
6pbakaus avatarlayoutpbakaus/impeccableImprove layout, spacing, and visual rhythm. Fixes monotonous grids, inconsistent spacing, and weak visual hierarchy. Use when the user mentions layout feeling o26.4Kskills.sh installs