flutter-executing

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Executing Flutter Implementation Plans

执行Flutter实施计划

Overview

概述

Load plan, review critically, execute tasks in batches, run Flutter verifications, report for review between batches.
Core principle: Batch execution with checkpoints for review.
Announce at start: "I'm using the flutter-executing skill to implement this plan."
加载计划、严格审核、分批执行任务、运行Flutter验证、在批次间提交审核报告。
核心原则: 分批执行并设置审核检查点。
开始时需声明: "我正在使用flutter-executing技能来执行此计划。"

The Process

执行流程

Step 1: Load and Review Plan

步骤1:加载并审核计划

  1. Read plan file
    bash
    cat docs/plans/YYYY-MM-DD-<feature>-plan.md
  2. Check dependencies first
    bash
    cat pubspec.yaml
  3. Install new dependencies if needed
    bash
    flutter pub get
  4. Review critically:
    • Are file paths correct?
    • Is layer order followed (Domain → Data → Presentation)?
    • Are there any gaps in the plan?
  5. If concerns: Raise them before starting
  6. If no concerns: Create TodoWrite and proceed
  1. 读取计划文件
    bash
    cat docs/plans/YYYY-MM-DD-<feature>-plan.md
  2. 首先检查依赖项
    bash
    cat pubspec.yaml
  3. 如有需要,安装新的依赖项
    bash
    flutter pub get
  4. 严格审核:
    • 文件路径是否正确?
    • 是否遵循分层顺序(Domain → Data → Presentation)?
    • 计划中是否存在遗漏?
  5. 若有疑问: 在开始前提出
  6. 若无疑问: 创建TodoWrite任务并继续

Step 2: Execute Batch

步骤2:执行批次任务

Default: First 3 tasks
For each task:
  1. Mark as in_progress in TodoWrite
  2. Create/modify files as specified
  3. Write complete code (from plan)
  4. Run verification:
    bash
    flutter analyze lib/features/<feature>/
  5. Commit:
    bash
    git add <files>
    git commit -m "<conventional commit message>"
  6. Mark as completed in TodoWrite
默认:前3项任务
针对每个任务:
  1. 在TodoWrite中标记为进行中
  2. 按要求创建/修改文件
  3. 编写完整代码(依据计划)
  4. 运行验证:
    bash
    flutter analyze lib/features/<feature>/
  5. 提交代码:
    bash
    git add <files>
    git commit -m "<conventional commit message>"
  6. 在TodoWrite中标记为已完成

Step 3: Verify Batch

步骤3:验证批次任务

After completing 3 tasks, run full verification:
bash
undefined
完成3项任务后,运行完整验证:
bash
undefined

Static analysis

静态分析

flutter analyze
flutter analyze

Expected: No issues found!

预期结果:未发现任何问题!

Run tests (if test files exist)

运行测试(若存在测试文件)

flutter test test/features/<feature>/
flutter test test/features/<feature>/

Expected: All tests passed!

预期结果:所有测试通过!

Quick build check (optional)

快速构建检查(可选)

flutter build apk --debug --target-platform android-arm64
flutter build apk --debug --target-platform android-arm64

Expected: Built successfully

预期结果:构建成功

undefined
undefined

Step 4: Report

步骤4:提交报告

When batch complete, report:
markdown
undefined
批次任务完成后,提交报告:
markdown
undefined

Batch N Complete

第N批次任务完成

Tasks completed:
  1. ✅ Task 1: [description]
  2. ✅ Task 2: [description]
  3. ✅ Task 3: [description]
Verification:
  • flutter analyze: No issues found
  • flutter test: X/X passed
Files created/modified:
  • lib/features/.../entity.dart
  • lib/features/.../repository.dart
  • ...
Ready for feedback.
undefined
已完成任务:
  1. ✅ 任务1:[描述]
  2. ✅ 任务2:[描述]
  3. ✅ 任务3:[描述]
验证结果:
  • flutter analyze:未发现任何问题
  • flutter test:X/X通过
已创建/修改的文件:
  • lib/features/.../entity.dart
  • lib/features/.../repository.dart
  • ...
等待反馈。
undefined

Step 5: Continue

步骤5:继续执行

Based on feedback:
  • Apply changes if needed
  • Execute next batch of 3 tasks
  • Repeat until all tasks complete
根据反馈:
  • 如有需要,修改内容
  • 执行下一批3项任务
  • 重复此流程直至所有任务完成

Step 6: Complete Development

步骤6:完成开发

