UNPKG

prprompts-flutter-generator

Version:

AI-powered Flutter development with full automation + official extension support - Generate 32 security-audited guides & auto-implement in 2-3 hours. NEW v5.1: Official Claude Code plugin with hooks, Gemini TOML commands, Qwen MCP settings. Features: Comp

189 lines (143 loc) • 6.53 kB
--- name: implement-next description: "[prprompts] Auto-implement next feature from IMPLEMENTATION_PLAN.md (10 min)" category: Automation version: 4.0.0 tags: [prprompts, automation, implementation, flutter] badge: NEW --- # /implement-next - Auto-Implement Next Feature ✨ **v4.0 Automation** - Automatically implement the next feature from your `IMPLEMENTATION_PLAN.md` in ~10 minutes. Includes data layer, domain logic, BLoC state management, UI screens, and comprehensive tests. ## Usage ```bash /implement-next ``` ## What It Does 1. **Reads Implementation Plan:** Parses `IMPLEMENTATION_PLAN.md` to find next pending feature 2. **Consults PRPROMPTS:** References relevant PRPROMPTS guides (architecture, security, testing) 3. **Generates Code:** Creates all necessary files with Clean Architecture pattern 4. **Writes Tests:** Unit, widget, and integration tests (85%+ coverage) 5. **Validates:** Runs tests, linting, security checks 6. **Updates Plan:** Marks feature as complete in `IMPLEMENTATION_PLAN.md` ## Example Session ``` /implement-next šŸ“‹ Reading IMPLEMENTATION_PLAN.md... āœ“ Found 7 features, 3 completed, 4 pending Next Feature: "Appointment Scheduling" Complexity: HIGH Dependencies: [Authentication, Patient Profile] Estimated Time: 45 minutes šŸ” Consulting PRPROMPTS... āœ“ 02-state_management.md (BLoC patterns) āœ“ 03-data_layer.md (Repository pattern) āœ“ 11-testing_strategy.md (Test structure) āœ“ 14-security_patterns.md (Authorization) āœ“ 19-offline_sync.md (Offline-first) šŸš€ Implementing Appointment Scheduling... Phase 1: Data Layer (2 min) āœ“ AppointmentModel (DTO with JSON serialization) āœ“ Appointment entity (domain model) āœ“ AppointmentRemoteDataSource (API calls) āœ“ AppointmentLocalDataSource (Hive storage) āœ“ AppointmentRepository (offline-first sync) Phase 2: Domain Layer (1 min) āœ“ GetAppointments use case āœ“ BookAppointment use case āœ“ CancelAppointment use case āœ“ RescheduleAppointment use case Phase 3: Presentation Layer (4 min) āœ“ AppointmentBloc (state management) āœ“ AppointmentEvent classes (4 events) āœ“ AppointmentState classes (loading, loaded, error) āœ“ AppointmentListPage (UI) āœ“ BookAppointmentPage (form UI) āœ“ AppointmentDetailsPage (details) Phase 4: Testing (3 min) āœ“ Repository unit tests (12 test cases) āœ“ Use case unit tests (16 test cases) āœ“ BLoC unit tests (23 test cases) āœ“ Widget tests for all 3 screens (18 test cases) āœ“ Integration test flow (book → view → cancel) Phase 5: Validation āœ“ flutter analyze (0 issues) āœ“ flutter test (69 tests passed) āœ“ Security scan (0 vulnerabilities) āœ“ Coverage: 87.3% (target: 85%) āœ… Implementation Complete! (9 min 23 sec) Generated: - 23 Dart files (2,847 lines) - 12 test files (1,923 lines) - 69 test cases (87.3% coverage) Updated IMPLEMENTATION_PLAN.md: āœ“ Feature #4 marked complete āœ“ Next: Feature #5 "Secure Messaging" Commit suggestion: feat: implement appointment scheduling feature - Add appointment booking, viewing, canceling - Offline-first sync with Hive - 87.3% test coverage (69 tests) - HIPAA compliant (PHI encryption) Run /review-and-commit? (y/n) ``` ## Output Files For each feature, generates: ### Data Layer - `lib/features/{feature}/data/models/{feature}_model.dart` - `lib/features/{feature}/data/datasources/{feature}_remote_datasource.dart` - `lib/features/{feature}/data/datasources/{feature}_local_datasource.dart` - `lib/features/{feature}/data/repositories/{feature}_repository_impl.dart` ### Domain Layer - `lib/features/{feature}/domain/entities/{feature}.dart` - `lib/features/{feature}/domain/repositories/{feature}_repository.dart` - `lib/features/{feature}/domain/usecases/get_{feature}s.dart` - `lib/features/{feature}/domain/usecases/create_{feature}.dart` ### Presentation Layer - `lib/features/{feature}/presentation/bloc/{feature}_bloc.dart` - `lib/features/{feature}/presentation/bloc/{feature}_event.dart` - `lib/features/{feature}/presentation/bloc/{feature}_state.dart` - `lib/features/{feature}/presentation/pages/{feature}_list_page.dart` - `lib/features/{feature}/presentation/pages/{feature}_details_page.dart` - `lib/features/{feature}/presentation/widgets/{feature}_card.dart` ### Tests - `test/features/{feature}/data/repositories/{feature}_repository_impl_test.dart` - `test/features/{feature}/domain/usecases/get_{feature}s_test.dart` - `test/features/{feature}/presentation/bloc/{feature}_bloc_test.dart` - `test/features/{feature}/presentation/pages/{feature}_list_page_test.dart` ## Complexity Handling | Complexity | Estimated Time | Files Generated | Tests Generated | |------------|---------------|----------------|-----------------| | LOW | 5-8 min | 12-15 files | 30-40 tests | | MEDIUM | 8-12 min | 18-25 files | 50-70 tests | | HIGH | 12-18 min | 25-35 files | 70-100 tests | | CRITICAL | 18-25 min | 35-50 files | 100-150 tests | ## Automatic Patterns - **Authentication:** Auto-adds JWT token to requests - **Authorization:** Role-based access control (RBAC) - **Encryption:** PHI/PII encrypted at rest (AES-256-GCM) - **Offline-First:** Hive caching with sync on reconnect - **Error Handling:** Try-catch with custom exceptions - **Logging:** Debug, info, error logs with context - **Validation:** Input validation for forms - **Accessibility:** Semantic labels, screen reader support ## Requirements - **Bootstrap:** Must run `/bootstrap-from-prprompts` first - **IMPLEMENTATION_PLAN.md:** Generated by bootstrap or manual - **Dependencies:** `flutter pub get` completed ## Next Steps After implementation: 1. **Review Code:** Check generated files 2. **Run App:** `flutter run` to test manually 3. **Commit:** `/review-and-commit` (validates & commits) 4. **Continue:** `/implement-next` for next feature, or `/full-cycle` for batch ## Related Commands - `/bootstrap-from-prprompts` - Initial setup - `/full-cycle` - Auto-implement 1-10 features in batch - `/review-and-commit` - Validate & commit changes - `/qa-check` - Comprehensive compliance audit ## Time Savings **Manual Implementation:** 4-8 hours per feature (with tests) **Auto-implementation:** 10-15 minutes per feature **Speedup:** 20-30x faster per feature --- **Powered by PRPROMPTS v4.0** | **40-60x Faster Development** | [Docs](https://github.com/Kandil7/prprompts-flutter-generator#readme)