flutter / flutter/agent-plugins

[Skill idea] flutter-scaffold-mvvm-feature — generate a complete MVVM feature in one shot

Offen
#108 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
P2 Skill
Vorherrschende Sprache
Dart
Sterne
2.9k
Forks
178
Ø Merge
4 T. 2 Std.
Gemergte PRs (30 T.)
9

Beschreibung

## Environment

- **Language model:** Claude Opus 4.7
- **Agent harness:** Claude Code
- **Project type:** Production Flutter app (logistics / driver-facing), strict MVVM

The current `flutter-apply-architecture-best-practices` skill is **educational** — it teaches the layered MVVM pattern. What's missing is a **generative** counterpart that scaffolds a full feature end-to-end: Page + ViewModel + Status + (optional) Effect + Route + DI registration + unit test, all wired and consistent.

Today, generating a new feature in a strict-MVVM app is a 10–15 file edit dance that's easy to get inconsistent (route variant wrong, DI not registered, ViewModel imports `flutter/material`, test missing mocks). A single skill that drives this correctly removes a recurring source of drift.

## Proposed skill

**Name:** `flutter-scaffold-mvvm-feature`

**Description (draft):**
> Scaffold a complete MVVM feature (Page, ViewModel, Status, optional Effect, Route, DI registration, and unit test) wired consistently across layers. Use when adding a new screen, sheet, or dialog to an app that already follows the MVVM pattern, to guarantee correct layer separation and DI on first generation.

**Inputs the skill should ask upfront (in a single batch):**
1. Feature name (snake_case)
2. Page type (full-screen / bottom-sheet / dialog)
3. Needs Effects? (snackbars, async navigation events)
4. Needs offline/connectivity awareness?
5. Domain model the page receives (or none)
6. Initial Status fields

**Outputs:**
- `lib/features/{name}/{name}_page.dart`
- `lib/features/{name}/{name}_view_model.dart`
- `lib/features/{name}/{name}_status.dart`
- `lib/features/{name}/{name}_effect.dart` (only if Effects needed)
- Route file + export
- DI factory registration
- Unit test stub for the ViewModel

## Why this is hard for a single-pass skill

Layer-correct generation benefits from **parallel sub-agents** (one per layer: data/VM, UI, tests) so the skill can produce 5–7 files coherently in one turn. We've implemented this pattern internally and it works well — happy to share the orchestration approach if useful.

## Real-world reference

We run an internal version of this in production (Claude Code, ~9k LOC monthly throughput). Generation success rate (no follow-up edit needed) is materially higher than per-file generation.

## Roadmap fit

This complements `flutter-apply-architecture-best-practices` (P1, already published) — that one teaches the pattern, this one applies it.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne mit der Überprüfung des bestehenden Skills `flutter-apply-architecture-best-practices` und der Struktur von Skills in diesem Repository. Definiere den Generierungsablauf anhand der aufgeführten Eingaben und Ausgaben und verifiziere anschließend, dass ein generiertes Feature konsistent Page, ViewModel, Status, den optionalen Effect, den route export, die DI registration und einen ViewModel unit-test stub enthält.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
dart, flutter
Bereich
developer-experience, mobile-dev, tooling
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.