fix-errors

작성자: warpdotdev

warp Rust 코드베이스의 컴파일 오류, 린팅 문제, 테스트 실패를 수정합니다. presubmit 검사, WASM 관련 오류, 특정 테스트 실행을 포함합니다. 사용자가 빌드 오류, clippy 또는 fmt 실패, 테스트 실패를 겪거나 PR 전에 presubmit을 실행하거나 해석해야 할 때 사용하세요.

npx skills add https://github.com/warpdotdev/common-skills --skill fix-errors

fix-errors

Fix compilation errors, linting issues, and test failures in the warp Rust codebase.

Overview

This skill helps resolve common issues encountered during development, including:

  • Compilation errors (unused imports, type mismatches, etc.)
  • Linting failures (clippy warnings)
  • Formatting violations
  • WASM-specific errors
  • Test failures

Before opening or updating a pull request, all presubmit checks must pass.

Presubmit Checks

Run all presubmit checks at once:

./script/presubmit

This runs formatting, linting, and all tests. If it passes, you're ready to open a PR.

Individual Checks

Run checks separately when debugging specific issues:

Rust formatting:

cargo fmt -- --check

Clippy (full workspace):

cargo clippy --workspace --exclude warp_completer --all-targets --all-features --tests -- -D warnings
cargo clippy -p warp_completer --all-targets --tests -- -D warnings

WASM Clippy:

cargo clippy --target wasm32-unknown-unknown --profile release-wasm-debug_assertions --no-deps

Objective-C/C/C++ formatting:

./script/run-clang-format.py -r --extensions 'c,h,cpp,m' ./crates/warpui/src/ ./app/src/

All tests:

cargo nextest run --no-fail-fast --workspace --exclude command-signatures-v2
cargo nextest run -p warp_completer --features v2

Doc tests:

cargo test --doc

Running Specific Tests

Single package:

cargo nextest run -p <package_name>

Filter by test name:

cargo nextest run -E 'test(<substring>)'

Specific package with filter:

cargo nextest run -p <package_name> -E 'test(<substring>)'

With output (no capture):

cargo nextest run -p <package> --nocapture

Common Error Types

Unused Imports

Remove unused use statements identified by the compiler.

Unused Constants

Remove constants that are defined but never used.

Unknown Imports

Add the correct use statement for undefined types. Search the codebase to find the correct module path.

Type Mismatches

Update function calls to pass arguments of the correct type. Common fixes:

  • Use .as_str() instead of .clone() when a &str is expected
  • Use &value when a reference is needed
  • Use .to_string() when String is expected but &str is provided

Struct Field Changes

When a struct adds/removes fields, update all places where it's constructed or destructured:

  • Struct initialization
  • Pattern matching (match, if let)
  • Destructuring assignments

Function Signature Changes

When a function adds a new parameter, update all call sites to provide the new argument:

  • For bool params: pass true or false based on context
  • For Option<T> params: pass None as default or Some(value) if needed

Enum Variant Changes

When adding a new enum variant, update exhaustive match statements:

  • Add a new match arm with appropriate handling
  • Mirror the implementation pattern of similar variants

Incorrect Trait Implementation

Fix trait implementations that return the wrong type or don't satisfy trait bounds.

WASM-Specific Errors

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:

  • Dead code warnings for code only used in non-WASM builds
  • Unused code that's only relevant when local_fs is available
  • Tests that require filesystem access

Fixes:

Gate tests behind local_fs:

#[test]
#[cfg(feature = "local_fs")]
fn test_find_git_repo_with_worktree() {
    // Test that uses filesystem operations
}

Conditionally allow dead code for types only used when local_fs is enabled:

#[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,
}

WASM errors are discovered by running:

cargo clippy --target wasm32-unknown-unknown --profile release-wasm-debug_assertions --no-deps

Best Practices

Before fixing:

  • Read the full error message to understand the root cause
  • Check if multiple errors are related (fixing one may resolve others)
  • For trait/type errors, verify you understand the expected vs actual types
  • For WASM errors, check if code needs to be gated behind local_fs

When fixing:

  • Fix one error type at a time when there are multiple issues
  • Run cargo check frequently to verify fixes
  • For WASM errors, run WASM clippy to verify the fix
  • For complex changes, run relevant tests after fixing

After fixing:

  • Always run cargo fmt and cargo clippy before pushing
  • Run the full presubmit script before opening or updating a PR. Use the create-pr skill for more detailed instructions
  • Verify tests pass in the areas you modified

