Source profileQuality 88/100

evanca/flutter-ai-rules/skills/firebase-data-connect/SKILL.md

firebase-data-connect

Use when setting up Data Connect, writing GraphQL queries/mutations, configuring generated SDKs, handling offline, or applying security rules.

Source repository stars
604
Declared platforms
0
Static risk flags
0
Last source update
2026-08-04
Source checked
2026-08-04

Decision brief

What it does—and where it fits

This skill defines how to correctly use Firebase Data Connect in Flutter applications.

Best for

  • Setting up and configuring Firebase Data Connect in a Flutter project.
  • Designing schemas, queries, and mutations for Data Connect.
  • Implementing generated SDK calls for typed queries and mutations.

Not for

  • Tasks that require unconfirmed production actions or broad system permissions.
  • Environments where the pinned source and install steps cannot be inspected.

Compatibility matrix

Platform support, with evidence labels

PlatformStatusEvidenceWhat to check
CodexNot declaredNo explicit evidencePortability before use
Claude CodeNot declaredNo explicit evidencePortability before use
CursorNot declaredNo explicit evidencePortability before use
Gemini CLINot declaredNo explicit evidencePortability before use
Open the compatibility checker

Installation

Inspect first. Install second.

The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.

Source-detected install commandSource
npx skills add https://github.com/evanca/flutter-ai-rules --skill "skills/firebase-data-connect"
Safe inspection promptEditorial

Inspect the Agent Skill "firebase-data-connect" from https://github.com/evanca/flutter-ai-rules/blob/b294a77b68b5508f8d3151fb93d87ed9622d2ff1/skills/firebase-data-connect/SKILL.md at commit b294a77b68b5508f8d3151fb93d87ed9622d2ff1. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.

Workflow

What the source asks the agent to do

  1. 01

    1. Setup and Configuration

    This produces typed Dart classes for each query and mutation.

    This produces typed Dart classes for each query and mutation.
  2. 02

    Step 1: Install the package

    Review the “Step 1: Install the package” section in the pinned source before continuing.

    Review and apply the “Step 1: Install the package” source section.
  3. 03

    Step 2: Import and initialize

    Review the “Step 2: Import and initialize” section in the pinned source before continuing.

    Review and apply the “Step 2: Import and initialize” source section.
  4. 04

    Step 3: Define a schema in dataconnect/schema/schema.gql

    Review the “Step 3: Define a schema in dataconnect/schema/schema.gql” section in the pinned source before continuing.

    Review and apply the “Step 3: Define a schema in dataconnect/schema/schema.gql” source section.

Permission review

Static risk signals and limitations

No configured static risk pattern was detected

This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.

Evidence record

Why each signal appears

EvidenceSourceComputedTestedEditorial
SignalValueEvidence typeMeaning
Quality score88/100ComputedDocumentation, specificity, maintenance, and trust rules
Repository stars604SourceRepository attention, not individual Skill quality
Compatibility0 platformsSourceDeclared in the catalog source record
Usage guideautomated source guideEditorialGenerated or reviewed according to the visible evidence level

Pinned source

Provenance and original SKILL.md

Repository
evanca/flutter-ai-rules
Skill path
skills/firebase-data-connect/SKILL.md
Commit
b294a77b68b5508f8d3151fb93d87ed9622d2ff1
License
MIT
Collected
2026-08-04
Default branch
main
View the original SKILL.md

Firebase Data Connect Skill

This skill defines how to correctly use Firebase Data Connect in Flutter applications.

When to Use

Use this skill when:

  • Setting up and configuring Firebase Data Connect in a Flutter project.
  • Designing schemas, queries, and mutations for Data Connect.
  • Implementing generated SDK calls for typed queries and mutations.
  • Handling network failures, data inconsistencies, and offline scenarios.
  • Applying security and performance best practices.

1. Setup and Configuration

Step 1: Install the package

flutter pub add firebase_data_connect

Step 2: Import and initialize

import 'package:firebase_data_connect/firebase_data_connect.dart';
import 'package:firebase_core/firebase_core.dart';
import 'firebase_options.dart';

await Firebase.initializeApp(
  options: DefaultFirebaseOptions.currentPlatform,
);

Step 3: Define a schema in dataconnect/schema/schema.gql

type Movie @table {
  id: UUID! @default(expr: "uuidV4()")
  title: String!
  releaseYear: Int
  genre: String
  rating: Float
  description: String
}

Step 4: Define queries and mutations in dataconnect/connector/queries.gql

query ListMovies @auth(level: PUBLIC) {
  movies {
    id
    title
    releaseYear
    genre
    rating
  }
}

mutation CreateMovie($title: String!, $releaseYear: Int, $genre: String) @auth(level: USER) {
  movie_insert(data: {
    title: $title
    releaseYear: $releaseYear
    genre: $genre
  })
}

mutation DeleteMovie($id: UUID!) @auth(level: USER) {
  movie_delete(id: $id)
}

Step 5: Generate the typed Flutter SDK

flutterfire generate

This produces typed Dart classes for each query and mutation.

Platform support:

PlatformSupport
iOSFull
AndroidFull
WebFull
Other platformsNot supported

2. Executing Queries and Mutations

Use the generated SDK to execute typed queries and mutations:

// Execute a query
final result = await ListMoviesQuery().execute();
final movies = result.data.movies;

// Execute a mutation
await CreateMovieMutation(title: 'Inception', releaseYear: 2010, genre: 'Sci-Fi')
    .execute();

// Delete by ID
await DeleteMovieMutation(id: movieId).execute();

Real-Time Listeners

Subscribe to query changes for live updates:

final subscription = ListMoviesQuery().subscribe();
subscription.listen((result) {
  final movies = result.data.movies;
  // Update UI with latest movie list
});

3. Performance and Caching

  • Design efficient queries requesting only the fields needed to minimize data transfer.
  • Implement pagination for large datasets:
    query ListMoviesPaginated($limit: Int!, $offset: Int!) @auth(level: PUBLIC) {
      movies(limit: $limit, offset: $offset) {
        id
        title
        releaseYear
      }
    }
    
  • Use real-time listeners judiciously to avoid unnecessary network usage.
  • Consider offline capabilities for critical app functionality by caching query results locally.

4. Error Handling

Wrap Data Connect calls in try/catch to handle network and validation errors:

try {
  final result = await ListMoviesQuery().execute();
  return result.data.movies;
} on FirebaseException catch (e) {
  if (e.code == 'unavailable') {
    // Handle offline — return cached data
    return _localCache.getMovies();
  }
  rethrow;
}
  • Implement retry logic with exponential backoff for transient connection errors.
  • Provide meaningful error messages for data validation failures.
  • Monitor error rates and investigate recurring issues.

5. Security

  • Use @auth directives in schema to control access levels (PUBLIC, USER, NO_ACCESS).
  • Integrate Firebase Authentication for user-based access control.
  • Validate data on both client and server sides.
  • Follow data privacy best practices when handling user information.

References