Go Engineering
Go engineering guidance for language correctness, idiomatic APIs, command contracts, testing and profiling, concurrency, HTTP clients and servers, SQL-backed CLIs, Cobra applications, subprocess supervision, and reproducible releases.
Included Skills
Design and review maintainable Go CLI application boundaries, package layout, dependency direction, command factories, configuration ownership, adapters, services, storage, and composition roots. Use when starting a multi-command CLI, extracting business logic from Cobra, untangling globals, adding external dependencies, or deciding what belongs under cmd, internal, or reusable packages.
Design and review predictable Go command-line interfaces with canonical names and flags; explicit inputs and precedence; human, plain, and structured output; safe prompting; stdout and stderr contracts; help; errors; exit codes; cancellation; dependency injection; and platform behavior. Use when creating a Go CLI, changing its public command contract, making command code testable, or reviewing compatibility for people, scripts, AI agents, and CI.
Prepare reproducible Go CLI artifacts across operating systems and architectures with toolchain-derived target matrices, capability profiles, portable config and cache discovery, CGO decisions, version metadata, artifact handoff, smoke tests, archives, checksums, containers, and versioned source installation. Use when cross-compiling, packaging binaries, defining the distribution contract, or reviewing portability before release automation.
Design and review recoverable Go CLI errors, exit semantics, structured logging, debug modes, traces, profiles, redaction, and user-consented diagnostic bundles. Use when a CLI needs actionable failures, safe support evidence, production troubleshooting, or observability that does not corrupt command output or expose secrets.
Execute and supervise external programs safely from Go CLIs with explicit arguments, typed failure classification, working directories, environments, bounded streams, deadlock-safe pipes, contexts, timeouts, signals, platform adapters, descendant cleanup, runner seams, and lifecycle tests. Use when wrapping a command, diagnosing start or exit failures, hangs, deadlocks, or orphan processes, or implementing cancellable cross-platform CLI workflows.
Design, implement, and review secure Go CLI release automation with versioned tags, GoReleaser, GitHub Actions, checksums, signing, provenance, changelogs, Homebrew distribution, least-privilege credentials, verification, and recovery. Use when publishing CLI artifacts, configuring release CI, adding package-manager delivery, or diagnosing a partial or failed release.
Design, implement, test, and ship SQL-backed persistence for Go CLIs using database/sql, explicit pool ownership, bounded startup checks, embedded migrations, transaction boundaries, parameterized queries, adapter error mapping, Scanner and Valuer types, SQLite or server databases, and real-driver integration tests. Use when a Go command stores durable state in SQL, initializes a local database, applies schema changes, or needs safe repository and transaction behavior.
Design and review adaptive Go CLI terminal experiences with explicit human, plain, and structured modes; per-stream TTY detection; color and accessibility controls; prompts; progress; secret input; cancellation; and broken-pipe handling. Use when a Go CLI must work safely for people, scripts, AI agents, CI, redirected streams, or interactive dashboards.
Design, implement, stabilize, and review Go CLI tests across fresh command trees, pure logic, table-driven cases, streams, typed configuration, files, environment, function-backed HTTP fakes, repositories, subprocesses, capability profiles, race checks, and artifact behavior. Use when adding command tests, diagnosing flaky Go tests, choosing test boundaries, or verifying human-, agent-, and CI-facing CLI contracts.
Build, refactor, test, and review Cobra-based Go applications with intentional command trees, fresh constructors, suggestions, typed boundaries, scoped flags, local or remote configuration, explicit precedence, safe live reload, context propagation, stable streams, shell completion, and generated documentation. Use for Cobra or Viper CLI architecture and implementation.
Design, implement, test, and review bounded in-process Go concurrency using goroutines, channels, iterators, mutexes, shared collections, WaitGroup, errgroup, backpressure, ordering, cancellation, and deterministic lifecycle checks. Use when building worker pools, streaming pipelines, concurrent batches, background stages, or diagnosing races, goroutine leaks, blocked operations, synchronization ownership, and shutdown failures.
Design, implement, test, and review resilient Go HTTP client boundaries with context propagation, layered timeouts, transport reuse, request construction, authentication, status classification, bounded bodies, retry safety, backoff, rate limits, pagination, observability, and deterministic fakes. Use when a Go CLI or service calls remote APIs or when HTTP behavior is slow, flaky, unsafe, or hard to test.
Design, build, test, and review production Go HTTP servers covering inbound adapters, modern ServeMux routing, middleware, strict bounded request decoding, response commitment, transparent ResponseWriter wrapping, server timeouts, health semantics, graceful shutdown, shared-state safety, and httptest verification. Use when implementing an HTTP service, API handler, middleware stack, server lifecycle, health endpoint, or inbound JSON boundary in Go.
Design and review stable, idiomatic Go package APIs covering naming, exported declarations, embedding, receivers, typed-nil interfaces, generics, functional options, method sets, errors, wire contracts, compatibility, and examples. Use when creating a reusable Go package, reviewing its public surface, evolving an exported API, or choosing concrete types, functions, methods, fields, interfaces, or type parameters.
Review and improve Go language-level correctness across numeric conversions, overflow, slices, maps, range loops, comparisons, strings, runes, UTF-8, defer evaluation, and version-dependent semantics. Use when reviewing agent-generated Go, debugging surprising mutation or memory retention, validating parsing and text handling, or checking code that depends on representation, aliasing, iteration, or runtime behavior.
Design, run, compare, and interpret Go performance evidence using benchmarks, B.Loop, benchstat, pprof, traces, escape analysis, cache locality, false sharing, sync.Pool, GC limits, container CPU behavior, and PGO. Use when investigating Go latency, throughput, CPU, memory, allocations, contention, runtime behavior, performance regressions, or optimization claims.