本文へ移動
cccskills
無料GitHub で公開

flutter-riverpod-arch

Implement Feature-First architecture with Riverpod state management and Flutter Hooks in Flutter applications

インストール方法を見る

含まれるファイル(9)

  • SKILL.md5.9 KB
  • references/architecture.md5.4 KB
  • references/presentation.md4.9 KB
  • references/providers.md5.4 KB
  • references/riverpod.md5.3 KB
  • references/testing.md5.8 KB
  • references/ui/button.md5.4 KB
  • references/ui/list.md6.3 KB
  • references/ui/responsive.md6.0 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Flutter Riverpod Architecture

Goal

Implements scalable Flutter applications using the Feature-First directory structure, Riverpod (with code generation) for state management, and flutter_hooks / HookConsumerWidget for UI composition. This architecture is a lightweight approach inspired by Domain-Driven Design and Clean Architecture. The design philosophy is three layers — Presentation, Domain, and Infrastructure — and the code-level notation in this skill is UI, UseCase, and Repository. Data source access is encapsulated inside repositories. Applies @Riverpod(keepAlive: true) for repository providers and @riverpod for screen-scoped state.

Layer Mapping (Source of Truth)

Design philosophyCode-level notation
PresentationUI
DomainUseCase
InfrastructureRepository

Decision Logic

Decide whether the task belongs in UI, UseCase, or Repository, whether it is feature-specific or shared, and which Riverpod scope is appropriate.

See architecture.md for structure and naming, providers.md for Repository/UseCase placement, and riverpod.md for provider scope rules.

Instructions

1. Plan the Feature Structure

Identify the feature, confirm whether the implementation is shared or feature-local, and place files in the correct layer before coding.

See architecture.md for directory structure and naming.

2. Implement the Repository Layer

Implement Repository code in the Repository layer and follow the Riverpod/provider rules for Repository providers.

See providers.md for Repository implementation details and riverpod.md for provider scope rules.

3. Implement the UseCase Layer

Implement UseCase code in the UseCase layer for validation, orchestration, and UI-facing state changes.

See providers.md for UseCase patterns and riverpod.md for provider scope rules.

4. Build the UI with HookConsumerWidget

Build UI in the Presentation layer using the patterns required by this skill.

See presentation.md for page and widget structure, riverpod.md for ref.watch / ref.read, and button.md for button and cursor rules.

5. Implement Responsive Layout

Apply the responsive layout rules defined for this skill.

See responsive.md for breakpoint policy and responsive layout patterns.

6. Write Tests

Test Repository, UseCase, controller, and widget behavior with the testing patterns used by this skill.

See testing.md for test structure, overrides, and fake/mock patterns.

Constraints

  • Prefer HookConsumerWidget: This skill uses HookConsumerWidget (with flutter_hooks) for all stateful pages and complex widgets. StatefulWidget may be used for isolated, purely local UI state with no Riverpod interaction.
  • No ref.read() in build: ref.read() must only appear inside event handlers or callbacks, never at the top of a build method to derive reactive UI state.
  • No ref.watch() in event handlers: ref.watch() must only appear inside build() or a provider's build() method.
  • No business logic in Views: Widget classes must contain only layout, conditional rendering, and navigation. All data transformation and validation must reside in Use Cases or Repositories.
  • List patterns: Follow the list and sliver rules defined in list.md.
  • Avoid button wrapper widgets for style only: Do not create a custom wrapper widget whose sole purpose is applying a fixed button style. If you need to encapsulate behavior such as loading state or submission flow, a wrapper is acceptable.
  • Use targeted MediaQuery static methods: Prefer MediaQuery.sizeOf, MediaQuery.paddingOf, MediaQuery.orientationOf etc. over MediaQuery.of(context) to avoid unnecessary rebuilds.
  • No LayoutBuilder for page-level breakpoints: Use ResponsiveLayout (which uses MediaQuery.sizeOf) so the layout decision is based on actual screen width, not parent constraints.
  • Mouse cursors required on macOS/Web: Every Button variant must include enabledMouseCursor: SystemMouseCursors.click. Every InkWell must include mouseCursor: SystemMouseCursors.click.
  • Code generation required: After adding or modifying a @riverpod annotation, always run dart run build_runner build.
  • Naming conventions: Files and directories use snake_case; classes use UpperCamelCase; page classes end in Page; repository classes end in Repository; use case classes use verb-noun format (e.g., FetchPosts, CreatePost).

