A collection of modular skills and rules for Flutter and Dart development, designed to integrate with AI-powered IDEs like Cursor and Windsurf. The project provides both individual rule files sourced from official documentation and pre-made skill packages that agents can apply contextually during development.
Flutter AI Skills and Rules for Claude, Codex, Cursor, and Other AI-Powered IDEs
At a glance
README
Flutter AI Skills and Rules for Cursor, Claude, Codex, Antigravity, and Other AI-Powered IDEs
⚡ TLDR
Primary method: Copy skill folders from skills/ into your IDE's skills directory (e.g., .cursor/skills/, .windsurf/skills/). The agent will automatically use relevant skills based on your tasks.
For traditional rules: If you want to use .cursor/rules or .windsurfrules, just copy the contents of the rule set of your choice (e.g., combined/flutter_dart__under_6K.md) into your IDE's global or local rules.
For maximum control, you can also copy the /rules folder into your project and reference rules as needed (e.g., "Read @rules/effective_dart.md and follow its conventions."). For tool- and package-specific guidance (Firebase, Bloc, Riverpod, Mockito, etc.), use the matching skill in skills/.
🚀 Introduction
This repository provides a comprehensive, (almost) non-opinionated collection of Flutter-related rules tailored for use with Windsurf, Cursor, and other AI-powered IDEs. These rules are designed to improve your development workflow, ensure consistency, and help you get the most out of your AI coding assistant.
📁 Repository Structure
-
skills/
NEW! Skills are an open standard for extending agent capabilities. A skill is a folder containing aSKILL.mdfile with instructions that the agent can follow when working on specific tasks. They are essentially what “dynamic rules” used to be — applied automatically when the agent determines they are relevant based on the description.Copy or symlink any skill folder into
.cursor/skills/,.agent/skills/, or another supported location. -
rules/
Contains individual rule files covering broad Flutter/Dart foundations (e.g.,effective_dart.md,flutter_app_architecture.md,flutter_errors.md,testing.md). Tool- and package-specific guidance (Bloc, Riverpod, Provider, Mockito, Firebase, etc.) now lives inskills/. These files are:- Based only on official documentation from Flutter, Dart, or relevant package websites.
- Categorized by subject to make them easy to mix, match, and reference.
- Meant to be refined, adjusted, or extracted based on your project needs.
-
combined/
Contains pre-made, curated sets of rules that combine commonly used topics (e.g., Flutter + Riverpod + Mockito).
These files:- Are kept under 6,000 characters to comply with Windsurf's limit.
- Can be used as-is by copying them into your global or local rules configuration.
✅ How To Use
Option 1: Skills - Agent Will Decide What to Use
Install skills interactively with the Skills CLI:
npx skills add evanca/flutter-ai-rules
To inspect the available skills without installing them:
npx skills add evanca/flutter-ai-rules --list
To install a specific skill:
npx skills add evanca/flutter-ai-rules --skill flutter-best-practices
The CLI discovers the packages under skills/ and installs them for supported agents. Alternatively, browse the folder and copy or symlink individual skill folders into your IDE's skills directory (e.g., .cursor/skills/, .windsurf/skills/). The agent will then activate relevant skills contextually based on your tasks.
Option 2: Use Pre-Made Combined Rules
If you want a quick setup with traditional rules:
- Browse the
combined/folder. - Copy a file that suits your project.
- Paste it into your IDE's global or local rules config.
- You're ready to go.
Option 3: Use Individual Rule Files
If you prefer more control:
- Browse the
rules/folder. - Pick files relevant to your project (e.g.,
effective_dart.md,testing.md, etc.). - You can:
- Include them directly in your IDE setup.
- Reference them in prompts to add context.
- Extract only the parts that are useful for your context.
- Include them partially or fully in a PRD (Product Requirements Document).
Everything is modular — use what works best for you.
Option 4: Download All Skills via CLI
You can fetch the latest skills directly into your project with a single command:
git clone --depth 1 https://github.com/evanca/flutter-ai-rules.git temp_repo && mkdir -p .skills && cp -r temp_repo/skills/* .skills && rm -rf temp_repo
This will copy all skills into a .skills folder in your project. After all skills are in the .skills folder, you can reference them individually based on your needs. For example:
"Read @.skills/bloc/SKILL.md and create test coverage for new methods."
Pro tip:
You can also configure your IDE to automatically load skills from this .skills folder, or reference them in prompts for specific guidance.
📏 No Opinions, Just Documentation
All rules are sourced from official documentation — no personal preferences or subjective interpretations. That’s intentional. You’re free to alter them to your taste, but this repo keeps things objective by sticking to the source.
Note: This might sometimes lead to contradictory rules (e.g., if one package suggests one folder architecture and another recommends a different one).
📌 Use Cases
- Install skills in your IDE for automatic, contextual assistance during development.
- Set up global rules for a Flutter project in your IDE.
- Configure project-specific constraints for popular state management packages.
- Provide clear expectations in a PRD when working with a team.
- Extract only what you need to avoid rule clutter.
- Reference individual skills or rules in prompts for specific guidance.
🛠️ Contributing
Contributions are welcome! If you'd like to suggest a new rule or improve an existing one, here’s how you can help:
- Fork this repository.
- Add or modify rules in the appropriate folder.
- Submit a pull request with a clear explanation of your changes.
Make sure to include an official documentation link for any rule set you’re adding or modifying to keep everything objective and reliable.
📚 References
Here are the official sources that have been used to build these rules:
Flutter
- Flutter App Architecture - Official Flutter architecture guidelines
- Flutter Common Errors - Common errors documentation
- Flutter ChangeNotifier State Management - Simple state management with ChangeNotifier
Dart
- Effective Dart - Official Dart style guidelines
- Dart 3 Updates - Documentation on Dart 3 features including:
State Management
- Bloc Library - Official Bloc library documentation
- Provider - Official Provider package documentation
- Riverpod - Official Riverpod documentation
Testing
Firebase
- Firebase for Flutter - Official Firebase Flutter documentation
- Code with Andrea - How to Setup Flutter & Firebase with Multiple Flavors using the FlutterFire CLI
📏 Recommended File Sizes by Tool
For each tool, the size guidance from its own official documentation for rule / instruction files and for SKILL.md skill files (accessed 2026-07-11).
| Tool | Rule file — recommended size | SKILL.md — recommended size |
|---|---|---|
| Cursor | .mdc rule: under 500 lines (soft) |
No numeric limit — "keep focused, move detail to separate files" |
| Windsurf | global_rules.md: 6,000 chars; .windsurf/rules/*.md: 12,000 chars/file (hard) |
No numeric limit — "keeps your context window lean" |
| Claude Code | CLAUDE.md: under 200 lines (soft) |
Under 500 lines (soft); description 1,536 chars (hard) |
| GitHub Copilot | copilot-instructions.md: ≤ 2 pages (soft, approx.) |
Not supported — no repo-level SKILL.md |
| OpenAI Codex | AGENTS.md: no limit stated |
Skill bundle: zip ≤ 50 MB, uncompressed file ≤ 25 MB, ≤ 500 files/version (no per-SKILL.md text limit) |
| Google Antigravity | rule file: 12,000 chars each (hard) | No numeric limit stated |
Notes:
- Hard = enforced/truncated at the limit; soft = a documented quality recommendation.
- Only Claude Code publishes a numeric
SKILL.mdlength recommendation (under 500 lines). Cursor, Windsurf, and Antigravity just say "keep it focused/lean" with no figure; OpenAI documents skill-bundle limits (50 MB zip / 25 MB per file / 500 files) rather than a text length; and GitHub Copilot has no repo-levelSKILL.md— it usescopilot-instructions.mdplus path-specific*.instructions.md(no size limit stated for the latter). - Claude Code loads
CLAUDE.mdin full regardless of length, but notes files over 200 lines "consume more context and reduce adherence"; its auto-memoryMEMORY.mdloads only the "first 200 lines or 25KB, whichever comes first." - Windsurf is still named Windsurf; its docs are served through Cognition (
docs.windsurf.com→docs.devin.ai) and reference.windsurf/rulesand.windsurf/skills. - This repo keeps the
combined/sets under 6,000 characters to satisfy the strictest hard limit above (Windsurfglobal_rules.md).
Official sources: Cursor — rules · skills | Windsurf — rules & skills | Claude Code — memory · skills | GitHub Copilot — instructions | OpenAI Codex — AGENTS.md · skills | Google Antigravity — rules · skills
36 skills in this repo
Copy into ~/.claude/skillsUse when working on accessibility, a11y, WCAG, ARIA, screen readers, keyboard nav, focus order, contrast, alt text, captions, reduced motion, or target sizes; not language/culture/device (see inclusive-design).
git clone --depth 1 https://github.com/evanca/flutter-ai-rules
cp -r flutter-ai-rules/skills/accessibility ~/.claude/skills/accessibility
Use when creating a feature, designing folder structure, adding repositories/services/view models, wiring dependency injection, or deciding which layer owns logic.
git clone --depth 1 https://github.com/evanca/flutter-ai-rules
cp -r flutter-ai-rules/skills/architecture-feature-first ~/.claude/skills/architecture-feature-first
Use when creating a Cubit or Bloc, modeling state with sealed classes or status enums, wiring BlocBuilder/BlocListener/BlocProvider, writing bloc tests, or choosing between Cubit and Bloc.
git clone --depth 1 https://github.com/evanca/flutter-ai-rules
cp -r flutter-ai-rules/skills/bloc ~/.claude/skills/bloc
Use when asked to review a PR, MR, branch, or diff, audit changed files, or check code quality.
git clone --depth 1 https://github.com/evanca/flutter-ai-rules
cp -r flutter-ai-rules/skills/code-review ~/.claude/skills/code-review
Use when writing switch statements, refactoring if-else chains, creating data classes, choosing records vs classes, destructuring values, or modernizing pre-Dart-3 code.
git clone --depth 1 https://github.com/evanca/flutter-ai-rules
cp -r flutter-ai-rules/skills/dart-3-updates ~/.claude/skills/dart-3-updates
Use when building AI agents in Dart, implementing Genkit flows or tools, integrating LLMs into Dart or Flutter applications, or using Genkit Dart plugins.
git clone --depth 1 https://github.com/evanca/flutter-ai-rules
cp -r flutter-ai-rules/skills/developing-genkit-dart ~/.claude/skills/developing-genkit-dart
Use when writing Dart code, reviewing for style, refactoring naming, adding doc comments, structuring imports, or enforcing type annotations.
git clone --depth 1 https://github.com/evanca/flutter-ai-rules
cp -r flutter-ai-rules/skills/effective-dart ~/.claude/skills/effective-dart
Use when setting up firebase_ai, generating text/chat with Gemini, streaming AI output, building multimodal prompts, or handling AI errors.
git clone --depth 1 https://github.com/evanca/flutter-ai-rules
cp -r flutter-ai-rules/skills/firebase-ai ~/.claude/skills/firebase-ai
Use when logging analytics events, setting user properties, configuring default event parameters, building funnels, or adding screen-view tracking.
git clone --depth 1 https://github.com/evanca/flutter-ai-rules
cp -r flutter-ai-rules/skills/firebase-analytics ~/.claude/skills/firebase-analytics
Use when implementing app attestation, configuring App Check providers, setting up debug tokens, enabling backend enforcement, or managing token refresh.
git clone --depth 1 https://github.com/evanca/flutter-ai-rules
cp -r flutter-ai-rules/skills/firebase-app-check ~/.claude/skills/firebase-app-check
Use when setting up auth, managing auth state, implementing email/password or social sign-in, handling auth errors, or managing users.
git clone --depth 1 https://github.com/evanca/flutter-ai-rules
cp -r flutter-ai-rules/skills/firebase-auth ~/.claude/skills/firebase-auth
Use when setting up Firestore, designing schemas, doing CRUD, creating listeners, paginating queries, configuring indexes, enabling offline persistence, or writing security rules.
git clone --depth 1 https://github.com/evanca/flutter-ai-rules
cp -r flutter-ai-rules/skills/firebase-cloud-firestore ~/.claude/skills/firebase-cloud-firestore
Use when calling callable functions (httpsCallable), passing data to server-side logic, handling function errors/timeouts, configuring regions, or testing with the Emulator Suite.
git clone --depth 1 https://github.com/evanca/flutter-ai-rules
cp -r flutter-ai-rules/skills/firebase-cloud-functions ~/.claude/skills/firebase-cloud-functions
Use when implementing crash reporting, capturing fatal/non-fatal errors, recording isolate/async exceptions, customizing reports, or uploading obfuscated symbols.
git clone --depth 1 https://github.com/evanca/flutter-ai-rules
cp -r flutter-ai-rules/skills/firebase-crashlytics ~/.claude/skills/firebase-crashlytics
Use when syncing real-time data, structuring JSON trees, reading/writing, creating listeners, enabling offline persistence, managing presence, sharding, or writing security rules.
git clone --depth 1 https://github.com/evanca/flutter-ai-rules
cp -r flutter-ai-rules/skills/firebase-database ~/.claude/skills/firebase-database
Use when setting up Data Connect, writing GraphQL queries/mutations, configuring generated SDKs, handling offline, or applying security rules.
git clone --depth 1 https://github.com/evanca/flutter-ai-rules
cp -r flutter-ai-rules/skills/firebase-data-connect ~/.claude/skills/firebase-data-connect
Use when running in-app message campaigns, triggering/suppressing messages, configuring opt-in data collection, testing on specific devices, or handling message callbacks.
git clone --depth 1 https://github.com/evanca/flutter-ai-rules
cp -r flutter-ai-rules/skills/firebase-in-app-messaging ~/.claude/skills/firebase-in-app-messaging
Use when setting up Firebase Cloud Messaging, managing permissions and tokens, handling background/foreground notification taps, or dispatching messages server-side (HTTP v1).
git clone --depth 1 https://github.com/evanca/flutter-ai-rules
cp -r flutter-ai-rules/skills/firebase-messaging ~/.claude/skills/firebase-messaging
Use when implementing feature flags, running A/B tests, setting parameter defaults, fetching/activating config, or enabling real-time config updates.
git clone --depth 1 https://github.com/evanca/flutter-ai-rules
cp -r flutter-ai-rules/skills/firebase-remote-config ~/.claude/skills/firebase-remote-config
Use when setting up Storage, uploading/downloading files, managing metadata, handling errors, or applying security rules.
git clone --depth 1 https://github.com/evanca/flutter-ai-rules
cp -r flutter-ai-rules/skills/firebase-storage ~/.claude/skills/firebase-storage
Use when scaffolding a project, refactoring into layers, creating view models/repositories, configuring dependency injection, or implementing unidirectional data flow (MVVM).
git clone --depth 1 https://github.com/evanca/flutter-ai-rules
cp -r flutter-ai-rules/skills/flutter-app-architecture ~/.claude/skills/flutter-app-architecture
Use when writing, reviewing, refactoring, or planning Flutter/Dart code — screens, features, project structure, state management, folders, widgets, cubits/blocs, repositories, services, or tests.
git clone --depth 1 https://github.com/evanca/flutter-ai-rules
cp -r flutter-ai-rules/skills/flutter-best-practices ~/.claude/skills/flutter-best-practices
Use when setting up ChangeNotifier models, providing them to the widget tree, consuming state with Consumer or Provider.of, or optimizing rebuilds.
git clone --depth 1 https://github.com/evanca/flutter-ai-rules
cp -r flutter-ai-rules/skills/flutter-change-notifier ~/.claude/skills/flutter-change-notifier
Use when hitting layout errors (RenderFlex overflow, unbounded constraints, RenderBox not laid out), scroll errors, or setState-during-build errors.
git clone --depth 1 https://github.com/evanca/flutter-ai-rules
cp -r flutter-ai-rules/skills/flutter-errors ~/.claude/skills/flutter-errors
Use when adding Firebase to a Flutter project, running flutterfire configure, initializing Firebase in main.dart, or configuring multiple flavors.
git clone --depth 1 https://github.com/evanca/flutter-ai-rules
cp -r flutter-ai-rules/skills/flutterfire-configure ~/.claude/skills/flutterfire-configure
Use when preloading fonts, asset/network images, Lottie/Rive animations, local JSON/config, warming initial API data, or optimizing Flutter Web startup.
git clone --depth 1 https://github.com/evanca/flutter-ai-rules
cp -r flutter-ai-rules/skills/flutter-pre-caching ~/.claude/skills/flutter-pre-caching
Use when building any Flutter screen or component to choose responsive Row, Column, Expanded, Flexible, and Spacer layouts before fixed-size or coordinate-based alternatives.
git clone --depth 1 https://github.com/evanca/flutter-ai-rules
cp -r flutter-ai-rules/skills/flutter-use-column-row-first ~/.claude/skills/flutter-use-column-row-first
Use when working on inclusion, i18n/localization, global name/address forms, low-end devices, slow/metered networks, affordability, or first-time/low-confidence users; not WCAG/screen readers (see accessibility).
git clone --depth 1 https://github.com/evanca/flutter-ai-rules
cp -r flutter-ai-rules/skills/inclusive-design ~/.claude/skills/inclusive-design
Use when generating mocks, stubbing methods, verifying interactions, capturing arguments, or choosing between mocks, fakes, and real objects (Mockito).
git clone --depth 1 https://github.com/evanca/flutter-ai-rules
cp -r flutter-ai-rules/skills/mockito ~/.claude/skills/mockito
Use when creating mocks, stubbing methods, verifying interactions, registering fallback values, or choosing between mocks, fakes, and real objects (Mocktail).
git clone --depth 1 https://github.com/evanca/flutter-ai-rules
cp -r flutter-ai-rules/skills/mocktail ~/.claude/skills/mocktail
Use when writing E2E/integration tests, testing native interactions like permissions or system dialogs, capturing UI regressions, or validating cross-platform behavior (Patrol 4.x).
git clone --depth 1 https://github.com/evanca/flutter-ai-rules
cp -r flutter-ai-rules/skills/patrol-e2e-testing ~/.claude/skills/patrol-e2e-testing
Use when setting up providers, consuming state, optimizing rebuilds, using ProxyProvider, or migrating from deprecated providers (Provider package).
git clone --depth 1 https://github.com/evanca/flutter-ai-rules
cp -r flutter-ai-rules/skills/provider ~/.claude/skills/provider
Use when testing RevenueCat purchases/subscriptions, setting up sandbox testing, debugging a purchase/restore/trial, verifying entitlements or events, or writing an IAP QA plan.
git clone --depth 1 https://github.com/evanca/flutter-ai-rules
cp -r flutter-ai-rules/skills/revenuecat-testing ~/.claude/skills/revenuecat-testing
Use when setting up providers, combining requests, managing state disposal, passing arguments, performing side effects, or testing providers (Riverpod).
git clone --depth 1 https://github.com/evanca/flutter-ai-rules
cp -r flutter-ai-rules/skills/riverpod ~/.claude/skills/riverpod
Use when writing store copy to character limits (name, subtitle, descriptions, keywords) or preparing listing images (icon, feature graphic, screenshots, preview video).
git clone --depth 1 https://github.com/evanca/flutter-ai-rules
cp -r flutter-ai-rules/skills/store-listing-assets ~/.claude/skills/store-listing-assets
Use when writing or reviewing Flutter/Dart tests (unit, widget, golden), fixing flaky tests, adding coverage, or choosing between unit and widget tests.
git clone --depth 1 https://github.com/evanca/flutter-ai-rules
cp -r flutter-ai-rules/skills/testing ~/.claude/skills/testing
Comments (0)
Sign in to join the discussion.
No comments yet
Be the first to share your take.