-
Notifications
You must be signed in to change notification settings - Fork 174
Add proactive Flutter hot reload rule #228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| --- | ||
| description: Proactively connect to running Dart/Flutter apps and trigger hot reload or hot restart upon editing .dart files under lib/. | ||
| trigger: glob | ||
| globs: "lib/**/*.dart" | ||
| --- | ||
|
|
||
| # Proactive Flutter Hot Reload Rule | ||
|
|
||
| Whenever you edit or modify any `.dart` file under `lib/` in this project: | ||
|
|
||
| 1. **When to Skip**: | ||
| - **Files Outside `lib/`**: Only trigger hot reload or hot restart for edits under `lib/`. Do not trigger when modifying files in other directories (e.g., `test/**`, `integration_test/**`, `benchmark/**`, `test_driver/**` or `example/**`). | ||
| - **Comments & Documentation**: Do not trigger hot reload or hot restart when changes only affect comments, docstrings, or whitespace. | ||
|
|
||
| 2. **Discover & Connect**: | ||
| - Discover active running application instances using the `dtd` MCP Tool (or `list_running_apps` / `vm_service`) from the Dart MCP server. | ||
|
|
||
| 3. **Trigger Hot Reload / Hot Restart**: | ||
| - Execute the `hot_reload` MCP tool immediately after making changes to UI widgets (including `build` methods of stateful widgets) or simple methods. | ||
| - Execute the `hot_restart` MCP tool if fundamental logic, state initialization (e.g., `initState`), global/static state, or `main()` was modified. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| --- | ||
| description: Proactively connect to running Dart/Flutter apps and trigger hot reload or hot restart upon editing .dart files under lib/. | ||
| globs: "lib/**/*.dart" | ||
| alwaysApply: false | ||
| --- | ||
|
Comment on lines
+1
to
+5
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed |
||
|
|
||
| # Proactive Flutter Hot Reload Rule | ||
|
|
||
| Whenever you edit or modify any `.dart` file under `lib/` in this project: | ||
|
|
||
| 1. **When to Skip**: | ||
| - **Files Outside `lib/`**: Only trigger hot reload or hot restart for edits under `lib/`. Do not trigger when modifying files in other directories (e.g., `test/**`, `integration_test/**`, `benchmark/**`, `test_driver/**` or `example/**`). | ||
| - **Comments & Documentation**: Do not trigger hot reload or hot restart when changes only affect comments, docstrings, or whitespace. | ||
|
|
||
| 2. **Discover & Connect**: | ||
| - Discover active running application instances using the `dtd` MCP tool (or `list_running_apps` / `vm_service`) from the Dart MCP server. | ||
|
|
||
| 3. **Trigger Hot Reload / Hot Restart**: | ||
| - Execute the `hot_reload` MCP tool immediately after making changes to UI widgets (including `build` methods of stateful widgets) or simple methods. | ||
| - Execute the `hot_restart` MCP tool if fundamental logic, state initialization (e.g., `initState`), global/static state, or `main()` was modified. | ||
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this point the agent to the official flutter hot reload docs? these docs explain when to use hot reload vs hot restart. https://docs.flutter.dev/tools/hot-reload
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, but that would add a lot of context, not to mention an agent turn to grab the content from the internet.
Not saying it wouldn't be better, but that we'd want Manual Eval to show the benefit for the cost.