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)检出的PR,并生成机器可读的审查输出,而非直接发布到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
通过仅提取未解决的路径、冲突块和紧凑差异来解决 Git
developmentcode-review
brandalf
warpdotdev
指导Warp或Oz品牌资产的创建、修订和审核。适用于启动页面、文档、HTML/CSS组件、UI模型、提示词、社交媒体素材、文案、演示文稿,以及任何应具有鲜明Warp或Oz风格与调性的品牌交付物。
designcreativemarketing