Skip to content
Open
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
20 changes: 20 additions & 0 deletions rules/flutter-hot-reload.md
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.
trigger: glob
globs: "**/*.dart"
---

# Proactive Flutter Hot Reload Rule

Whenever you edit or modify any `.dart` file in this project:

1. **When to Skip**:
- **Tests**: Do not trigger hot reload or hot restart when modifying test files (e.g., `test/**`, `*_test.dart`). Run tests using `flutter test` instead.
- **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` tool (or `list_running_apps` / `vm_service`).

3. **Trigger Hot Reload / Hot Restart**:
- Execute `hot_reload` immediately after making changes to UI widgets (including `build` methods of stateful widgets) or simple methods.
- Execute `hot_restart` if fundamental logic, state initialization (e.g., `initState`), global/static state, or `main()` was modified.
20 changes: 20 additions & 0 deletions rules/flutter-hot-reload.mdc
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.
globs: "**/*.dart"
alwaysApply: false
---
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 trigger: glob field is not a standard or supported frontmatter key for Cursor .mdc files. Cursor rules only support description, globs, and alwaysApply. Keeping unsupported fields can cause parsing issues or be ignored by the Cursor editor.

---
description: Proactively connect to running Dart/Flutter apps and trigger hot reload or hot restart upon editing .dart files.
globs: "**/*.dart"
alwaysApply: false
---

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.

fixed


# Proactive Flutter Hot Reload Rule

Whenever you edit or modify any `.dart` file in this project:

1. **When to Skip**:
- **Tests**: Do not trigger hot reload or hot restart when modifying test files (e.g., `test/**`, `*_test.dart`). Run tests using `flutter test` instead.
- **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` tool (or `list_running_apps` / `vm_service`).

3. **Trigger Hot Reload / Hot Restart**:
- Execute `hot_reload` immediately after making changes to UI widgets (including `build` methods of stateful widgets) or simple methods.
- Execute `hot_restart` if fundamental logic, state initialization (e.g., `initState`), global/static state, or `main()` was modified.
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