code-designing

Design Go domain types and vertical-slice architecture with validating constructors.

4|1|Updated Oct 13, 2025
One-click install
npx skills add https://github.com/buzzdan/ai-coding-rules --skill code-designing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-designing
Source: https://github.com/buzzdan/ai-coding-rules/tree/main/go-linter-driven-development/skills/code-designing
Command: npx skills add https://github.com/buzzdan/ai-coding-rules --skill code-designing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Domain-driven design for Go: plan domain types, validate invariants, and structure code to avoid primitive obsession, enabling vertical slice architecture and robust type safety.

Core Features & Use Cases

  • Analyze architecture to decide vertical vs horizontal slices.
  • Identify core domain concepts and self-validating types with validating constructors.
  • Plan feature package structure and orchestration between types and services.
  • Use in feature planning, refactoring, and architecture reviews to maintain cohesion.

Quick Start

Analyze the feature scope, identify core domain types, and produce a vertical-slice design plan.

Frequently Asked Questions about code-designing

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

FAQPage Schema
How do I design self-validating domain types in Go to avoid primitive obsession?

Self-validating domain types enforce invariants inside constructor functions, preventing invalid states and reducing primitive obsession in Go. This approach keeps validation logic centralized within the type creation process.

What is vertical slice architecture and when should I use it in Go projects?

Vertical slice architecture structures Go packages by feature instead of technical layers. Apply it during feature planning and refactoring to ensure cohesive modules with explicit orchestration between domain types and services.

How do I plan feature package structure for domain-driven design in Go?

Analyze the feature scope to identify core domain concepts, then organize packages into vertical slices. Produce a design plan defining validating constructors, explicit type boundaries, and service orchestration for domain-driven Go projects.

Does this vertical slice design approach work for refactoring existing Go codebases?

This approach applies to refactoring by analyzing existing architecture to decide vertical versus horizontal slices, identifying self-validating domain types, and planning package restructuring to strengthen type safety and module cohesion.

What's the best way to enforce invariants and validation in Go domain types?

The best way is using self-validating constructors that reject invalid data during instantiation. This ensures type safety by making invalid states unrepresentable, reducing primitive obsession, and enforcing domain rules at the type level.

When should I choose vertical slices over horizontal layering for Go architecture?

Choose vertical slices over horizontal layering when features demand strong cohesion across domain types and services. Architecture reviews help decide the split by analyzing feature scope and orchestration needs to reduce coupling between unrelated modules.