flutter-expert
できること
FlutterとDartで、iPhoneとAndroidのアプリを作るようエージェントを導きます。一つのコードベースで両方のプラットフォームでうまく動かしたい開発者向けです。
使う場面
- ✓新しいFlutterのアプリを始めるか、既存のアプリに画面を追加するとき。
- ✓RiverpodまたはBlocの状態管理を設定する必要があるとき。
- ✓Flutterアプリが遅くかくつく場合に、性能の調整が必要なとき。
スキルのリンク
https://github.com/Jeffallan/claude-skills/blob/main/skills/flutter-expert/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“ログイン画面、ホームのタブ、ユーザーのセッションを管理するRiverpodを備えたFlutterアプリを作ってください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、プロジェクトと画面遷移を設定し、状態のプロバイダーを定義して、再利用できるウィジェットを作ります。そして、解析とテストを実行します。カクつく場合はアプリをプロファイリングします。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Flutter Expert
Senior mobile engineer building high-performance cross-platform applications with Flutter 3 and Dart.
When to Use This Skill
- Building cross-platform Flutter applications
- Implementing state management (Riverpod, Bloc)
- Setting up navigation with GoRouter
- Creating custom widgets and animations
- Optimizing Flutter performance
- Platform-specific implementations
Core Workflow
- Setup — Scaffold project, add dependencies (
flutter pub get), configure routing - State — Define Riverpod providers or Bloc/Cubit classes; verify with
flutter analyze- If
flutter analyzereports issues: fix all lints and warnings before proceeding; re-run until clean
- If
- Widgets — Build reusable, const-optimized components; run
flutter testafter each feature- If tests fail: inspect widget tree with Flutter DevTools, fix failing assertions, re-run
flutter test
- If tests fail: inspect widget tree with Flutter DevTools, fix failing assertions, re-run
- Test — Write widget and integration tests; confirm with
flutter test --coverage- If coverage drops or tests fail: identify untested branches, add targeted tests, re-run before merging
- Optimize — Profile with Flutter DevTools (
flutter run --profile), eliminate jank, reduce rebuilds- If jank persists: check rebuild counts in the Performance overlay, isolate expensive
build()calls, applyconstor move state closer to consumers
- If jank persists: check rebuild counts in the Performance overlay, isolate expensive
Reference Guide
Load detailed guidance based on context:
| Topic | Reference | Load When |
|---|---|---|
| Riverpod | references/riverpod-state.md |
State management, providers, notifiers |
| Bloc | references/bloc-state.md |
Bloc, Cubit, event-driven state, complex business logic |
| GoRouter | references/gorouter-navigation.md |
Navigation, routing, deep linking |
| Widgets | references/widget-patterns.md |
Building UI components, const optimization |
| Structure | references/project-structure.md |
Setting up project, architecture |
| Performance | references/performance.md |
Optimization, profiling, jank fixes |
Code Examples
Riverpod Provider + ConsumerWidget (correct pattern)
// provider definition — Notifier, not the legacy StateNotifier
final counterProvider = NotifierProvider<CounterNotifier, int>(CounterNotifier.new);
class CounterNotifier extends Notifier<int> {
@override
int build() => 0;
void increment() => state = state + 1; // new instance, never mutate
}
// consuming widget — use ConsumerWidget, not StatefulWidget
class CounterView extends ConsumerWidget {
const CounterView({super.key});
@override
Widget build(BuildContext context, WidgetRef ref) {
final count = ref.watch(counterProvider);
return Text('$count');
}
}
Before / After — State Management
// ❌ WRONG: app-wide state in setState
class _BadCounterState extends State<BadCounter> {
int _count = 0;
void _inc() => setState(() => _count++); // causes full subtree rebuild
}
// ✅ CORRECT: scoped Riverpod consumer
class GoodCounter extends ConsumerWidget {
const GoodCounter({super.key});
@override
Widget build(BuildContext context, WidgetRef ref) {
final count = ref.watch(counterProvider);
return IconButton(
onPressed: () => ref.read(counterProvider.notifier).increment(),
icon: const Icon(Icons.add), // const on static widgets
);
}
}
Constraints
MUST DO
- Use
constconstructors wherever possible - Implement proper keys for lists
- Use
Consumer/ConsumerWidgetfor state (notStatefulWidget) - Follow Material/Cupertino design guidelines
- Profile with DevTools, fix jank
- Test widgets with
flutter_test
MUST NOT DO
- Build widgets inside
build()method - Mutate state directly (always create new instances)
- Use
setStatefor app-wide state - Skip
conston static widgets - Ignore platform-specific behavior
- Block UI thread with heavy computation (use
compute())
Troubleshooting Common Failures
| Symptom | Likely Cause | Recovery |
|---|---|---|
flutter analyze errors |
Unresolved imports, missing const, type mismatches |
Fix flagged lines; run flutter pub get if imports are missing |
| Widget test assertion failures | Widget tree mismatch or async state not settled | Use tester.pumpAndSettle() after state changes; verify finder selectors |
| Build fails after adding package | Incompatible dependency version | Run flutter pub upgrade --major-versions; check pub.dev compatibility |
| Jank / dropped frames | Exp |
よくある質問
どの状態管理のライブラリに対応していますか?
RiverpodとBlocを、Cubitのクラスとともに扱います。
画面遷移はどう扱いますか?
GoRouterで画面遷移を設定します。
性能はどう確認しますか?
Flutter DevToolsでアプリをプロファイリングし、不要な再描画を探します。
詳細
作者による元の説明
Use when building cross-platform applications with Flutter 3+ and Dart. Invoke for widget development, Riverpod/Bloc state management, GoRouter navigation, platform-specific implementations, performance optimization.
repo: Jeffallan/claude-skills
人気
- GitHubのスター
- 12k
- ランキング
- #11425
- ライセンス
- MIT
- 更新日
- 2026/10/30
コメント
- …
このリポジトリの他のスキル
angular-architect
12kエージェントが、スタンドアロンコンポーネント、遅延読み込みのルーティング、NgRxの状態管理、RxJSのパターン、性能の調整を使ったAngular 17以降のアプリを作るのを支援します。
api-designer
12kエージェントが、RESTまたはGraphQLのAPIを設計し、OpenAPI 3.1の仕様を書くのを支援します。リソース、ページネーション、エラーの形式、バージョン管理のルールを含みます。
architecture-designer
12kエージェントが、システムのアーキテクチャを設計し、パターンや技術を比べて、それぞれの選択を説明するアーキテクチャ決定記録(ADR)を書くのを支援します。
atlassian-mcp
12kMCPを通じて、JiraのIssueとConfluenceのページを検索、更新するのを支援します。JQLとCQLのクエリ、スプリント、ドキュメントの同期を含みます。
似ているスキル
android-clean-architecture
280kエージェントがAndroidプロジェクトを効率よく整理できるようにします。コードを構造化して、保守や新機能の開発をしやすくします。
compose-multiplatform-patterns
280kエージェントがKMPプロジェクトでCompose MultiplatformとJetpack Composeのパターンを使えるようにします。状態管理、ナビゲーション、テーマ設定、パフォーマンスを扱います。
dart-flutter-patterns
280kエージェントがDartとFlutterのアプリ向けのコードを書けるようにします。最新のパターンを使い、堅牢で管理しやすいアプリを作ります。