Investigate failed PR checks and iteratively fix CI issues faster.
Copy the install command and let the AI configure it · recommended for beginners
Please install the "fix-ci-failures" skill from askskill: 1. Download https://raw.githubusercontent.com/microsoft/vscode/main/.github/skills/fix-ci-failures/SKILL.md 2. Save it as ~/.claude/skills/fix-ci-failures/SKILL.md 3. Reload skills and tell me it's ready
Help me investigate CI failures on this PR. Use the gh CLI to find the PR, list failed checks, download relevant logs and artifacts, summarize the root cause, and provide a fix or generate one directly.
A list of failed checks, root-cause analysis, and actionable fix steps or code change suggestions.
CI tests failed on this branch. Download the failing job logs, identify which test, dependency, or configuration caused the failure, and iteratively propose fixes until there is a clear implementation plan.
The specific failure point, impact scope, fix approach, and recommended changes to commit.
Inspect the failed CI jobs for this PR, download artifacts and logs, extract the key error signals, determine whether the issue is environmental, script-related, or a code regression, and provide prioritized next steps.
A categorized diagnosis of the failure cause, key evidence summary, and prioritized remediation recommendations.
This skill guides you through diagnosing and fixing CI failures on a PR using the gh CLI. The user has the PR branch checked out locally.
# Get the current branch name
git branch --show-current
# Find the PR for this branch
gh pr view --json number,title,url,statusCheckRollup
If no PR is found, the user may need to specify the PR number.
# List all checks and their status (pass/fail/pending)
gh pr checks --json name,state,link,bucket
# Filter to only failed checks
gh pr checks --json name,state,link,bucket --jq '.[] | select(.bucket == "fail")'
The link field contains the URL to the GitHub Actions job. Extract the run ID from the URL — it's the number after /runs/:
https://github.com/microsoft/vscode/actions/runs/<RUN_ID>/job/<JOB_ID>
If checks are still IN_PROGRESS, wait for them to complete before downloading logs:
gh pr checks --watch --fail-fast
# List failed jobs in a run (use the run ID from the check link)
gh run view <RUN_ID> --json jobs --jq '.jobs[] | select(.conclusion == "failure") | {name: .name, id: .databaseId}'
There are two approaches depending on the type of failure.
Best for build/compile/lint failures where the error is in the step output:
# View only the failed step logs (most useful — shows just the errors)
gh run view <RUN_ID> --job <JOB_ID> --log-failed
Important:
--log-failedrequires the entire run to complete, not just the failed job. If other jobs are still running, this command will block or error. Use Option C below to get logs for a completed job while the run is still in progress.
The output can be large. Pipe through tail or grep to focus:
# Last 100 lines of failed output
gh run view <RUN_ID> --job <JOB_ID> --log-failed | tail -100
# Search for common error patterns
gh run view <RUN_ID> --job <JOB_ID> --log-failed | grep -E "Error|FAIL|error TS|AssertionError|failing"
Best for integration test failures where detailed logs (terminal logs, ext host logs, crash dumps) are uploaded as artifacts:
# List available artifacts for a run
gh run download <RUN_ID> --pattern '*' --dir /dev/null 2>&1 || gh run view <RUN_ID> --json jobs --jq '.jobs[].name'
# Download log artifacts for a specific failed job
# Artifact naming convention: logs-<platform>-<arch>-<test-type>-<attempt>
# Examples: logs-linux-x64-electron-1, logs-linux-x64-remote-1
gh run download <RUN_ID> -n "logs-linux-x64-electron-1" -D /tmp/ci-logs
# Download crash dumps if available
gh run download <RUN_ID> -n "crash-dump-linux-x64-electron-1" -D /tmp/ci-crashes
Tip: Use the test runner name from the failed check (e.g., "Linux / Electron" →
electron, "Linux / Remote" →remote) and platform map ("Windows" →windows-x64, "Linux" →linux-x64, "macOS" →macos-arm64) to construct the artifact name.
Warning: Log artifacts may be empty if the test runner crashed before producing output (e.g., Electron download failure). In that case, fall back to Option C.
When the run is still in progress but the failed job has completed, use the GitHub API to download that job's step logs directly:
# Save the full job log to a temp file (can be very large — 30k+ lines)
gh api repos/microsoft/vscode/actions/jobs/<JOB_ID>/logs > "$TMPDIR/ci-job-log.txt"
…
Validate Azure DevOps pipeline changes and troubleshoot builds and YAML faster.
Upgrade Anthropic SDKs, migrate versions, and fix dependency or typing issues.
Generate or update chat customization files for AI coding agents.
Find and read Code OSS dev build logs for faster debugging.
Merge session branch changes back into the base branch cleanly.
Create and maintain screenshot test fixtures for UI components effectively.
Debug failing GitHub Actions PR checks, analyze logs, propose fixes, then implement with approval.
Investigate failing GitHub integration tests and suggest likely fixes
Check CI readiness before pushing by catching common formatting and policy issues.
Fetch GitHub issues, create fixes, open PRs, and handle reviews.
Fix lint, formatting, and common code issues before passing CI.
Address review and issue comments on the current branch's GitHub PR with gh CLI.