architecture

Enforce clean architecture layer separation and inward dependency flow in Go projects.

1|Updated Mar 5, 2026
One-click install
npx skills add https://github.com/baphled/dotopencode --skill architecture-baphled
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: architecture
Source: https://github.com/baphled/dotopencode/tree/main/skills/architecture
Command: npx skills add https://github.com/baphled/dotopencode --skill architecture-baphled

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enforces clean architecture principles, ensuring layer separation, correct dependency direction, and boundary rules to maintain a clean and scalable codebase.

Core Features & Use Cases

  • Layer Enforcement: Ensures domain, service, repository, and handler layers are distinct and correctly structured.
  • Dependency Management: Prevents outward dependencies, keeping the core domain logic free from external framework or infrastructure concerns.
  • Use Case: When designing a new feature in a Go project, use this Skill to guide the placement of new logic within the appropriate layers (domain, service, handler) and verify that dependencies flow correctly inward.

Quick Start

Use the architecture skill to review the current Go project structure for layer boundary violations.

Frequently Asked Questions about architecture

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

FAQPage Schema
How do I enforce clean architecture and layer separation in a Go project?

To enforce clean architecture in a Go project, ensure domain, service, repository, and handler layers are distinct. Verify that dependencies flow inward toward the domain core, keeping infrastructure concerns isolated from business logic.

What's the best way to structure feature-based packages using clean architecture?

The best way to structure feature-based packages in clean architecture is to organize code by domain features, placing logic in appropriate layers like domain, service, and handler. This maintains layer isolation and inward dependency flow for scalable codebases.

How do I prevent outward dependencies from polluting my domain logic?

To prevent outward dependencies from polluting domain logic, apply interface-based repository patterns and service orchestration. This keeps the core domain free from external framework or infrastructure concerns by enforcing strict boundary rules.

Can I use dependency injection to manage layers in a Golang service architecture?

Yes, you can use dependency injection in Golang service architecture to manage layers. It facilitates service orchestration and ensures dependencies flow correctly inward, keeping the domain layer isolated from infrastructure and framework implementations.

When do I need interface-based repository patterns for code quality?

You need interface-based repository patterns for code quality when separating domain logic from data access. This approach enforces clean architecture by defining contracts at the domain layer, preventing direct infrastructure dependencies.

Why does my clean architecture review keep failing on layer boundary violations?

Clean architecture reviews fail on layer boundary violations when dependencies flow outward instead of inward. This happens when domain or service layers directly reference infrastructure or handler components, breaking the required layer isolation.