skills/gh-fix-ci/SKILL.md
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.
npx skillsauth add euxx/claude-skills-for-copilot gh-fix-ciInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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.
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.
# 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.
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).
For each failing GitHub Actions check:
link (the numeric segment in the URL).gh run view <run-id> -R <owner>/<repo> --json name,workflowName,conclusion,status,url,event,headBranch,headSha
gh run view <run-id> -R <owner>/<repo> --log
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).
Present a short summary for the user:
Draft a concise fix plan covering:
Ask the user for explicit approval before implementing.
Apply the approved plan. Show a summary of diffs and note any tests run.
After changes, suggest:
gh pr checks <pr-number> -R <owner>/<repo> --watch
to confirm the checks pass.
testing
Analyzes type design quality by rating encapsulation, invariant expression, usefulness, and enforcement. Helps design types that make invalid states unrepresentable. Use when reviewing new types or data models.
testing
Reviews test coverage quality from a behavioral perspective, identifying critical gaps and test quality issues. Does not check line coverage — checks meaningful scenario coverage. Use after adding or modifying tests.
development
Audits error handling for silent failures, inadequate user feedback, and unjustified fallback behavior. Finds issues in catch blocks, fallbacks, and error paths. Use after modifying error handling code.
development
Repository-grounded threat modeling that enumerates trust boundaries, assets, attacker capabilities, abuse paths, and mitigations, and writes a concise Markdown threat model. Trigger only when the user explicitly asks to threat model a codebase or path, enumerate threats/abuse paths, or perform AppSec threat modeling. Do not trigger for general architecture summaries, code review, or non-security design work.