go-architect

Designs Go web server architecture with net/http routing, dependency injection, and graceful shutdown.

2|Updated May 25, 2026
One-click install
npx skills add https://github.com/edheltzel/Do-Skills --skill go-architect-edheltzel
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: go-architect
Source: https://github.com/edheltzel/Do-Skills/tree/main/skills/engineering/go/do-review-go/references/go-architect
Command: npx skills add https://github.com/edheltzel/Do-Skills --skill go-architect-edheltzel

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Go developers often struggle with structuring web applications: choosing between flat and modular layouts, wiring dependencies without globals, and implementing production-grade graceful shutdown. This Skill provides opinionated architecture guidance and review gates for building maintainable Go HTTP services. ## Core Features & Use Cases - Go 1.22+ Routing Patterns: Method-based routing, path parameters, wildcards, and precedence rules using the enhanced net/http ServeMux without third-party frameworks. - Dependency Injection Guidance: Constructor-based wiring, consumer-defined interfaces, functional options, and a composition root in main.go for testable code. - Graceful Shutdown & Project Structure: Signal handling with signal.NotifyContext, bounded shutdown timeouts, cleanup ordering, health checks, and flat-to-modular migration signals. - Use Case: When scaffolding a new Go API server or reviewing an existing one, apply the hard gates to verify the toolchain version, composition root, bounded shutdown context, and absence of env reads or globals in handlers. ## Quick Start Ask the agent to review or scaffold a Go HTTP server using the go-architect skill, for example: review my Go service for proper dependency injection and graceful shutdown.

Frequently Asked Questions about go-architect

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a Go web application project?▼

Start with a flat structure (single package, files like main.go, server.go, handlers.go) for small services under ~10 handlers. Migrate to a modular layout with cmd/ and internal/ domain packages when files grow large, naming collisions appear, or multiple teams contribute.

How do I implement graceful shutdown in a Go HTTP server?▼

Use signal.NotifyContext to listen for SIGINT and SIGTERM, then call http.Server.Shutdown with a bounded context.WithTimeout (typically 10 seconds). Close databases and caches via deferred calls after the server drains in-flight requests.

Does Go need a dependency injection framework?▼

No. Go's interfaces, structs, and constructor functions provide everything needed for dependency injection. Pass dependencies through New* constructors, define small interfaces at the consumer, and wire everything explicitly in main.go as the composition root.

Should I use gin or echo instead of net/http for routing?▼

Start with the standard library. Go 1.22+ ServeMux supports method-based routing and path parameters like GET /api/users/{id}, covering most needs. Only add a framework when you hit concrete limitations such as complex middleware chains or regex routes.

Why is using init() or global variables bad in Go services?▼

Globals and init() create hidden dependencies, run before main() without error handling, and make code untestable. Instead, construct dependencies explicitly in main() or a run() function and pass them through struct fields and constructors.