← 返回 Skills 市场
pipedog

flutter-architecture

作者 leiliang · GitHub ↗ · v1.0.0
cross-platform ✓ 安全检测通过
383
总下载
0
收藏
4
当前安装
1
版本数
在 OpenClaw 中安装
/install flutter-architecture
功能描述
Flutter 四层组件化 + MVVM 项目架构规范。适用于 Flutter 项目开发、新模块创建、目录结构设计、代码评审、架构对齐。支持在项目中直接创建/搭建整套 MVVM+组件化目录结构。
使用说明 (SKILL.md)

Flutter 组件化 + MVVM 架构规范

核心架构

四层纵向依赖(严格单向):

app → business → component → foundation

业务模块内 MVVM

View (page/view) → ViewModel → Repository → Model

层级职责速查

层级 职责
app 主工程层:全局配置、路由、启动项、模块编排,无业务逻辑
business 业务组件层:强业务实现,按模块拆分,模块间通过路由通信
component 功能组件层:公司/团队通用能力(支付、分享、推送等),与业务有一定绑定
foundation 基础组件层:与公司/项目无关的底层能力,强可移植性

业务模块目录结构

{module}/
├── page/           # 页面:xxx_page.dart → XxxPage
├── view/           # 视图:xxx_view.dart、xxx_navigation_bar.dart 等
├── view_model/
├── model/
└── repository/

Page / View 命名(强制)

  • page:文件 xxx_page.dart,类 XxxPage
  • view:常规视图 xxx_view.dartXxxView;功能型 xxx_navigation_bar.dartXxxNavigationBar
  • 严禁:禁止使用 widget 关键字

依赖规则(严禁违反)

  • 上层可依赖下层,下层不可依赖上层
  • 同级业务不互相 import,仅通过路由通信
  • 依赖链唯一:app → business → component → foundation

目录创建能力(Scaffold)

当用户要求创建目录结构搭建架构新建模块scaffold 时,在项目 lib/ 下直接创建以下结构:

全量创建(新项目或完整搭建):

  • lib/app/config/lib/app/pages/
  • lib/business/{module}/ 下每个模块含 page/view/view_model/model/repository/
  • lib/component/(可含 pay、share、push、update 等子目录)
  • lib/foundation/(network、image、router、db、utils、base 等)

增量创建(新增业务模块):

  • lib/business/ 下创建 {module_name}/page/view/view_model/model/repository/
  • 模块名使用小写下划线(如 home、user_profile、scenario_learning)

创建时按 references/architecture.md 中的完整目录结构执行,确保层级与命名符合规范。

完整规范

详细目录结构、各层说明、MVVM 职责、命名规范、代码示例、Code Review 标准见 references/architecture.md

安全使用建议
This skill appears coherent and instruction-only, but be aware it will create directories/files under your project's lib/ when you ask it to scaffold. Before using: (1) run it from the intended project root or a safe test repo, (2) back up or use version control so you can review/revert generated changes, and (3) inspect the generated files to ensure naming/ dependency rules match your team's conventions. No credentials or network access are requested by the skill.
功能分析
Type: OpenClaw Skill Name: flutter-architecture Version: 1.0.0 The skill bundle provides a Flutter project architecture template (MVVM + Componentization) and instructions for the agent to scaffold directory structures within the 'lib/' directory. The logic is entirely focused on project organization and naming conventions as described in SKILL.md and references/architecture.md, with no evidence of malicious intent, data exfiltration, or unauthorized command execution.
能力评估
Purpose & Capability
The name and description match the content: both SKILL.md and references/architecture.md document a Flutter MVVM + componentized project structure and describe scaffolding. There are no declared env vars, binaries, or unrelated requirements that don't belong to this purpose.
Instruction Scope
Runtime instructions are limited to creating the described directory/file structure under lib/ (scaffold or new module) and to following the included reference doc. The instructions do not ask the agent to read unrelated system files, access credentials, or contact external endpoints.
Install Mechanism
There is no install spec and no code files to write or execute beyond the agent following textual instructions — this is the lowest-risk pattern for a skill of this type.
Credentials
The skill requires no environment variables, credentials, or config paths. The requested scope (creating project folders/files) is proportional to the stated functionality.
Persistence & Privilege
always:false and no install means the skill does not request permanent presence or elevated platform privileges. It will create files in the project when invoked, which is expected for a scaffolding guideline.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install flutter-architecture
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /flutter-architecture 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
flutter-architecture 1.0.0 - Initial release with standardized Flutter project structure: four-layer architecture (app, business, component, foundation) and MVVM pattern. - Provides conventions for directory layout, strict dependency rules, and naming. - Supports automated directory scaffolding for new projects or modules, following consistent structure and naming. - Detailed code examples and guidelines referenced in architecture documentation.
元数据
Slug flutter-architecture
版本 1.0.0
许可证
累计安装 4
当前安装数 4
历史版本数 1
常见问题

flutter-architecture 是什么?

Flutter 四层组件化 + MVVM 项目架构规范。适用于 Flutter 项目开发、新模块创建、目录结构设计、代码评审、架构对齐。支持在项目中直接创建/搭建整套 MVVM+组件化目录结构。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 383 次。

如何安装 flutter-architecture?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install flutter-architecture」即可一键安装,无需额外配置。

flutter-architecture 是免费的吗?

是的,flutter-architecture 完全免费(开源免费),可自由下载、安装和使用。

flutter-architecture 支持哪些平台?

flutter-architecture 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 flutter-architecture?

由 leiliang(@pipedog)开发并维护,当前版本 v1.0.0。

💬 留言讨论