mcpbeat Sign in

Firebase Crashlytics Agent Skill

Use when implementing crash reporting, capturing fatal/non-fatal errors, recording isolate/async exceptions, customizing reports, or uploading obfuscated symbols.

1k tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
604
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/evanca/flutter-ai-rules --skill firebase-crashlytics

The instruction itself

9 sections, as written by the author

Firebase Crashlytics Skill

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

When to Use

Use this skill when:

  • Implementing crash reporting in a Flutter project.
  • Capturing fatal errors, non-fatal exceptions, and async/isolate errors.
  • Customizing crash reports with keys, logs, and user identifiers.
  • Configuring opt-in data collection or disabling reporting in debug builds.
  • Uploading symbol files for obfuscated builds.

1. Setup and Configuration

flutter pub add firebase_crashlytics
flutter pub add firebase_analytics  # enables breadcrumb logs for better crash context

Run flutterfire configure to update the Firebase configuration and add the required Crashlytics Gradle plugin for Android.

import 'package:firebase_crashlytics/firebase_crashlytics.dart';

Obfuscated code:

  • For apps built with --split-debug-info and/or --obfuscate, upload symbol files for readable stack traces.
  • iOS: Flutter 3.12.0+ and Crashlytics Flutter plugin 3.3.4+ handle symbol upload automatically.
  • Android: Use Firebase CLI (v11.9.0+) to upload Flutter debug symbols:
firebase crashlytics:symbols:upload --app=FIREBASE_APP_ID PATH/TO/symbols

2. Error Handling

Configure comprehensive error capture in main() to catch errors from all sources:

Fatal Flutter errors:

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp();

  // Pass all uncaught fatal errors from the framework to Crashlytics
  FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterFatalError;

  // Catch async errors not handled by the Flutter framework
  PlatformDispatcher.instance.onError = (error, stack) {
    FirebaseCrashlytics.instance.recordError(error, stack, fatal: true);
    return true;
  };

  runApp(MyApp());
}

Non-fatal Flutter errors: use recordFlutterError instead of recordFlutterFatalError.

Isolate errors:

Isolate.current.addErrorListener(RawReceivePort((pair) async {
  final List<dynamic> errorAndStacktrace = pair;
  await FirebaseCrashlytics.instance.recordError(
    errorAndStacktrace.first,
    errorAndStacktrace.last,
    fatal: true,
  );
}).sendPort);

Caught exceptions (non-fatal):

await FirebaseCrashlytics.instance.recordError(
  error,
  stackTrace,
  reason: 'a non-fatal error',
  information: ['further diagnostic information about the error', 'version 2.0'],
);
  • Crashlytics only stores the most recent 8 non-fatal exceptions per session — older ones are discarded.

3. Crash Report Customization

Custom keys (max 64 key/value pairs, up to 1 kB each):

FirebaseCrashlytics.instance.setCustomKey('str_key', 'hello');
FirebaseCrashlytics.instance.setCustomKey('bool_key', true);
FirebaseCrashlytics.instance.setCustomKey('int_key', 1);

Custom log messages (limit: 64 kB per session):

FirebaseCrashlytics.instance.log("User tapped on payment button");

User identifier:

FirebaseCrashlytics.instance.setUserIdentifier("user-123");
// Clear by setting to blank string
FirebaseCrashlytics.instance.setUserIdentifier("");
  • Avoid putting unique values (user IDs, timestamps) directly in exception messages — use custom keys instead.

4. Performance and Optimization

  • Crashlytics processes exceptions on a dedicated background thread to minimize performance impact.
  • Fatal reports are sent in real-time without requiring an app restart.
  • Non-fatal reports are written to disk and sent with the next fatal report or on app restart.
  • Use breadcrumb logs (requires Firebase Analytics) to understand user actions leading up to a crash.

Disable Crashlytics in debug builds:

if (kReleaseMode) {
  await FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(true);
} else {
  await FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(false);
}

5. Testing and Debugging

Force a test crash to verify the setup:

FirebaseCrashlytics.instance.crash();

Verification workflow:

  • Build and run the app in release mode.
  • Trigger the test crash.
  • Reopen the app so the crash report is uploaded.
  • Check the Firebase Console Crashlytics dashboard within 5 minutes.
  • Verify that custom keys, logs, and user identifiers appear on the crash report.
  • Verify stack traces are properly symbolicated when using code obfuscation.

6. Opt-in Reporting

By default, Crashlytics automatically collects crash reports for all users.

To give users control over data collection:

  • Disable automatic reporting and enable it only via setCrashlyticsCollectionEnabled(true) when users opt in.
  • The override value persists across all subsequent app launches.
  • To opt a user out, pass false — this applies from the next app launch.
  • When disabled, crash info is stored locally; if later enabled, locally stored crashes are sent to Crashlytics.

References

Other skills for the same job

different authors, same section of the catalogue
XLSX
by anthropics
vendor ×15

Comprehensive spreadsheet creation, editing, and analysis with support for formulas, formatting, data analysis, and visualization. When Claude needs to work with spreadsheets (.xlsx, .xlsm, .csv, .tsv, etc) for: (1) Creating new spreadsheets with formulas and formatting, (2) Reading or analyzing data, (3) Modify existing spreadsheets while preserving formulas, (4) Data analysis and visualization in spreadsheets, or (5) Recalculating formulas

5k tokens scripts
XLSX
by w95
×7

Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like \"the xlsx in my downloads\") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.

3k tokens
Raffle Winner Picker
by frostant
×5

Picks random winners from lists, spreadsheets, or Google Sheets for giveaways, raffles, and contests. Ensures fair, unbiased selection with transparency.

949 tokens
Fda Database
by christophacham
×4

Query openFDA API for drugs, devices, adverse events, recalls, regulatory submissions (510k, PMA), substance identification (UNII), for FDA regulatory data analysis and safety research.

32k tokens scripts
Matlab
by christophacham
×4

MATLAB and GNU Octave numerical computing for matrix operations, data analysis, visualization, and scientific computing. Use when writing MATLAB/Octave scripts for linear algebra, signal processing, image processing, differential equations, optimization, statistics, or creating scientific visualizations. Also use when the user needs help with MATLAB syntax, functions, or wants to convert between MATLAB and Python code. Scripts can be executed with MATLAB or the open-source GNU Octave interpreter.

25k tokens
Umap Learn
by ComeOnOliver
×4

UMAP dimensionality reduction. Fast nonlinear manifold learning for 2D/3D visualization, clustering preprocessing (HDBSCAN), supervised/parametric UMAP, for high-dimensional data.

14k tokens
D3 Viz
by chrisvoncsefalvay
×3

Creating interactive data visualisations using d3.js. This skill should be used when creating custom charts, graphs, network diagrams, geographic visualisations, or any complex SVG-based data visualisation that requires fine-grained control over visual elements, transitions, or interactions. Use this for bespoke visualisations beyond standard charting libraries, whether in React, Vue, Svelte, vanilla JavaScript, or any other environment.

20k tokens
Alphafold Database
by christophacham
×3

Access AlphaFold 200M+ AI-predicted protein structures. Retrieve structures by UniProt ID, download PDB/mmCIF files, analyze confidence metrics (pLDDT, PAE), for drug discovery and structural biology.

7k tokens

How to use it

Copy the folder

Take evanca/firebase-crashlytics from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.