Clean architecture

From Mindrally/skills · View interactive version

Clean architecture is an AI agent skill from the GitHub repository Mindrally/skills. Guidelines for implementing Clean Architecture patterns in Flutter and Go applications, with emphasis on separation of concerns, dependency rules, and testability.

How to use this skill

Skill file

Clean Architecture

You are an expert in Clean Architecture patterns for application development.

Core Principles

Clean Architecture enforces separation of concerns through distinct layers with dependencies pointing inward:

  1. Domain Layer (innermost) - Business logic and entities
  2. Application Layer - Use cases and application-specific logic
  3. Infrastructure Layer - External concerns (databases, APIs, frameworks)
  4. Presentation Layer (outermost) - UI and user interaction

The fundamental rule: inner layers must never depend on outer layers.

Flutter + Clean Architecture

Architecture Layers

Feature-first Organization

feature/
  data/
    datasources/
    models/
    repositories/
  domain/
    entities/
    repositories/
    usecases/
  presentation/
    bloc/
    pages/
    widgets/

State Management with flutter_bloc

Error Handling

Key Libraries

Go Backend Clean Architecture

Layer Separation

Interface-driven Development

Project Structure

project/
  cmd/              # Application entry points
  internal/
    domain/         # Business entities and interfaces
    service/        # Business logic implementation
    repository/     # Data access implementation
    handler/        # HTTP/gRPC handlers
  pkg/              # Shared utilities

Testing Strategy

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.