Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 85a6113726
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| echo "---" | ||
| echo "description: Official Flutter AI rules profile (${profile_name}) synced from flutter/flutter." | ||
| echo "alwaysApply: false" | ||
| echo "globs: [\"lib/**/*.dart\", \"test/**/*.dart\", \"**/*.dart\"]" |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
Summary
- Addressed the review feedback by removing
globsemission fromdownload_rule(), so generated profile files underrules/official/no longer auto-attach themselves to Dart files. This keeps those files as neutral synced artifacts. scripts/sync_official_flutter_ai_rules.shL33-L47 - Updated the script’s active-profile step to inject
globsonly when writingrules/flutter-official-ai-rules.mdc, preserving the active-profile contract while keeping auto-attach behavior on the selected profile only. scripts/sync_official_flutter_ai_rules.shL56-L67 - Updated the checked-in synced artifacts (
10k,4k,1k) to removeglobsfrom their front matter, matching the corrected behavior. rules/official/flutter-ai-rules-10k.mdcL1-L4 rules/official/flutter-ai-rules-4k.mdcL1-L4 rules/official/flutter-ai-rules-1k.mdcL1-L4 - Confirmed the active rule file still includes
globsfront matter. rules/flutter-official-ai-rules.mdcL1-L5 - Committed on the current branch as
56978eband created a follow-up PR via themake_prtool.
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)
Motivation
Description
scripts/sync_official_flutter_ai_rules.shto prepend YAML front matter (description,alwaysApply,globs) before the synced content for each generated.mdcprofile.rules/official/(flutter-ai-rules-10k.mdc,flutter-ai-rules-4k.mdc,flutter-ai-rules-1k.mdc).rules/flutter-official-ai-rules.mdcso it is auto-attached forlib/**/*.dart/test/**/*.dart/**/*.dartglobs.Testing
bash -n scripts/sync_official_flutter_ai_rules.shsucceeded (syntax check passed).scripts/sync_official_flutter_ai_rules.sh 4kwas attempted but failed in this environment due to upstreamraw.githubusercontent.comreturning HTTP 403, so full network fetch could not be exercised here.rules/official/*.mdcandrules/flutter-official-ai-rules.mdcnow start with the expected YAML front matter (checked withsed/head).Codex Task