Go Project Bootstrap
You scaffold a complete Go project from scratch following hexagonal architecture, ready for feature development with the full skill/agent pipeline.
Interview (quick — 3-5 questions max)
Ask the user:
- Project name and Go module path (e.g.,
github.com/org/service)
- Infrastructure: Which external dependencies? (PostgreSQL, Redis, RabbitMQ, Kafka, MongoDB, etc.)
- API type: HTTP (gorilla/mux, chi, stdlib), gRPC, or both?
- First bounded context name (e.g.,
server, identity, billing)
- Any existing conventions to follow? (error format, ID type, auth middleware, logging library)
What You Create
Read patterns.md for the full project structure and all code patterns. Use each section as a template when creating the corresponding file.
Foundation Code
For each pattern below, read the corresponding section in patterns.md and adapt to the user's answers:
Project Structure — full directory tree
Domain Error Pattern — domainerror.New(code, message) in domain/errors/
Typed ID Pattern — type ProjectID string with UUID in domain/types/
Service Interface Pattern — empty interfaces in domain/services/<entity>/ (inbound ports)
Repository Interface Pattern — empty interfaces in domain/repositories/<entity>/ (outbound ports)
Event Types Pattern — consumed.go and emitted.go in pkg/<context>/events/
init.go Wiring — Setup() creates repos, app, handlers; passes service interface, not *app.App
main.go — minimal: env vars + Setup() + ListenAndServe
Structured Logging — App struct with *slog.Logger dependency
Error Response Helper — writeErrorJSON() for structured JSON errors
Health Check — GET /health returning {"status":"ok"}
E2E Test Setup — TestMain with testcontainers boilerplate
Makefile — build, test, lint, lint-arch, lint-pipeline, migrate targets
Architecture Lint Config — .go-arch-lint.yml enforcing hexagonal layer dependencies
CI Pipeline — GitHub Actions with testcontainers
Hooks — auto-format on edit, build-check before commit
Project Map Skeleton — .claude/skills/doc-project/SKILL.md (minimal table of contents with the first context) and .claude/skills/doc-project/conventions.md (patterns established during bootstrap). Context docs in .claude/skills/doc-project/contexts/ are created by go-finish as features arrive.
Key principles:
- Inbound handlers receive the service interface from
domain/services/, not *app.App
main.go has zero business logic — E2E tests call Setup() directly
- Hooks are deterministic — auto-formatting and build checks run guaranteed, not advisory
Install Skill/Agent Suite
Copy all 17 agent files to .claude/agents/:
go-brainstorm.md — Problem exploration (approach validation, scope check)
go-pm.md — Product manager (spec interrogation, aggregate identification)
go-architect.md — Architecture design (TASKS.md generation)
go-api-designer.md — HTTP API design (routes, types, validation)
go-scaffolder.md — Scaffolding (stubs, interfaces, mocks, skipped tests)
go-test-writer.md — Red phase TDD (failing tests)
go-dev.md — Green phase TDD (implementation + observability)
go-reviewer.md — Review (architecture, security, data, performance, compatibility)
go-migrator.md — Data migrations (backfill, transform, split)
go-fixer.md — Circuit breaker recovery (fresh-perspective fixes)
go-debugger.md — Systematic root cause investigation (escalation from fixer)
go-runner.md — Task execution (dispatch, validate, report)
go-finish.md — Feature closure (verification, acceptance criteria, integration)
go-refactor.md — Safe refactoring (document, lock, rewrite)
go-product-manager.md — Product decomposition (spec → ordered features → sequential execution)
go-retrospective.md — Feedback analysis (interactive questionnaire, skill improvement proposals)
go-bootstrap.md — This file
Verification
After bootstrapping:
go build ./... — passes
go test -race ./... -short — health check test passes
docker-compose up -d — infrastructure starts
curl localhost:<port>/health — returns {"status":"ok"}
.claude/agents/ has 17 agent files
go-arch-lint check — zero violations (architectural boundaries enforced)
make lint-pipeline — all skills and agents referenced in the pipeline exist
domain/services/ directory exists (inbound port interfaces)
domain/repositories/ directory exists (outbound port interfaces)
pkg/<context>/events/ directory exists (event contracts)
.claude/skills/doc-project/SKILL.md exists (project map skeleton)
After Bootstrap
Tell the user: "Project is ready. Describe your first feature and I'll plan and implement it using the full skill pipeline."
The go-pm skill takes over from here for feature development.
1---2name: go-bootstrap3description: Bootstraps a new Go project from scratch with hexagonal architecture, testcontainers, CI pipeline, and the full skill/agent suite installed. Use when starting a new project or microservice.4---56# Go Project Bootstrap78You scaffold a complete Go project from scratch following hexagonal architecture, ready for feature development with the full skill/agent pipeline.910## Interview (quick — 3-5 questions max)1112Ask the user:131. **Project name** and Go module path (e.g., `github.com/org/service`)142. **Infrastructure**: Which external dependencies? (PostgreSQL, Redis, RabbitMQ, Kafka, MongoDB, etc.)153. **API type**: HTTP (gorilla/mux, chi, stdlib), gRPC, or both?164. **First bounded context name** (e.g., `server`, `identity`, `billing`)175. **Any existing conventions** to follow? (error format, ID type, auth middleware, logging library)1819## What You Create2021Read [patterns.md](patterns.md) for the full project structure and all code patterns. Use each section as a template when creating the corresponding file.2223### Foundation Code2425For each pattern below, read the corresponding section in [patterns.md](patterns.md) and adapt to the user's answers:2627- **Project Structure** — full directory tree28- **Domain Error Pattern** — `domainerror.New(code, message)` in `domain/errors/`29- **Typed ID Pattern** — `type ProjectID string` with UUID in `domain/types/`30- **Service Interface Pattern** — empty interfaces in `domain/services/<entity>/` (inbound ports)31- **Repository Interface Pattern** — empty interfaces in `domain/repositories/<entity>/` (outbound ports)32- **Event Types Pattern** — consumed.go and emitted.go in `pkg/<context>/events/`33- **init.go Wiring** — Setup() creates repos, app, handlers; passes service interface, not `*app.App`34- **main.go** — minimal: env vars + `Setup()` + `ListenAndServe`35- **Structured Logging** — App struct with `*slog.Logger` dependency36- **Error Response Helper** — `writeErrorJSON()` for structured JSON errors37- **Health Check** — `GET /health` returning `{"status":"ok"}`38- **E2E Test Setup** — `TestMain` with testcontainers boilerplate39- **Makefile** — build, test, lint, lint-arch, lint-pipeline, migrate targets40- **Architecture Lint Config** — `.go-arch-lint.yml` enforcing hexagonal layer dependencies41- **CI Pipeline** — GitHub Actions with testcontainers42- **Hooks** — auto-format on edit, build-check before commit4344- **Project Map Skeleton** — `.claude/skills/doc-project/SKILL.md` (minimal table of contents with the first context) and `.claude/skills/doc-project/conventions.md` (patterns established during bootstrap). Context docs in `.claude/skills/doc-project/contexts/` are created by go-finish as features arrive.4546Key principles:47- Inbound handlers receive the service **interface** from `domain/services/`, not `*app.App`48- `main.go` has zero business logic — E2E tests call `Setup()` directly49- Hooks are deterministic — auto-formatting and build checks run guaranteed, not advisory5051### Install Skill/Agent Suite5253Copy all 17 agent files to `.claude/agents/`:54- `go-brainstorm.md` — Problem exploration (approach validation, scope check)55- `go-pm.md` — Product manager (spec interrogation, aggregate identification)56- `go-architect.md` — Architecture design (TASKS.md generation)57- `go-api-designer.md` — HTTP API design (routes, types, validation)58- `go-scaffolder.md` — Scaffolding (stubs, interfaces, mocks, skipped tests)59- `go-test-writer.md` — Red phase TDD (failing tests)60- `go-dev.md` — Green phase TDD (implementation + observability)61- `go-reviewer.md` — Review (architecture, security, data, performance, compatibility)62- `go-migrator.md` — Data migrations (backfill, transform, split)63- `go-fixer.md` — Circuit breaker recovery (fresh-perspective fixes)64- `go-debugger.md` — Systematic root cause investigation (escalation from fixer)65- `go-runner.md` — Task execution (dispatch, validate, report)66- `go-finish.md` — Feature closure (verification, acceptance criteria, integration)67- `go-refactor.md` — Safe refactoring (document, lock, rewrite)68- `go-product-manager.md` — Product decomposition (spec → ordered features → sequential execution)69- `go-retrospective.md` — Feedback analysis (interactive questionnaire, skill improvement proposals)70- `go-bootstrap.md` — This file7172## Verification7374After bootstrapping:751. `go build ./...` — passes762. `go test -race ./... -short` — health check test passes773. `docker-compose up -d` — infrastructure starts784. `curl localhost:<port>/health` — returns `{"status":"ok"}`795. `.claude/agents/` has 17 agent files806. `go-arch-lint check` — zero violations (architectural boundaries enforced)817. `make lint-pipeline` — all skills and agents referenced in the pipeline exist828. `domain/services/` directory exists (inbound port interfaces)839. `domain/repositories/` directory exists (outbound port interfaces)8410. `pkg/<context>/events/` directory exists (event contracts)8511. `.claude/skills/doc-project/SKILL.md` exists (project map skeleton)8687## After Bootstrap8889Tell the user: "Project is ready. Describe your first feature and I'll plan and implement it using the full skill pipeline."9091The go-pm skill takes over from here for feature development.