home / skills / shipshitdev / library / gh-fix-ci

This skill diagnoses failing GitHub Actions in a PR using gh, documents root causes, and proposes an approved fix plan with actionable changes.

npx playbooks add skill shipshitdev/library --skill gh-fix-ci

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
1.1 KB
---
name: gh-fix-ci
description: Inspect GitHub PR checks with gh, pull failing GitHub Actions logs, summarize failure context, then create a fix plan and implement after user approval. Use when a user asks to debug or fix failing PR CI/CD checks on GitHub Actions and wants a plan plus code changes; for external checks (e.g., Buildkite), only report the details URL and mark them out of scope.
---

# GH Fix CI

Use this skill to diagnose failing GitHub Actions checks on a PR and propose a fix plan.

## Workflow

1) Verify auth:
   - `gh auth status -h github.com`
2) Identify the PR:
   - `gh pr view --json number,title,url`
   - If no PR is found, ask for the PR URL.
3) List checks:
   - `gh pr checks`
4) For GitHub Actions failures, fetch logs:
   - `gh run view <run-id> --log`
   - If you only have a job id: `gh run view --job <job-id> --log`
5) Summarize the root cause and impacted files.
6) Propose a fix plan and get user approval before changing code.
7) For external checks (non-GitHub Actions), report the details URL and mark as out of scope.

## Notes

- Do not rerun CI unless the user asks.
- Keep the failure summary concise and actionable.

Overview

This skill diagnoses failing GitHub Actions checks on a pull request, pulls relevant logs, summarizes the failure context, and prepares a proposed fix plan. After you approve the plan, it can implement code changes and open a follow-up commit or PR. External CI (non-GitHub Actions) is reported as out of scope with a details URL.

How this skill works

It verifies GH CLI authentication, locates the PR, and lists associated checks using gh commands. For GitHub Actions failures it fetches run or job logs, extracts root-cause details and impacted files, then drafts a concise fix plan. It asks for user approval before making any code edits and will report external CI checks as out of scope with their details URL.

When to use it

  • A PR’s GitHub Actions checks are failing and you want a diagnosis and fix plan.
  • You need a concise summary of failing job logs and impacted files.
  • You want automated edits after reviewing and approving a repair plan.
  • You prefer the tool to fetch GH Actions logs rather than manually searching runs.
  • You need clear distinction between GitHub Actions and external CI failures.

Best practices

  • Ensure gh is authenticated (gh auth status -h github.com) before starting.
  • Provide the PR URL if the skill cannot auto-detect the target PR.
  • Do not request rerunning CI unless you explicitly want it re-run.
  • Keep tests and changes isolated to a minimal set of files to simplify review.
  • Review the proposed plan carefully before approving automated code changes.

Example use cases

  • Unit tests failing on a feature branch — fetch logs, identify failing tests, propose code or test fixes.
  • Build or compilation errors — locate failing step, summarize missing deps or config, propose edits to build scripts or Dockerfiles.
  • Lint or formatting failures — extract linter output and create fixes or formatting commits.
  • Intermittent or flaky tests — gather logs from multiple runs and propose stability or timeout adjustments.
  • Dependency upgrade causing breakage — identify stacktrace, propose version pin or code adjustments.

FAQ

Can the skill push code or create commits?

Yes — but only after you explicitly approve the proposed fix plan. Changes are committed or opened as a PR per your instruction.

Will it rerun CI or re-trigger workflows?

No — it will not rerun CI by default. It reports logs and makes code changes; rerunning workflows requires an explicit request from you.