Skip to content
Merged
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
6 changes: 6 additions & 0 deletions rules/flutter-official-ai-rules.mdc
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
description: Official Flutter AI rules profile (4k) synced from flutter/flutter.
alwaysApply: false
globs: ["lib/**/*.dart", "test/**/*.dart", "**/*.dart"]
---

<!--
Synced from official Flutter AI rules.
Source: https://raw.githubusercontent.com/flutter/flutter/main/docs/rules/rules_4k.md
Expand Down
6 changes: 6 additions & 0 deletions rules/official/flutter-ai-rules-10k.mdc
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
description: Official Flutter AI rules profile (10k) synced from flutter/flutter.
alwaysApply: false
globs: ["lib/**/*.dart", "test/**/*.dart", "**/*.dart"]
---

<!--
Synced from official Flutter AI rules.
Source: https://raw.githubusercontent.com/flutter/flutter/main/docs/rules/rules_10k.md
Expand Down
6 changes: 6 additions & 0 deletions rules/official/flutter-ai-rules-1k.mdc
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
description: Official Flutter AI rules profile (1k) synced from flutter/flutter.
alwaysApply: false
globs: ["lib/**/*.dart", "test/**/*.dart", "**/*.dart"]
---

<!--
Synced from official Flutter AI rules.
Source: https://raw.githubusercontent.com/flutter/flutter/main/docs/rules/rules_1k.md
Expand Down
6 changes: 6 additions & 0 deletions rules/official/flutter-ai-rules-4k.mdc
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
description: Official Flutter AI rules profile (4k) synced from flutter/flutter.
alwaysApply: false
globs: ["lib/**/*.dart", "test/**/*.dart", "**/*.dart"]
---

<!--
Synced from official Flutter AI rules.
Source: https://raw.githubusercontent.com/flutter/flutter/main/docs/rules/rules_4k.md
Expand Down
6 changes: 6 additions & 0 deletions scripts/sync_official_flutter_ai_rules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ download_rule() {
curl -fsSL "${source_url}" -o "${tmp_file}"

{
echo "---"
echo "description: Official Flutter AI rules profile (${profile_name}) synced from flutter/flutter."
echo "alwaysApply: false"
echo "globs: [\"lib/**/*.dart\", \"test/**/*.dart\", \"**/*.dart\"]"

Choose a reason for hiding this comment

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

P1 Badge Restrict auto-attach metadata to the active profile

Adding globs front matter in download_rule() makes every generated file in rules/official/ auto-match Dart files, so the plugin can apply 10k/4k/1k simultaneously instead of honoring the selected active copy. This conflicts with the repository’s own active-profile contract (docs/flutter-ai-rules-sync.md describes rules/flutter-official-ai-rules.mdc as the active profile) and can cause duplicated/conflicting guidance plus unnecessary token overhead whenever Dart files are opened.

Useful? React with 👍 / 👎.

Copy link
Owner Author

Choose a reason for hiding this comment

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

@codex address it and create pr on your own

Choose a reason for hiding this comment

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

Summary

Testing

  • bash -n scripts/sync_official_flutter_ai_rules.sh
  • for f in rules/official/flutter-ai-rules-10k.mdc rules/official/flutter-ai-rules-4k.mdc rules/official/flutter-ai-rules-1k.mdc rules/flutter-official-ai-rules.mdc; do echo '---' $f; sed -n '1,8p' $f; done
  • ⚠️ curl -fsSL 'https://docs.cursor.com/context/rules' | head -n 40 (HTTP 403 in this environment)
  • ⚠️ curl -fsSL 'https://duckduckgo.com/html/?q=cursor+.mdc+globs+front+matter' | head -n 20 (HTTP 403 in this environment)

View task →

echo "---"
echo
echo "<!--"
echo "Synced from official Flutter AI rules."
echo "Source: ${source_url}"
Expand Down
Loading