After all tasks complete and verified:
  1. Run final verification:
    bash
    flutter analyze
    flutter test
    flutter build apk --debug  # or ios
  2. Announce: "I'm using the flutter-finishing skill to complete this work."
  3. REQUIRED SUB-SKILL: Use
    flutter-craft:flutter-finishing
    • Verify tests
    • Present 4 options (merge/PR/keep/discard)
    • Execute choice
    • Cleanup worktree if applicable
所有任务完成并验证后:
  1. 运行最终验证:
    bash
    flutter analyze
    flutter test
    flutter build apk --debug  # 或iOS版本
  2. 声明: "我正在使用flutter-finishing技能来完成此项工作。"
  3. 必填子技能: 使用
    flutter-craft:flutter-finishing
    • 验证测试
    • 提供4种选项(合并/PR/保留/丢弃)
    • 执行选择的操作
    • 必要时清理工作区

Flutter-Specific Verification Commands

Flutter专属验证命令

StageCommandExpected Output
Per-file
flutter analyze lib/path/file.dart
No issues found
Per-batch
flutter analyze lib/features/<feature>/
No issues found
Test
flutter test test/features/<feature>/
All tests passed
Final
flutter build apk --debug
Built successfully
阶段命令预期输出
单文件
flutter analyze lib/path/file.dart
未发现任何问题
批次
flutter analyze lib/features/<feature>/
未发现任何问题
测试
flutter test test/features/<feature>/
所有测试通过
最终
flutter build apk --debug
构建成功

When to Stop and Ask for Help

何时停止并寻求帮助

STOP executing immediately when:
  • flutter analyze
    shows errors (not just warnings)
  • Tests fail with unclear cause
  • Missing dependency not in pubspec.yaml
  • Plan has unclear instructions
  • File path in plan doesn't match project structure
  • State management pattern unclear
Ask for clarification rather than guessing.
立即停止执行的情况:
  • flutter analyze
    显示错误(不仅仅是警告)
  • 测试失败且原因不明
  • 缺少未在pubspec.yaml中声明的依赖项
  • 计划说明不清晰
  • 计划中的文件路径与项目结构不匹配
  • 状态管理模式不明确
请寻求澄清,而非自行猜测。

Layer Order Verification

分层顺序验证

Before executing, verify plan follows this order:
1. Domain Layer tasks first
   ├── Entities
   ├── Repository interfaces
   └── UseCases

2. Data Layer tasks second
   ├── Models
   ├── DataSources
   └── Repository implementations

3. Presentation Layer tasks third
   ├── State Management
   ├── Widgets
   └── Screens

4. Test tasks after implementation
   ├── Repository tests (priority 1)
   ├── State tests (priority 2)
   └── Widget tests (priority 3)
If plan doesn't follow this order, raise concern before starting.
执行前,需验证计划是否遵循以下顺序:
1. 首先执行领域层(Domain Layer)任务
   ├── 实体(Entities)
   ├── 仓库接口(Repository interfaces)
   └── 用例(UseCases)

2. 其次执行数据层(Data Layer)任务
   ├── 模型(Models)
   ├── 数据源(DataSources)
   └── 仓库实现(Repository implementations)

3. 最后执行表示层(Presentation Layer)任务
   ├── 状态管理
   ├── 组件(Widgets)
   └── 页面(Screens)

4. 实现完成后执行测试任务
   ├── 仓库测试(优先级1)
   ├── 状态测试(优先级2)
   └── 组件测试(优先级3)
若计划未遵循此顺序,请在开始前提出疑问。

REQUIRED SUB-SKILL

必填子技能

During Execution

执行期间

After EACH batch, you MUST invoke: → flutter-craft:flutter-verification (verify before continuing)
每个批次完成后,必须调用: → flutter-craft:flutter-verification(继续前先验证)

After All Tasks Complete

所有任务完成后

You MUST invoke: → flutter-craft:flutter-finishing (present completion options)
必须调用: → flutter-craft:flutter-finishing(提供完成选项)

Remember

注意事项

  • Review plan critically first - Don't blindly execute
  • Follow layer order - Domain → Data → Presentation
  • Run flutter analyze per batch - Catch errors early
  • Commit after each task - Atomic commits
  • Report and wait - Don't continue without feedback
  • Stop when blocked - Don't guess, ask
  • 首先严格审核计划 - 不要盲目执行
  • 遵循分层顺序 - Domain → Data → Presentation
  • 每个批次运行flutter analyze - 尽早发现错误
  • 每个任务完成后提交代码 - 原子提交
  • 提交报告并等待 - 未收到反馈前不要继续
  • 遇到阻塞时停止 - 不要猜测,主动询问