flutter-supabase-engineering
Skill8 starsChanged 48 days agoMITView on GitHub
Design, implement, review, secure, test, debug, migrate, and optimize production Supabase integrations in Flutter and Dart applications. Use when a task involves supabase_flutter, Supabase Auth or session restoration, OAuth/PKCE or deep links, PostgREST queries and mutations, PostgreSQL Row Level Security, RPC/database functions, pagination or query performance, Realtime/Postgres Changes/Broadcast/Presence, Storage buckets/uploads/downloads/signed URLs, Edge Functions, caching or offline behavior, retries/idempotency, local Supabase testing, mock_supabase_http_client, or Supabase architecture and production readiness. Do not use for generic PostgreSQL work with no Supabase client or policy concerns, backend-only Supabase integrations, or non-Supabase authentication.
In this repository70 other files it gives its agents.
- camerawesome-flutterSkill
- dart-args-production-cliSkill
- dart-flutter-equatable-engineeringSkill
- dart-flutter-ffi-systems-engineeringSkill
- dart-metaSkill
- document-camera-frameSkill
- document-scan-flutterSkill
- figma-to-flutter-expertSkill
- flutter-animations-production-engineeringSkill
- flutter-app-hardening-reverse-engineeringSkill
- flutter-app-icon-engineeringSkill
- flutter-application-security-engineeringSkill
- flutter-app-links-deep-link-engineeringSkill
- flutter-cachingSkill
- flutter-concurrency-memory-performanceSkill
- flutter-confetti-engineeringSkill
- flutter-dart-package-engineeringSkill
- flutter-design-system-from-design-mdSkill
- flutter-dio-cache-interceptor-engineeringSkill
- flutter-dio-engineeringSkill
- flutter-doc-scannerSkill
- flutter-drift-persistence-engineeringSkill
- flutter-expert-tipsSkill
- flutter-firebase-analyticsSkill
- flutter-firebase-core-engineeringSkill
- flutter-firebase-messagingSkill
- flutter-get-it-injectable-dependency-injectionSkill
- flutter-go-router-engineeringSkill
- flutter-hive-persistence-engineeringSkill
- flutter-image-performanceSkill
- flutter-image-picker-production-engineeringSkill
- flutter-lints-static-analysis-engineeringSkill
- flutter-local-notifications-production-engineeringSkill
- flutter-memory-leak-engineeringSkill
- flutter-mobile-developmentSkill
- flutter-motion-engineeringSkill
- flutter-multi-environmentSkill
- flutter-native-splash-engineeringSkill
- flutter-package-plugin-selectionSkill
- flutter-path-provider-production-storageSkill
- flutter-performance-jank-optimizationSkill
- flutter-permission-handler-engineeringSkill
- flutter-pinputSkill
- flutter-production-build-releaseSkill
- flutter-production-engineeringSkill
- flutter-production-loggingSkill
- flutter-pro-image-editor-engineeringSkill
- flutter-secure-storage-security-engineeringSkill
- flutter-sentry-engineeringSkill
- flutter-share-plus-engineeringSkill
- flutter-skeletonizer-engineeringSkill
- flutter-squadron-concurrency-engineeringSkill
- flutter-svg-engineeringSkill
- flutter-ui-performance-engineeringSkill
- flutter-url-launcher-engineeringSkill
- flutter-video-player-production-engineeringSkill
- flutter-webview-production-engineeringSkill
- freezed-production-engineeringSkill
- html-to-flutterSkill
- hydrated-blocSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
30 rules. About 0 are common, 27 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈27
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Treat Flutter as an untrusted client.
- Very specific: line 40
Do not create a new client, query, Future, stream, Auth listener, or Realtime channel from build().
- Distinctive: line 42
Treat the project URL and client publishable/anonymous key as client configuration, not authorization.
- Distinctive: line 44
Never ship a service-role key, secret key, database password, JWT signing secret, third-party secret, or privileged credential in Flutter.
- Distinctive: line 48
Keep authorization claims in trusted server-controlled data, not editable user metadata.
- Distinctive: line 50
Keep ordinary user-owned CRUD behind direct PostgREST plus RLS when that is the simplest secure boundary.
- Distinctive: line 52
Use database functions/RPC for atomic multi-row or transactional SQL work.
- Distinctive: line 53
Use Edge Functions for server-only secrets, external integrations, or custom privileged orchestration—not as a generic proxy for every …
- Very specific: line 57
Use .single() only when exactly one row is required.
- Distinctive: line 61
Keep Realtime subscriptions narrow, persist stream instances, remove unused channels, and never treat Realtime as durable history.
- Distinctive: line 64
Use private buckets for private data and enforce access with Storage RLS.
- Distinctive: line 68
Do not stack retries across client, repository, and state layers.
- Distinctive: line 69
Do not assume Supabase is offline-first.
- Distinctive: line 73
Never rely on mocks to prove RLS, grants, constraints, triggers, Auth, Realtime, or real PostgreSQL behavior.
- Distinctive: line 78
Use this decision order:
- Distinctive: line 80
Use direct PostgREST plus RLS for ordinary user-owned CRUD.
- Distinctive: line 81
Use RPC for atomic database work or reusable server-side SQL logic.
- Distinctive: line 82
Use an Edge Function when server-only credentials, external APIs, or custom privileged orchestration are required.
- Distinctive: line 84
Use Postgres Changes for moderate live database views.
- Distinctive: line 85
Use Broadcast for high-scale fan-out or application-defined messages.
- Distinctive: line 86
Use Presence for ephemeral online state.
- Distinctive: line 87
Use private Storage plus signed URLs for temporary external access.
- Distinctive: line 88
Add offline-first architecture only for an explicit offline editing requirement.
- Distinctive: line 91
Prefer the first boundary that fully satisfies security and correctness.
- Very specific: line 95
Read only the relevant sections of references/production-guide.md.
- Distinctive: line 102
Use these search headings:
- Distinctive: line 131
Do not add an interface, wrapper, Edge Function, or cache solely for future flexibility.
- Distinctive: line 133
Keep transport and Supabase error types inside the data boundary.
- Distinctive: line 138
Run the narrowest relevant Dart/Flutter checks, then validate authoritative behavior against a local or isolated Supabase stack.
- Distinctive: line 153
Never test destructive behavior against production.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Flutter Supabase Engineering
Treat Flutter as an untrusted client. Keep the database, Row Level Security, constraints, and server-side policy authoritative.
Start with evidence
Before changing code:
- Inspect
pubspec.yaml,pubspec.lock, Flutter/Dart constraints, and target platforms. - Identify the locked
supabase_flutter,supabase,postgrest,realtime_client,storage_client,functions_client, and test-package versions. - Find every Supabase initialization and client construction; identify the single intended client owner and lifetime.
- Inspect Auth bootstrap, persistence, deep-link handling, listeners, sign-out, and session-dependent startup behavior.
- Inspect database migrations, grants, RLS policies, indexes, functions, constraints, and generated/typed models relevant to the task.
- Inventory query count, selected columns, pagination, N+1 patterns, mutation idempotency, Realtime channels, Storage transfer paths, Edge Functions, retry layers, caching, and offline requirements.
- Separate current repository behavior from version-sensitive guidance.
The bundled guide was validated on 2026-08-11 against
supabase_flutter 2.17.1, supabase 2.16.0, storage_client 2.6.0,
functions_client 2.7.1, and mock_supabase_http_client 0.0.3+2. Use the
installed packages and their changelogs as the source of truth when versions
differ.
Preserve these invariants
- Initialize
supabase_flutteronce beforerunAppand reuse its client. - Do not create a new client, query, Future, stream, Auth listener, or Realtime
channel from
build(). - Treat the project URL and client publishable/anonymous key as client configuration, not authorization.
- Never ship a service-role key, secret key, database password, JWT signing secret, third-party secret, or privileged credential in Flutter.
- Enable and test RLS for client-accessible data; do not treat hidden UI or a client-supplied user/tenant ID as authorization.
- Keep authorization claims in trusted server-controlled data, not editable user metadata.
- Keep ordinary user-owned CRUD behind direct PostgREST plus RLS when that is the simplest secure boundary.
- Use database functions/RPC for atomic multi-row or transactional SQL work.
- Use Edge Functions for server-only secrets, external integrations, or custom privileged orchestration—not as a generic proxy for every query.
- Select only needed columns, filter on the server, paginate large results, avoid N+1 requests, and index real query and RLS predicates.
- Use
.single()only when exactly one row is required; use.maybeSingle()when absence is valid. - Make retried mutations idempotent at the database or protocol boundary; do not infer safety from a client boolean.
- Keep Realtime subscriptions narrow, persist stream instances, remove unused channels, and never treat Realtime as durable history.
- Reconcile initial query data and Realtime changes deliberately.
- Use private buckets for private data and enforce access with Storage RLS; object paths are organization, not authorization.
- Choose standard versus resumable upload based on object size and network reliability; avoid whole-file memory loads for large objects.
- Do not stack retries across client, repository, and state layers.
- Do not assume Supabase is offline-first; add an explicit local source of truth, sync, conflict, and deletion model only when the product requires it.
- Apply schema and policy migrations through the database workflow, never from the Flutter app.
- Never rely on mocks to prove RLS, grants, constraints, triggers, Auth, Realtime, or real PostgreSQL behavior.
Choose the smallest secure boundary
Use this decision order:
- Use direct PostgREST plus RLS for ordinary user-owned CRUD.
- Use RPC for atomic database work or reusable server-side SQL logic.
- Use an Edge Function when server-only credentials, external APIs, or custom privileged orchestration are required.
- Use Postgres Changes for moderate live database views.
- Use Broadcast for high-scale fan-out or application-defined messages.
- Use Presence for ephemeral online state.
- Use private Storage plus signed URLs for temporary external access.
- Add offline-first architecture only for an explicit offline editing requirement.
Prefer the first boundary that fully satisfies security and correctness.
Route to the production guide
Read only the relevant sections of references/production-guide.md. Locate
sections before reading them with:
rg -n '^#{1,3} (SECTION|RELATED SECTION)$' references/production-guide.mdUse these search headings:
| Task | Search headings | |||||||||||||
| Select packages, configure secrets, initialize, or manage client lifetime | `Package Selection | Platform Capability Matrix | Configuration and Secrets | Initialization | Session Restoration Is Asynchronous | Client Lifetime | Do Not Recreate Clients` | |||||||
| Implement Auth, sessions, sign-out, OAuth, PKCE, deep links, or recovery | `Authentication | Auth Session Lifecycle | Access and Refresh Tokens | getSession | onAuthStateChange | Sign-Out | Auth Persistence | OAuth and PKCE | OAuth Deep-Link Flow | Password Recovery | Native Provider Sign-In` | |||
| Design authorization, RLS, grants, tenant isolation, or policy performance | `Authorization and RLS | RLS Baseline | Grants and RLS | auth.uid | Index RLS Columns | RLS Policy Performance | Multi-Tenant RLS | User Metadata and Authorization | security definer` | |||||
| Implement queries, typed models, pagination, or query optimization | `Database Queries | Select Required Columns | Current Filter APIs | Typed Models | Repository Example | single.*maybeSingle | Pagination | Keyset Pagination | Avoid N+1 | Query Performance Workflow | Database Index Awareness` | |||
| Implement mutations, constraints, idempotency, RPC, or transactions | `Mutations | Insert | Update | Upsert | Delete | Database Constraints | Idempotency | RPC and Database Functions | Transactions | Database Function Security` | ||||
| Choose direct queries, RPC, or Edge Functions | `Edge Functions vs RPC vs Direct Queries | Decision Framework` | ||||||||||||
| Add or optimize Realtime, Broadcast, Presence, or streams | `Realtime Architecture | Postgres Changes | Realtime Multiple Filters | Realtime Scaling | Realtime Performance Rules | Remove Channels | Flutter Lifecycle and Realtime | Realtime Is Not Durable History | stream | Realtime + Local State Reconciliation | Broadcast | Presence` | ||
| Implement Storage, uploads, downloads, buckets, signed URLs, or CDN behavior | `Storage | Public vs Private Buckets | Storage RLS | Storage Ownership | Storage Upload | Web Uploads | Standard vs Resumable Uploads | Large Upload Memory | Storage Retry | Signed URLs | Public URLs | CDN and cacheControl | Downloads` | |
| Invoke, cancel, retry, locate, or debug Edge Functions | `Edge Functions | Current Function Cancellation | Function Error Types | Function Retry Strategy | Function Region | Web Edge Functions | Function Performance` | |||||||
| Add caching, offline support, retry, or error mapping | `Offline Behavior | Caching Strategy | Retry Strategy | PostgREST Automatic Retry | Error Handling | Error Mapping` | ||||||||
| Review architecture, Flutter performance, concurrency, security, or reliability | `Architecture | Repository Pattern | Dependency Injection | State Management | Flutter Widget Performance | Concurrency and Race Conditions | Security Rules | Performance Rules | Reliability Rules` | |||||
| Test, debug, migrate, review, or prepare production | `Testing | mock_supabase_http_client | Mock Limitations | Local Supabase | RLS Security Tests | Database Migration Rules | Edge Function Testing | Observability and Debugging | Debugging Guide | Anti-Patterns | Implementation Checklist | Code Review Checklist | Production Readiness Checklist | Version-Sensitive Areas` |
For a full security or production-readiness audit, read the entire guide after completing the repository inventory.
Implement at the authoritative boundary
- Fix authorization in RLS, grants, trusted claims, or server-side code rather than duplicating checks in every Flutter caller.
- Fix query shape and indexes before applying Dart micro-optimizations.
- Fix atomicity with a database constraint, transaction, or function rather than client sequencing.
- Reuse the existing repository, client, Auth bootstrap, cache, and subscription ownership patterns when they are sound.
- Do not add an interface, wrapper, Edge Function, or cache solely for future flexibility.
- Keep transport and Supabase error types inside the data boundary; map them to stable application failures where the existing architecture expects it.
Validate the result
Run the narrowest relevant Dart/Flutter checks, then validate authoritative behavior against a local or isolated Supabase stack. Cover changed paths from this matrix:
- authenticated, anonymous, expired, refreshed, and signed-out sessions;
- allowed and denied RLS cases for each relevant role and tenant;
- database constraints, triggers, functions, transactions, and indexes;
- empty, single-row, multi-row, pagination, and concurrent mutation cases;
- Realtime subscribe, reconnect, reconcile, and channel disposal behavior;
- private/public Storage access and representative transfer sizes;
- Edge Function success, typed failures, timeout, cancellation, and idempotent retry behavior;
- offline/cache transitions when changed;
- release-like deep-link and OAuth behavior on each affected platform.
Never test destructive behavior against production. Report any authorization, migration, platform, or local-stack path that was not executed.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

