Skip to main content
skill CX Codex

clean-architecture · mindrally — Claude Code skill: what it does, install

This skill guides Clean Architecture work in Flutter and Go. Use it when layer boundaries, dependency direction, and testable business logic matter.

Apache-2.0 1,100 installs ★ 312 updated 2026-10-08

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add Mindrally/skills --skill clean-architecture -a claude-code
Open on GitHub

What clean-architecture does

The skill separates an application into inward-pointing layers: domain, application, infrastructure, and presentation. For Flutter, it describes feature-first folders, flutter_bloc for state, immutable models with freezed, and functional failures using Either<Failure, Success> from dartz.

For Go, it groups the code into handlers, services, repositories, and domain models. The guidance uses small interfaces, constructor injection, and table-driven unit tests with mocks. A Flutter project therefore needs to account for flutter_bloc, freezed, get_it, and dartz.

What it helps with

  • split a Flutter feature into clear architecture layers
  • keep business rules independent from external services
  • organize Go handlers, services, and repositories
  • inject dependencies through focused interfaces
  • write table-driven unit tests with mocks

Example prompts for the agent

  • Reorganize this Flutter feature around Clean Architecture and suggest its folder layout.
  • Inspect the dependency direction between domain, data, and presentation.
  • Design Go repository interfaces and table-driven unit tests with mocks.

How to install clean-architecture

1Skills CLI (Vercel)

npx skills add Mindrally/skills --skill clean-architecture -a claude-code

2Manually: put the files in place

~/.claude/skills/clean-architecture/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/clean-architecture/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about clean-architecture

How do I install clean-architecture in Claude Code?

Run npx skills add Mindrally/skills --skill clean-architecture -a claude-code, then check ~/.claude/skills/clean-architecture/SKILL.md.

What does clean-architecture do?

It guides the agent through layer separation, inward dependencies, dependency injection, and testing patterns for Flutter and Go applications.

Which Flutter libraries does the skill use?

The Flutter guidance refers to flutter_bloc, freezed, get_it, and dartz for state management, immutable types, dependency injection, and functional error handling.

Source text

SKILL.md · Apache-2.0
---
name: clean-architecture
description: Guidelines for implementing Clean Architecture patterns in Flutter and Go applications, with emphasis on separation of concerns, dependency rules, and testability.
metadata:
  maintainer: Mindrally
  source: https://github.com/Mindrally/skills
---

# 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
- **Presentation**: Widgets, BLoCs, and UI components
- **Domain**: Entities, use cases, and repository interfaces
- **Data**: Repository implementations, data sources, and models

### Feature-first Organization
```
feature/
  data/
    datasources/
    models/
    repositories/
  domain/
    entities/
    repositories/
    usecases/
  presentation/
    bloc/
    pages/
    widgets/
```

### State Management with flutter_bloc
- Use flutter_bloc for state management
- Implement immutable states via Freezed
- Handle events and states with proper patterns
- Keep BLoCs focused on single responsibilities

### Error Handling
- Implement Either<Failure, Success> pattern from Dartz
- Use functional error handling without exceptions
- Define clear Failure types for different error scenarios

### Key Libraries
- `flutter_bloc` - State management
- `freezed` - Immutable classes and unions
- `get_it` - Service locator for DI
- `dartz` - Functional programming utilities

## Go Backend Clean Architecture

### Layer Separation
- **Handlers** - HTTP/gRPC request handling
- **Services** - Business logic and use cases
- **Repositories** - Data access abstractions
- **Domain Models** - Core business entities

### Interface-driven Development
- Define interfaces for all dependencies
- Implement dependency injection through constructors
- Keep interfaces small and focused
- Allow easy mocking for tests

### 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
- Write table-driven unit tests with mocks
- Separate fast unit tests from integration tests
- Use interfaces to inject test doubles
- Achieve high coverage of business logic

© Mindrally · Apache-2.0 · Mindrally/skills

Similar skills

All skills for Frontend and UI →

clean-architecture by other authors comes first.

