flutter-scalable-scaffold

Create production-ready Flutter mobile app projects with clean architecture, feature-based structure, state management (flutter_bloc/riverpod), routing, theming, networking, secure storage, and reusable components. Includes dependency injection, custom widgets, flavors (dev/prod), environment variables, and backend integration (custom/Firebase/Supabase). Use this skill when users want to scaffold a complete Flutter project with a scalable, production-ready structure.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "flutter-scalable-scaffold" with this command: npx skills add obalolu/flutter-scalable-scaffold/obalolu-flutter-scalable-scaffold-flutter-scalable-scaffold

Flutter Scalable Scaffold Skill

This skill creates a complete, production-ready Flutter mobile application with clean architecture, proper separation of concerns, and all the essential building blocks for a scalable app.

When to Use This Skill

Use this skill when a user wants to:

  • Create a new Flutter mobile app project from scratch
  • Set up a production-ready Flutter project structure
  • Configure state management (flutter_bloc or riverpod)
  • Set up backend integration (custom API, Firebase, or Supabase)
  • Configure app flavors (dev/prod)
  • Add testing infrastructure

High-Level Workflow

Phase 1: Mode Selection & User Input Collection

  1. Ask user to choose mode: create_new or integrate_existing
  2. If create_new: Follow the full workflow (Phase 2-5)
  3. If integrate_existing: Follow integration workflow (Phase 1b)

Phase 1b: Integration Mode (Existing Project)

For integrate_existing mode:

  1. Detect existing Flutter project in working directory
  2. Parse existing pubspec.yaml to derive project name
  3. Analyze existing dependencies to avoid conflicts
  4. Ask which components to add (core, network, feature, testing)
  5. Check for existing files and decide merge strategy
  6. Install missing dependencies
  7. Create folder structure (only missing directories)
  8. Create core files (only if not present)
  9. Create network layer (if custom backend selected)
  10. Create router (only if not present)
  11. Create dependency injection (merge with existing if needed)
  12. Create new feature module
  13. Run code generation

Phase 2: Confirmation (Create New Mode Only)

  1. Display configuration summary and confirm with user

Phase 3: Project Creation (Create New Mode Only)

  1. Create Flutter project with organization and platforms
  2. Set up flavors (dev/prod)
  3. Install dependencies using flutter pub add
  4. Clean up default files
  5. Create environment files
  6. Set up folder structure
  7. Create core files (config, theme, errors, utils)
  8. Create network layer (if custom backend)
  9. Create router and utilities
  10. Create shared widgets
  11. Set up dependency injection
  12. Create example feature
  13. Create main app files
  14. Run code generation

Phase 4: Testing Setup (Create New Mode Only)

  1. Configure testing infrastructure
  2. Create test examples

Phase 5: Finalization (Create New Mode Only)

  1. Configure run/launch configurations
  2. Create README
  3. Initialize git (if selected)

Variable Summary

Store these variables for use throughout the skill:

VariableDescriptionExample
PROJECT_MODEMode: create_new or integrate_existingcreate_new
PROJECT_NAMEProject name (lowercase, underscores)my_awesome_app
WORKING_DIRWorking directory path/home/claude
ORG_IDOrganization identifiercom.mycompany
PLATFORMSPlatform listandroid,ios
BACKEND_TYPEBackend typecustom/firebase/supabase/custom+firebase/custom+supabase
DEV_API_URLDevelopment API URLhttps://dev-api.example.com
PROD_API_URLProduction API URLhttps://api.example.com
REQUIRES_API_KEYBoolean for API key requirementtrue/false
FIREBASE_SERVICESArray of Firebase services["auth", "firestore"]
SUPABASE_URLSupabase URLhttps://xxx.supabase.co
SUPABASE_ANON_KEYSupabase anon keyxxx
STATE_MANAGEMENTflutter_bloc or riverpodflutter_bloc
INITIAL_FEATUREInitial feature namehome
INIT_GITBoolean for git initializationtrue/false
ENABLE_TESTINGBoolean for testing setuptrue/false
TEST_TYPESArray of test types["unit", "widget", "integration"]
SETUP_ICONS_SPLASHBoolean for app icons/splashtrue/false
ADD_FORM_VALIDATIONBoolean for form validatorstrue/false
INTEGRATION_COMPONENTSComponents to add in integration modeArray of components

Step-by-Step Execution

Step 1: Verify Prerequisites

  • Run flutter --version to confirm Flutter SDK is installed
  • Check if Flutter project exists in working directory (for integration mode)

Step 2: Mode Selection

Ask user to choose:

  • create_new - Create a new Flutter project from scratch
  • integrate_existing - Add scalable architecture to existing Flutter project

Step 3: User Input Collection

Follow the questions in references/user-input-questions.md to collect all required information from the user.

Step 4: Create Project (create_new mode only)

