Back to Skills

fix-ci

verified

Analyze and fix CI failures for a GitHub pull request

View on GitHub

Marketplace

clipboard

ClipboardHealth/core-utils

Plugin

core

Repository

ClipboardHealth/core-utils
30stars

plugins/core/skills/fix-ci/SKILL.md

Last Verified

February 1, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/ClipboardHealth/core-utils/blob/main/plugins/core/skills/fix-ci/SKILL.md -a claude-code --skill fix-ci

Installation paths:

Claude
.claude/skills/fix-ci/
Powered by add-skill CLI

Instructions

# Fix CI Errors

Analyze and fix CI failures for a GitHub pull request.

## Arguments

- `$ARGUMENTS` - The GitHub pull request URL (e.g., `https://github.com/owner/repo/pull/123`)

If no PR URL is provided, it uses the PR associated with the current branch.

## Instructions

You are tasked with identifying and fixing CI failures for the provided pull request.

### Step 0: Resolve PR Number

If a PR URL is provided in `$ARGUMENTS`, extract the PR number from it. Otherwise, get the PR for the current branch:

```bash
# If no PR URL provided, get PR for current branch
gh pr view --json number,url,headRefName
```

This will return the PR associated with the current branch. If a URL was provided, extract the PR number from the URL path (e.g., `https://github.com/owner/repo/pull/123` → PR number is `123`).

### Step 1: Get PR Information and CI Status

Use the GitHub CLI to get the PR details and check status:

```bash
gh pr view $PR_NUMBER --json title,headRefName,statusCheckRollup,url
```

Identify any failed checks from the `statusCheckRollup`. The `statusCheckRollup` contains check details including `detailsUrl` which links to the GitHub Actions run.

### Step 2: Get Failed Job Logs

Extract the run ID from the failed check's `detailsUrl` (e.g., `https://github.com/owner/repo/actions/runs/123456789` → run ID is `123456789`).

Then get the failed jobs and stream their logs directly:

```bash
# Get failed job IDs from the run
gh run view $RUN_ID --json jobs --jq '.jobs[] | select(.conclusion == "failure") | .databaseId'

# Stream logs for a specific failed job and search for errors
gh run view --job $JOB_ID --log | grep -iE "FAIL|Error:|error:|Test Suites:|Tests:"

# Or view only failed steps' logs (more concise)
gh run view --job $JOB_ID --log-failed
```

Analyze the log output to identify the specific errors causing CI to fail.

### Step 3: Identify Root Cause

Analyze the error messages to determine:

- Is it a compilation error (TypeScript, build failure)?
- Is it 

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
3315 chars