Reference Files

  • architecture.md — Project structure, directory layout, naming conventions
  • providers.md — Repository and use case implementation patterns
  • riverpod.md — Provider types, ref.watch vs ref.read, caching, code generation
  • presentation.md — Page structure, navigation, hooks usage, error handling
  • testing.md — Test patterns, mocking strategy, ProviderContainer usage
  • button.md — Button patterns, styleFrom, hover cursor for macOS/Web
  • list.md — ListView.builder, Pull-to-Refresh, pagination with Slivers
  • responsive.md — Breakpoints, ResponsiveLayout, platform-specific layouts

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

claude-md-manager

無料日本語概要

AGENTS.md / CLAUDE.mdの作成・編集・整理を行うスキル。CLAUDE.mdを50行以下を推奨とし、詳細ルールはrules/やスキルにモジュール化して分割管理する。以下のリクエストで使用する: (1)「CLAUDE.mdを作って」「AGENTS.mdを整理して」などCLAUDE.mdの新規作成・編集、(2)「ルールを追加して」「rules/に分割して」などルールの追加・分離、(3)「ディレクトリ構成を更新して」など参照の更新、(4) 新しいディレクトリやルールファイルを作成した後のCLAUDE.md反映。

hukusuke1007/agent-skills82026年9月12日 更新

codebase-onboarding

無料日本語概要

複雑なコードベースを体系的に分析し、アーキテクチャを可視化・ドキュメント化して新規開発者のオンボーディングを支援する汎用スキル。成果物は必ず `docs/` 配下に分割出力する。以下のリクエストで使用する:(1)「このコードベースを分析して」「全体像を教えて」など概要把握、(2)「アーキテクチャドキュメントを作って」「C4図を生成して」など設計ドキュメント生成、(3)「オンボーディング資料を作って」など新規開発者向け資料作成、(4)「技術的負債を洗い出して」など負債評価、(5)「機能一覧を出して」など機能インベントリ生成、(6)「この機能を操作したら何が起きるか追跡して」などユーザー操作フロー追跡、(7)「新機能の実装手順を出して」などフロント/バック横断の実装ガイド生成。特定の言語・フレームワーク・ディレクトリ構成に依存せず、どのリポジトリでも利用できる。

hukusuke1007/agent-skills82026年9月12日 更新

coding-rules

無料日本語概要

AIコーディングエージェント向けの共通コーディングルール。コードの実装・修正・リファクタリング・レビュー時に使用し、前提確認、最小限の変更、検証に加え、空行・処理の区切り・目的と理由のコメントによる人間が後で理解できる可読性を厳守する。

hukusuke1007/agent-skills82026年9月12日 更新

design-md-generator

無料日本語概要

URL・画像・テキスト要件からAIコーディングエージェント向けのDESIGN.mdを生成するスキル。「example.comをDESIGN.md化して」「このサムネをDESIGN.md化して」「クールでポップなLP用のDESIGN.mdを作って」といったリクエストで使用する。Claude Code / Cursor / Stitch に渡せば一貫したUIを生成できる、getdesign.md / awesome-design-md 準拠の9セクション構成のデザイン仕様書を出力する。CSS解析・画像目視抽出・要件生成の3パターンに対応。

hukusuke1007/agent-skills82026年9月12日 更新

image-compressor

無料日本語概要

添付された複数の画像を一括で圧縮・リサイズするスキル。「画像を圧縮して」「このスクショを軽くして」「リサイズして」「画像を小さくして」などのリクエストで使用する。Pillowで長辺1920pxにリサイズし、JPEG/PNGで出力先ディレクトリに保存する。

hukusuke1007/agent-skills82026年9月12日 更新

knowledge-graph-init

無料日本語概要

アーキテクチャ知識グラフ(memory MCP / memory.jsonl)の初期作成。「知識グラフを初期化して」「memory グラフを作って」「アーキテクチャグラフを登録して」といった依頼、またはプロジェクト初期構築完了後の仕上げとして使用する。コードベースを調査し、モジュール構成と依存関係を entities / relations として登録する。

hukusuke1007/agent-skills82026年9月12日 更新

hukusuke1007 のスキルをすべて見る

このスキルの問題を報告する