npx skills add ...
npx skills add warpdotdev/common-skills --skill fix-errors
Fix compilation errors, linting issues, and test failures in the warp Rust codebase. Covers presubmit checks, WASM-specific errors, and running specific tests. Use when the user hits build errors, clippy or fmt failures, test failures, or needs to run or interpret presubmit before a PR.
npx skills add warpdotdev/common-skills --skill fix-errors
Fix compilation errors, linting issues, and test failures in the warp Rust codebase.
This skill helps resolve common issues encountered during development, including:
Before opening or updating a pull request, all presubmit checks must pass.
Run all presubmit checks at once:
This runs formatting, linting, and all tests. If it passes, you're ready to open a PR.
Run checks separately when debugging specific issues:
Rust formatting:
Clippy (full workspace):
WASM Clippy:
Objective-C/C/C++ formatting:
All tests:
Doc tests:
Single package:
Filter by test name:
Specific package with filter:
With output (no capture):
Remove unused use statements identified by the compiler.
Remove constants that are defined but never used.
Add the correct use statement for undefined types. Search the codebase to find the correct module path.
Update function calls to pass arguments of the correct type. Common fixes:
.as_str() instead of .clone() when a &str is expected&value when a reference is needed.to_string() when String is expected but &str is providedWhen a struct adds/removes fields, update all places where it's constructed or destructured:
match, if let)When a function adds a new parameter, update all call sites to provide the new argument:
bool params: pass true or false based on contextOption<T> params: pass None as default or Some(value) if neededWhen adding a new enum variant, update exhaustive match statements:
Fix trait implementations that return the wrong type or don't satisfy trait bounds.
WASM builds (wasm32-unknown-unknown target) don't support filesystem operations. Code that uses filesystem APIs must be gated behind the local_fs feature flag.
Common WASM errors:
local_fs is availableFixes:
Gate tests behind local_fs:
Conditionally allow dead code for types only used when local_fs is enabled:
WASM errors are discovered by running:
Before fixing:
local_fsWhen fixing:
cargo check frequently to verify fixesAfter fixing:
cargo fmt and cargo clippy before pushingcreate-pr skill for more detailed instructionscargo clippy --target wasm32-unknown-unknown --profile release-wasm-debug_assertions --no-depscargo clippy --target wasm32-unknown-unknown --profile release-wasm-debug_assertions --no-deps./script/run-clang-format.py -r --extensions 'c,h,cpp,m' ./crates/warpui/src/ ./app/src/cargo nextest run --no-fail-fast --workspace --exclude command-signatures-v2
cargo nextest run -p warp_completer --features v2cargo test --doccargo nextest run -p <package_name>cargo nextest run -E 'test(<substring>)'cargo nextest run -p <package_name> -E 'test(<substring>)'cargo nextest run -p <package> --nocapture#[test]
#[cfg(feature = "local_fs")]
fn test_find_git_repo_with_worktree() {
// Test that uses filesystem operations
}#[cfg_attr(not(feature = "local_fs"), allow(dead_code))]
#[derive(Clone, EnumDiscriminants, Serialize)]
pub enum ExampleType {
// Variants only used when local_fs is enabled
Variant1,
Variant2,
Variant3,
}