Go Project Implementation Guide
Use this skill together with /pma. /pma controls workflow, approval, and task tracking; this guide defines the implementation baseline after approval.
Keep this entry file lean. Load only the reference packs needed for the task.
Scope
For PMA-managed Go backends, API services, and CLI applications.
Not for embedded targets, library-only modules without binaries, or non-PMA projects.
Loading Order
- Always load
references/baseline.md first.
- Load
references/config-and-data.md for config layering, validation, sqlc, pgx, GORM, and migrations.
- Load
references/http-and-runtime.md for handlers, middleware, logging, observability, and shutdown.
- Load
references/delivery.md for lint, tests, task runners, security review, CI, and Git workflow.
Quick Routing
- New service or CLI setup →
references/baseline.md
- config (koanf layering, env mapping, validation) →
references/config-and-data.md
- data access (sqlc + pgx, GORM, migrations, repository boundaries) →
references/config-and-data.md
- runtime (HTTP server, middleware, slog, tracing, shutdown) →
references/http-and-runtime.md
- dev URL routing (nsl) →
references/http-and-runtime.md (full protocol → /pma references/dev-environment.md)
- testing →
references/delivery.md
- CI and delivery (quality gates, lint, Taskfile, security checklist, PR readiness) →
references/delivery.md
Reference Packs
references/baseline.md
Stack defaults, quality gates, layout, conventions, error model, and code quality standards.
references/config-and-data.md
Config layering with koanf, validation, sqlc plus pgx, GORM alternative, and migration rules.
references/http-and-runtime.md
Router structure, handler patterns, middleware, logging, observability, and graceful shutdown.
references/delivery.md
Lint config, testing, task runner expectations, security checks, CI, and Git conventions.
Acceptance Checklist
Before merge:
If the repo already diverges from these defaults, make the divergence explicit and apply it consistently across code, docs, and CI.
1---2name: pma-go3description: Go implementation and acceptance baseline for PMA-managed service and CLI projects. Covers project layout (cmd/internal), strict linting with golangci-lint v2, database access, HTTP patterns, layered config, structured logging, observability, and CI quality gates. Use when implementing, scaffolding, upgrading, or validating acceptance of a Go service or CLI; use pma-cr for code-review workflow.4---5
6# Go Project Implementation Guide
7
8Use this skill together with `/pma`. `/pma` controls workflow, approval, and task tracking; this guide defines the implementation baseline after approval.
9
10Keep this entry file lean. Load only the reference packs needed for the task.
11
12## Scope
13
14For PMA-managed Go backends, API services, and CLI applications.
15
16Not for embedded targets, library-only modules without binaries, or non-PMA projects.
17
18## Loading Order
19
201. Always load `references/baseline.md` first.
212. Load `references/config-and-data.md` for config layering, validation, sqlc, pgx, GORM, and migrations.
223. Load `references/http-and-runtime.md` for handlers, middleware, logging, observability, and shutdown.
234. Load `references/delivery.md` for lint, tests, task runners, security review, CI, and Git workflow.
24
25## Quick Routing
26
27- New service or CLI setup → `references/baseline.md`
28- config (koanf layering, env mapping, validation) → `references/config-and-data.md`
29- data access (sqlc + pgx, GORM, migrations, repository boundaries) → `references/config-and-data.md`
30- runtime (HTTP server, middleware, slog, tracing, shutdown) → `references/http-and-runtime.md`
31- dev URL routing (nsl) → `references/http-and-runtime.md` (full protocol → `/pma references/dev-environment.md`)
32- testing → `references/delivery.md`
33- CI and delivery (quality gates, lint, Taskfile, security checklist, PR readiness) → `references/delivery.md`
34
35## Reference Packs
36
37- `references/baseline.md`
38 Stack defaults, quality gates, layout, conventions, error model, and code quality standards.
39- `references/config-and-data.md`
40 Config layering with koanf, validation, sqlc plus pgx, GORM alternative, and migration rules.
41- `references/http-and-runtime.md`
42 Router structure, handler patterns, middleware, logging, observability, and graceful shutdown.
43- `references/delivery.md`
44 Lint config, testing, task runner expectations, security checks, CI, and Git conventions.
45
46## Acceptance Checklist
47
48Before merge:
49
50- [ ] `goimports -l .` reports nothing; `golangci-lint run` and `go vet ./...` pass
51- [ ] `go test -cover ./...` passes; coverage target 80% or higher
52- [ ] `go build ./...` succeeds; `go mod tidy` leaves no diff
53- [ ] `gosec ./...` passes for changed code
54- [ ] config layered via koanf (defaults -> file -> env -> flags) and validated after load
55- [ ] graceful shutdown wired (`signal.NotifyContext` + `http.Server.Shutdown` with timeout)
56- [ ] nsl dev routing works when the service ships a UI (see `references/http-and-runtime.md`)
57
58If the repo already diverges from these defaults, make the divergence explicit and apply it consistently across code, docs, and CI.