This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Experimental Go HTTP server with CI pipeline tooling. Uses gorilla/mux for routing and serves a JSON API on port 8080.
# Build the binary
go build cmd/server/main.go
# Run tests
go test ./...
# Run a single test (by function name)
go test ./internal/handlers/ -run TestGetUsers
# Run tests with verbose JUnit output (as CI does)
gotestsum --junitfile junit-report.xml --format standard-verbose ./...
# Lint (static analysis)
golangci-lint run
# Cyclomatic complexity check (flags functions over 10)
gocyclo -over 10 .
# Security scan
gosec ./...
# License check
go-licenses report ./...
# Build Docker image
docker build -f ci/Dockerfile -t golang-build:latest .cmd/server/main.go— Entry point. Sets up the mux router with middleware chain (Logging → Recover → ContentType) and starts the HTTP server.cmd/onboard/— TUI wizard that walks the user through generating a.envfor the server. Demonstrates theinternal/tuiframework.cmd/loadgen/— TUI HTTP load generator with a live-updating dashboard. Demonstrates theLiveViewphase.cmd/scaffold/— TUI code generator. Demonstrates theTextInputphase with inline validation.cmd/admin/— TUI deployment inspector. Demonstrates the dynamic Picker pattern (Picker fed by an AsyncTask result). Has aBackendinterface with both a live (pgxpool + valkey) and a fake implementation.cmd/devup/— TUI wrapper arounddocker compose. Usesinternal/proc.Runnerfor subprocess execution (proc.OSshells out,proc.Fakefor tests).cmd/migrate/— TUI for schema migrations. Has aMigratorinterface withLiveMigrator(golang-migrate against the real DB) andFakeMigrator(in-memory). Composes existing phases without adding new framework muscle.cmd/inspect/— TUI demo wiringinternal/eventbusintoLiveView. TheInspectorsubscribes to aneventbus.Async[Event], accumulates per-level/-kind counters and a ring buffer of recent events, exposes itself as atui.LiveSampler. Synthetic producers (steady/bursty/noisy) drive the bus.internal/handlers/— Route handlers. Handlers returnhttp.HandlerFuncclosures.internal/middleware/— HTTP middleware (logging, panic recovery, content-type detection). Each middleware is afunc(http.Handler) http.Handlerapplied viarouter.Use().internal/tui/— Reusable TUI scaffolding built on bubbletea/lipgloss. Exports aPhaseinterface and reusable phases (Picker,Confirm,TextInput,AsyncTask,LiveView,Done); callers assemble them into a roottea.Model. Seecmd/onboard/model.go,cmd/loadgen/model.go, andcmd/scaffold/model.gofor examples.ci/Dockerfile— Multi-stage build: compiles ingolang:alpine, copies binary toscratchimage.
Defined in .github/workflows/commit.yml. Runs on all pushes and PRs. Jobs: compile-binary, build-image (depends on compile), test, complexity, static-analysis, check-licenses, security, codeql-analysis. Go version is read from go.mod.