agentleFS
aaziraniaazirani/flutter_agentify/.agents/skills/clean-architecture/SKILL.md

clean-architecture

Skill0 starsChanged 4 days agoMITView on GitHub

Which code goes in domain/, data/, presentation/ and ai/, which way imports may point, and where a new file belongs. Use when adding a file, adding a repository, or when an import is rejected by the layer rules.

30 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use convention-learner, opentelemetry and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • codewithmukeshSkill

    convention-learner

    Detects and enforces project-specific coding conventions by analyzing existing codebase patterns. Learns naming conventions, folder structure, test organization, and coding style from the existing code. Load when: "conventions", "coding standards", "project patterns", "enforce style", "detect patterns", "learn conventions", "code consistency".

    Also in 3 projects that use this

  • codewithmukeshSkill

    opentelemetry

    OpenTelemetry observability for .NET 10 applications. Covers traces, metrics, and logs using the OpenTelemetry SDK with OTLP export. Includes custom ActivitySource, IMeterFactory metrics, resource configuration, and Aspire Dashboard integration. Load this skill when setting up distributed tracing, custom metrics, OTLP export, or when the user mentions "OpenTelemetry", "OTLP", "traces", "spans", "Activity", "ActivitySource", "metrics", "IMeterFactory", "Meter", "Counter", "Histogram", "Gauge", "telemetry", "observability", "distributed tracing", "OTEL", or "Aspire Dashboard".

    Also in 3 projects that use this

  • MovGP0Skill

    modern-csharp

    Modern C# style guidance for Bendex and MicroSea code changes, including primary constructors, expression-bodied members, var usage, target-typed new, lambdas, and pattern matching.

    Also in 3 projects that use this

  • MicrosoftSkill

    resilience

    Apply resilience patterns (retry, backoff, circuit breaking) when writing or reviewing code that makes outbound HTTP/REST calls, database operations, or any I/O that can experience transient failures. Use this skill when: (1) writing new code that calls external services or APIs, (2) reviewing code that uses fetch, HTTP clients, or service-to-service calls, (3) adding queue consumers or workers that interact with remote systems, (4) debugging intermittent failures in production.

    Also in 3 projects that use this

  • hongyuancSkill

    vertical-slice

    Build and evaluate a production-quality vertical slice before advancing from Pre-Production to Production.

    Also in 3 projects that use this

  • wpankSkill

    caching

    Caching strategies, invalidation, eviction policies, HTTP caching, distributed caching, and anti-patterns. Use when designing cache layers, choosing eviction policies, debugging stale data, or optimizing read-heavy workloads.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 0 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 28 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Don't load this for how screens refresh or hold state.

    line 8
  2. Very specific:

    Write the interface in lib/domain/repositories/.

    line 43
  3. Very specific:

    Read it in a provider with ServiceLocator.getIt<ItemsRepository>(), typed as the interface (see …

    line 46

“Common” is measured: kept by at least 6 in 10 of the 28 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Clean architecture

Don't load this for how screens refresh or hold state; see state-management.

Rule

Imports point inward, toward lib/domain/:

  • lib/domain/ imports neither data/, presentation/ nor Flutter (package:flutter/…, dart:ui). It is plain Dart.
  • lib/presentation/ imports nothing from data/. It reaches data through a repository interface from lib/domain/repositories/ and changes data through an action.
  • lib/data/ implements the domain interfaces.
  • lib/ai/ holds the adapters between the app and the assistant.

Enforced by the lint rules domain_layer_boundaries and presentation_layer_boundaries. They show only in dart analyze run from the repo root (and in tool/check.sh), not in flutter analyze.

Why

Plain-Dart domain/ is why the same actions run in the app, in tests and in the action CLI (tool/action.dart). If domain/ knew about Drift or widgets, the CLI and the assistant could not use it.

How

Where a new file goes:

You are addingPut it in
An entity (a plain value class)lib/domain/entities/, like lib/domain/entities/item.dart
A repository interfacelib/domain/repositories/, like lib/domain/repositories/items_repository.dart
An actionlib/domain/actions/, registered in lib/domain/actions/app_actions.dart
A Drift table or DAOlib/data/local/database/tables/ or .../daos/
A repository implementationlib/data/repositories/, like lib/data/repositories/drift_items_repository.dart
A screen or widgetlib/presentation/<feature>/
A Riverpod providerlib/presentation/providers/
Theme tokens, shared state widgetslib/core/
Screen summaries, router and change-event adapterslib/ai/

Steps for new data:

  1. Write the interface in lib/domain/repositories/. Name reads watch… or get….
  2. Implement it in lib/data/repositories/. Map table rows to entities there, as _toItem does in DriftItemsRepository.
  3. Register the implementation against the interface in lib/data/di/data_layer_injection.dart.
  4. Read it in a provider with ServiceLocator.getIt<ItemsRepository>(), typed as the interface (see lib/presentation/providers/items_provider.dart).

Anti-patterns

  • A screen importing lib/data/… or a Drift class. Add an interface member instead.
  • A domain file importing package:flutter/material.dart for one Color. Keep the value as plain data and convert in presentation/.
  • Putting model calls or widgets in an action.
  • Using // ignore: flutter_agentify_lints/domain_layer_boundaries to get past an import. The doctor's ratchet counts ignores and they may only go down.
  • Exposing a Drift row type from a repository interface. Return entities.

Verification

  • dart analyze --fatal-infos from the repo root reports a boundary violation as domain_layer_boundaries or presentation_layer_boundaries.
  • tool/check.sh runs it with the tests and ends with All checks passed.

Related skills

  • state-management — providers and refresh after writes.
  • storing-data — the tables and migrations behind a data-layer repository.
  • actions — writing the action that changes the data.
  • adding-a-feature — the whole path from screen to screen-context entry.
  • testing — which layer each kind of test covers.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.