首页/AI 系统可观测与 SRE/diagnose-ci-failures
D

diagnose-ci-failures

by @warpdotdevv
4.6(120)

该技能通过GitHub CLI自动诊断PR的CI失败,提取错误日志,分析问题类型,并生成详细的修复计划。它能识别编译错误、测试失败、格式化和Linting问题,帮助开发者快速定位并解决CI/CD流程中的故障,确保代码质量和部署效率。适用于检查CI状态、排查构建失败等场景。

ci-cdtroubleshootinggithub-clidevopsfailure-diagnosisGitHub
安装方式
npx skills add https://github.com/warpdotdev/common-skills --skill diagnose-ci-failures
compare_arrows

Before / After 效果对比

1 组
使用前

手动排查CI失败,需要耗费大量时间浏览日志、定位错误,并人工总结修复方案,过程繁琐且易出错,严重拖慢开发进度。

使用后

AI自动诊断CI失败,快速提取关键错误信息并生成详细修复计划,大幅缩短故障排查时间,提升开发效率和问题解决速度。

SKILL.md

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:"

用户评价 (0)

发表评价

效果
易用性
文档
兼容性

暂无评价

统计数据

安装量28.3K
评分4.6 / 5.0
版本
更新日期2026年10月23日
对比案例1 组

用户评分

4.6(120)
5
37%
4
43%
3
13%
2
5%
1
2%

为此 Skill 评分

0.0

兼容平台

🤖claude-code

时间线

创建2026年5月22日
最后更新2026年10月23日
🎁 Agent 知识卡片
调研问卷