joeyave/golang-ddd-skills · Archived

golang-ddd-architecture

Design and refactor Go service architecture for DDD-style systems.

First seen Apr 12, 2026

Installation

$ npx skills add joeyave/golang-ddd-skills --skill golang-ddd-architecture

Summary

  • Design and refactor Go service architecture for DDD-style systems.
  • Use when a Go codebase needs explicit ports/app/domain/adapters boundaries, dependency rules, interface placement, composition-root dependency injection, separate transport and database models, or help deciding whether DDD, Clean Architecture, or CQRS are justified.

Stronger alternatives

This repository is archived — consider an actively maintained alternative.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from joeyave/golang-ddd-skills.

npx skills add joeyave/golang-ddd-skills

Browse all from joeyave/golang-ddd-skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Declared
Cursor Declared
Codex Declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Declared
Cline Not declared
OpenCode Declared

Repository health

Stars 4
License LICENSE
Default branch main
Open issues 0
Status Archived

Skill metadata

Parsed from SKILL.md frontmatter.

Version0.3.0
LicenseMIT
CompatibilityDesigned for Codex, Claude Code, Gemini CLI, Cursor, OpenCode, and similar AI coding agents working with Go services.
Declared agents claude-code cursor codex gemini opencode
More metadata
author
joeyave
version
0.3.0

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 3,476 B
  • docs SUMMARY.md 364 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 45 installs

SKILL.md

Golang DDD Architecture

Use this skill to shape a Go service so it stays easy to change, test, and reason about as business logic grows.

Start Here

  • Check whether the service is complex enough to justify the pattern.
  • Keep the design smaller for simple CRUD or authentication flows where read and write shapes are mostly identical and business rules are thin.
  • Use the full workflow when handlers keep growing if trees, models are reused across boundaries, or dependencies are hard to mock or untangle.

Workflow

  1. Inventory entry points and use cases.
  • Start from HTTP handlers, gRPC services, CLI commands, message consumers, and scheduled jobs.
  • Rewrite the supported operations in business language before moving code around.
  1. Draw the boundary map.
  • ports are inbound transport and serialization only.
  • app orchestrates use cases.
  • domain owns business rules and invariants.
  • adapters talk to databases, queues, external APIs, files, and other infrastructure.
  1. Enforce dependency direction.
  • domain depends on nothing outside itself.
  • app may import domain but not concrete transport or adapter packages.
  • ports and adapters may import inward layers.
  • Fix import cycles by moving interfaces inward or by splitting responsibilities, not by flattening everything into one package.
  1. Place interfaces next to the consumer.
  • Define interfaces in the package that needs the behavior.
  • Keep them narrow and use-case-oriented.
  • Inject implementations from the composition root.
  1. Separate models that change for different reasons.
  • Do not reuse one struct for DB rows, API responses, Pub/Sub payloads, and domain state unless their change cadence is truly the same.
  • Accept data duplication when it removes coupling. DRY is usually more valuable for behavior than for data.
  1. Keep main boring.
  • Use main as the composition root.
  • Wire repositories, clients, handlers, and configuration there.
  • Do not hide business logic, validation, or workflow branching there.
  1. Leave the codebase more testable than you found it.
  • Domain rules should be unit-testable without mocks.
  • Application orchestration should be testable with tiny handwritten mocks.
  • Adapter behavior should be covered with integration tests.

Use These References

  • Read [references/architecture-rules.md](references/architecture-rules.md) for layer rules, package layouts, and anti-patterns.
  • Read [references/naming-and-models.md](references/naming-and-models.md) when naming, model boundaries, or shared-struct tradeoffs are the hard part.

Deliverables

  • a clear layer map or package plan,
  • dependency direction that compiles without import-cycle hacks,
  • constructors or wiring points in the composition root,
  • explicit model boundaries,
  • a short backlog of follow-up refactors if the system is too tangled for one pass.