Skip to main content

feature-flag-system

Implements feature flags for progressive rollouts, A/B testing, and kill switches. Supports user targeting and percentage rollouts.

Source facts

Repository
Fadil369/Solutions
Last source activity
April 9, 2026 at 00:36
Detected SKILL.md language
English
Stars
1
Forks
0

Install options

The review-first prompt is selected by default. You can switch to a direct command or download a local copy.

Review the source files

Read SKILL.md and any companion files shown by SkillsMP before deciding whether to install.

Showing SKILL.md

SKILL.md
Source instructions · Read-only preview
name
Feature Flag System
version
1.0.0
description
Implements feature flags for progressive rollouts, A/B testing, and kill switches. Supports user targeting and percentage rollouts.
author
workspace
activated
false
# Feature Flag System Implements feature flags for progressive rollouts, A/B testing, and kill switches. Supports user targeting and percentage rollouts. ## Decision Framework ### When to Apply Use when: Progressive rollouts, A/B testing, kill switches, environment-specific features, beta programs ### When NOT to Apply Don't use when: Feature is permanent and always-on, simple config values suffice ## Anti-Patterns ### 1. Flags That Never Get Removed Technical debt accumulates. Schedule flag cleanup after full rollout. ### 2. Complex Flag Dependencies ```javascript // BAD: Hard to reason about if (flags.newCheckout && flags.newPayment && !flags.legacyCart) { } // GOOD: Single flag with clear meaning if (flags.modernCheckoutFlow) { } ``` ## Trigger Phrases - "Feature flags" - "A/B testing" - "Progressive rollout" - "Kill switch" - "Feature toggle" ## Patterns ### Flag Evaluator ```javascript class FeatureFlags { constructor(flags) { this.flags = flags; } isEnabled(flagName, context = {}) { const flag = this.flags[flagName]; if (!flag || !flag.enabled) return false; // Percentage rollout if (flag.percentage < 100) { const hash = this.hashUserId(context.userId || 'anonymous'); if (hash % 100 >= flag.percentage) return false; } // User targeting if (flag.targetUsers?.includes(context.userId)) return true; // Environment if (flag.environments && !flag.environments.includes(context.env)) return false; return true; } hashUserId(userId) { let hash = 0; for (let i = 0; i < userId.length; i++) { hash = ((hash << 5) - hash) + userId.charCodeAt(i); hash |= 0; } return Math.abs(hash); } } ``` ## Integration - Works with: deployment-pipeline-architect, multi-tenant-architecture, notification-system-builder
View on GitHub