add-feature-flag

Add a feature flag to Cargo.toml and the FeatureFlag enum for runtime gating.

37|1|Updated Apr 28, 2026
One-click install
npx skills add https://github.com/terzigolu/warp-lite --skill add-feature-flag-terzigolu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-feature-flag
Source: https://github.com/terzigolu/warp-lite/tree/main/.agents/skills/add-feature-flag
Command: npx skills add https://github.com/terzigolu/warp-lite --skill add-feature-flag-terzigolu

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Add a new feature flag to gate code changes in Warp, enabling safer, staged releases by toggling features without code changes.

Core Features & Use Cases

  • Add to Cargo.toml under [features] (non-default) to declare a feature flag.
  • Update the FeatureFlag enum and runtime gating to conditionally enable features.
  • Use for dogfood builds or selective production releases to minimize risk.

Quick Start

Add a new feature flag and wire it through your code to gate behavior at runtime.

Frequently Asked Questions about add-feature-flag

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

FAQPage Schema
How do I add a feature flag in Rust to gate code changes?

To add a feature flag in Rust, declare it as a non-default feature in Cargo.toml, update the FeatureFlag enum, and apply conditional compilation or runtime checks to selectively gate code behavior.

What is the purpose of using feature flags for Rust release management?

Feature flags enable safer, staged releases by allowing you to toggle features on or off without deploying new code, minimizing risk during production releases and dogfood builds.

How does conditional compilation work with Cargo features for dogfood builds?

Conditional compilation uses Cargo features declared in Cargo.toml to include or exclude code paths via cfg attributes, allowing dogfood builds to activate experimental features selectively at runtime.

Do I need to update Cargo.toml when creating a runtime feature gate?

Yes, you must declare the feature flag under the [features] section in Cargo.toml as non-default, then update your FeatureFlag enum and runtime gating logic to control activation safely.

Can I use feature flags for multi-channel releases in Rust?

Yes, feature flags support multi-channel releases by enabling selective activation of features across different build channels, ensuring safe gating without requiring immediate code changes.

What are the limitations of using Cargo features for feature gating?

Cargo features require manual updates to both Cargo.toml and the FeatureFlag enum, and managing many flags can complicate conditional compilation and runtime checks if not gated carefully.