diagnose-ci-failures

作者: warpdotdev

使用 GitHub CLI 診斷 PR 的 CI 失敗,提取錯誤日誌,並生成修復計劃。當用戶要求檢查 CI 狀態、提取 CI 問題、分類測試失敗或調查 PR 構建失敗時使用。

npx skills add https://github.com/warpdotdev/common-skills --skill diagnose-ci-failures

diagnose-ci-failures

Programmatically diagnose CI failures for a PR and generate a plan to fix them.

Overview

This skill provides a deterministic workflow to check CI status for a PR, extract failure logs, analyze errors, and create a plan (not code changes) to resolve issues. The output is always a plan document that can be reviewed before execution.

Workflow

1. Verify PR exists for current branch

Get the current branch and check if a PR exists:

# Get current branch
git branch --show-current

# Check for PR
gh --no-pager pr view <branch-name> --json number,title,url,state

If no PR exists, inform the user and offer to create one using the create-pr skill.

2. Check CI status

Fetch the status of all CI checks:

gh pr view <branch-name> --json statusCheckRollup

Parse the output to identify:

  • Completed checks vs. in-progress checks
  • Successful checks
  • Failed checks with their names and details URLs

If CI is still running, inform the user which checks have already failed or passed, highlight the checks that are still running, and suggest waiting for completion before diagnosis.

3. Extract failure logs

For each failed check, pull the logs using the run ID from the status check:

gh run view <run-id> --log-failed

Focus on extracting:

  • Error messages and their locations (file paths, line numbers)
  • Compilation errors (unused imports, type mismatches, etc.)
  • Linting/clippy errors with specific lint names
  • Test failure messages and stack traces
  • Build failures and their root causes

4. Categorize errors

Group errors by type:

  • Formatting issues: cargo fmt failures
  • Linting issues: cargo clippy warnings/errors
  • Compilation errors: Type errors, missing imports, signature mismatches
  • Test failures: Failing tests with their names and failure reasons
  • Platform-specific issues: WASM, Linux, macOS, Windows-specific failures

5. Generate fix plan

Create a plan document (using create_plan tool) with:

  • Problem Statement: Summary of failing checks
  • Current State: What errors were found and where
  • Proposed Changes: Specific fixes needed for each error category
  • Validation Steps: Commands to verify fixes (fmt, clippy, tests, presubmit)

The plan should reference the fix-errors skill for detailed guidance on resolving specific error types.

Important Notes

  • Always create a plan first: Never make code changes directly. Generate a plan for user review
  • Check test status in CI: Even if tests fail locally, verify they passed in CI before flagging as issues
  • Unrelated test failures: If tests passed in CI but fail locally, they may be environment-specific or flaky
  • Multiple error types: Fix one category at a time (e.g., all clippy errors before tests)
  • Cross-reference fix-errors skill: For detailed error resolution strategies, use the fix-errors skill

Common CI Check Names

  • Formatting + Clippy (MacOS)
  • Formatting + Clippy (Linux)
  • Run MacOS tests
  • Run Linux tests
  • Run Windows tests
  • Check CI results (summary check)
  • WASM build

Example Commands

Get PR status with details:

gh --no-pager pr view --json number,title,state,statusCheckRollup

Get logs from specific failed run:

gh run view 12345678 --log-failed

Check for specific error in logs:

gh run view 12345678 --log-failed 2>&1 | grep -A 5 "error:"

來自 warpdotdev 的更多技能

council
warpdotdev
運行一個模型多樣化的子代理委員會,從多個角度調查同一問題,比較發現,並產出最終建議。每當用戶要求委員會、第二意見、多個代理/模型評估一個問題、平行調查、紅隊/藍隊比較,或協助在競爭的技術方法之間做決定時,使用此技能。
researchcommunicationproject-management
spec-driven-implementation
warpdotdev
在實作前先撰寫 PRODUCT.md,必要時撰寫 TECH.md,並隨著實作演進持續更新這兩份規格,以推動規格優先的工作流程,適用於開始開發重大功能、規劃由代理驅動的實作,或使用者希望將產品與技術規格納入版本控制時。
developmentdocumentproject-management
review-pr
warpdotdev
審查拉取請求的差異,並將結構化反饋寫入 review.json,以供工作流程發布。適用於從本地工件(如 pr_diff.txt 和 pr_description.txt)審查已檢出的拉取請求,並產生機器可讀的審查輸出,而非直接發布到 GitHub。
code-reviewdevelopment
create-pr
warpdotdev
在 warp 儲存庫中為當前分支建立拉取請求。當使用者提及開啟 PR、建立拉取請求、提交變更以供審查或準備合併程式碼時使用。
developmentcode-review
implement-specs
warpdotdev
根據已核准的 PRODUCT.md 與 TECH.md 實作功能,在開發過程中保持規格與程式碼同步於同一個 PR 中。請於產品與技術規格核准後、下一步為建置功能時使用。
developmentcode-reviewapi
cross-critique
warpdotdev
針對有爭議的問題進行第二輪討論,將每個子代理的獨立提案傳遞給其他作者,並要求提供結構化的優缺點分析,然後進行綜合。當你面對多個獨立提案或意見(例如架構權衡、程式碼審查分歧、設計選擇、相互競爭的根本原因理論)時,使用此技能可獲得比單純綜合更精確的分析。此技能與 council 和 research 技能自然搭配;……
resolve-merge-conflicts
warpdotdev
Resolve Git merge conflicts by extracting only unresolved paths, conflict hunks, and compact diffs instead of loading whole files into context. Use when a merge, rebase, cherry-pick, or stash pop stops on conflicts, when `git status` shows unmerged paths, or when files contain conflict markers.
developmentcode-review
brandalf
warpdotdev
引導Warp或Oz品牌資產的創作、修訂與審查。適用於製作啟動頁面、文件、HTML/CSS元件、UI模型、提示詞、社群素材、文案、簡報,或任何其他應呈現明確Warp或Oz風格與語調的品牌交付物。
designcreativemarketing