Go project setup
Set up a brand-new greenfield Go module after base-repo-setup, using modern Go modules, cmd/internal layout when useful, standard-library-first defaults, slog, tests, lint/security wrappers, and local just check validation. Use only for new Go scaffolding, not migrations.From its SKILL.md
npx -y skills add nyquistwilder/personal-pi --skill go-project-setupAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
4.9 KB, ~1.2k tokens by cl100k_base, as published. Nobody here has run it
Go Project Setup
Rule
Scaffold a brand-new Go project; do not only propose a structure. Layer Go-specific
conventions on top of base-repo-setup and target greenfield work only.
Greenfield Go should be boring, small, standard-library-first, and easy to build as a single static-ish binary. Add frameworks only when the problem justifies them.
Hard Stops
Stop before writing files when:
- The repository baseline is missing (
flake.nix,mise.toml,justfile,.gitignore). - The target already has
go.mod,go.sum,cmd/,internal/, or source files that would be overwritten. - Module path, binary/library shape, minimum Go version, license, or public API intent is unclear.
- The user asks for legacy migration, framework migration, or preserving pre-existing Go layout; these greenfield skills are not migration skills.
- A dependency, external service, database, or generated-code tool would be introduced without explicit approval.
Required Decisions
Ask and confirm these before scaffolding:
- Module path. Recommend a canonical VCS path such as
github.com/<owner>/<repo>when publishable, or a private module path for internal work. - Project shape: binary app, library module, or multi-command app.
- Minimum Go version and toolchain policy. Recommend the current stable Go from the repo
environment; set the
godirective intentionally and add atoolchaindirective only when the project wants toolchain auto-selection. - Binary name and
cmd/<name>path for apps. - Initial package names. Recommend short lowercase names without underscores.
- Whether HTTP API, CLI, database, config files, or observability scaffolding is in scope. Default is no; use specialized skills after the baseline exists.
Greenfield Defaults
- Use Go modules. Track
go.modandgo.sum. - Prefer standard library first:
testing,net/http,log/slog,flag,context,database/sql,errors,cmp,slices,maps, anditerwhen supported by the chosen Go version. - Keep dependencies out of the initial scaffold unless generated code imports them.
- Use
cmd/<binary>/main.gofor apps andinternal/for app-private packages. - Use root package files for small libraries; add subpackages only around cohesive concepts.
- Do not create
pkg/by default. It is not a public API guarantee and often becomes a junk drawer. - Keep
mainthin: parse config, configure logging, construct dependencies, callrun. - Use
log/slogfor logging. Do not introduce zap, zerolog, or logrus in greenfield code without a specific operational reason. - Use native tests with table cases and subtests. Add
go-cmponly when diffs are materially better than==orreflect.DeepEqual.
Layout
Small binary app:
.
|-- go.mod
|-- go.sum
|-- cmd/
| `-- <binary>/
| `-- main.go
|-- internal/
| `-- app/
| |-- app.go
| `-- app_test.go
`-- README.md
Small library:
.
|-- go.mod
|-- go.sum
|-- <package>.go
|-- <package>_test.go
`-- README.md
Use internal/<domain> for application internals and short public package names for library
APIs. Split packages by responsibility, not by layer names such as utils, helpers, or
common.
Tooling
Wire local commands through just and keep just check as the canonical validation
interface. Prefer this baseline:
fmt:
gofmt -w .
fmt-check:
test -z "$(gofmt -l .)"
vet:
go vet ./...
lint:
staticcheck ./...
test:
go test ./...
test-race:
go test -race ./...
vuln:
govulncheck ./...
build:
go build ./...
check: fmt-check vet lint test build vuln
Use golangci-lint only when the project explicitly wants an aggregate runner; keep
gofmt, go vet, staticcheck, go test, and govulncheck understandable without it.
Add tool versions through flake.nix, mise.toml, go install tool recipes, or an
approved tool-management policy; do not hide versions in ad-hoc scripts.
Workflow
- Verify the baseline repository files and Git root.
- Ask all required decisions.
- Create
go.mod, source skeleton, smoke tests, README updates, and just recipes. - Add
.gitignoreentries only for generated Go artifacts if missing (bin/,coverage.*,*.test,*.prof). Do not ignorego.sum. - Run
go mod tidy. - Run
gofmt,go test ./...,go vet ./...,staticcheck ./...when available, andjust check.
Completion
Report module path, Go/toolchain policy, project shape, files created, dependencies added or avoided, commands run, validation results, and intentionally skipped optional items such as HTTP frameworks, CLI frameworks, database, OpenTelemetry, release automation, or CI.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.