This skill guides the creation of clean, idiomatic Go project structures.
Core Mandates
Standard Layout Only: Use the official Go project layout (cmd/, internal/).
NEVER create a pkg/ directory. (It is an anti-pattern common in Kubernetes but not idiomatic Go).
Flat by Default: Start with a flat structure (all files in root) for simple apps. Only introduce cmd/ and internal/ when multiple binaries or private packages are needed.
Modern Go: Ensure go.mod specifies the latest stable Go version (currently 1.24+).
Workflow
1. Determine Scope
Ask the user: "Is this a simple tool, a library, or a multi-service repo?"
2. Select and Use Template
MANDATORY: You MUST read and use the templates provided in the assets/ directory. They establish idiomatic patterns like graceful shutdown, run functions, and package separation.
Cobra CLI: assets/cli-cobra. For complex CLI tools.
Library: assets/library. Package in root, internal/ for hidden logic.
Application / Service: assets/webservice.
cmd/app-name/main.go: Entry point using the run function pattern.
internal/: Private application logic.
MCP Server: assets/mcp-server.
Game: assets/game. Using Ebitengine.
3. Initialize
Create Directory: mkdir my-app
Init Module: go mod init github.com/user/my-app
Linting: (Optional) Initialize .golangci.yml if the project requires rigorous style enforcement.
Apply Template: Copy and adapt the files from the chosen template in assets/. Ensure module names are updated.
Verify: Run go mod tidy and go build ./....
References
references/project_layout.md: Official Go Module Layout guide.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: googlecloudplatform-devrel-demos-go-project-setup3description: Go Project Setup4---56# Go Project Setup78This skill guides the creation of clean, idiomatic Go project structures.910## Core Mandates111. **Standard Layout Only**: Use the official Go project layout (`cmd/`, `internal/`).12 * **NEVER** create a `pkg/` directory. (It is an anti-pattern common in Kubernetes but not idiomatic Go).132. **Flat by Default**: Start with a flat structure (all files in root) for simple apps. Only introduce `cmd/` and `internal/` when multiple binaries or private packages are needed.143. **Modern Go**: Ensure `go.mod` specifies the latest stable Go version (currently 1.24+).1516## Workflow1718### 1. Determine Scope19Ask the user: "Is this a simple tool, a library, or a multi-service repo?"2021### 2. Select and Use Template22**MANDATORY**: You MUST read and use the templates provided in the `assets/` directory. They establish idiomatic patterns like graceful shutdown, `run` functions, and package separation.2324* **Simple CLI / Tool**: `assets/cli-simple`. Flat structure.25* **Cobra CLI**: `assets/cli-cobra`. For complex CLI tools.26* **Library**: `assets/library`. Package in root, `internal/` for hidden logic.27* **Application / Service**: `assets/webservice`.28 * `cmd/app-name/main.go`: Entry point using the `run` function pattern.29 * `internal/`: Private application logic.30* **MCP Server**: `assets/mcp-server`.31* **Game**: `assets/game`. Using Ebitengine.3233### 3. Initialize341. **Create Directory**: `mkdir my-app`352. **Init Module**: `go mod init github.com/user/my-app`363. **Linting**: (Optional) Initialize `.golangci.yml` if the project requires rigorous style enforcement.374. **Apply Template**: Copy and adapt the files from the chosen template in `assets/`. Ensure module names are updated.385. **Verify**: Run `go mod tidy` and `go build ./...`.3940## References41* `references/project_layout.md`: Official Go Module Layout guide.4243---44> Converted and distributed by [TomeVault](https://tomevault.io/claim/googlecloudplatform) — claim your Tome and manage your conversions.45<!-- tomevault:4.0:skill_md:2026-04-11 -->
Run npx skillmds@latest add tomevault-io/googlecloudplatform-devrel-demos-go-project-setup in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Go Project Setup It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
tomevault-io (@tomevault-io) published this skill. Their other Agent Skills are listed on their SkillMD profile.