Skip to content

fix: emit Cursor front matter for synced Flutter AI rules profiles#11

Merged
Wreos merged 1 commit intomainfrom
codex/github-mention-feat-sync-official-flutter-ai-rules-profile
Feb 21, 2026
Merged

fix: emit Cursor front matter for synced Flutter AI rules profiles#11
Wreos merged 1 commit intomainfrom
codex/github-mention-feat-sync-official-flutter-ai-rules-profile

Conversation

@Wreos
Copy link
Owner

@Wreos Wreos commented Feb 21, 2026

Motivation

  • Synced official Flutter AI rule profiles were written with only an HTML comment header so the active profile file could not be auto-attached to Dart/Flutter files; adding Cursor rule front matter enables automatic application and profile switching.

Description

  • Update scripts/sync_official_flutter_ai_rules.sh to prepend YAML front matter (description, alwaysApply, globs) before the synced content for each generated .mdc profile.
  • Add the same YAML front matter to the checked-in synced artifacts under rules/official/ (flutter-ai-rules-10k.mdc, flutter-ai-rules-4k.mdc, flutter-ai-rules-1k.mdc).
  • Add YAML front matter to the active profile copy at rules/flutter-official-ai-rules.mdc so it is auto-attached for lib/**/*.dart / test/**/*.dart / **/*.dart globs.

Testing

  • bash -n scripts/sync_official_flutter_ai_rules.sh succeeded (syntax check passed).
  • scripts/sync_official_flutter_ai_rules.sh 4k was attempted but failed in this environment due to upstream raw.githubusercontent.com returning HTTP 403, so full network fetch could not be exercised here.
  • Verified via automated inspection that rules/official/*.mdc and rules/flutter-official-ai-rules.mdc now start with the expected YAML front matter (checked with sed/head).

Codex Task

@Wreos Wreos merged commit 4586765 into main Feb 21, 2026
2 of 3 checks passed
@Wreos Wreos deleted the codex/github-mention-feat-sync-official-flutter-ai-rules-profile branch February 21, 2026 20:11
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 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\"]"

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 →

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant