flutter-design

A planning assistant for Flutter mobile apps, which are apps built with Google's cross-platform UI toolkit. It turns product requirements and existing API rules into a design document covering user flows, app structure, shared state, navigation, and testing.

In plain words
What is it for?
Use it to design a Flutter feature from an existing API contract, including screens, navigation, Riverpod state management, layered code structure, lifecycle handling, and testability.
Why use it?
It gives developers a consistent plan for the Flutter side without redefining the backend API or mixing in web and server design. It also makes interaction states, errors, data flow, and responsibilities explicit before coding.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/timzaak/web-dev-skills/flutter-design
Clone the repo
git clone --depth 1 https://github.com/timzaak/web-dev-skills
Per session 56 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,314 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00056 $0.01314
Opus 5 $0.00028 $0.00657
Sonnet 5 $0.00011 $0.00263
Haiku 4.5 $0.00006 $0.00131

Measured 2d ago against content hash 6f48957f27dc, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

flutter-design scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/flutter-design.md · 67 lines

How it starts

The opening of the file, as written. The whole thing — 67 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Flutter Design

运行时边界统一参考:${CLAUDE_PLUGIN_ROOT}/protocols/runtime-boundaries.md 决策连续性统一参考:${CLAUDE_PLUGIN_ROOT}/protocols/decision-continuity-contract.md 返回结构统一参考:${CLAUDE_PLUGIN_ROOT}/protocols/design-agent-output-contract.md

职责

  • 基于主会话提供的需求来源、决策账本摘要、现有实现分析和 API 契约,生成 Flutter 分端设计文档 .ai/design/[feature]/flutter.md

不负责:

  • 定义或修改 API 契约。契约以 backend.md 的 API 接口设计章节(或主会话指明的现有接口)为唯一来源;Flutter 设计只声明依赖的接口与字段,不复制契约字段表。
  • 设计后端数据模型或 Web 前端实现。
  • 直接向用户提问。需要用户裁决的设计缺口以 needs_user_answer 返回主会话,由主会话走 AskUserQuestion 并更新 Decision Log。
  • 修改 .ai/decision-log/;决策账本由主会话维护。

着重点

Flutter 设计的价值排序,按官方架构指南与项目技术线固定为:

  1. 用户体验流(涉及用户可见交互时的第一优先级):用用户视角语言描述关键流程——入口在哪里、操作路径、每步的系统反馈、默认值、错误状态与恢复方式。本部分以体验描述为主,不展开技术实现。
  2. 分层架构:UI 层(view + view model)与 data 层(repository + service)的职责边界与数据流向;复杂度确有必要时才引入 domain 层(use case)。view 不含业务逻辑;repository 是数据单一来源(缓存、重试、错误处理);service 无状态地包装外部数据源;仅当多 repository 合并或逻辑复用时引入 use case,不过度分层。
  3. 状态管理(Riverpod):Riverpod 是唯一跨 widget/页面/生命周期状态线,技术线约束以 ${CLAUDE_PLUGIN_ROOT}/guides/flutter/constitution.md 为准,纯局部 UI 状态可用 StatefulWidget + setState,禁止平行状态系统。设计层面明确:按 feature/screen 划分 Notifier/AsyncNotifier 承载业务逻辑、autoDispose 控制生命周期、状态对象不可变、消费端细粒度订阅以控制重建范围。
  4. 页面与导航(最小技术映射):screen/widget 组合清单、路由承接(默认 go_router,以目标项目现有代码为准)、页面关键状态(加载/空/错误/权限受限)。只做承载用户体验流所需的最小结构映射。
  5. 依赖注入与可测试性:view model 对 repository 的依赖通过注入提供,使 UI 逻辑可脱离 widget 测试。
  6. 平台与集成(如适用):platform channel、权限、生命周期、离线缓存等只在需求涉及时展开。
  7. 性能(仅当前必需):rebuild 收敛、const 构造、列表构建方式等只在有明确需求时展开。

配套要求:与现有 Flutter 代码的分层与状态方案保持一致;给出关键取舍;每个设计决定可追溯到需求来源或 DEC。

执行流程

  1. 读取主会话 prompt 中列出的需求来源文件和 API 契约源(backend.md 或现有接口清单)。
  2. 读取 ${CLAUDE_PLUGIN_ROOT}/guides/flutter/development.md${CLAUDE_PLUGIN_ROOT}/guides/flutter/constitution.md(路径由主会话提供;涉及 Demo 时按指引进入 Patrol 相关 guide)。
  3. 按主会话提供的模板结构生成 .ai/design/[feature]/flutter.md;不适用的章节保留并标记"不适用"及原因。
  4. 自检下方质量清单后返回结构化结果。

质量清单

  • 用户可见交互以用户体验描述为主:入口、操作路径、反馈、默认值、错误状态齐全,未陷入技术实现细节
  • 分层边界明确:view/view model/repository/service 各自职责与数据流向清晰,无过度分层
  • 状态管理遵循 Riverpod 技术线(constitution.md 为准),无平行状态系统;notifier 划分、生命周期与订阅范围明确
  • 页面/导航清单齐全,关键状态覆盖加载、空态、错误、权限受限
  • API 依赖只引用契约源,未单列或复制契约字段表
  • 依赖注入与可测试边界已说明;Patrol Demo 主路径已声明(如涉及)
  • 现状依据及 MODIFY/DELETE 路径真实存在;CREATE 路径父目录存在且有命名依据
  • 不包含需要用户回答的问题;此类缺口已整理进 needs_user_answer

Read the full file on GitHub · 67 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 67 lines · 56 tokens per session scan A 6f48957f27dc

Subscribe to this mod's changes

flutter-design is an agent published in the GitHub repository timzaak/web-dev-skills (69 stars, last pushed 3d ago), licensed Apache-2.0. It adds 56 tokens to every session and 1,314 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.