Sync Official Flutter AI Rules
Use this workflow to keep plugin guidance aligned with upstream Flutter AI rules.
Workflow
- •Choose target profile:
- •
10k: full guidance, best for larger context windows. - •
4k: balanced default profile. - •
1k: minimal profile for constrained contexts.
- •
- •Run:
- •
scripts/sync_official_flutter_ai_rules.sh <10k|4k|1k>
- •
- •Verify synced outputs:
- •
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(active profile copy)
- •
- •Keep plugin-specific policy in
rules/flutter-plugin-policy-priority.mdc. - •Review diffs and ensure no local manual edits were mixed into official synced files.
- •Update changelog if behavior/guidance changed materially.
Guardrails
- •Do not hand-edit generated files under
rules/official/. - •Keep active file
rules/flutter-official-ai-rules.mdcaligned with chosen profile. - •Do not enforce plugin policy by patching official content after sync.
- •Use
rules/flutter-plugin-policy-priority.mdcfor higher-priority policy and conflict resolution. - •Prefer
4kunless there is a clear reason to switch to10kor1k. - •Do not claim sync completed unless command output is available.
- •In simulation/planning mode, status must be
PENDINGand includenot executednote.
Required output
- •Selected profile and rationale.
- •Files synced/updated.
- •Diff summary for active rule + policy routing layer.
- •Follow-up actions (if manual review is needed).
Official upstream sources
- •
https://raw.githubusercontent.com/flutter/flutter/main/docs/rules/rules_10k.md - •
https://raw.githubusercontent.com/flutter/flutter/main/docs/rules/rules_4k.md - •
https://raw.githubusercontent.com/flutter/flutter/main/docs/rules/rules_1k.md