Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions rules/flutter-app-runtime.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
description: Proactively connect to running Dart/Flutter apps and trigger hot reload or hot restart using the flutter-app-runtime skill workflows upon editing .dart files.
trigger: glob
globs: "**/*.dart"
---
Comment on lines +1 to +5

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The previous rule file rules/hot_reload.md included trigger: glob in its frontmatter. If the rule parser requires this field to trigger the rule on glob matches, it should be retained in the new rules/flutter-app-runtime.md file.

Suggested change
---
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"
---
---
trigger: glob
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"
---

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


# 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.
Comment on lines +9 to +12

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The rule references the flutter-app-runtime skill, but this skill is currently not defined in resources/flutter_skills.yaml. Please make sure to define the flutter-app-runtime skill in resources/flutter_skills.yaml so that the skill can be generated and successfully resolved by the agent.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skill will be added in #221


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, stateful widgets or logic affecting variables that stateful widgets use, 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.
26 changes: 26 additions & 0 deletions rules/flutter-app-runtime.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
description: Proactively connect to running Dart/Flutter apps and trigger hot reload or hot restart using the flutter-app-runtime skill workflows upon editing .dart files.
trigger: glob
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.
Comment on lines +10 to +13

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The rule references the flutter-app-runtime skill, but this skill is currently not defined in resources/flutter_skills.yaml. Please make sure to define the flutter-app-runtime skill in resources/flutter_skills.yaml so that the skill can be generated and successfully resolved by the agent.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, will be added


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, stateful widgets or logic affecting variables that stateful widgets use, 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.
Comment on lines +21 to +22

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be part of this rule IMO. This is expensive to run after each hot reload / hot restart and is a bit of scope creep. Debugging runtime errors is a separate user journey.


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.
10 changes: 0 additions & 10 deletions rules/hot_reload.md

This file was deleted.

9 changes: 0 additions & 9 deletions rules/hot_reload.mdc

This file was deleted.

Loading