Execute the following:

  1. Create Flutter project: flutter create --org ORG_ID --platforms PLATFORMS PROJECT_NAME
  2. Set up flavors as described in references/project-creation.md
  3. Install dependencies using flutter pub add commands
  4. Create folder structure
  5. Generate all core files using templates from templates/ folder
  6. Set up dependency injection
  7. Create example feature
  8. Configure testing

See references/project-creation.md for detailed instructions on each step.

Step 4b: Integrate Existing Project (integrate_existing mode only)

Execute the following:

  1. Detect existing project: check for pubspec.yaml
  2. Parse existing project configuration (name, org, dependencies)
  3. Ask which components to add (core architecture, network, feature, testing)
  4. Install missing dependencies
  5. Create missing folder structure
  6. Create core files only if not present
  7. Create network layer if using custom backend
  8. Set up dependency injection (merge if exists)
  9. Create new feature module
  10. Configure testing infrastructure

See references/project-creation.md for integration-specific instructions.

Step 5: Code Generation

After creating all files, run code generation:

If testing is enabled, see `references/testing-setup.md` for testing infrastructure details.

### Step 7: Final Verification
- Verify project builds: `flutter build apk` (Android) or `flutter build ios` (iOS)
- Run tests: `flutter test`

## Template Files

The `templates/` folder contains all code templates. Reference these files when creating the project:

### Core Configuration
- `templates/flavor_config.dart` - Flavor configuration (dev/prod)
- `templates/env_config.dart` - Environment variables configuration
- `templates/app_constants.dart` - App-wide constants

### Utilities
- `templates/app_logger.dart` - Logging utility
- `templates/session_manager.dart` - Session/token management
- `templates/error_handler.dart` - Error handling utility

### Errors
- `templates/exceptions.dart` - Custom exception classes
- `templates/failures.dart` - Failure classes for repositories

### Theme
- `templates/app_colors.dart` - Color constants
- `templates/app_typography.dart` - Text styles
- `templates/app_theme.dart` - ThemeData configuration

### Network (if custom backend)
- `templates/network_dio_client.dart` - Dio client setup
- `templates/api_service.dart` - API service base class

### Routing
- `templates/go_router.dart` - Router configuration

### Dependency Injection
- `templates/dependency_injection.dart` - DI setup with GetIt

### Feature Example (INITIAL_FEATURE)
- `templates/home_screen.dart` - Example screen
- `templates/home_bloc.dart` - BLoC class
- `templates/home_event.dart` - BLoC events
- `templates/home_state.dart` - BLoC states
- `templates/home_repository.dart` - Repository
- `templates/home_entity.dart` - Domain entity

### Main App Files
- `templates/app.dart` - Root app widget
- `templates/main_dev.dart` - Dev entry point
- `templates/main_prod.dart` - Prod entry point

### Configuration Files
- `templates/pubspec.yaml` - Dependencies
- `templates/pubspec_overrides.yaml` - flutter_gen config

### Testing
- `templates/test_helper.dart` - Test utilities

## Code Generation

After creating the project structure, run code generation for:
- Freezed models: `dart run build_runner build --delete-conflicting-outputs`
- Envied: `dart run build_runner build`
- Injectable: `dart run build_runner build`

## Important Notes

1. **State Management**: Use `templates/home_bloc.dart` for flutter_bloc, or create provider equivalents for riverpod
2. **Backend**: Only create network files if using custom backend (not pure Firebase/Supabase)
3. **Assets**: Add actual images to `assets/images/` and `assets/icons/` after creation
4. **Firebase**: Run `flutterfire configure` after project creation if using Firebase
5. **Environment**: Update `.env.dev` and `.env.prod` with actual API keys

## References

- `references/user-input-questions.md` - Detailed questions to ask users
- `references/project-creation.md` - Step-by-step project creation guide
- `references/testing-setup.md` - Testing infrastructure details

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

openclaw-version-monitor

监控 OpenClaw GitHub 版本更新,获取最新版本发布说明,翻译成中文, 并推送到 Telegram 和 Feishu。用于:(1) 定时检查版本更新 (2) 推送版本更新通知 (3) 生成中文版发布说明

Archived SourceRecently Updated
Coding

ask-claude

Delegate a task to Claude Code CLI and immediately report the result back in chat. Supports persistent sessions with full context memory. Safe execution: no data exfiltration, no external calls, file operations confined to workspace. Use when the user asks to run Claude, delegate a coding task, continue a previous Claude session, or any task benefiting from Claude Code's tools (file editing, code analysis, bash, etc.).

Archived SourceRecently Updated
Coding

ai-dating

This skill enables dating and matchmaking workflows. Use it when a user asks to make friends, find a partner, run matchmaking, or provide dating preferences/profile updates. The skill should execute `dating-cli` commands to complete profile setup, task creation/update, match checking, contact reveal, and review.

Archived SourceRecently Updated