← 返回 Skills 市场
symboy

flutter-schema

作者 symboy · GitHub ↗ · v2.0.0 · MIT-0
cross-platform ✓ 安全检测通过
235
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install flutter-schema
功能描述
Flutter GetX 三层架构规范。core + shared + modules 纵向分层,业务模块 GetX 化。适用于新模块创建、目录设计、代码评审。支持 scaffold 搭建目录结构。
使用说明 (SKILL.md)

Flutter GetX 三层架构规范

架构概览

纵向分层(自上而下单向依赖,modules 依赖 core 和 shared):

shared(底)← core ← modules(顶)

模块内 GetX 结构

Binding(注入) + View ← Logic → State

层级速查

层级 职责
core 配置、路由、服务、工具、通用 UI 组件
shared 业务基类、存储、网络、可复用能力
modules 业务功能实现,按功能拆模块,模块间走路由

模块目录模板

{module}/
├── {feature}/                 # 子功能(可选)
│   ├── xxx_binding.dart
│   ├── xxx_logic.dart
│   ├── xxx_state.dart
│   ├── xxx_view.dart
│   ├── model/
│   └── view/
├── binding/
├── model/
├── view/
├── db/                        # 本地数据(可选)
└── upload/                    # 上传(可选)

命名约定

  • binding / logic / state / view:xxx_binding.dartXxxBinding
  • logic 继承项目内 BaseController 基类
  • 视图文件以 _view 结尾,类名以 PageView 结尾
  • 避免使用 widget 作为文件或类名后缀

依赖约束

  • 仅允许上层依赖下层
  • 同级模块不互相 import,通过路由(Get.toNamed)通信
  • Logic 不持有 BuildContext、不直接操作 UI

Scaffold 能力

用户要求创建目录搭建架构新建模块时:

全量:创建 core/config、constants、navigation、utils、services、widgets;shared/data、domain;modules/{name}

增量:在 modules 下新建 {module_name}/,可用 validate.py 生成页面骨架

模块名使用小写下划线(如 order_list、user_profile)。

页面生成

  • 普通页:python ~/flutter-schema/scripts/validate.py \x3Cname> [dir]

完整说明见 schema.md

安全使用建议
This skill is a local scaffolding helper: it generates Flutter GetX page files under your project's lib directory and reads pubspec.yaml to fill package imports. Before using it: (1) run it from your project (or copy scripts/validate.py into your project) so the script can locate pubspec.yaml; (2) back up or review changes before committing, since it will create files; (3) ensure the target directory you pass is inside your project's lib folder (the script enforces this but be careful with symlinks/paths); (4) you need Python available locally to run the script. There is no network activity or credential use in this skill.
功能分析
Type: OpenClaw Skill Name: flutter-schema Version: 2.0.0 The skill bundle provides a legitimate Flutter GetX architecture scaffolding tool. The core logic in scripts/validate.py includes proactive security measures, such as regex validation for page names and path traversal checks to ensure file generation is restricted to the project's 'lib' directory. No evidence of data exfiltration, malicious execution, or harmful prompt injection was found.
能力评估
Purpose & Capability
Name/description (Flutter GetX scaffold & architecture guidance) match the included artifacts: documentation and a small Python script that generates GetX page files. The requested capabilities (file generation under lib/modules) are appropriate for the stated purpose.
Instruction Scope
SKILL.md instructs running the included Python script to create page scaffolding. The script only reads pubspec.yaml (to get the package name) and writes four Dart files under lib (with checks to prevent path traversal). Minor ambiguity: SKILL.md suggests running the script from '~/flutter-schema/scripts/validate.py' while the repository provides scripts/validate.py; the user will need to ensure the script is placed/run in their project environment. No instructions reference external network endpoints or unrelated system files.
Install Mechanism
No install spec is provided (instruction-only plus a small helper script). Nothing is downloaded or executed from remote URLs; there are no package installs declared.
Credentials
The skill requests no environment variables or credentials. The script reads only local project files (pubspec.yaml) which is reasonable for generating Dart package imports.
Persistence & Privilege
always is false and the skill does not request persistent or cross-skill privileges. It only writes files within the project's lib directory and does not modify other skills or system-wide settings.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install flutter-schema
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /flutter-schema 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v2.0.0
Initial release. - Provides a three-layer vertical architecture guideline for Flutter using GetX: shared, core, modules. - Defines recommended directory structure, naming conventions, and dependency rules. - Supports scaffold-based directory and module creation. - Includes guidance for module and page generation using helper scripts. - Suitable for new module creation, directory planning, and code review.
v1.0.0
- Initial release of flutter-schema skill. - Provides a Flutter GetX three-layer vertical architecture: shared (base) ← core ← modules (top). - Enforces layered code structure, module scaffolding, and naming conventions. - Includes scaffold features for rapid directory and module creation. - Details constraints for dependencies, layers, and module communication via GetX routing. - Offers a Python script for fast page module generation.
元数据
Slug flutter-schema
版本 2.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

flutter-schema 是什么?

Flutter GetX 三层架构规范。core + shared + modules 纵向分层,业务模块 GetX 化。适用于新模块创建、目录设计、代码评审。支持 scaffold 搭建目录结构。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 235 次。

如何安装 flutter-schema?

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

flutter-schema 是免费的吗?

是的,flutter-schema 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

flutter-schema 支持哪些平台?

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

谁开发了 flutter-schema?

由 symboy(@symboy)开发并维护,当前版本 v2.0.0。

💬 留言讨论