golang-project-layout

golang-project-layout is a skill for Claude Code from alexastrum/skl. It costs 71 tokens per session (1,516 once invoked), scanned A, original, MIT.

A guide to organizing Go projects and workspaces. It explains how to structure services, command-line tools, packages, and monorepos—a single repository containing multiple related projects or packages.

In plain words
What is it for?
Use it when starting or reorganizing a Go project, setting up a monorepo, creating several command-line programs, or deciding how to use cmd, internal, and pkg directories.
Why use it?
It helps choose a project layout that fits the software's size and avoids unnecessary folders or abstractions.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool; mentions Claude Code; installed under .agents/ (shared by several agents).

Good fit Use it when starting or reorganizing a Go project, setting up a monorepo, creating several command-line programs, or deciding how to use cmd, internal, and pkg directories.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/alexastrum/skl/golang-project-layout
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add alexastrum/skl --skill golang-project-layout
Clone the repo
git clone --depth 1 https://github.com/alexastrum/skl

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for golang-project-layout

README.md
[![agentmods](https://agentmods.dev/badge/skills/alexastrum/skl/golang-project-layout/github.svg)](https://agentmods.dev/skills/alexastrum/skl/golang-project-layout)
Your own site
<a href="https://agentmods.dev/skills/alexastrum/skl/golang-project-layout"><img src="https://agentmods.dev/badge/skills/alexastrum/skl/golang-project-layout/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for golang-project-layout

Your own site · 80×15
<a href="https://agentmods.dev/skills/alexastrum/skl/golang-project-layout"><img src="https://agentmods.dev/badge/skills/alexastrum/skl/golang-project-layout.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 71 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,516 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00071 $0.01516
Opus 5.5 $0.00028 $0.00606
Sonnet 5.5 $0.00014 $0.00303
Haiku 4.5 $0.00007 $0.00152

Measured 2mo ago against content hash 6572b1c5eb22, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

golang-project-layout scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.agents/skills/golang-project-layout/SKILL.md · 121 lines

How it starts

The opening of the file, as written. The whole thing — 121 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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.

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.). NEVER over-structure 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

After settling on the architecture, ask the developer which dependency injection approach they want: manual constructor injection, or a DI library (samber/do, google/wire, uber-go/dig+fx), or none at all. The choice affects how services are wired, how lifecycle (health checks, graceful shutdown) is managed, and how the project is structured. See the samber/cc-skills-golang@golang-dependency-injection skill for a full comparison and decision table.

12-Factor App

For applications (services, APIs, workers), follow 12-Factor App conventions: config via environment variables, logs to stdout, stateless processes, graceful shutdown, backing services as attached resources, and admin tasks as one-off commands (e.g., cmd/migrate/).

Quick Start: Choose Your Project Type

Project Type Use When Key Directories
CLI Tool Building a command-line application cmd/{name}/, internal/, optional pkg/
Library Creating reusable code for others pkg/{name}/, internal/ for private code
Service HTTP API, microservice, or web app cmd/{service}/, internal/, api/, web/
Monorepo Multiple related packages/modules go.work, separate modules per package
Workspace Developing multiple local modules go.work, replace directives

Read the full file on GitHub · 121 lines

Files

What ships with it

7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 121 lines · 71 tokens per session scan A 6572b1c5eb22

Subscribe to this mod's changes

golang-project-layout is a skill published in the GitHub repository alexastrum/skl (10 stars, last pushed 4mo ago), licensed MIT. It adds 71 tokens to every session and 1,516 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

golang-project-layout compared with skills from other repositories

golang-project-layout next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
golang-project-layoutalexastrum/sklSkill104mo agoMITA71Claude Code
goericrisco/rsc-harnessSkill5032d agoMITA86Claude Code, Codex
gographozgurcd/gographSkill231yesterdayMITA69Claude Code
go-127dimetron/pi-goSkill2223d agoMITA177Claude Code, Codex
bubbletea-testingdimetron/pi-goSkill2223d agoMITA139Claude Code, Codex
design-reviewdimetron/pi-goSkill2223d agoMITA30Claude Code, Codex
demo-subagents-tuidimetron/pi-goSkill2223d agoMITA0Claude Code, Codex