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

201 lines (156 loc) • 6.36 kB
--- name: bootstrap-from-prprompts description: "[prprompts] Complete project setup from PRPROMPTS (2 min)" category: Automation version: 4.0.0 tags: [prprompts, automation, bootstrap, setup, flutter] badge: NEW --- # /bootstrap-from-prprompts - Complete Project Setup šŸš€ **v4.0 Automation** - Complete project setup from PRPROMPTS in ~2 minutes. Sets up Clean Architecture structure, security patterns, state management, dependency injection, and comprehensive test infrastructure. ## Usage ```bash /bootstrap-from-prprompts ``` ## What It Does Reads `PRPROMPTS/` directory and auto-generates: ### 1. Project Structure (Clean Architecture) ``` lib/ ā”œā”€ā”€ core/ │ ā”œā”€ā”€ di/ # Dependency injection │ ā”œā”€ā”€ error/ # Error handling │ ā”œā”€ā”€ network/ # API client │ └── utils/ # Shared utilities ā”œā”€ā”€ features/ │ └── auth/ │ ā”œā”€ā”€ data/ # Repositories & data sources │ ā”œā”€ā”€ domain/ # Entities & use cases │ └── presentation/ # BLoC & UI └── main.dart ``` ### 2. Core Infrastructure - **Dependency Injection:** GetIt service locator - **State Management:** BLoC with event/state classes - **API Client:** Dio with interceptors (auth, logging, retry) - **Error Handling:** Custom exceptions & error boundaries - **Storage:** Hive for local data, secure_storage for tokens - **Navigation:** GoRouter with deep linking - **Logging:** Logger with multiple transports ### 3. Security Setup - **Authentication:** JWT/OAuth2 token management - **Encryption:** AES-256-GCM for sensitive data - **Certificate Pinning:** TLS/SSL validation - **Biometric Auth:** Local auth integration - **Secure Storage:** Flutter secure storage for tokens/keys ### 4. Testing Infrastructure - **Unit Tests:** Test structure for repositories, use cases - **Widget Tests:** Test harness for BLoCs and screens - **Integration Tests:** E2E test flows - **Mocks:** Mock data sources and repositories - **Coverage:** Configured for 85%+ coverage ### 5. Configuration - **Environment:** Development, staging, production configs - **Build Flavors:** Separate flavor configurations - **CI/CD:** GitHub Actions workflow (optional) - **Code Analysis:** Analysis_options.yaml with strict rules ## Example Session ``` /bootstrap-from-prprompts šŸš€ Bootstrapping from PRPROMPTS... Reading PRPROMPTS files... āœ“ Found 32 PRPROMPTS files āœ“ Detected: HIPAA compliance, JWT auth, offline-first Phase 1: Project Structure āœ“ Created lib/core/ (15 files) āœ“ Created lib/features/auth/ (23 files) āœ“ Created test/ structure (12 files) Phase 2: Core Infrastructure āœ“ Dependency injection (GetIt) āœ“ API client (Dio + interceptors) āœ“ Error handling (CustomException) āœ“ Local storage (Hive + secure_storage) āœ“ Navigation (GoRouter) āœ“ Logging (logger + firebase_analytics) Phase 3: Security Setup āœ“ JWT RS256 authentication flows āœ“ AES-256-GCM encryption helpers āœ“ Certificate pinning configuration āœ“ Biometric authentication āœ“ Secure storage wrapper Phase 4: Testing Infrastructure āœ“ Unit test structure āœ“ Widget test harness āœ“ Integration test flows āœ“ Mock implementations āœ“ Coverage configuration (85%+) Phase 5: Configuration āœ“ Environment configs (dev, staging, prod) āœ“ Build flavors setup āœ“ GitHub Actions workflow āœ“ Analysis options (strict) šŸ“¦ Bootstrap Complete! (1 min 47 sec) Generated: - 147 Dart files (12,843 lines) - 52 test files (4,291 lines) - 85%+ test coverage setup - Security patterns: HIPAA compliant Next Steps: 1. flutter pub get 2. flutter test (should pass) 3. /implement-next (to auto-implement first feature) Ready to implement features? (y/n) ``` ## Output ### Files Created (~147 files) **Core Infrastructure:** - `lib/core/di/injection.dart` - GetIt setup - `lib/core/network/api_client.dart` - Dio client - `lib/core/error/exceptions.dart` - Custom exceptions - `lib/core/error/failures.dart` - Failure types - `lib/core/utils/encryption_helper.dart` - AES encryption - `lib/core/utils/logger.dart` - Logging setup **Authentication Feature:** - `lib/features/auth/data/repositories/auth_repository_impl.dart` - `lib/features/auth/data/datasources/auth_remote_datasource.dart` - `lib/features/auth/data/models/user_model.dart` - `lib/features/auth/domain/entities/user.dart` - `lib/features/auth/domain/usecases/login.dart` - `lib/features/auth/presentation/bloc/auth_bloc.dart` - `lib/features/auth/presentation/pages/login_page.dart` **Tests:** - `test/core/network/api_client_test.dart` - `test/features/auth/data/repositories/auth_repository_impl_test.dart` - `test/features/auth/presentation/bloc/auth_bloc_test.dart` ## Customization Bootstrap adapts based on PRD configuration: | PRD Setting | Bootstrap Behavior | |-------------|-------------------| | `compliance: [hipaa]` | PHI encryption, audit logging, access controls | | `auth_method: oauth2` | OAuth2 flow instead of JWT | | `offline_support: true` | Offline-first repository pattern | | `real_time: true` | WebSocket setup in API client | | `state_management: riverpod` | Riverpod instead of BLoC | | `backend_type: graphql` | GraphQL client instead of REST | ## Requirements - **PRPROMPTS:** Must have generated PRPROMPTS first (`/gen-prprompts`) - **Flutter:** 3.0.0+ - **Dart:** 3.0.0+ ## Next Steps After bootstrapping: 1. **Install Dependencies:** `flutter pub get` 2. **Run Tests:** `flutter test` (should all pass) 3. **Implement Features:** `/implement-next` or `/full-cycle` 4. **QA Check:** `/qa-check` (generates compliance report) ## Related Commands - `/gen-prprompts` - Generate PRPROMPTS first - `/implement-next` - Auto-implement next feature (10 min) - `/full-cycle` - Auto-implement 1-10 features (1-2 hours) - `/review-and-commit` - Validate & commit changes - `/qa-check` - Comprehensive compliance audit ## Time Savings **Manual Setup:** 3-5 days for experienced developer **Bootstrap:** ~2 minutes **Speedup:** 40-60x faster --- **Powered by PRPROMPTS v4.0** | **40-60x Faster Development** | [Docs](https://github.com/Kandil7/prprompts-flutter-generator#readme)