scaffold-feature-module

Generates Flutter feature folders with fixed Riverpod presentation anatomy and boundary checks.

Updated Aug 22, 2026
One-click install
npx skills add https://github.com/zakariaf/NearlyStop --skill scaffold-feature-module-zakariaf
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: scaffold-feature-module
Source: https://github.com/zakariaf/NearlyStop/tree/main/.claude/skills/scaffold-feature-module
Command: npx skills add https://github.com/zakariaf/NearlyStop --skill scaffold-feature-module-zakariaf

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Adding a new screen or feature to a Flutter app often produces inconsistent folder layouts, sideways imports between features, and state-management mistakes like watching providers in callbacks or storing derived counters. This Skill enforces one repeatable structure so every feature is built the same way. ## Core Features & Use Cases - Fixed feature anatomy: Generates lib/features/<feature>/presentation/ with a dumb View, a 1:1 Notifier/AsyncNotifier ViewModel, scoped providers, and a widgets/ folder. - Boundary enforcement: Ships a verify script that greps for cross-feature imports, Drift leaks into Views, DateTime.now() calls, non-directional geometry, and navigation from ViewModels. - Routing and l10n guidance: Documents typed go_router registration with path-param identity and the ARB parity workflow across locales. - Use Case: When adding a new task_list screen, run the scaffold script to generate compiling Riverpod placeholders, then follow the references to register the typed route and add localized strings before running the verifier. ## Quick Start Ask the AI to scaffold a new Flutter feature named task_list using this skill, then register its typed go_router route and add the ARB strings.

Frequently Asked Questions about scaffold-feature-module

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a new feature folder in a Flutter Riverpod app?

Create lib/features/<feature>/presentation/ containing a dumb <feature>_screen.dart ConsumerWidget, a 1:1 <feature>_notifier.dart AsyncNotifier ViewModel, scoped <feature>_providers.dart, and a widgets/ folder. The scaffold_feature.sh script generates this skeleton with compiling placeholders.

How do I wire a Riverpod StreamProvider to a Drift repository watch?

Wrap the repository's scoped .watch(key) in a StreamProvider.autoDispose.family keyed on a stable value like a parent id. The repository maps Drift rows to domain value types, so no Drift symbol ever reaches the View or ViewModel.

Should a Flutter feature be its own package or a folder?

A feature is a folder under lib/features/, never a new package. Packages are deliberate boundary decisions owned by the project-structure skill; a screen addition only needs the fixed folder anatomy with downward-only dependencies.

Can a Flutter feature import another feature's files?

No. Features must never import each other; dependencies point down into shared core and data layers only. The verify_feature.sh script greps for cross-feature imports and fails the build if any are found.

How do I test a Riverpod Notifier ViewModel without widget tests?

Use ProviderContainer.test() and override the repository provider with a fake, plus clockProvider.overrideWithValue(Clock.fixed(t)). Verify wiring and UI-state mapping only; never mock the Notifier itself.

Why should identity go in go_router path params instead of state.extra?

state.extra is null on cold start, reboot, and OS restore, so screens cannot rebuild their data. Path params like :taskId keep identity deep-linkable, letting the screen reload from the store using the ids.