Feature Flag System

Feature Flag System

Guides an AI coding agent to implement feature flags for gradual rollouts, A/B tests, canary releases and kill switches, with a TypeScript service and React hook.

Skill files8 files

references/

scripts/

templates/

SKILL.md103 lines
1
---
2
name: feature-flag-system
3
description: >
4
Implement feature flags (toggles) for controlled feature rollouts, A/B
5
testing, canary deployments, and kill switches. Use when deploying new
6
features gradually, testing in production, or managing feature lifecycles.
7
---
8
9
# Feature Flag System
10
11
## Table of Contents
12
13
- [Overview](#overview)
14
- [When to Use](#when-to-use)
15
- [Quick Start](#quick-start)
16
- [Reference Guides](#reference-guides)
17
- [Best Practices](#best-practices)
18
19
## Overview
20
21
Implement feature flags to decouple deployment from release, enable gradual rollouts, A/B testing, and provide emergency kill switches.
22
23
## When to Use
24
25
- Gradual feature rollouts
26
- A/B testing and experiments
27
- Canary deployments
28
- Beta features for specific users
29
- Emergency kill switches
30
- Trunk-based development
31
- Dark launching
32
- Operational flags (maintenance mode)
33
- User-specific features
34
35
## Quick Start
36
37
Minimal working example:
38
39
```typescript
40
interface FlagConfig {
41
key: string;
42
enabled: boolean;
43
description: string;
44
rules?: FlagRule[];
45
variants?: FlagVariant[];
46
createdAt: Date;
47
updatedAt: Date;
48
}
49
50
interface FlagRule {
51
type: "user" | "percentage" | "attribute" | "datetime";
52
operator: "in" | "equals" | "contains" | "gt" | "lt" | "between";
53
attribute?: string;
54
values: any[];
55
}
56
57
interface FlagVariant {
58
key: string;
59
weight: number;
60
value: any;
61
}
62
63
interface EvaluationContext {
64
userId?: string;
65
// ... (see reference guides for full implementation)
66
```
67
68
## Reference Guides
69
70
Detailed implementations in the `references/` directory:
71
72
| Guide | Contents |
73
|---|---|
74
| [Feature Flag Service (TypeScript)](references/feature-flag-service-typescript.md) | Feature Flag Service (TypeScript) |
75
| [React Hook for Feature Flags](references/react-hook-for-feature-flags.md) | React Hook for Feature Flags |
76
| [Feature Flag with Analytics](references/feature-flag-with-analytics.md) | Feature Flag with Analytics |
77
| [LaunchDarkly-Style SDK](references/launchdarkly-style-sdk.md) | LaunchDarkly-Style SDK |
78
| [Admin UI for Feature Flags](references/admin-ui-for-feature-flags.md) | Admin UI for Feature Flags |
79
80
## Best Practices
81
82
### ✅ DO
83
84
- Use descriptive flag names
85
- Document flag purpose and lifecycle
86
- Implement gradual rollouts
87
- Track flag evaluations
88
- Clean up old flags regularly
89
- Use feature flags for experiments
90
- Implement kill switches for critical features
91
- Test both enabled and disabled states
92
- Use consistent hashing for stable rollouts
93
- Provide admin UI for non-technical users
94
95
### ❌ DON'T
96
97
- Use flags for permanent configuration
98
- Accumulate technical debt with old flags
99
- Skip flag cleanup
100
- Make flags too granular
101
- Hard-code flag checks everywhere
102
- Skip analytics and monitoring
103

© AJ Geddes · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 13,413 prompts

More by @OpenSourceBuffGuy

See all
Butterfly on Wheat at Golden Sunrise prompt image

Butterfly on Wheat at Golden Sunrise

Paints a classical oil painting of a butterfly resting on a golden wheat stalk in misty backlit sunrise light with dewdrop bokeh.

image-prompt, oil-painting, painting, classical-art, animals, flowers, landscape, golden-hour, bokeh, dramatic-lighting, soft-lighting, vertical-format, macro, dreamy, impressionism, fine-art, vibrant-colors, spring, for-artists, gpt-image, wallpaper, quick

Chibi character 16 frame dance reference sheet prompt image

Chibi character 16 frame dance reference sheet

Creates a square 4x4 sheet of sixteen consecutive dance keyframes of an uploaded character, following numbered choreography steps with identity locked and secondary motion on hair and cloth.

image-prompt, character-sheet, multi-panel, dance, chibi, reference-image, character-consistency, character-design, full-body, white-background, illustration, structured-output, square-format, negative-prompt, gpt-image, for-artists, for-designers, game-assets, long-form, advanced

Running Man Pulled Back by Semi Chibi Double prompt image

Running Man Pulled Back by Semi Chibi Double

Makes a bright studio editorial photo of a running person from a reference photo, with a 3D semi-chibi double tugging their clothes back and realistic fabric tension.

image-prompt, gpt-image, reference-image, face-reference, negative-prompt, photorealistic, editorial, chibi, 3d-render, studio-lighting, white-background, fashion, portrait, full-body, motion-blur, whimsical, vertical-format, character-consistency, action-figure, fashion-shoot, pixar-style, soft-lighting, for-photographers, for-artists, humorous

Reviews

Loading reviews…

Discussion

Loading comments…