# Go project layout

> Go project layout is an open-source agent skill for developer tools. Guides an agent to scaffold a new Go project or service with a sized layout. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/eduardo-sl/go-agent-skills/tree/main/skills/(architecture)/go-project-layout
- **Repository:** https://github.com/eduardo-sl/go-agent-skills
- **GitHub stars:** 90
- **License:** MIT
- **Skill name:** go-project-layout
- **Collection:** https://github.com/eduardo-sl/go-agent-skills
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-02

## About

This skill helps an AI coding agent set up the folder structure and starting files for a new Go project. It starts by matching the layout to the project's size: a flat package main for a small single-binary tool, a root package for a library, or a cmd/ and internal/ structure for services and multi-binary projects. It covers module path naming, keeping main.go thin with a run function that takes its dependencies, and where configuration and dependency direction should live.

The skill also gives the agent a short scaffolding procedure and a verification checklist. The steps cover initialising the module, setting the go directive, creating only the directories the first feature needs, pinning developer tools, and confirming that go build and go vet pass on the skeleton. It also advises against creating empty directories in advance and against committing local replace directives.

It relies on the Go toolchain and git, and the agent is expected to work in a Go project with read, edit and shell access restricted to go, gofmt and git commands. The skill ships as a single SKILL.md file with no bundled scripts.

## When your agent uses it

> Scaffold new Go projects and services: directory structure, cmd/ and internal/ conventions, when to use a flat layout, module naming, and main package wiring. Use when: "new Go project", "scaffold a service", "create project structure", "start a Go module", "how do I organize a new service", "set up folder structure". Not for: reviewing an existing architecture (go-architecture-review), DI wiring (go-dependency-injection), CI setup (go-ci).

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/eduardo-sl/go-agent-skills/tree/HEAD/skills/(architecture)/go-project-layout)
- [Asks for: Read, Edit, Write, Glob, Grep, Bash(go:*), Bash(gofmt:*), Bash(git:*)](https://github.com/eduardo-sl/go-agent-skills/blob/HEAD/skills/(architecture)/go-project-layout/SKILL.md)
- [License: MIT](https://github.com/eduardo-sl/go-agent-skills/tree/HEAD/skills/(architecture)/go-project-layout)

## Features

- **Layout by project size:** Chooses between flat, library, single-service and multi-binary structures based on what is being built.
- **Module naming guidance:** Explains how to pick a fetchable module path and how the last path element becomes the import name.
- **Thin main pattern:** Shows a main that only wires dependencies and delegates to a testable run function.
- **Package and directory rules:** Covers internal/ usage, avoiding grab-bag packages, and keeping package names matching directories.
- **Config and dependency flow:** Describes loading and validating config at startup and keeping domain code free of infrastructure imports.
- **Scaffolding checklist:** Lists the steps and verification checks to confirm a fresh skeleton builds and vets cleanly.

## Good for

- Scaffold a new Go service with cmd and internal directories
- Set up a Go module for a reusable library
- Decide whether a small Go tool should use a flat layout
- Start a new Go project with a thin main.go and config struct
- Organise the folders for a multi-binary Go repository

## Install

### Any agent

Download the skill folder from https://github.com/eduardo-sl/go-agent-skills and copy it into your agent's skills folder.

## FAQ

### What does the skill need to run?

It requires the Go toolchain and git for repository initialisation.

### Does Go project layout change or add any files on its own?

It is a guide for an agent that may create files with Read, Edit, Write and shell access limited to go, gofmt and git commands. The skill itself bundles no scripts.

### Does Go project layout cover reviewing an existing project's architecture?

No. The skill's own description points reviews of existing architecture, dependency injection and CI setup to other skills.

### Which Go versions does Go project layout mention?

It notes that since Go 1.26, go mod init writes the previous release in the go directive, and that module tools via go get -tool need Go 1.24 or later.

### Does Go project layout run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Go project layout?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Go project layout?

The closest alternatives to Go project layout are Go architecture review, Project scaffold, Skill creator, Go documentation and Developing genkit go.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Go architecture review](https://ai-powered.com/skills/go-architecture-review): Go architecture review is an open-source agent skill for developer tools.
- [Project scaffold](https://ai-powered.com/skills/project-scaffold): Project scaffold is an open-source agent skill for developer tools.
- [Skill creator](https://ai-powered.com/skills/skill-creator-melandlabs): Skill creator is an open-source agent skill for developer tools.
- [Go documentation](https://ai-powered.com/skills/go-documentation): Go documentation is an open-source agent skill for developer tools.
- [Developing genkit go](https://ai-powered.com/skills/developing-genkit-go): Developing genkit go is an open-source agent skill for developer tools.
- [Go coding standards](https://ai-powered.com/skills/go-coding-standards): Go coding standards is an open-source agent skill for developer tools.
- [Go skills router](https://ai-powered.com/skills/go-skills-router): Go skills router is an open-source agent skill for developer tools.
- [Principle foundational thinking](https://ai-powered.com/skills/principle-foundational-thinking): Principle foundational thinking is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/go-project-layout
