Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

golang-project-layout

Skill by samber

Sets up Go project layout and workspaces for AI coding assistants. It covers cmd, internal and pkg directories, module naming, go.work monorepos and root configuration files. It is for developers starting or reorganizing a Go project.

  • Score 94
  • 4.1k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install golang-project-layout

Built from the published package, never by AI.

git clone --depth 1 https://github.com/samber/cc-skills-golang /tmp/cc-skills-golang && mkdir -p ~/.claude/skills && cp -r /tmp/cc-skills-golang/skills/golang-project-layout ~/.claude/skills/golang-project-layout

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install golang-project-layout in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

Golang project layout guides an AI assistant through starting a new Go project or organizing an existing one. It covers cmd, internal and pkg directory conventions, module and package naming, go.work workspaces for monorepos, and essential root files such as a Makefile, .gitignore and .golangci.yml. It also includes an initialization checklist for new projects.

Before creating files, the skill asks the developer which software architecture and dependency injection approach to use, one question at a time. It keeps small projects flat and points to other skills in the same repository for linting, CLI patterns, testing details and refactoring. It is aimed at developers starting a new Go project, organizing a codebase, or setting up a monorepo with several packages or main packages.

Written from the project's SKILL.md and checked against it.

What it can do

  • Directory layoutExplains cmd, internal and pkg conventions, with main packages kept in cmd with minimal logic.
  • Module namingSets go.mod module path rules: match the repository URL, lowercase, hyphens for multi-word names.
  • Workspace setupCovers go.work for developing multiple related modules in a monorepo.
  • Configuration filesProvides Makefile, .gitignore and .golangci.yml templates for the project root.
  • Initialization checklistLists steps for a new project, from go mod init to gofmt and creating cmd and internal.
  • Test layoutDescribes co-locating _test.go files with their code and using testdata/ for fixtures.
  • Architecture and DI questionsAsks the developer to choose an architecture and a dependency injection approach before creating files.

What you need

  • Go toolchain (the go binary)
  • AI coding harness such as Claude Code or Codex
  • A project that uses Golang

Try asking

  • Set up a new Go CLI project with cmd and internal directories
  • Create a go.work workspace for my monorepo with three modules
  • Check my Go project layout against cmd, internal and pkg conventions

Good to know

  • Restructuring existing code without a layout change is handled by a different skill.
  • Detailed architecture guides, linting and CI setup are in other skills from the same repository.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: skills/golang-project-layout/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

Allowed tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent AskUserQuestion

  • SKILL.md7 KB
  • assets/.gitignore421 B
  • assets/Makefile2 KB
  • evals/evals.json12 KB
  • references/config.md1 KB
Show all 8 files
  • references/directory-layouts.md5 KB
  • references/testing-layout.md5 KB
  • references/workspaces.md3 KB

Alternatives to golang-project-layout

All alternatives →
openclaw-github-repo-commandersickn33
94

Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.

AAA Skill 50k
gradiogradio-app
94

Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.

AAA Skill 44k
hig-components-menussickn33
94

Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.

AAA Skill 50k
fastapi-templateswshobson
94

Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.

AAA Skill 43k
appfunctionsandroid
94

Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.

AAA Skill 11k
agent-qa-authoringsickn33
94

Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.

AAA Skill 50k

Compare with openclaw-github-repo-commander, gradio or hig-components-menus

golang-project-layout: common questions

Does it choose the architecture for my project?

No. The skill asks the developer which architecture to use first and warns against heavy structure in small projects.

Can it help with an existing Go codebase?

It covers organizing an existing codebase. For moving or splitting existing code without a layout change, the source points to the golang-refactoring skill.

Which dependency injection options does it mention?

It names manual constructor injection, samber/do, google/wire, uber-go/dig with fx, or no DI library at all.

How do I install golang-project-layout?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is golang-project-layout free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is golang-project-layout safe to use?

It scores 94 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to golang-project-layout?

Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.

golang-project-layout Install

Add to stack

Loading.