agentleFS
euxxeuxx/claude-skills-for-copilot/skills/gh-fix-ci/SKILL.md

gh-fix-ci

Skill4 starsChanged 7 months agoMITView on GitHub

Debug failing GitHub Actions CI checks on the current branch's PR using the gh CLI — inspect logs, summarize root cause, and propose a focused fix plan before implementing.

35 other projects use a version of this, 21 of them edited.

Adopted by

Most recently taken up by

Used with

Projects with it also use codebase-migrate, email-draft-polish and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • ComposioHQSkill

    codebase-migrate

    Run large codebase migrations and multi-file refactors. Uses the Composio CLI to coordinate issue tracking, batched PRs, and CI verification while the agent executes the transforms locally across hundreds of files.

    Also in 5 projects that use this

  • ComposioHQSkill

    email-draft-polish

    Draft, rewrite, or condense emails with target tone, length, and audience; use for cold outreach, replies, status updates, or escalations where clarity and brevity matter.

    Also in 4 projects that use this

  • petestewartSkill

    datadog-logs

    Query Datadog logs via the Logs Search API v2. Use when the user asks to "check the logs", "search logs", "find errors in Datadog", "look up logs for", "show me production logs", "check for errors", "search Datadog", or any request involving log search, error investigation, or production debugging that requires Datadog log data.

    Also in 3 projects that use this

  • MicrosoftSkill

    deploy-pipeline

    Triggers a Power Platform Pipeline deployment run for a Power Pages solution. Selects a target stage, validates the package, optionally configures deployment settings (environment variables, connection references), then deploys and polls for completion. Use when asked to: "deploy pipeline", "run pipeline", "trigger deployment", "deploy to staging", "deploy to production", "run power platform pipeline", "deploy solution via pipeline", "promote solution", "push to staging", "push to production".

    Also in 3 projects that use this

  • +8 more from ComposioHQ

The file

We split this skill into the rules it gives an agent

5 rules. 1 is common, 1 is distinctive, and 3 are very specific to this project.

  • 1

    Common

    Most of the 33 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use gh to locate failing PR checks, fetch GitHub Actions logs, summarize the failure, then propose a fix plan and implement only after …

    line 10
  2. Very specific:

    Verify gh authentication before doing anything else:

    line 14
  3. Very specific:

    If unauthenticated, ask the user to run gh auth login (repo + workflow scopes required), then stop.

    line 20
  4. Common:

    If the run is still in progress, get the job IDs and fetch logs directly:

    line 57
  5. Distinctive:

    Check name and run URL

    line 72

“Common” is measured: kept by at least 6 in 10 of the 33 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Fix Failing CI Checks

Use gh to locate failing PR checks, fetch GitHub Actions logs, summarize the failure, then propose a fix plan and implement only after explicit user approval.

Prerequisites

Verify gh authentication before doing anything else:

gh auth status

If unauthenticated, ask the user to run gh auth login (repo + workflow scopes required), then stop.

Workflow

1. Resolve the PR

# if the user specified a PR number or URL:
gh pr view <number-or-url> --json number,url,headRefName

# otherwise (current branch):
gh pr view --json number,url,headRefName

Extract owner and repo from the returned url field — PR URLs have the form https://github.com/<owner>/<repo>/pull/<number>, so split on / to get the 4th and 5th segments. These are the base (target) repository coordinates where GitHub Actions checks run, and are reliable even for cross-fork PRs.

2. Inspect failing checks

gh pr checks <pr-number> -R <owner>/<repo> --json name,state,bucket,link,startedAt,completedAt,workflow

If a field is rejected, rerun with the available fields reported by gh. Scope only to GitHub Actions checks. If link is not a GitHub Actions run URL, label it as external, report the URL only, and do not investigate further (e.g. Buildkite, CircleCI are out of scope).

3. Fetch failure logs

For each failing GitHub Actions check:

  1. Extract the run ID from link (the numeric segment in the URL).
  2. Fetch run metadata:
    gh run view <run-id> -R <owner>/<repo> --json name,workflowName,conclusion,status,url,event,headBranch,headSha
  3. Fetch logs:
    gh run view <run-id> -R <owner>/<repo> --log
  4. If the run is still in progress, get the job IDs and fetch logs directly:
    gh run view <run-id> -R <owner>/<repo> --json jobs
    Then for each relevant job:
    gh api "/repos/<owner>/<repo>/actions/jobs/<job-id>/logs"

Extract a concise failure snippet (relevant error lines and stack traces only).

4. Summarize failures

Present a short summary for the user:

  • Check name and run URL
  • Root cause (1–2 sentences with supporting log snippet)
  • Note if logs are missing or truncated

5. Plan and get approval

Draft a concise fix plan covering:

  • Which files to change and why
  • Any tests that need updating
  • Expected outcome

Ask the user for explicit approval before implementing.

6. Implement

Apply the approved plan. Show a summary of diffs and note any tests run.

7. Recheck

After changes, suggest:

gh pr checks <pr-number> -R <owner>/<repo> --watch

to confirm the checks pass.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.