AgentSkillsCN

flutter-module-creator

在 Melos 单体仓库中创建 Flutter/Dart 模块。当用户希望在 Melos 管理的工作空间中新建 Flutter 应用、Dart 包、Flutter 插件,或 FFI 插件时,可调用此技能。当收到诸如“创建新的 Flutter 应用”、“添加一个包”、“创建插件”、“添加 FFI 模块”,或任何关于在 Flutter/Dart 单体仓库中创建模块的请求时,该技能便会自动触发。

SKILL.md
--- frontmatter
name: flutter-module-creator
description: Create Flutter/Dart modules in Melos monorepo workspaces. Use when the user wants to create new Flutter apps, Dart packages, Flutter plugins, or FFI plugins in a Melos-managed workspace. Triggers on requests like "create a new Flutter app", "add a package", "create a plugin", "add FFI module", or any module creation in Flutter/Dart monorepos.

Flutter Module Creator

Create modules in a Melos monorepo workspace with proper configuration.

Module Types

TypeCommandDescription
apppython scripts/create_module.py app <name>Flutter application
app --consolepython scripts/create_module.py app <name> --consoleDart console application
packagepython scripts/create_module.py package <name>Dart package
package --flutterpython scripts/create_module.py package <name> --flutterFlutter package
pluginpython scripts/create_module.py plugin <name>Flutter plugin
ffipython scripts/create_module.py ffi <name>Flutter FFI plugin

Usage Examples

bash
# Create Flutter app
python scripts/create_module.py app my_app

# Create Dart console app
python scripts/create_module.py app my_cli --console

# Create Dart package
python scripts/create_module.py package my_utils

# Create Flutter package
python scripts/create_module.py package my_widgets --flutter

# Create plugin with specific platforms
python scripts/create_module.py plugin my_plugin --platforms android,ios

# Create FFI plugin (all platforms by default)
python scripts/create_module.py ffi my_native

# Skip melos bootstrap
python scripts/create_module.py package my_pkg --no-bootstrap

Options

  • --console: Create Dart console app (app type only)
  • --flutter: Create Flutter package (package type only)
  • --platforms <list>: Comma-separated platforms (plugin/ffi)
  • --workspace <path>: Workspace root (auto-detected)
  • --no-bootstrap: Skip melos bootstrap

Behavior

The script automatically:

  1. Detects workspace root (directory with melos/workspace in pubspec.yaml)
  2. Creates module in apps/ (apps) or packages/ (packages/plugins/ffi)
  3. Configures analysis_options.yaml with appropriate lints
  4. Adds resolution: workspace to module pubspec.yaml
  5. Updates root workspace: list in root pubspec.yaml
  6. Copies LICENSE from workspace root
  7. Runs melos bootstrap