clean-architecture wondelai clean-architecture — a skill that keeps business rules independent of framework and database by enforcing one rule: source code dependencies point inward. CX Codex +1 8,000installs clean-architecture codewithmukesh clean-architecture — a skill that lays out .NET code across four projects, keeps dependencies pointing inward, and shows where use case handlers belong. CX Codex +1 4,200installs clean-architecture ciembor This Claude Code skill applies clean architecture principles to decisions about separating business policy from implementation details. It activates for work on dependency direction, use cases, and application boundaries. CX Codex +1 645installs clean-architecture giuseppe-trisciuoglio Skill for designing layered Java 21+ and Spring Boot 3.5+ applications. Separates business logic from the framework by uniting Clean Architecture, Hexagonal Architecture, and Domain-Driven Design into one system. CX Codex +1 4,200installs clean-architecture pproenca clean-architecture — a skill with 42 rules from Robert C. Martin's book: it tells the agent which way dependencies should point and where layer boundaries belong. CX Codex +1 2,100installs go-backend-clean-architecture rebyteai-template go-backend-clean-architecture scaffolds a Go backend in the current folder: Gin, MongoDB, JWT auth and Clean Architecture layers, from clone to first run. CX Codex +1 105installs python-clean-architecture MKToronto python-clean-architecture provides Clean Architecture guidance for Python and FastAPI projects. It checks layer boundaries, inspects coupling, and generates service scaffolding inside Claude Code. ★ 11repo stars android-clean-architecture affaan-m android-clean-architecture tells the agent how to split an Android or KMP project into layers: modules, dependency rules, UseCases, repositories, plus Room, SQLDelight and Ktor patterns. CX Codex +1 7,200installs architecture-patterns OrchestKit architecture-patterns enforces clean architecture, backend layer boundaries, and directory limits. Triggers when designing module boundaries or running refactoring tasks. CX Codex +1 236installs mobile-engineer First Fluke mobile-engineer implements mobile features across Flutter, React Native, Swift, and Kotlin following Clean Architecture boundaries. CX Codex ★ 1,472repo stars audit-clean-arch Quintin Henry (https://github.com/qdhenry/) audit-clean-arch audits a Rust codebase against Clean Architecture rules. It locates improper layer dependencies, framework leaks, and concrete adapter couplings. CX Codex +1 ★ 1,357repo stars

From the same set247

The whole set →
bootstrap Tells the agent how to build interfaces with Bootstrap: grid, components, utilities, form validation. Useful when you want no custom CSS. CX Codex +1 1,200installs technical-writing Enforces strict technical writing rules for developer tutorials and documentation. It eliminates cliches and bullet lists to produce deep, practical implementation guides. CX Codex +1 1,200installs python This skill tells your coding agent how to write Python: PEP 8, type hints, early returns, async for I/O. Useful when the agent edits or generates code in a Python repo. CX Codex +1 1,100installs numpy-best-practices numpy-best-practices — a skill that gives your agent NumPy ground rules: vectorize instead of looping, pick dtypes, watch memory, use np.linalg. Useful whenever Python code crunches numbers. CX Codex +1 1,100installs scipy-best-practices scipy-best-practices — a skill that gives your coding agent rules for SciPy work: optimization, linear algebra, stats, signal processing. Useful when the Python code does math, not UI. CX Codex +1 1,100installs optimized-nextjs-typescript optimized-nextjs-typescript is a Claude Code skill for building and refining Next.js applications written in TypeScript. It covers performance, security, project structure, and UI work. CX Codex +1 1,100installs kubernetes kubernetes is a Claude Code skill for Kubernetes, DevOps, and cloud infrastructure work. It guides tasks involving containers, CI/CD pipelines, and infrastructure as code. CX Codex +1 1,100installs quarkus Teaches coding agents the Quarkus way: project layout, CDI, MicroProfile APIs, native GraalVM builds. It kicks in when the agent writes or tests Java backend code. CX Codex +1 1,100installs

Project sponsors

Companies that keep this analytics open