flutter-parallel-agents
npx skills add https://github.com/vp-k/flutter-craft --skill flutter-parallel-agents
Agent 安装分布
Skill 文档
Dispatching Parallel Flutter Agents
Overview
When you have multiple unrelated tasks (different features, different test files, different bugs), working on them sequentially wastes time. Each investigation is independent and can happen in parallel.
Core principle: Dispatch one agent per independent problem domain. Let them work concurrently.
Announce at start: “I’m using the flutter-parallel-agents skill to handle these tasks.”
When to Use
Multiple tasks/failures?
ââ NO â Single agent handles it
ââ YES â Are they independent?
ââ NO (related) â Single agent investigates all
ââ YES â Can they work in parallel?
ââ NO (shared state/files) â Sequential agents
ââ YES â Parallel dispatch (this skill)
Use when:
- Multiple test files failing with different root causes
- Multiple features to implement in different areas
- Each problem can be understood without context from others
- No shared state between investigations
- Different Clean Architecture layers to work on
Don’t use when:
- Failures are related (fix one might fix others)
- Tasks modify same files
- Tasks have dependencies on each other
- Need to understand full system state first
Flutter-Specific Parallel Scenarios
Independent Layer Tasks
lib/features/auth/
âââ domain/ â Agent 1: Implement entities & interfaces
âââ data/ â Agent 2: Implement models & datasources
âââ presentation/ â Wait for Agents 1 & 2 (has dependencies)
Can parallelize: Domain + Data layers (different files) Cannot parallelize: Presentation depends on Domain
Independent Feature Tasks
lib/features/
âââ auth/ â Agent 1: Auth feature
âââ profile/ â Agent 2: Profile feature
âââ settings/ â Agent 3: Settings feature
Can parallelize: All three (different feature folders)
Independent Test Fixes
test/features/
âââ auth/data/repositories/auth_repo_test.dart â Agent 1
âââ profile/presentation/bloc/profile_bloc_test.dart â Agent 2
âââ settings/data/datasources/settings_ds_test.dart â Agent 3
Can parallelize: Different test files, different features
The Pattern
1. Identify Independent Domains
Group tasks by what’s affected:
- Feature A: User authentication
- Feature B: Profile management
- Feature C: Settings storage
Each domain is independent – fixing auth doesn’t affect settings.
2. Create Focused Agent Tasks
Each agent gets:
- Specific scope: One feature or test area
- Clear goal: What to implement/fix
- Constraints: Don’t change other features
- Expected output: Summary of what was done
3. Dispatch in Parallel
Task("Implement auth domain layer - entities and repository interface")
Task("Implement profile domain layer - entities and repository interface")
Task("Implement settings domain layer - entities and repository interface")
// All three run concurrently
4. Review and Integrate
When agents return:
- Read each summary
- Verify fixes don’t conflict
- Run
flutter analyze - Run
flutter test - Integrate all changes
Agent Prompt Structure
Implement the [Layer] layer for [Feature] feature.
## Scope
lib/features/[feature]/[layer]/
## Files to Create
- entities/[entity].dart
- repositories/[repository].dart (interface)
## Requirements
[Paste specific requirements from plan]
## Constraints
- ONLY modify files in lib/features/[feature]/[layer]/
- Do NOT touch other features
- Follow Clean Architecture principles
- Run flutter analyze before committing
## Expected Output
- Summary of what you created
- flutter analyze result
- Commit message used
Example: Parallel Feature Implementation
Scenario: Need to implement domain layers for 3 features
Decision: Each domain layer is independent
Dispatch:
Agent 1 â Implement auth/domain/ (User entity, AuthRepository interface)
Agent 2 â Implement profile/domain/ (Profile entity, ProfileRepository interface)
Agent 3 â Implement settings/domain/ (Settings entity, SettingsRepository interface)
Results:
- Agent 1: Created User entity, AuthRepository â
- Agent 2: Created Profile entity, ProfileRepository â
- Agent 3: Created Settings entity, SettingsRepository â
Integration:
flutter analyze # All clean
flutter test # All pass
git log --oneline -3 # See all three commits
Common Mistakes
â Too broad: “Implement all features” – agent gets lost â Specific: “Implement auth/domain layer” – focused scope
â Dependent tasks in parallel: Data layer before Domain â Correct order: Domain first, then Data in parallel
â Same files: Two agents editing pubspec.yaml â No conflicts: Each agent has isolated file scope
When NOT to Use
- Sequential dependencies: Data layer needs Domain layer first
- Shared files: Multiple agents need same file
- Cross-feature dependencies: Feature B imports from Feature A
- Need global context: Understanding requires seeing entire app
Verification
After agents return:
- Review each summary – Understand what changed
- Check for conflicts – Did agents edit same files?
- Run flutter analyze – Verify all code is clean
- Run flutter test – Verify tests pass
- Check imports – No circular dependencies
flutter analyze
flutter test
git diff --stat # See all changes
Benefits
- Parallelization – Multiple implementations simultaneously
- Focus – Each agent has narrow scope
- Independence – Agents don’t interfere
- Speed – N problems solved in time of 1