clean-architecture-general

Generate a runnable Clean Architecture Go scaffold with ports and adapters.

Updated Mar 20, 2026
One-click install
npx skills add https://github.com/gophper/clean-arch-skills --skill clean-architecture-general
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-architecture-general
Source: https://github.com/gophper/clean-arch-skills/tree/main
Command: npx skills add https://github.com/gophper/clean-arch-skills --skill clean-architecture-general

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Teams and learners struggle to consistently apply Clean Architecture (Ports & Adapters) in Go, especially when adding business use cases and external integrations without breaking dependency rules.

Core Features & Use Cases

  • Runnable minimal demo: Generates a minimal Clean Architecture Go scaffold you can run immediately to learn the patterns with real code.
  • Port/Adapter structure: Models business logic around interfaces (ports) and keeps adapters responsible for external integration and error mapping.
  • Test-friendly by design: Supports unit tests using fakes with no DB/MQ/HTTP dependencies, keeping business rules isolated.
  • Use-case expansion workflow: Provides SOP and AI prompt templates to add new use cases, ports, adapters, domain errors, and tests while preserving dependency direction.

Quick Start

Ask your AI assistant to extend the generated minimal demo by adding a new order use case (e.g., CancelOrder) and update the required domain errors, ports, adapters, handler mapping, and unit tests so the architecture constraints remain satisfied.

Frequently Asked Questions about clean-architecture-general

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

FAQPage Schema
How do I scaffold a Clean Architecture project in Go for HTTP APIs and CLI flows?

You can scaffold a Clean Architecture Go project by generating a runnable Ports & Adapters structure that isolates business logic via interfaces and keeps external dependencies in adapters. This provides a minimal demo for HTTP APIs and CLI consumer flows.

What's the best way to add new use cases in Go without breaking dependency rules?

The best way to add use cases is using an expansion workflow with AI prompt templates that guide adding ports, adapters, domain errors, and unit tests while preserving explicit dependency direction and business isolation.

How does adapter error mapping work in Go Ports & Adapters architecture?

Adapter error mapping in Ports & Adapters architecture translates external integration errors into domain errors. Adapters handle external dependencies and map failures to domain-specific errors so business rules remain isolated.

Can I unit test Go business rules with fake dependencies instead of a real database?

Yes, you can unit test Go business rules using fake dependencies. The test-friendly design supports unit tests with fakes requiring no DB, MQ, or HTTP dependencies, keeping business logic fully isolated.

Does Go Clean Architecture support incremental feature additions for new integrations?

Go Clean Architecture supports incremental feature additions by providing SOPs to add new use cases, ports, and adapters. This allows extending external integrations while maintaining dependency direction constraints.

Why do I need dependency injection in Go Clean Architecture scaffolds?

You need dependency injection in Go Clean Architecture scaffolds to enforce explicit dependency direction. It ensures business logic depends only on port interfaces, keeping external integrations isolated in adapters.