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
npx skills add Mindrally/skills --skill clean-architecture -a claude-codeWhat 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, andpresentation. - 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-code2Manually: put the files in place
~/.claude/skills/clean-architecture/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/clean-architecture/
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill clean-architecture -a codex2Manually: put the files in place
.agents/skills/clean-architecture/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill clean-architecture -a cursor2Manually: put the files in place
.cursor/skills/clean-architecture/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install Mindrally/skills clean-architecture2Manually: put the files in place
.github/skills/clean-architecture/SKILL.md1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill clean-architecture -a gemini-cli2Platform CLI
gemini skills install https://github.com/Mindrally/skills --path clean-architectureManually: put the files in place
.devin/skills/clean-architecture/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add Mindrally/skills --skill clean-architecture -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
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.