go-backend

Scaffold Go backends with a stdlib-first layered architecture and Chi router.

5|Updated Jan 31, 2026
One-click install
npx skills add https://github.com/katsutoo/dotfiles --skill go-backend
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-backend
Source: https://github.com/katsutoo/dotfiles/tree/main/config/opencode/skills/go-backend
Command: npx skills add https://github.com/katsutoo/dotfiles --skill go-backend

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Go backend projects often suffer from over-dependency bloat and inconsistent architectures. This Skill proposes a stdlib-first approach to craft reliable, maintainable backends with clear layering and security-conscious defaults.

Core Features & Use Cases

  • Stdlib-first Go backend design with minimal dependencies and strong typing.
  • Layered architecture (handler/service/repository) with explicit transaction boundaries and domain models.
  • Production-ready stack guidance: Chi router, pgx + sqlc, Goose migrations, slog logging, Argon2id password hashing, UUIDv7 IDs, and testcontainers for integration tests.
  • Comprehensive guidelines for testing, CI/CD, security, deployment patterns, and maintainable project structure.

Quick Start

Scaffold a new Go backend project using the stdlib-first guidelines and the recommended stack.

Frequently Asked Questions about go-backend

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

FAQPage Schema
How do I structure a Go backend project to avoid dependency bloat?

A stdlib-first Go backend structure minimizes dependency bloat by prioritizing the standard library and enforcing a clear layered architecture. This approach separates handler, service, and repository layers with explicit transaction boundaries to maintain reliable domain models.

What is the best way to set up a Go REST API with sqlc and pgx?

Setting up a Go REST API with sqlc and pgx uses a stdlib-first architecture with Chi routing. This stack provides type-safe database queries, explicit transaction boundaries, and layered domain models for maintainable microservices.

Does this Go backend architecture support integration testing with testcontainers?

Yes, this Go backend architecture supports integration testing with testcontainers. It includes comprehensive testing guidelines that leverage testcontainers to spin up database instances, ensuring your pgx and sqlc repository layers are validated against real database environments.

Can I use Goose database migrations in a layered Go backend?

Yes, you can use Goose database migrations in a layered Go backend. The architecture integrates Goose to manage schema changes alongside pgx and sqlc, ensuring your database state remains synchronized with your strongly typed domain models and repository layer.

How do you handle password hashing and UUIDs in a Go microservice?

Handle password hashing and UUIDs in a Go microservice using Argon2id for security and UUIDv7 for identifiers. This stdlib-first approach establishes security-conscious defaults throughout the service and repository layers without relying on excessive external dependencies.

Why choose a stdlib-first approach over heavy frameworks for Go backends?

Choose a stdlib-first approach for Go backends to solve the problem of over-dependency bloat and inconsistent architectures. It crafts maintainable services with minimal dependencies, using targeted libraries like Chi and sqlc rather than restrictive overarching web frameworks.