一键导入
add-feature-flag
Add a new feature flag to gate code changes in the Warp codebase.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Add a new feature flag to gate code changes in the Warp codebase.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Repo-specific review guidance for warp. Only the categories declared overridable by the core review-pr 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.
Promote a feature-flagged feature to Dogfood, Preview, or Stable in the Warp codebase. Use when a feature behind a FeatureFlag is ready to roll out to a broader audience, including wiring up the compile-time/runtime bridge and deferring flag cleanup safely.
Remove a feature flag after it has been rolled out and stabilized in the Warp codebase.
Write, improve, and run Rust unit tests in the warp Rust codebase.
Launch two parallel Oz cloud agents with computer use to download and install the latest stable Linux Warp build, capture screenshots while walking through first-time onboarding in both logged-out and logged-in states, then selectively fan out follow-up cloud agents for distinct onboarding branches proposed by those initial explorers. Use this whenever the user asks to test, document, screenshot, or walk through the Warp first-time install/onboarding experience in a cloud Linux environment.
| 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)