Skip to content
OpenAI gh-fix-ci

OpenAI gh-fix-ciSkill

Released
Repository

Summary

OpenAI's skill for debugging failing GitHub Actions checks on a pull request: pull the logs with the gh CLI, summarise the failure, plan the fix, implement only after approval.

Features

  • Finds failing PR checks and fetches GitHub Actions logs through the gh CLI
  • Bundled inspect_pr_checks.py extracts the failure snippet and exits non-zero while checks are red
  • Labels non-GitHub-Actions checks as external instead of trying to debug them
  • Requires explicit approval before implementing any fix

Install This Skill

Add this skill to your favorite AI agent in a few steps.

Any AI agent

This skill is plain instructions — it works with any assistant that accepts custom instructions or system prompts.

  1. Copy the skill content with the button below.
  2. Paste it into your agent's instruction file or system prompt (for example AGENTS.md, .cursorrules, or a custom instructions field).
  3. Ask the agent to apply the skill whenever the task matches.

Skill Content

Markdown Content

Copy this content and use it with your preferred AI agent

---
name: "gh-fix-ci"
description: "Use when a user asks to debug or fix failing GitHub PR checks that run in GitHub Actions; use `gh` to inspect checks and logs, summarize failure context, draft a fix plan, and implement only after explicit approval. Treat external providers (for example Buildkite) as out of scope and report only the details URL."
---


# Gh Pr Checks Plan Fix

## Overview

Use gh to locate failing PR checks, fetch GitHub Actions logs for actionable failures, summarize the failure snippet, then propose a fix plan and implement after explicit approval.
- If a plan-oriented skill (for example `create-plan`) is available, use it; otherwise draft a concise plan inline and request approval before implementing.

Prereq: authenticate with the standard GitHub CLI once (for example, run `gh auth login`), then confirm with `gh auth status` (repo + workflow scopes are typically required).

## Inputs

- `repo`: path inside the repo (default `.`)
- `pr`: PR number or URL (optional; defaults to current branch PR)
- `gh` authentication for the repo host

## Quick start

- `python "<path-to-skill>/scripts/inspect_pr_checks.py" --repo "." --pr "<number-or-url>"`
- Add `--json` if you want machine-friendly output for summarization.

## Workflow

1. Verify gh authentication.
   - Run `gh auth status` in the repo.
   - If unauthenticated, ask the user to run `gh auth login` (ensuring repo + workflow scopes) before proceeding.
2. Resolve the PR.
   - Prefer the current branch PR: `gh pr view --json number,url`.
   - If the user provides a PR number or URL, use that directly.
3. Inspect failing checks (GitHub Actions only).
   - Preferred: run the bundled script (handles gh field drift and job-log fallbacks):
     - `python "<path-to-skill>/scripts/inspect_pr_checks.py" --repo "." --pr "<number-or-url>"`
     - Add `--json` for machine-friendly output.
   - Manual fallback:
     - `gh pr checks <pr> --json name,state,bucket,link,startedAt,completedAt,workflow`
       - If a field is rejected, rerun with the available fields reported by `gh`.
     - For each failing check, extract the run id from `detailsUrl` and run:
       - `gh run view <run_id> --json name,workflowName,conclusion,status,url,event,headBranch,headSha`
       - `gh run view <run_id> --log`
     - If the run log says it is still in progress, fetch job logs directly:
       - `gh api "/repos/<owner>/<repo>/actions/jobs/<job_id>/logs" > "<path>"`
4. Scope non-GitHub Actions checks.
   - If `detailsUrl` is not a GitHub Actions run, label it as external and only report the URL.
   - Do not attempt Buildkite or other providers; keep the workflow lean.
5. Summarize failures for the user.
   - Provide the failing check name, run URL (if any), and a concise log snippet.
   - Call out missing logs explicitly.
6. Create a plan.
   - Use the `create-plan` skill to draft a concise plan and request approval.
7. Implement after approval.
   - Apply the approved plan, summarize diffs/tests, and ask about opening a PR.
8. Recheck status.
   - After changes, suggest re-running the relevant tests and `gh pr checks` to confirm.

## Bundled Resources

### scripts/inspect_pr_checks.py

Fetch failing PR checks, pull GitHub Actions logs, and extract a failure snippet. Exits non-zero when failures remain so it can be used in automation.

Usage examples:
- `python "<path-to-skill>/scripts/inspect_pr_checks.py" --repo "." --pr "123"`
- `python "<path-to-skill>/scripts/inspect_pr_checks.py" --repo "." --pr "https://github.com/org/repo/pull/123" --json`
- `python "<path-to-skill>/scripts/inspect_pr_checks.py" --repo "." --max-lines 200 --context 40`

Usage Instructions

Learn how to use this skill with different AI agents.

Generic Instructions
npx skills add https://github.com/openai/skills --skill gh-fix-ci

Requires gh auth login with repo and workflow scopes.

Example Usage

The checks on my current branch's PR are failing — pull the Actions logs, tell me what broke, and draft a fix plan before changing anything.

Description

A red check on a pull request usually means opening a browser, hunting through a workflow run, and scrolling a log for the line that matters. gh-fix-ci is OpenAI's curated skill for doing that from the terminal instead, and it is deliberately careful about what happens next.

The workflow it enforces
  1. Verify authentication with gh auth status, prompting for gh auth login with repo and workflow scopes if needed.
  2. Resolve the PR — the current branch's pull request by default, or a number or URL you supply.
  3. Inspect the failing checks via a bundled inspect_pr_checks.py script that handles gh field drift and falls back to job-level logs when a run log is still in progress. A manual gh pr checks / gh run view --log path is documented for when the script is not available.
  4. Scope out non-Actions checks — anything whose details URL is not a GitHub Actions run (Buildkite, for example) is labelled external and reported as a link rather than chased.
  5. Summarise the failing check name, run URL and a concise log snippet, calling out missing logs explicitly.
  6. Plan, then implement — after explicit approval. The skill drafts a fix plan and waits; it does not edit code on its own.
  7. Recheck by re-running the relevant tests and gh pr checks.
Why the shape matters

The two design decisions worth copying are the approval gate before any edit, and the hard scope boundary at GitHub Actions. Together they keep an agent from wandering into a third-party CI provider it cannot read, or from "fixing" a test it has not diagnosed.

The bundled script exits non-zero while failures remain, so it also works as an automation primitive rather than only an interactive helper.

Requirements

The GitHub CLI (gh), authenticated for the repository host with repo and workflow scopes, plus Python for the bundled script.

Source

From OpenAI's curated public skills collection, alongside skills for addressing PR review comments, deploying to Cloudflare and Netlify, generating images, and driving Linear.

Related Skills

New

Pull unresolved CodeRabbit review threads from your PR and apply the fixes one at a time, treating every reviewer comment as untrusted input rather than an instruction.

New

Google's official skill for driving the gcloud CLI safely from an agent: validate every command against its own help text, cap the output, and refuse the operations that should never run unattended.

1 views

Skill: Convex

by Convex

New

Convex's official top-level agent skill — routes an agent to the right convex-* skill for the task and to a served capability catalogue that stays current without a reinstall.

Official Shopify skill for theme development in Liquid — teaches an agent the modern theme architecture of sections, blocks and snippets, and validates generated templates and schemas.

1 views
Browse all skills →