Prompt file imported from michaelsandner/training_organizer (
.github/prompts/new-feature.prompt.md). Copyright stays with the author.
New Feature
Create a new feature following the project's Clean Architecture and conventions.
Steps
- Domain layer — define entities, use cases in
lib/domain/, and repository interfaces inlib/domain/repositories/ - Data layer — implement the repository in
lib/data/ - Register dependencies — add new services and use cases to
lib/di/service_locator.dart - Presentation layer — create a feature folder in
lib/ui/features/<feature_name>/with:- A Cubit and its State class (using
Equatable) - Page and widget files (one widget class per file — no
_build*methods)
- A Cubit and its State class (using
- Tests — add tests that mirror the
lib/structure:- Unit tests for use cases in
test/unit/domain/ - Unit tests for the cubit in
test/unit/features/<feature_name>/ - Widget tests in
test/widget/features/<feature_name>/
- Unit tests for use cases in
- Validate — run
flutter analyzeandflutter testbefore finishing
Conventions Checklist
- UI texts are in German
- Code comments, methods, and variables are in English
- Each class has its own file
- Cubit is used instead of Bloc
- All state fields are in the Equatable
propslist - Shared widgets go into
lib/ui/shared/widgets/ - Tests follow Given-When-Then (Gherkin) structure