flutter-finishing について
flutter-finishingは、Flutterの開発ブランチを完了するためのワークフロースキルです。静的解析とテストを確認し、4つの選択肢を提示して、選択に応じた処理とワークツリーの整理を行います。
主な機能
- 01flutter analyzeとflutter testの確認
- 02ブランチ完了時の4つの選択肢
- 03マージ、PR、保持、破棄の実行
- 04破棄前の確認要求
- 05ルールに沿ったワークツリー整理
活用シーン
- 01完了前のFlutterブランチ検証
- 02ローカルマージかPR作成の選択
- 03ブランチの保持または安全な破棄
インストール
コマンドをコピーしてターミナルで実行します。
npx skills add https:/ / github.com/ vp-k/ flutter-craft --skill flutter-finishingインストール後、Claude Code で/flutter-finishingを入力して読み込まれたか確認します。
詳細
Flutter 開発ブランチの完了
概要
明確な選択肢を提示し、選択されたワークフローに対応することで、Flutter 開発作業の完了を支援します。
基本原則: テストを検証 → 選択肢を提示 → 選択を実行 → クリーンアップ
開始時に告知: 「flutter-finishing スキルを使用して、この作業を完了します。」
プロセス
ステップ 1:テストと解析を検証する
選択肢を提示する前に、すべてが成功することを確認します:
# Static analysis
flutter analyze
# Expected: No issues found!
# All tests
flutter test
# Expected: All tests passed!
# Build check — required once here, against the project's target platform
# (apk / ios / web / windows / macos / linux). Skip only if the platform
# toolchain is unavailable in this environment, and say so in the report.
flutter build <target> --debug
# Expected: Built successfully
テストが失敗した場合:
Flutter tests failing (N failures). Must fix before completing:
[Show failures]
Cannot proceed with merge/PR until tests pass.
停止してください。ステップ 2 に進まないでください。
テストが成功した場合: ステップ 2 に進みます。
ステップ 2:ベースブランチを特定する
# Find merge base
git merge-base HEAD main 2>/dev/null || git merge-base HEAD master 2>/dev/null
# Or ask: "This branch split from main - is that correct?"
ステップ 3:選択肢を提示する
次の 4 つの選択肢をそのまま提示します:
Implementation complete. All tests passing. What would you like to do?
1. Merge back to <base-branch> locally
2. Push and create a Pull Request
3. Keep the branch as-is (I'll handle it later)
4. Discard this work
Which option?
説明を追加しないでください。選択肢は簡潔にします。
ステップ 4:選択を実行する
オプション 1:ローカルでマージする
# Switch to base branch
git checkout <base-branch>
# Pull latest
git pull
# Merge feature branch
git merge <feature-branch>
# Verify tests on merged result
flutter analyze
flutter test
# If tests pass, delete feature branch
git branch -d <feature-branch>
その後: worktree をクリーンアップします(ステップ 5)
オプション 2:プッシュして PR を作成する
# Push branch
git push -u origin <feature-branch>
# Create PR
gh pr create --title "<feature-title>" --body "$(cat <<'EOF'
## Summary
- Implemented [feature] following Clean Architecture
- Added [Layer] layer components
- [Test coverage details]
## Test Plan
- [ ] flutter analyze passes
- [ ] flutter test passes
- [ ] Manual testing of [scenarios]
## Flutter Version
- Flutter: X.X.X
- Dart: X.X.X
🤖 Generated with [Claude Code](https://claude.com/claude-code)
EOF
)"
worktree をクリーンアップしないでください。PR レビューの修正で必要になる場合があります。
オプション 3:現状のまま維持する
報告:「ブランチ <name> を維持します。worktree は <path> に保持されています。」
worktree をクリーンアップしないでください。
オプション 4:破棄する
最初に確認します:
This will permanently delete:
- Branch: <name>
- All commits: <commit-list>
- Worktree at: <path>
Type 'discard' to confirm.
正確な確認を待ちます。
確認された場合:
git checkout <base-branch>
git branch -D <feature-branch>
その後: worktree をクリーンアップします(ステップ 5)
ステップ 5:worktree をクリーンアップする
オプション 1、2、4 の場合:
worktree 内にいるか確認します:
git worktree list | grep $(git branch --show-current)
該当する場合:
# Navigate to main repo
cd <main-repo-path>
# Remove worktree
git worktree remove <worktree-path>
オプション 3 の場合: worktree を維持します。
クイックリファレンス
| オプション | マージ | プッシュ | worktree を維持 | ブランチをクリーンアップ |
|---|---|---|---|---|
| 1. ローカルでマージ | ✓ | - | - | ✓ |
| 2. PR を作成 | - | ✓ | ✓ | - |
| 3. 現状のまま維持 | - | - | ✓ | - |
| 4. 破棄 | - | - | - | ✓(強制) |
Flutter 固有の検証
完了を許可する前に:
# 1. Analysis must pass
flutter analyze
# Must show: No issues found!
# 2. Tests must pass
flutter test
# Must show: All tests passed!
# 3. Build verification — once, per project target platform (see Step 1)
flutter build <target> --debug
# Must show: Built successfully
よくある間違い
テスト検証を省略する
- 問題:壊れたコードをマージしたり、失敗する PR を作成したりする
- 対処法:選択肢を提示する前に、必ずテストを検証します
自由回答形式の質問
- 問題:「次に何をすればよいですか?」では曖昧です
- 対処法:構成された選択肢を 4 つだけ提示します
worktree を自動的にクリーンアップする
- 問題:必要になる可能性がある worktree を削除してしまう(オプション 2、3)
- 対処法:オプション 1 と 4 の場合にのみクリーンアップします
破棄の確認がない
- 問題:作業を誤って削除する
- 対処法:入力による「discard」の確認を必須にします
注意事項
絶対にしないこと:
- テストが失敗している状態で進める
- 結果に対するテストを検証せずにマージする
- 確認を得ずに作業を削除する
- 明示的な依頼なしに強制プッシュする
- flutter analyze を省略する
必ず行うこと:
- 選択肢を提示する前にテストを検証する
- 選択肢を 4 つだけ提示する
- オプション 4 では入力による確認を得る
- オプション 1 と 4 の場合にのみ worktree をクリーンアップする
統合
呼び出し元:
- flutter-subagent-dev(すべてのタスク完了後)
- flutter-executing(すべてのバッチ完了後)
連携先:
- flutter-worktrees - そのスキルが作成した worktree をクリーンアップします