Skip to content
Development
Skill

/go-architecture

Use when laying out a new Go service, choosing an HTTP router or DB layer, or wiring dependencies. Not for concurrency (go-concurrency) or language idioms (go-core-idioms).

From plugin
fusengine-claude-plugins
34200 skills40 agents34 commands

Claude Code

$ npx -y skills add fusengine/claude-plugins --skill go-architecture --agent claude-code

SKILL.md

go-architecture.SKILL.md
name: go-architecture
description: Use when laying out a new Go service, choosing an HTTP router or DB layer, or wiring dependencies. Not for concurrency (go-concurrency) or language idioms (go-core-idioms).

<objective> Structure Go 1.22+ backend services: the standard cmd/internal layout, choosing an HTTP router (net/http ServeMux, chi, echo/gin/fiber), constructor-based dependency injection, and type-safe database access with sqlc + pgx. Covers laying out a new Go project, choosing a router or DB layer, wiring dependencies, and reviewing an existing service's structure. Does not cover goroutines/channels concurrency patterns (see go-concurrency) or general language idioms (see go-core-idioms). </objective>

Go Architecture

Opinionated, 2026-current guidance for structuring Go backend services. Favors the standard library and small, composable libraries over heavy frameworks.

**Use when:**

  • Laying out a new Go module or service (directory structure, `cmd/`, `internal/`)
  • Choosing an HTTP router (stdlib `net/http` ServeMux, chi, echo/gin/fiber)
  • Choosing a database layer (sqlc + pgx, GORM) or wiring queries
  • Wiring dependencies (constructors, DI without a framework)
  • Reviewing an existing Go service for structural / architectural issues

**Do NOT use for:**

  • Writing tests, benchmarks, fuzzing, coverage — use `go-testing-quality`
  • SOLID line-limit / interface-placement enforcement — use `fuse-solid:solid-go`
  • Non-Go backends (Laravel, Next.js, Rust) — use the matching expert
  • Frontend / UI work — use `fuse-design` or a framework expert

---

Decision Map

| Question | Load | |----------|------| | Where do files/packages go? | [project-layout.md](references/project-layout.md) | | Which HTTP router? How do I route? | [http-routing.md](references/http-routing.md) | | How do I talk to the database? | [database-access.md](references/database-access.md) | | How do I wire dependencies? | [dependency-injection.md](references/dependency-injection.md) | | I need a full working example | [templates/rest-service.md](references/templates/rest-service.md) |

---

Core Principles (2026)

1. **Standard library first.** Since Go 1.22 the `net/http.ServeMux` supports method matching and path wildcards (`GET /posts/{id}`, `req.PathValue("id")`). Most services no longer need a routing framework. Source: https://go.dev/blog/routing-enhancements 2. **`internal/` is the default home for service logic.** A server binary is self-contained; keep packages under `internal/` and binaries under `cmd/`. There is no official `pkg/` requirement — do not cargo-cult it. Source: https://go.dev/doc/modules/layout 3. **Constructor injection, no DI framework by default.** Pass dependencies as interface parameters to `New…` constructors; wire them in `main`. 4. **Type-safe SQL is the 2026 default.** `sqlc` generates idiomatic Go from raw SQL; run it on top of the `pgx` driver for PostgreSQL. GORM still works but is in relative decline for new services — see database-access.md for the nuance. Sources: https://docs.sqlc.dev + https://pkg.go.dev/github.com/jackc/pgx/v5

---

Workflow

1. **Explore** the existing tree first (do not assume layout). 2. **Load** the relevant reference from the Decision Map above. 3. **Cross-check** the version-sensitive claims (router, sqlc/pgx) against the source URLs before writing code — APIs move. 4. **Scaffold** from [templates/rest-service.md](references/templates/rest-service.md) when starting fresh. 5. **Keep files small** and interfaces separated (defer to `fuse-solid:solid-go`). 6. **Validate** with `go-testing-quality` + sniper after any code change.

---

Boundaries (cross-referenced, not copied)

The community skill set at `github.com/samber/cc-skills-golang` covers overlapping Go territory. This skill deliberately scopes to **architecture / structure / routing / DB wiring** and hands testing off to `go-testing-quality`. When in doubt about which skill owns a topic, prefer the more specific one.

Read more
@fusengine
Ships withfusengine-claude-plugins

A plugin ecosystem that turns Claude Code into a supervised, multi-agent development environment.

34200 skills40 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
34
Star history of fusengine/agents on GitHub, a chart by star-history.com

Other skills on fusengine-claude-plugins.

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills10d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc12d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react1d252k
@facebook@facebookInstall Skill

Questions about go-architecture.

Which coding agents can use go-architecture?
go-architecture installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.