go-setup
Skill1 starsChanged 2 months agoMITView on GitHub
Go project setup, structure decisions, and library selection for production-ready applications. Use when starting a new Go project, deciding on project structure, choosing libraries, or setting up build tools. Covers CLI/TUI, single service, monorepo, mixed layouts, and recommended libraries. Keywords: go project setup, go project structure, go monorepo, go workspace, go libraries, go architecture.
- Reads credentials
- Deletes or force-pushes
- Installs packages
In this repository30 other files it gives its agents.
- arch-linux-cachyosSkill
- arch-linux-triageSkill
- bash-defensive-patternsSkill
- bash-linuxSkill
- bash-scriptingSkill
- beansSkill
- context7Skill
- docker-compose-setupSkill
- audioSkill
- deploymentSkill
- ecsSkill
- game-loopSkill
- inputSkill
- physicsSkill
- renderingSkill
- resourcesSkill
- ebitenSkill
- geminiSkill
- go-browser-testsSkill
- go-devSkill
- go-fluent-testingSkill
- go-htmx-frontendSkill
- interactive-browser-testingSkill
- keep-on-goingSkill
- mcpcSkill
- minimaxSkill
- pixellabSkill
- playwright-mcpSkill
- public-repo-maturitySkill
- searxngSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 22
Use this skill when:
- Very specific: line 174
Use
pkg/: only for packages meant to be imported by others - Distinctive: line 189
Create a new package when:
- Distinctive: line 194
Don't create a package just to:
- Distinctive: line 203
When starting a new Go project:
- Distinctive: line 288
After setup, use these skills for development:
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
What I do
I help with Go project initialization and setup:
- Project structure decisions
- Library selection
- Architecture planning
- Configuration setup
When to use me
Use this skill when:
- Starting a new Go project
- Deciding on project structure
- Choosing libraries and dependencies
- Setting up build tools and configuration
Project Structure References
Detailed structure guides are split into focused reference files:
- CLI / TUI Applications — Simple CLI, supporting packages, TUI with Bubble Tea
- Single Service — Basic service, service with database, service layer responsibilities
- Monorepo — go.work, multi-service justfile, CI
- Mixed — Combined CLI + service + shared packages layout
- Recommended Libraries — Core, CLI/TUI, database, concurrency, testing, build tools
Common Commands
just build # Build binary
just run # Run application
just dev # Run with hot reload
just check # vet + test-unit + lint
just lint # golangci-lint
just test-unit # Unit tests only
just test-all # All tests
just migrate-up # Apply migrations
just migrate-down # Rollback migrations
just sqlc # Generate SQL codeStandard justfile Template
# Variables
binary := "myapp"
main := "./cmd/server"
# Default recipe (runs with just `just`)
default: build
# Build binary
build:
go build -o bin/{{binary}} {{main}}
# Run application
run:
go run {{main}}
# Development with hot reload (requires air)
dev:
air
# Run all checks
check: lint test
# Run linter
lint:
golangci-lint run ./...
# Run unit tests
test:
go test -v -race ./...
# Run unit tests with coverage
test-coverage:
go test -v -race -coverprofile=coverage.out ./...
go tool cover -html=coverage.out -o coverage.html
# Run integration tests
test-integration:
go test -v ./test/integration/...
# Run E2E tests
test-e2e:
go test -v ./test/e2e/...
# Run all tests
test-all: test test-integration test-e2e
# Database migrations
migrate-up:
migrate -path ./db/migrations -database "$DATABASE_URL" up
migrate-down:
migrate -path ./db/migrations -database "$DATABASE_URL" down
# Generate SQL code
sqlc:
sqlc generate
# Clean build artifacts
clean:
rm -rf bin/
rm -f coverage.out coverage.html
# Install binary to GOPATH
install:
go install {{main}}Configuration
Environment Variables (Recommended)
package config
import "github.com/caarlos0/env/v11"
type Config struct {
Port int `env:"PORT" envDefault:"8080"`
DatabaseURL string `env:"DATABASE_URL" envRequired:"true"`
LogLevel string `env:"LOG_LEVEL" envDefault:"info"`
JWTSecret string `env:"JWT_SECRET" envRequired:"true"`
}
func Load() (*Config, error) {
cfg := &Config{}
if err := env.Parse(cfg); err != nil {
return nil, err
}
return cfg, nil
}.env Files (Development Only)
# .env (gitignored)
DATABASE_URL=postgres://user:pass@localhost:5432/mydb
JWT_SECRET=dev-secret
LOG_LEVEL=debug
PORT=8080Key Principles
From Official Go Docs
- Start simple - Single
main.gois fine for small projects - Use
internal/for private packages (enforced by compiler) - Use
cmd/for multiple binaries - Use
pkg/only for packages meant to be imported by others - Never use
/src- this is a Java pattern, not Go
Common Mistakes to Avoid
| ❌ Don't | ✅ Do |
Create /src directory | Use root or cmd/ |
| Over-engineer small projects | Start simple, evolve |
| Create packages just to organize files | Create packages for logical boundaries |
| Copy Java/Python structures | Follow Go conventions |
| Premature abstraction | Wait until you need it |
When to Create a New Package
Create a new package when:
- Code needs to be reused in multiple places
- You want to enforce a boundary between code
- It reduces cognitive overhead as a "black box"
Don't create a package just to:
- Organize files
- Reduce file size
- Match structure from other languages
Initialization Checklist
When starting a new Go project:
- Initialize go module:
go mod init github.com/org/project - Choose structure based on project type
- Add justfile
- Configure golangci-lint
- Set up CI/CD (GitHub Actions)
- Add .gitignore
- Create README.md
- Set up database migrations (if needed)
- Configure sqlc (if using)
- Add base tests
.gitignore for Go
# Binaries
*.exe
*.exe~
*.dll
*.so
*.dylib
bin/
# Test
*.test
*.out
coverage.out
# Go workspace
go.work
go.work.sum
# Environment
.env
.env.local
*.env
# IDE
.idea/
.vscode/
*.swp
*.swo
# Build
dist/CI/CD Example (GitHub Actions)
name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
- uses: extractions/setup-just@v2
- name: Download dependencies
run: go mod download
- name: Run checks
run: just check
- name: Run all tests
run: just test-allRelated Skills
After setup, use these skills for development:
go-dev- Go development patterns and best practicesgo-fluent-testing- Unit/integration/E2E testing (fluent Given/When/Then)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

