Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Add a new feature flag to gate code changes in the Warp codebase.
.claude/skills/warpdotdev-add-feature-flag/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -3% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 18% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 2% | 0% |
| case-06 | ✗→✓ | ▲ Improved | -53% | 0% |
| case-07 | ✗→✓ | ▲ Improved | -10% | 0% |
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.
The FeatureFlag enum (warp_core/src/features.rs) and the runtime FeatureFlag::X.is_enabled() check are SHARED by both front-ends: the GUI desktop app (app/) and the headless TUI (crates/warp_tui). The Cargo-feature steps in this skill (app/Cargo.toml, app/src/lib.rs) are GUI-app-specific. Prefer runtime is_enabled() checks so a flag works in both front-ends with no per-binary wiring. Only if you truly need a compile-time Cargo feature in the TUI, wire it into crates/warp_tui/Cargo.toml as well. Test the TUI with ./script/run-tui.
Add the feature to app/Cargo.toml under the [features] section, but NOT under the default nested stanza:
toml[features] your_feature_name = []
Add a new variant to the FeatureFlag enum in warp_core/src/features.rs:
rust#[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:
rust#[cfg(feature = "your_feature_name")] YourFeatureName,
In your code, use the runtime check to conditionally execute feature-gated code:
rustif 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:
rustpub const DOGFOOD_FLAGS: &[FeatureFlag] = &[ FeatureFlag::YourFeatureName, ];
To test locally with the feature enabled:
bashcargo 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:
rustEditableBinding::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:
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)| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 11,791 | 8,635 | -27% | 1 | 1 | 0% | 1,897 | 1,842 | -3% | 0 | 0 | — |
case-02 | fail→pass | 13,523 | 14,597 | +8% | 1 | 1 | 0% | 2,185 | 2,586 | +18% | 0 | 0 | — |
case-03 | fail→fail | 25,307 | 6,961 | -72% | 1 | 1 | 0% | 1,910 | 1,220 | -36% | 0 | 0 | — |
case-04 | pass→pass | 10,146 | 5,152 | -49% | 1 | 1 | 0% | 1,486 | 1,771 | +19% | 0 | 0 | — |
case-05 | fail→pass | 9,471 | 4,899 | -48% | 1 | 1 | 0% | 1,471 | 1,500 | +2% | 0 | 0 | — |
case-06 | fail→pass | 14,473 | 9,383 | -35% | 1 | 1 | 0% | 2,467 | 1,154 | -53% | 0 | 0 | — |
case-07 | fail→pass | 12,691 | 5,530 | -56% | 1 | 1 | 0% | 1,987 | 1,783 | -10% | 0 | 0 | — |
case-08 | pass→pass | 18,907 | 7,907 | -58% | 1 | 1 | 0% | 3,081 | 2,194 | -29% | 0 | 0 | — |
case-09 | fail→pass | 12,379 | 4,365 | -65% | 1 | 1 | 0% | 1,680 | 1,372 | -18% | 0 | 0 | — |
case-10 | pass→pass | 3,863 | 2,630 | -32% | 1 | 1 | 0% | 536 | 1,201 | +124% | 0 | 0 | — |
case-11 | pass→pass | 13,456 | 2,562 | -81% | 1 | 1 | 0% | 914 | 1,227 | +34% | 0 | 0 | — |
case-12 | pass→pass | 10,775 | 3,142 | -71% | 1 | 1 | 0% | 1,728 | 1,407 | -19% | 0 | 0 | — |
case-13 | fail→pass | 11,992 | 2,889 | -76% | 1 | 1 | 0% | 1,632 | 1,223 | -25% | 0 | 0 | — |
case-14 | fail→pass | 9,399 | 4,215 | -55% | 1 | 1 | 0% | 1,529 | 1,412 | -8% | 0 | 0 | — |
case-15 | pass→pass | 11,061 | 8,167 | -26% | 1 | 1 | 0% | 1,889 | 1,883 | -0% | 0 | 0 | — |
case-16 | pass→pass | 15,545 | 8,946 | -42% | 1 | 1 | 0% | 2,080 | 2,235 | +7% | 0 | 0 | — |
case-17 | pass→pass | 12,230 | 5,535 | -55% | 1 | 1 | 0% | 1,390 | 1,769 | +27% | 0 | 0 | — |
case-18 | pass→pass | 8,935 | 4,068 | -54% | 1 | 1 | 0% | 1,411 | 1,551 | +10% | 0 | 0 | — |
case-19 | pass→pass | 10,546 | 8,712 | -17% | 1 | 1 | 0% | 1,917 | 2,302 | +20% | 0 | 0 | — |
case-20 | pass→pass | 10,168 | 6,564 | -35% | 1 | 1 | 0% | 1,621 | 1,986 | +23% | 0 | 0 | — |
case-21 | pass→pass | 13,373 | 8,602 | -36% | 1 | 1 | 0% | 2,343 | 2,401 | +2% | 0 | 0 | — |
case-22 | pass→pass | 12,965 | 10,267 | -21% | 1 | 1 | 0% | 2,064 | 2,523 | +22% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 21 counted toward the lift figure. The other 1 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +36 percentage points is the difference between those two pass rates over the 21 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.