← Back to Skills Marketplace
pipedog

flutter-architecture

by leiliang · GitHub ↗ · v1.0.0
cross-platform ✓ Security Clean
383
Downloads
0
Stars
4
Active Installs
1
Versions
Install in OpenClaw
/install flutter-architecture
Description
Flutter 四层组件化 + MVVM 项目架构规范。适用于 Flutter 项目开发、新模块创建、目录结构设计、代码评审、架构对齐。支持在项目中直接创建/搭建整套 MVVM+组件化目录结构。
README (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

Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install flutter-architecture
  3. After installation, invoke the skill by name or use /flutter-architecture
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Slug flutter-architecture
Version 1.0.0
License
All-time Installs 4
Active Installs 4
Total Versions 1
Frequently Asked Questions

What is flutter-architecture?

Flutter 四层组件化 + MVVM 项目架构规范。适用于 Flutter 项目开发、新模块创建、目录结构设计、代码评审、架构对齐。支持在项目中直接创建/搭建整套 MVVM+组件化目录结构。 It is an AI Agent Skill for Claude Code / OpenClaw, with 383 downloads so far.

How do I install flutter-architecture?

Run "/install flutter-architecture" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is flutter-architecture free?

Yes, flutter-architecture is completely free (open-source). You can download, install and use it at no cost.

Which platforms does flutter-architecture support?

flutter-architecture is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created flutter-architecture?

It is built and maintained by leiliang (@pipedog); the current version is v1.0.0.

💬 Comments