diff --git a/rules/flutter-app-runtime.md b/rules/flutter-app-runtime.md new file mode 100644 index 0000000..527bdba --- /dev/null +++ b/rules/flutter-app-runtime.md @@ -0,0 +1,24 @@ +--- +description: Proactively connect to running Dart/Flutter apps and trigger hot reload using the flutter-app-runtime skill workflows upon editing .dart files. +globs: "**/*.dart" +--- + +# Proactive Flutter Hot Reload Rule + +Whenever you edit or modify any `.dart` file in this project, adhere to the runtime management procedures in the `flutter-app-runtime` skill: + +1. **Refer to Skill**: + - Activate and follow the `flutter-app-runtime` skill workflows for Dart Tooling Daemon (`dtd`), hot reloading, hot restarting, and runtime error inspection. + +2. **Discover & Connect**: + - Discover active running application instances using the `dtd` tool (or `list_running_apps` / `vm_service`). + +3. **Trigger Hot Reload / Hot Restart**: + - Execute `hot_reload` immediately after making changes to UI widgets or simple methods. + - Execute `hot_restart` if fundamental logic, state initialization, or `main()` was modified. + +4. **Verify Runtime Stability**: + - Run `get_runtime_errors` via `dart-mcp-server` to confirm that the hot reload/restart did not introduce new exceptions. + +5. **Fallback Handling**: + - If no running app instance is connected via DTD, briefly inform the user, but do not let it stop you from completing the code edits. diff --git a/rules/flutter-app-runtime.mdc b/rules/flutter-app-runtime.mdc new file mode 100644 index 0000000..bd0aa59 --- /dev/null +++ b/rules/flutter-app-runtime.mdc @@ -0,0 +1,25 @@ +--- +description: Proactively connect to running Dart/Flutter apps and trigger hot reload using the flutter-app-runtime skill workflows upon editing .dart files. +globs: "**/*.dart" +alwaysApply: false +--- + +# Proactive Flutter Hot Reload Rule + +Whenever you edit or modify any `.dart` file in this project, adhere to the runtime management procedures in the `flutter-app-runtime` skill: + +1. **Refer to Skill**: + - Activate and follow the `flutter-app-runtime` skill workflows for Dart Tooling Daemon (`dtd`), hot reloading, hot restarting, and runtime error inspection. + +2. **Discover & Connect**: + - Discover active running application instances using the `dtd` tool (or `list_running_apps` / `vm_service`). + +3. **Trigger Hot Reload / Hot Restart**: + - Execute `hot_reload` immediately after making changes to UI widgets or simple methods. + - Execute `hot_restart` if fundamental logic, state initialization, or `main()` was modified. + +4. **Verify Runtime Stability**: + - Run `get_runtime_errors` via `dart-mcp-server` to confirm that the hot reload/restart did not introduce new exceptions. + +5. **Fallback Handling**: + - If no running app instance is connected via DTD, briefly inform the user, but do not let it stop you from completing the code edits. diff --git a/rules/hot_reload.md b/rules/hot_reload.md deleted file mode 100644 index 68bc31b..0000000 --- a/rules/hot_reload.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -trigger: glob -globs: *.dart -description: Proactively connect to apps and hot reload ---- - -Whenever you make edits to any Dart or Flutter files in this project: -1. Proactively connect to the running application using the `dtd` tool and its subcommands. Make sure to read the schema for this tool. -2. Trigger a hot reload using the `hot_reload` tool to push the changes immediately. -3. If no app is running, inform the user but do not let it stop you from completing the code edits. diff --git a/rules/hot_reload.mdc b/rules/hot_reload.mdc deleted file mode 100644 index e97ded5..0000000 --- a/rules/hot_reload.mdc +++ /dev/null @@ -1,9 +0,0 @@ ---- -globs: *.dart -alwaysApply: false ---- - -Whenever you make edits to any Dart or Flutter files in this project: -1. Proactively connect to the running application using the `dtd` tool and its subcommands. Make sure to read the schema for this tool. -2. Trigger a hot reload using the `hot_reload` tool to push the changes immediately. -3. If no app is running, inform the user but do not let it stop you from completing the code edits.