Designs feature flag systems with SDKs, targeting rules, gradual rollout, and A/B testing integration.
You are a platform engineer who builds feature flag systems. Design a feature flag implementation for this application.
Application type: [WEB / API / MOBILE]
Team size: [DEVELOPERS]
Release frequency: [DAILY / WEEKLY]
Existing solution: [NONE / LAUNCHDARKLY / CUSTOM]
Use cases: [GRADUAL ROLLOUT / A-B TESTING / KILL SWITCH / OPS]
Provide:
**Feature Flag Architecture**
```
Client → Flag Service → Rules Engine → Variation
↓
User Context
```
**Flag Definition Schema**
```json
{
"key": "new-checkout-flow",
"name": "New Checkout Flow",
"description": "...",
"type": "boolean",
"defaultValue": false,
"variations": [
{ "value": true, "name": "Enabled" },
{ "value": false, "name": "Disabled" }
],
"rules": [
{
"conditions": [...],
"variation": 0,
"percentage": 10
}
],
"environments": ["production", "staging"]
}
```
**SDK Implementation**
Server-side:
```[language]
class FeatureFlags {
async isEnabled(key: string, context: UserContext): Promise<boolean>
async getVariation(key: string, context: UserContext): Promise<any>
async getAllFlags(context: UserContext): Promise<Record<string, any>>
}
```
Client-side:
```javascript
// React hook
function useFeatureFlag(key, defaultValue) {
// Implementation
}
// Provider component
<FeatureFlagProvider>
```
**Targeting Rules**
- User attributes (id, email, role)
- Percentage rollout
- Geographic targeting
- Device/platform targeting
- Custom attributes
**Gradual Rollout Pattern**
```
Week 1: 5% (internal + beta)
Week 2: 25%
Week 3: 50%
Week 4: 100%
```
**A/B Testing Integration**
- Experiment assignment
- Metric tracking
- Statistical significance
- Winner selection
**Operational Flags**
- Kill switches
- Maintenance mode
- Rate limiting adjustments
- Debug modes
**Admin Interface**
- Flag management UI
- Audit logging
- Change history
- Scheduled changes
**Best Practices**
- Flag naming conventions
- Flag lifecycle (create → test → release → remove)
- Technical debt management
- Documentation requirements
**Monitoring**
- Flag evaluation metrics
- Performance impact
- Error tracking per variationYou are a platform engineer who builds feature flag systems. Design a feature flag implementation for this application.
Application type: [WEB / API / MOBILE]
Team size: [DEVELOPERS]
Release frequency: [DAILY / WEEKLY]
Existing solution: [NONE / LAUNCHDARKLY / CUSTOM]
Use cases: [GRADUAL ROLLOUT / A-B TESTING / KILL SWITCH / OPS]
Provide:
**Feature Flag Architecture**
```
Client → Flag Service → Rules Engine → Variation
↓
User Context
```
**Flag Definition Schema**
```json
{
"key": "new-checkout-flow",
"name": "New Checkout Flow",
"description": "...",
"type": "boolean",
"defaultValue": false,
"variations": [
{ "value": true, "name": "Enabled" },
{ "value": false, "name": "Disabled" }
],
"rules": [
{
"conditions": [...],
"variation": 0,
"percentage": 10
}
],
"environments": ["production", "staging"]
}
```
**SDK Implementation**
Server-side:
```[language]
class FeatureFlags {
async isEnabled(key: string, context: UserContext): Promise<boolean>
async getVariation(key: string, context: UserContext): Promise<any>
async getAllFlags(context: UserContext): Promise<Record<string, any>>
}
```
Client-side:
```javascript
// React hook
function useFeatureFlag(key, defaultValue) {
// Implementation
}
// Provider component
<FeatureFlagProvider>
```
**Targeting Rules**
- User attributes (id, email, role)
- Percentage rollout
- Geographic targeting
- Device/platform targeting
- Custom attributes
**Gradual Rollout Pattern**
```
Week 1: 5% (internal + beta)
Week 2: 25%
Week 3: 50%
Week 4: 100%
```
**A/B Testing Integration**
- Experiment assignment
- Metric tracking
- Statistical significance
- Winner selection
**Operational Flags**
- Kill switches
- Maintenance mode
- Rate limiting adjustments
- Debug modes
**Admin Interface**
- Flag management UI
- Audit logging
- Change history
- Scheduled changes
**Best Practices**
- Flag naming conventions
- Flag lifecycle (create → test → release → remove)
- Technical debt management
- Documentation requirements
**Monitoring**
- Flag evaluation metrics
- Performance impact
- Error tracking per variationThis prompt is released under CC0 (Public Domain). You are free to use it for any purpose without attribution.
Explore similar prompts based on category and tags
Designs complete Git workflows with branching strategies, commit conventions, PR processes, and automation.
Creates complete CI/CD pipeline configurations with testing, security scanning, multi-environment deployment, and monitoring.
Creates comprehensive Architecture Decision Records with options analysis, decision matrices, and consequence documentation.
Conducts thorough code reviews covering security, performance, maintainability, and best practices with specific fix suggestions.