go-project-setup

Create Go projects with idiomatic cmd/ and internal/ layouts.

13|3|Updated Jan 29, 2026
One-click install
npx skills add https://github.com/danicat/skills --skill go-project-setup
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-project-setup
Source: https://github.com/danicat/skills/tree/main/go-project-setup
Command: npx skills add https://github.com/danicat/skills --skill go-project-setup

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

It removes guesswork and messy scaffolding when creating new Go applications by enforcing a consistent, idiomatic repository layout from day one.

Core Features & Use Cases

  • Standard Layout Enforcement: Uses the official Go structure with cmd/ and internal/ and forbids pkg/ as an anti-pattern.
  • Template-Driven Initialization: Selects the right starter template (CLI, Cobra CLI, library, webservice, MCP server, or game) and applies it using the skill’s provided assets.
  • Production-Ready Patterns: Ensures common best practices like a run-function pattern, graceful shutdown, and clear package separation.

Quick Start

Tell an AI: “Set up a new Go service repo using the go-project-setup skill, choosing the webservice template, and explain what folders and key files I should create so I can run go build ./... successfully.”

Frequently Asked Questions about go-project-setup

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

FAQPage Schema
What is the standard idiomatic repository layout for a new Go project?

A standard Go project layout enforces `cmd/` and `internal/` directories while forbidding `pkg/` as an anti-pattern. This structure aligns with Go conventions and ensures clear package separation.

How do I scaffold a new Go web service or Cobra CLI with production-ready patterns?

You can scaffold a Go project by selecting a specific starter template like webservice or Cobra CLI, which automatically applies production-ready patterns including a run-function pattern and graceful shutdown to ensure standardized repository creation.

Why should I avoid the `pkg/` directory when setting up a Go project structure?

You should avoid the `pkg/` directory because it is considered an anti-pattern in modern Go project layout. Standardizing on `cmd/` and `internal/` enforces clear package separation and matches official Go conventions.

Can I use this project scaffolding approach for different types of Go applications?

Yes, this scaffolding approach supports bootstrapping simple tools, Cobra CLIs, libraries, web services, MCP servers, and games. It selects the right starter template to ensure the repository layout matches the specific Go application type.

How do I validate my new Go module setup after applying the project templates?

You validate a Go module setup by running `go mod tidy` to synchronize dependencies and `go build ./...` to confirm the entire repository compiles successfully. This ensures the standardized structure is production-ready.