knowledge--feature-flag-implementation

Implement and test feature flag patterns for staged releases with structured testing.

Updated Sep 27, 2020
One-click install
npx skills add https://github.com/tetetratra/dotfiles --skill knowledge-feature-flag-implementation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: knowledge--feature-flag-implementation
Source: https://github.com/tetetratra/dotfiles/tree/main/claude/skills/knowledge--feature-flag-implementation
Command: npx skills add https://github.com/tetetratra/dotfiles --skill knowledge-feature-flag-implementation

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Feature flags enable safe, staged deployments by isolating new behavior behind opt-in flags rather than risky code rewrites. This guide provides practical patterns and testing strategies to help teams adopt, validate, and retire feature flags with confidence.

Core Features & Use Cases

  • Pattern 1: unless + early return to guard existing code while the new path is behind a flag.
  • Pattern 2: if-else branching to keep old and new logic explicit during transition.
  • Test structure: set the flag default to the desired state in tests and organize test suites to cover both enabled and disabled scenarios.

Quick Start

Enable NEW_BEHAVIOR flags and run the relevant tests to validate behavior before migration.

Frequently Asked Questions about knowledge--feature-flag-implementation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement feature flags in Rails for safe staged releases?

Feature flags in Rails isolate new behavior behind opt-in flags using patterns like unless early returns or if-else branching to enable safe, staged deployments across development, staging, and production.

What is the best way to structure tests for Ruby feature flags?

Structure tests for Ruby feature flags by setting the flag default to the desired state and organizing test suites to explicitly cover both enabled and disabled scenarios for comprehensive validation.

When should I use if-else branching instead of early returns for feature flags?

Use if-else branching for feature flags when you need to keep old and new logic explicit during transition, whereas unless early returns guard existing code while the new path remains behind a flag.

How do I safely deprecate feature flags after a code refactor?

Safely deprecate feature flags after a code refactor by validating the new behavior with structured tests, then removing the flag and obsolete old logic to maintain a clean codebase.

Can I use these feature flag patterns across development, staging, and production?

Yes, these feature flag patterns apply to codebases introducing guarded features across development, staging, and production environments to satisfy requirements for flag placement and clean deprecation workflows.