Skip to content
Skills Library
Programming · Building & coding

feature

/feature

Build a new Flutter feature end to end in a feature-first, layered structure (domain, data, presentation) with Riverpod 3, loading/error/empty states and tests. Use when the user asks to add a screen, flow or feature to a Flutter app.

Licence
MIT
Last repository change
27.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
2
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 27.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Build a new Flutter feature end to end in a feature-first, layered structure (domain, data, presentation) with Riverpod 3, loading/error/empty states and tests. Use when the user asks to add a screen, flow or feature to a Flutter app.

Original author description

Build a new Flutter feature end to end in a feature-first, layered structure (domain, data, presentation) with Riverpod 3, loading/error/empty states and tests. Use when the user asks to add a screen, flow or feature to a Flutter app.

How it works

  1. 1. Understand before writing
  2. 2. Domain first
  3. 3. Data layer
  4. 4. Presentation
  5. 5. Tests
  6. 6. Verify and report
Original SKILL.md headings · 72 lines, 408 words
SKILL.md preview
---
name: feature
description: Build a new Flutter feature end to end in a feature-first, layered structure (domain, data, presentation) with Riverpod 3, loading/error/empty states and tests. Use when the user asks to add a screen, flow or feature to a Flutter app.
---

# Build a Flutter feature

Build the feature in small, verified steps. Follow the project's `AGENTS.md` and existing code first; this skill fills the gaps.

## 1. Understand before writing

1. Read `pubspec.yaml` (state management, routing, codegen), `analysis_options.yaml`, and one existing feature folder end to end. Copy its patterns.
2. Restate the feature in 3–5 bullet points: what the user sees, what data it needs, where it comes from, and what happens offline or on error. Ask the user only if something can't be inferred.

## 2. Domain first

Create `lib/features/<feature>/domain/`:

- **Model:** immutable, `const` constructor, `copyWith`, `==`/`hashCode` (or freezed if the project uses it). Money as `int` minor units, times as UTC `DateTime`.
- **Repository interface:** `abstract interface class <Thing>Repository` with only the methods the screen needs.

No Flutter imports in `domain/`.

## 3. Data layer

Create `lib/features/<feature>/data/`:

- An implementation of the repository (HTTP, database or both). Timeouts on every call; map failures to the project's typed exceptions.
- A provider for it: `final thingRepositoryProvider = Provider<ThingRepository>((ref) => HttpThingRepository(ref.watch(apiClientProvider)));`
- If the backend isn't ready, write an in-memory implementation with realistic delays and data, and say so.

## 4. Presentation

Create `lib/features/<feature>/presentation/`:

- **Controller:** `AsyncNotifier<State>` (or the project's equivalent). Public methods for each user action. After every `await`, check `ref.mounted` before setting `state`.
- **Screen:** `ConsumerWidget` that `switch`es on `AsyncValue`:

```dart
return switch (ref.watch(expensesControllerProvider)) {
  AsyncData(:final value) when value.isEmpty => const _EmptyState(),
  AsyncData(:final value) => _ExpenseList(expenses: value),
  AsyncError(:final error) => ErrorView(error: error, onRetry: controller.refresh),
  _ => const Center(child: CircularProgressIndicator()),
};
```

- Small private widgets for each part. Strings from localisations, colours and text styles from the theme, tap targets ≥ 48 dp with labels.
- Register the route with the router the project uses.

## 5. Tests

Add tests next to the existing ones (`test/features/<feature>/...`):

- **Controller unit test** with a fake repository: initial load, each action, and the error path.
- **Widget test** for loading, data, empty and error states, using `ProviderScope(overrides: [...])`.
- An accessibility check on the main screen:

```dart
final handle = tester.ensureSemantics();
await expectLater(tester, meetsGuideline(androidTapTargetGuideline));
await expectLater(tester, meetsGuideline(labeledTapTargetGuideline));
await expectLater(tester, meetsGuideline(textContrastGuideline));
handle.dispose();
```

## 6. Verify and report

Run `dart format .`, `flutter analyze` and `flutter test`, and fix everything. Then report:

- the files you added or changed, grouped by layer
- anything stubbed or assumed (for example, an in-memory repository)
- how to try it (route, test command)

See [checklist.md](checklist.md) for a review checklist to run before reporting.
Files in this package (2)
  • SKILL.md 3 KB
  • checklist.md 1 KB

Versions

RepositoryScoreLicence
This page · ChandraChaan/flutter-agent-skills100MIT
A7-studio/jobmigo100MIT
crbnos/carbon100AGPL-3.0
arxdsilva/ai-loops100MIT
jisuzzzz/haechi100MIT
pawangai/pawang-agents100MIT
andrewBezerra/concordia100MIT
cryndoc/polisade-orchestrator100Apache-2.0
garagon/nanostack100Apache-2.0

Database snapshot: 13.11.2026 · package version 5ecfde6727c4 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100flutter-feature-scaffold
    Use when adding a new feature or module to a Flutter app that follows feature-first Clean Architecture (data / domain / presentation) with Riverpod 3 and no code generation for providers, when deciding which layer or folder a file belongs in, or when reviewing dependency…
  • 100flutter-architecture
    Provides Flutter app architecture patterns with feature-first structure, clean architecture, and state management (Bloc, Riverpod, Provider). Use when user asks about Flutter project structure, state management selection, dependency injection, or designing Flutter app architecture.
  • 95testing-flutter
    Testing Flutter 3.47 / BLoC v9 / Riverpod 3 - Stratégie Complète. Use when writing tests, reviewing test coverage, or setting up testing.
  • 100flutter
    Flutter framework guardrails, patterns, and best practices for AI-assisted development. Use when working with Flutter projects, or when the user mentions Flutter. Provides widget patterns, state management (Riverpod), navigation, and cross-platform guidelines.
  • 100flutter-riverpod-state-management
    Implement reactive state management using Riverpod 3.x with code generation in Flutter. Use when defining providers, building AsyncNotifiers, or overriding providers in tests.
  • 100flutter-init-project
    Initialize or reset a Flutter project into a production-ready baseline aligned with this repository's real Flutter projects: manual Riverpod setup, GoRouter routing, Material 3 configuration, shared services, shared widgets, design tokens, and either modular `lib/modules/`…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.