con un clic
add-feature-flag
Add a new feature flag to gate code changes in the Warp codebase.
Menú
Add a new feature flag to gate code changes in the Warp codebase.
Control and inspect the currently running local Warp application with the warpctrl CLI. Use this skill whenever the user asks the agent to manipulate Warp's own windows, tabs, panes, sessions, input buffer, themes, or UI surfaces; open a file in Warp; inspect local Warp state; or explain how to invoke Warp Control manually.
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
View or modify Warp application settings using the bundled JSON schema for guidance
Fetch and display GitHub PR review comments for the current branch.
Repo-specific dedupe guidance for warp. Only the categories declared overridable by the core dedupe-issue skill may be specialized here.
Repo-specific bug reproduction guidance for Warp. Specializes the core reproduce-bug-report skill for logged-out Warp UI repros, exact reporter-version installs, and login-free onboarding.
| name | add-feature-flag |
| description | Add a new feature flag to gate code changes in the Warp codebase. |
Add a new feature flag to gate code changes in the Warp codebase.
Feature flags in Warp are compile-time flags that allow features to be selectively enabled for different channels (e.g.: Dev, Stable). They use a small runtime plumbing layer that checks if a flag is enabled.
Add the feature to app/Cargo.toml under the [features] section, but NOT under the default nested stanza:
[features]
your_feature_name = []
Add a new variant to the FeatureFlag enum in warp_core/src/features.rs:
#[derive(Sequence)]
pub enum FeatureFlag {
YourFeatureName,
}
Add the feature to app/src/lib.rs with a corresponding #[cfg(feature = "...")] attribute to ensure it's only included when enabled:
#[cfg(feature = "your_feature_name")]
YourFeatureName,
In your code, use the runtime check to conditionally execute feature-gated code:
if FeatureFlag::YourFeatureName.is_enabled() {
// feature-gated behavior
}
To enable the feature by default for Dev/dogfood builds, add it to the DOGFOOD_FLAGS array in features.rs:
pub const DOGFOOD_FLAGS: &[FeatureFlag] = &[
FeatureFlag::YourFeatureName,
];
To test locally with the feature enabled:
cargo run --features your_feature_name
# Multiple features:
cargo run --features your_feature_name,another_feature
If adding an EditableBinding or FixedBinding that's part of a gated feature, include an enabled predicate that checks the feature flag. This prevents the keybinding from appearing in keyboard settings when the feature is disabled.
Example:
EditableBinding::new(
"action:name",
"Action description",
YourAction::Variant
)
.with_enabled(|| FeatureFlag::YourFeatureName.is_enabled())
.with_key_binding("cmdorctrl-key")
When ready to enable the feature for all Warp Stable users, add it to the default array in app/Cargo.toml:
[features]
default = [
"your_feature_name",
# other default features...
]
FeatureFlag::YourFeatureName.is_enabled() instead of #[cfg(...)] when possible, so flags can be toggled without recompilation and are easier to clean up later#[cfg(...)] only when code cannot compile without the flag (e.g., platform-specific code or missing dependencies)