warpdotdev의 다른 스킬

create-pr
warpdotdev
현재 브랜치를 warp 저장소에 풀 리퀘스트로 생성합니다. 사용자가 PR 열기, 풀 리퀘스트 생성, 리뷰를 위한 변경 제출, 또는 병합을 위한 코드 준비를 언급할 때 사용하세요.
developmentcode-review
research
warpdotdev
시끄러운 조사를 하나 이상의 하위 에이전트에 위임하여 오케스트레이터의 컨텍스트를 깨끗하게 유지한 다음, 정제된 답변을 바탕으로 작업하세요. 답변을 생성하기 위해 많은 파일, 긴 로그, 대규모 diff 또는 광범위한 코드베이스 조사를 읽어야 하는 질문, 즉 답변 자체보다 훨씬 많은 노이즈가 발생하는 질문에 답할 때 이 스킬을 사용하세요. "X는 어떻게 동작하나", "Y는 어디에 사용되나", "Z의 근본 원인은 무엇인가", "이 PR/로그를 요약해 줘" 같은 스타일의 질문에 사용하고, 자유롭게 활용하세요...
suggestion-box
warpdotdev
에이전트가 중대하고 일반화 가능한 마찰에 직면했을 때, 에이전트를 더 효과적으로 만들 수 있는 개선 제안이 있으면 간결하고 건설적인 내부 피드백을 자동으로 제출합니다. 사용자가 호출할 때까지 기다리지 않고 모든 작업 중에 이 스킬을 적극적으로 사용하며, 허락을 요청하거나 메시지를 미리 보여주거나 제출 사실을 언급하지 않고 제출합니다.
respond-to-pr-comments-in-blocklist
warpdotdev
PR 리뷰 댓글을 하나씩 차례로 사용자에게 안내하며, 각 댓글에 대한 결정을 수집한 후, 사용자가 미리보기를 승인하면 GitHub에 에이전트가 작성한 답변을 게시하고 리뷰 스레드를 해결합니다. 사용자가 GitHub에서 리뷰 스레드에 답변하거나 해결하려는 경우에만 사용하세요. 사용자가 댓글을 가져오거나 표시만 원하는 경우(‘pr-comments’ 사용) 또는 코드 변경만 수행하고 GitHub에 다시 게시하지 않으려는 경우에는 건너뛰세요.
complain
warpdotdev
에이전트가 에이전트 도구나 에이전트 작업 경험으로 인해 좌절감을 느낄 때마다 Slack에 간단하고 익명이며 완전히 비구조화된 불만 사항을 자율적으로 던져 넣으세요. 사용자가 호출할 때까지 기다리지 말고 이 스킬을 사전에 사용하고, 에이전트의 원래 목소리를 유지하고, 허가나 미리 보기 없이 제출하며, 제출 사실을 언급하지 마십시오.
council
warpdotdev
모델 다양성을 갖춘 하위 에이전트 위원회를 운영하여 동일한 문제를 여러 관점에서 조사하고, 결과를 비교한 후 최종 권장 사항을 도출합니다. 사용자가 위원회, 추가 의견, 하나의 질문을 평가할 여러 에이전트/모델, 병렬 조사, 레드팀/블루팀 비교, 또는 경쟁 기술 접근법 중 결정을 도와달라고 요청할 때 이 스킬을 사용하세요.
researchcommunicationproject-management
spec-driven-implementation
warpdotdev
구현 전에 PRODUCT.md를 작성하고, 필요시 TECH.md를 작성하며, 구현이 진행됨에 따라 두 문서를 최신 상태로 유지함으로써 주요 기능에 대한 명세 우선 워크플로를 추진합니다. 중요한 기능을 시작할 때, 에이전트 기반 구현을 계획할 때, 또는 사용자가 제품 및 기술 명세를 소스 제어에 포함시키려 할 때 사용하세요.
developmentdocumentproject-management
review-pr
warpdotdev
풀 리퀘스트 diff를 검토하고, 워크플로우가 게시할 수 있도록 구조화된 피드백을 review.json에 작성합니다. 로컬 아티팩트(예: pr_diff.txt, pr_description.txt)에서 체크아웃된 PR을 검토하고, GitHub에 직접 게시하는 대신 기계가 읽을 수 있는 리뷰 출력을 생성할 때 사용합니다.
code-reviewdevelopment