firebase-remote-config — скилл для Claude Code и Codex: фича-флаги
Скилл для Flutter-приложений: агент подключает Firebase Remote Config — фича-флаги, значения по умолчанию, A/B-тесты и обновления конфига без релиза.
MIT ★ 674 обновлён 2026-10-29
/plugin marketplace add evanca/flutter-ai-rules
/plugin install flutter-ai-skills@flutter-ai-rulesЧто делает firebase-remote-config
Скилл описывает, как агенту подключать Remote Config в приложении на Flutter: настройки SDK, параметры по умолчанию, получение и активацию значений, обновления в реальном времени. Внутри — разделы по установке пакетов, работе с типизированными геттерами и проверке статуса последней загрузки.
Агент ставит firebase_remote_config, а для условного таргетинга ещё и firebase_analytics: без включённой аналитики в проекте Firebase правила по аудиториям не сработают. Отдельно оговорены fetchTimeout и minimumFetchInterval, значения по умолчанию через setDefaults и то, что ключи и значения видны конечным пользователям — секреты туда не кладут.
Есть нюансы платформ и лимитов. Real-time обновления не работают в Web, на macOS нужно включить Keychain Sharing в Xcode, а частые загрузки упираются в троттлинг: в продакшене интервал по умолчанию 12 часов, короткий советуют только для debug-сборок.
Какие задачи решает
- включить фича-флаг без релиза приложения
- задать значения по умолчанию, чтобы экран не падал до первой загрузки
- подтянуть параметры с сервера и применить их одним вызовом
- прогнать A/B-тест на разных сегментах пользователей
- не упереться в троттлинг частых загрузок и квоты
Примеры запросов агенту
- Добавь фича-флаг
feature_new_onboardingчерез Firebase Remote Config и прочитай его в виджете - Настрой
setDefaultsдля параметров и обработайlastFetchStatusпослеfetchAndActivate - Сделай обновление конфига в реальном времени через
onConfigUpdatedи обнови состояние экрана
Как установить firebase-remote-config
1Через маркетплейс плагинов
/plugin marketplace add evanca/flutter-ai-rules/plugin install flutter-ai-skills@flutter-ai-rulesКоманда ставит плагин flutter-ai-skills целиком, со всеми его скиллами
2Через Skills CLI (Vercel)
npx skills add evanca/flutter-ai-rules --skill firebase-remote-config -a claude-code3Вручную: положить файлы
~/.claude/skills/firebase-remote-config/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/firebase-remote-config/
1Через Skills CLI (Vercel)
npx skills add evanca/flutter-ai-rules --skill firebase-remote-config -a codex2Вручную: положить файлы
.agents/skills/firebase-remote-config/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add evanca/flutter-ai-rules --skill firebase-remote-config -a cursor2Вручную: положить файлы
.cursor/skills/firebase-remote-config/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install evanca/flutter-ai-rules skills/firebase-remote-config2Вручную: положить файлы
.github/skills/firebase-remote-config/SKILL.md1Через Skills CLI (Vercel)
npx skills add evanca/flutter-ai-rules --skill firebase-remote-config -a gemini-cli2Командой платформы
gemini skills install https://github.com/evanca/flutter-ai-rules --path skills/firebase-remote-configВручную: положить файлы
.devin/skills/firebase-remote-config/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Claude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о firebase-remote-config
Как установить firebase-remote-config в Claude Code?
Добавьте маркетплейс командой /plugin marketplace add evanca/flutter-ai-rules, затем поставьте набор: /plugin install flutter-ai-skills@flutter-ai-rules. Файл скилла окажется в ~/.claude/skills/firebase-remote-config/SKILL.md.
Что делает firebase-remote-config?
Задаёт агенту правила работы с Firebase Remote Config во Flutter: установка пакетов, параметры по умолчанию, типизированные геттеры, fetchAndActivate, обновления в реальном времени и проверка троттлинга.
Что должно быть включено помимо самого пакета?
Google Analytics в проекте Firebase — иначе не будет таргетинга по свойствам и аудиториям. Ещё нужно, чтобы не был отключён REST API Remote Config, а на macOS — Keychain Sharing в Xcode.
Исходный текст
SKILL.md · MIT
---
name: firebase-remote-config
description: "Use when implementing feature flags, running A/B tests, setting parameter defaults, fetching/activating config, or enabling real-time config updates."
license: MIT
---
# Firebase Remote Config Skill
This skill defines how to correctly use Firebase Remote Config in Flutter applications.
## When to Use
Use this skill when:
* Implementing feature flags or remote configuration without deploying app updates.
* Managing parameter defaults and fetching remote values.
* Implementing real-time config updates for instant changes.
* Setting up A/B testing or conditional targeting for user segments.
---
## 1. Setup and Configuration
```
flutter pub add firebase_remote_config
flutter pub add firebase_analytics # required for conditional targeting of app instances
```
```dart
import 'package:firebase_remote_config/firebase_remote_config.dart';
final remoteConfig = FirebaseRemoteConfig.instance;
```
- Enable **Google Analytics** in the Firebase project for user property and audience targeting.
- Ensure the **Remote Config REST API** is not disabled — the SDK depends on it.
- For **macOS**, enable Keychain Sharing in Xcode.
**Configure settings:**
```dart
await remoteConfig.setConfigSettings(RemoteConfigSettings(
fetchTimeout: const Duration(minutes: 1),
minimumFetchInterval: const Duration(hours: 1),
));
```
---
## 2. Parameter Management
**Set in-app defaults** (ensures the app behaves as intended before connecting to the backend):
```dart
await remoteConfig.setDefaults(const {
"feature_new_onboarding": false,
"max_retry_attempts": 3,
"welcome_message": "Hello, world!",
"promo_discount_pct": 0.0,
});
```
**Read values with type-specific getters:**
```dart
final showNewOnboarding = remoteConfig.getBool("feature_new_onboarding");
final maxRetries = remoteConfig.getInt("max_retry_attempts");
final welcomeMsg = remoteConfig.getString("welcome_message");
final discount = remoteConfig.getDouble("promo_discount_pct");
```
- **Never** store confidential data in Remote Config keys or values — they can be accessed by end users.
- Define parameters with the **same names** in the Firebase console as those in the app.
- Group related parameters with common prefixes (e.g., `login_timeout`, `login_attempts_max`).
---
## 3. Fetching and Activating
```dart
await remoteConfig.fetchAndActivate();
```
- Use `fetchAndActivate()` to fetch and apply values in a single call.
- Alternatively, call `fetch()` then `activate()` separately to control when values take effect.
- Activate fetched values at appropriate times (e.g., app start) for a smooth user experience.
- Check `remoteConfig.lastFetchStatus` to determine if the fetch was successful, failed, or throttled.
- Handle fetch failures gracefully — default values are used automatically when fetch fails.
---
## 4. Real-time Updates
```dart
remoteConfig.onConfigUpdated.listen((event) async {
await remoteConfig.activate();
// event.updatedKeys contains the changed parameter names
if (event.updatedKeys.contains("feature_new_onboarding")) {
// Refresh UI based on the new value
}
});
```
- Real-time Remote Config is **not available for Web**.
- Update UI state when new configuration values are activated.
- Ensure real-time updates do not disrupt the user experience mid-flow.
---
## 5. Throttling and Performance
- Fetch calls are **throttled** if an app fetches too frequently.
- Default minimum fetch interval in production: **12 hours**.
- For development, use a shorter interval — but only in debug builds:
```dart
await remoteConfig.setConfigSettings(RemoteConfigSettings(
fetchTimeout: const Duration(minutes: 1),
minimumFetchInterval: const Duration(minutes: 5),
));
```
- Be mindful of **service-side quota limits** with a large user base.
---
## 6. Testing and Debugging
- Use **conditional values** in the Firebase console to test configurations without new app deployments.
- Implement **A/B testing** with different parameter values for different user segments.
- Test the app with both default and remote values.
- Verify graceful handling of configuration changes at runtime.
- Test **offline behavior** to ensure proper fallback to defaults.
---
## References
- [Firebase Remote Config Flutter documentation](https://firebase.google.com/docs/remote-config/get-started?platform=flutter)
© Ivanna Kaceviča · MIT · evanca/flutter-ai-rules