Creates and manages LaunchDarkly feature flags at SimplePractice. Use when the user needs to create, toggle, target, test, roll out, or clean up feature flags.
Reference skill for LaunchDarkly feature flag workflows at SimplePractice. Feature flags decouple deployments from releases — they are if-else statements that control which users see which features.
| File | Purpose |
|---|---|
app/models/concerns/ld_feature_flags.rb | Flag definitions (backend) |
app/resources/frontend/user_resource.rb | Auto-exposed to frontend API |
frontend/app/models/user.js | Frontend flag consumption |
app/controllers/application_controller.rb | Mixpanel experiment tracking |
.ld_flag_overrides.yml (project root) | Local dev overrides |
feature_ — alwaysfeature_new_payment_allocation, feature_client_demographics_reportLaunchDarklyScripts::CreateFeatureFlagService.new(
flag_key: "feature_your_flag_name",
description: "Product Owner: Name. Maintainer: Name. Description of the feature.",
tags: [LaunchDarklyScripts::CreateFeatureFlagService::PRACTICE_MANAGEMENT_TAG]
).call
Available tags: GROWTH_TAG, RCM_TAG, PRACTICE_MANAGEMENT_TAG, MOBILE_TAG, CLINICAL_TAG
For Therapy Finder flags, add project_key: "monarch".
Add to app/models/concerns/ld_feature_flags.rb with fallback_value: false for new flags.
Add to frontend/app/models/user.js. Flags not exposed on the API are unreachable from the frontend. Set frontend: false in ld_feature_flags.rb to hide from frontend API.
Link it to the implementation story. Set expected removal date (30-60 days after 100% rollout).
LaunchDarklyScripts::ToggleFeatureFlagService.new(
flag_key: "feature_your_flag_name",
turn_flag_on: true,
environment_key: "development" # "development", "staging", "production"
).call
Turning a flag on makes it usable — it does NOT set its value to true. Add targeting for that.
LaunchDarklyScripts::EnableForPracticesService.new(
flag_key: "feature_your_flag_name",
flag_value: true,
practice_uuids: ["uuid1", "uuid2"]
).call
#product-releases at each milestone, thread repliesfallback_value: true in code within 1 weekCritical: Always update fallback_value: true when at 100% rollout. If LaunchDarkly goes down, flags revert to fallback — leaving it false hides shipped features. This caused the October 2025 outage.
stub_flag(:feature_your_flag_name, true)
Option A: Toggle via admin dashboard
Option B: Create .ld_flag_overrides.yml in project root (auto-reloads):
feature_your_flag_name: true
For detailed A/B testing setup, Mixpanel tracking, and Therapy Finder flags, see reference.md.
- [ ] Feature stable at 100% for 30+ days
- [ ] fallback_value already set to true
- [ ] Remove flag from ld_feature_flags.rb
- [ ] Remove flag from frontend/app/models/user.js
- [ ] Remove all conditional logic (keep only "true" path)
- [ ] Remove stub_flag calls from tests
- [ ] Run full test suite
- [ ] Deploy to production
- [ ] Archive flag in LaunchDarkly
- [ ] Close cleanup Linear story
fallback_value in code