Feature Flag Naming Conventions
Pattern
All feature flags MUST follow this pattern:
<category>.<feature_name>
- Category: One of
ui,backend,admin,integration,experiment,ops - Name: snake_case identifier, descriptive of the feature
Categories
ui - Frontend Changes
For visual/UX features affecting the web app or admin panel.
// Good ui.dark_mode; ui.new_voice_settings; ui.compact_chat_layout; // Bad darkMode; // Missing category ui.DarkMode; // Wrong case ui - dark - mode; // Wrong separator
backend - API/Server Features
For backend functionality, API changes, or server-side processing.
// Good backend.streaming_responses; backend.rag_strategy; backend.cache_enabled; backend.rbac_enforcement;
experiment - A/B Tests
For experiments and A/B tests that need metrics tracking.
// Good experiment.onboarding_flow_v2; experiment.pricing_display; experiment.voice_synthesis;
ops - Operational Controls
For operational toggles (maintenance, rate limiting, circuit breakers).
// Good ops.maintenance_mode; ops.rate_limiting_enabled; ops.circuit_breaker_rag; ops.debug_logging;
Naming Rules
- Use lowercase only -
ui.dark_modenotui.Dark_Mode - Use dots to separate category -
ui.new_layoutnotui_new_layout - Use underscores within feature name -
backend.cache_strategynotbackend.cache-strategy - Be descriptive -
ui.compact_message_listnotui.cml - Include version when iterating -
ui.voice_settings_v2 - No abbreviations unless widely known (
backend.rag_strategyis OK)
Migration from Old Pattern
If you encounter the old ff_category_name pattern:
// Temporary during migration const enabled = useFeatureFlag("ui.dark_mode_v2") ?? useFeatureFlag("darkMode"); // legacy fallback
- Create new flag with correct name
- Update code to read both (fallback to old)
- Migrate state
- Remove old flag after deprecation period