Agent skill

CI/CD Failure Troubleshooting

by ruby-git in ruby-git/ruby-git

Diagnoses and fixes failing GitHub Actions runs by identifying the failure, fetching only the relevant logs, finding the root cause and reproducing it locally.

MITAuto-check passedDevOps & Cloud

Install CI/CD Failure Troubleshooting

skills CLI
$ npx skills add ruby-git/ruby-git --skill ci-cd-troubleshooting -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ruby-git/ruby-git ci-cd-troubleshooting --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ruby-git/ruby-git.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.github/skills/ci-cd-troubleshooting .claude/skills/ci-cd-troubleshooting && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
ci-cd-troubleshooting
GitHub stars
1.8k
Token cost
~1.9k tokens
SKILL.md length
850 words
Files
1
Skills in repo
30
Repo updated
First seen
Licence
MIT

At a glance

Diagnoses and fixes failing GitHub Actions runs by identifying the failure, fetching only the relevant logs, finding the root cause and reproducing it locally.

  • Works in 6 steps: Identify the Failure → Fetch Relevant Logs → Diagnose Root Cause → …
  • CI is failing on a pull request and you need the cause
  • SKILL.md covers Contents, How to use this skill, Related skills and Step 1: Identify the Failure, plus 6 more sections
  • Calls bundle and gh

What it does

Given a failing PR, branch or CI run, the agent follows a six-step workflow. It first gets CI status with `gh pr checks` or `gh run list` and sorts the failure into test, linter, build, timeout or platform-specific. It notes the exact failing job and step along with the Ruby version and OS involved, then fetches logs with care, because CI logs can run past 100K lines and exceed token limits.

The remaining steps diagnose the root cause, reproduce it locally when that applies, and report either a diagnosis for a 'why is CI failing' question or an implemented fix when you ask for one, followed by verification of the fix. The skill links to related skills for test debugging, a TDD development workflow and PR readiness review, and its examples come from a Ruby project with Rubocop and YARD checks. It is meant to be attached to Copilot Chat along with a PR number, branch or run.

When your agent uses it

  • CI is failing on a pull request and you need the cause
  • Tests pass locally but fail in GitHub Actions
  • A build is broken by a dependency, timeout or platform-specific job failure

Example prompts

  • “Why is CI failing on this PR? Diagnose only, don't change anything.”
  • “Fix the failing build on my branch and verify the checks pass.”
  • “The Rubocop job fails in Actions but passes locally, find out why.”

Requirements

  • The GitHub CLI (`gh`) with access to the repository's runs

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Identify the Failure
  2. Fetch Relevant Logs
  3. Diagnose Root Cause
  4. Reproduce Locally (if applicable)
  5. Report Findings or Fix
  6. Verify Fix

What it can do on your machine

Read from SKILL.md and the folder at commit f3bf20f. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • bundle
    • gh

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use gh, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

CI/CD Failure Troubleshooting loads about 1.9k tokens when it runs. Until then it costs about 44 tokens; SKILL.md has 850 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~44
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from ruby-git/ruby-git at commit f3bf20f, republished under its MIT licence (© ruby-git). 850 words, ~1,917 tokens.

Download SKILL.mdSave it as .claude/skills/ci-cd-troubleshooting/SKILL.md (or your agent's skills folder).
name
ci-cd-troubleshooting
description
Diagnoses and fixes CI/CD failures in GitHub Actions workflows. Use when CI is failing on a PR, builds are broken, or tests pass locally but fail in CI.

CI/CD Troubleshooting Workflow

When asked to diagnose or fix CI/CD failures (e.g., "Why is CI failing on PR #999?", "Fix the failing build"), follow this workflow to identify the root cause and optionally implement fixes.

Contents

How to use this skill

Attach this file to your Copilot Chat context, then invoke it with a failing PR number, branch, or CI run context. Use Option A for diagnosis-only requests and Option B when the user explicitly asks for a fix.

Step 1: Identify the Failure

  1. Get CI Status:

    • For PRs: gh pr checks #999
    • For branches: gh run list --branch <branch-name> --limit 5
    • Note which jobs passed and which failed
  2. Categorize the Failure Type:

    • Test failures - Unit tests, integration tests failing
    • Linter failures - Rubocop, YARD documentation issues
    • Build failures - Dependency installation, compilation errors
    • Timeout failures - Jobs exceeding time limits
    • Platform-specific failures - Failing on specific Ruby version or OS
  3. Identify Specific Failing Steps:

    • Note the exact job name and step that failed
    • Record the Ruby version, OS, and other environment details

Step 2: Fetch Relevant Logs

CRITICAL: CI logs can be massive (100K+ lines) and exceed token limits.

  1. Get the Run ID:

    bash
    gh run list --branch <branch> --limit 1 --json databaseId --jq '.[0].databaseId'
  2. Fetch Failed Job Logs Only:

    bash
    gh run view <run-id> --log-failed

    This limits output to only failed jobs, making it manageable.

  3. Extract Key Error Information:

    • For test failures: Look for stack traces, assertion errors, specific test names

    • For linter failures: Extract file names, line numbers, and violation types

    • For build failures: Find dependency errors or missing packages

    • Use grep to filter logs if still too large:

      bash
      gh run view <run-id> --log-failed | grep -A 10 -B 5 "Error\|FAILED\|Failure"
  4. Avoid Full Log Downloads:

    • Do NOT use --log without --log-failed unless specifically requested
    • If logs are still too large, focus on the most recent or critical failure

Step 3: Diagnose Root Cause

Based on the failure type, investigate:

For Test Failures:

  • Check if the test exists and what it's testing
  • Look for recent changes that might have broken the test
  • Consider environment differences (local vs. CI)
  • Check for flaky tests (intermittent failures)

For Linter Failures:

  • Run linters locally: bundle exec rubocop and bundle exec rake yard
  • Identify specific violations from the log
  • Check if violations are in files related to recent changes

For Build Failures:

  • Check dependency versions in Gemfile and git.gemspec
  • Look for platform-specific dependency issues
  • Verify Ruby version compatibility

For Timeout Failures:

  • Identify which test or step is timing out
  • Check for infinite loops or performance regressions
  • Consider if it's a resource limitation in CI environment
Show full SKILL.md (391 more words)Show less

Step 4: Reproduce Locally (if applicable)

For PR Failures:

  1. Fetch the PR branch:

    bash
    gh pr checkout #999
  2. Run the failing tests locally:

    bash
    bundle exec rspec <path/to/spec.rb>
  3. Run linters:

    bash
    bundle exec rubocop
    bundle exec rake yard

For Branch Failures:

  1. Checkout the branch.

  2. Run full CI workflow:

    bash
    bundle exec rake default

Step 5: Report Findings or Fix

Determine the appropriate action based on the user's request:

Option A: Diagnostic Report ("Why is CI failing?")

Present findings to the user:

markdown
# CI Failure Diagnosis: <Branch/PR>

**Status:** <X of Y jobs failed>

## Failed Jobs
1. **<Job Name>** (<Ruby version>, <OS>)
   - **Step:** <failing step name>
   - **Failure Type:** <test/linter/build/timeout>

## Root Cause
<Explanation of what's causing the failure>

## Error Details
```
<Relevant error messages and stack traces>
```

## Recommendations
- <Specific fix suggestion 1>
- <Specific fix suggestion 2>

**Would you like me to implement a fix, or do you need more information?**

STOP here unless the user asks you to proceed with fixes.

Option B: Implement Fix ("Fix the failing build")

Proceed based on failure type:

  • Test Failures: Use the full TDD workflow (Phase 1-3) to fix the failing tests
  • Linter Failures: Fix violations directly, commit with appropriate message (e.g., style: fix rubocop violations in lib/git/base.rb)
  • Build Failures: Update dependencies or configuration as needed
  • Timeout Failures: Investigate performance issues, may require user guidance

For PR Failures on Someone Else's PR:

  • You may not have push access to their branch
  • Present the fix and ask user to either:
    • Push to the PR branch (if they have access)
    • Comment on the PR with suggested changes
    • Create a new PR with fixes

Step 6: Verify Fix

After implementing fixes:

  1. Run Affected Tests Locally:

    bash
    bundle exec rspec <path/to/spec.rb>
  2. Run Full CI Suite:

    bash
    bundle exec rake default
  3. Push and Monitor:

    • Push the fixes

    • Monitor CI to confirm the fix worked:

      bash
      gh run watch
  4. Confirm Resolution:

    text
    Fix implemented and pushed. Monitoring CI run...
    CI Status: <link to run>

Special Troubleshooting Considerations

Platform-Specific Failures:

  • If tests pass on macOS but fail on Linux/Windows, document the difference
  • Check for path separator issues (/ vs. \)
  • Look for encoding differences
  • Consider file system case sensitivity

Flaky Tests:

  • If a test fails intermittently, note this in your diagnosis
  • Run the test multiple times locally to confirm flakiness
  • Suggest fixes for race conditions or timing issues

Permission Issues:

  • If you can't push to a PR branch, clearly communicate this limitation
  • Provide the exact commands or changes needed for the user to apply

Token Limit Management:

  • Always use --log-failed to limit output
  • If logs are still too large, use grep to extract errors
  • Focus on the first failure if multiple failures exist
  • Consider running tests locally instead of relying on full CI logs

© ruby-git, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .github/skills/ci-cd-troubleshooting of ruby-git/ruby-git.

Open the folder on GitHubat commit f3bf20f

Compare with similar skills

CI/CD Failure Troubleshooting next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

CI/CD Failure Troubleshooting compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
CI/CD Failure Troubleshooting this skillruby-git/ruby-git1.8k—~1.9kAutomated safety check: PassMIT
Debugging CI FailuresPostHog/posthog-foss721—~5.7kAutomated safety check: PassMIT
Authoring CI WorkflowsPostHog/posthog-foss721—~11kAutomated safety check: PassMIT
GitHub Actions Failure Analysisykdojo/claude-code-tips10k—~639Automated safety check: PassCustom licence
ONNX Runtime CI Managementmicrosoft/onnxruntime22k—~4.1kAutomated safety check: PassMIT
CI Watchdoglatitude-dev/latitude-llm4.7k—~1.6kAutomated safety check: PassMIT

Similar skills

  • Debugging CI Failures

    PostHog/posthog-foss

    Official

    Debugs failing GitHub Actions CI runs for PostHog PRs, commits, and branches, and answers broad CI-health questions ("is CI red?", "is master green today?", "what's broken right now?").

    721 GitHub stars~5.7k tokensUpdated today
    Testing & QAAuto-check passed
  • Authoring CI Workflows

    PostHog/posthog-foss

    Official

    A skill your agent uses when adding or editing a GitHub Actions workflow, composite action, or reusable workflow under .github/ — new CI jobs, triggers, matrices, checkout/clone tuning, action…

    721 GitHub stars~11k tokensUpdated today
    DevelopmentAuto-check passed
  • GitHub Actions Failure Analysis

    ykdojo/claude-code-tips

    Investigates a failed GitHub Actions run from its URL: pinpoints the real failure, checks the job's history for flakiness, and finds the breaking commit and any existing fix PR.

    10k GitHub stars~639 tokensUpdated 12 days ago
    DevOps & CloudAuto-check passed
  • ONNX Runtime CI Management

    microsoft/onnxruntime

    Official

    Triggers, re-runs and unblocks the CI checks on an ONNX Runtime pull request, after diagnosing whether a failure is transient or needs a code change.

    22k GitHub stars~4.1k tokensUpdated today
    DevOps & CloudAuto-check passed
  • CI Watchdog

    latitude-dev/latitude-llm

    Continuously monitor GitHub PR CI checks and automatically fix failures until all checks pass.

    4.7k GitHub stars~1.6k tokensUpdated yesterday
    DevOps & CloudAuto-check passed
  • Swig CI Repro

    swig/swig

    Reproduce a GitHub Actions Linux CI failure locally when it does not happen on your machine: a podman/docker image that mirrors the ubuntu-22.04 runner by reusing the real Tools/CI-linux-.sh install…

    6.3k GitHub stars~1.2k tokensUpdated today
    DevOps & CloudAuto-check passed

More from ruby-git/ruby-git

All 30 skills in this repo
  • Addresses unresolved pull request review threads and suppressed (low-confidence) Copilot review comments on the current branch, folds each fix into the…

    1.8k GitHub stars~657 tokensUpdated 5 days ago
    Auto-check passed
  • Breaking Change Analysis

    ruby-git/ruby-git

    Assesses what an API change would break before it is made, finds every usage, documents the impact and plans a deprecation or migration path.

    1.8k GitHub stars~1.7k tokensUpdated 5 days ago
    Auto-check passed
  • Scaffolds and reviews `Git::Commands::*` classes in the ruby-git library, with unit tests, integration tests and YARD docs, using the Base command architecture.

    1.8k GitHub stars~3k tokensUpdated 5 days ago
    Auto-check passed
  • Gem Dependency Management

    ruby-git/ruby-git

    Workflow for updating gem dependencies and fixing CVEs in the ruby-git project: assess with bundle outdated and audit, edit the gemspec, test, then commit with conventional messages.

    1.8k GitHub stars~806 tokensUpdated 5 days ago
    Auto-check passed
  • Migrates a direct command call in Ruby Git's Git::Lib to a Git::Commands class, as part of a Strangler Fig redesign, with a plan, legacy tests and a pull request.

    1.8k GitHub stars~4.4k tokensUpdated 5 days ago
    Auto-check passed
  • Scaffolds and reviews facade methods on Git::Repository in ruby-git, with unit tests, integration tests and YARD documentation.

    1.8k GitHub stars~3.4k tokensUpdated 5 days ago
    Auto-check passed

Questions about CI/CD Failure Troubleshooting

What does CI/CD Failure Troubleshooting do?

Diagnoses and fixes failing GitHub Actions runs by identifying the failure, fetching only the relevant logs, finding the root cause and reproducing it locally. Given a failing PR, branch or CI run, the agent follows a six-step workflow. It first gets CI status with `gh pr checks` or `gh run list` and sorts the failure into test, linter, build, timeout or platform-specific.

When should I use CI/CD Failure Troubleshooting?

CI/CD Failure Troubleshooting fits situations like: CI is failing on a pull request and you need the cause; tests pass locally but fail in GitHub Actions; A build is broken by a dependency, timeout or platform-specific job failure.

How do I install CI/CD Failure Troubleshooting in Claude Code?

Run `npx skills add ruby-git/ruby-git --skill ci-cd-troubleshooting -a claude-code`. Or copy the skill folder (.github/skills/ci-cd-troubleshooting in ruby-git/ruby-git) into .claude/skills/ci-cd-troubleshooting in your project. Claude Code loads it when a task matches its description.

How do I install CI/CD Failure Troubleshooting in Codex?

Run `npx skills add ruby-git/ruby-git --skill ci-cd-troubleshooting -a codex`. Or copy the skill folder (.github/skills/ci-cd-troubleshooting in ruby-git/ruby-git) into .agents/skills/ci-cd-troubleshooting in your project. Codex loads it when a task matches its description.

Can I use CI/CD Failure Troubleshooting in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ruby-git/ruby-git --skill ci-cd-troubleshooting -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/ci-cd-troubleshooting, .gemini/skills/ci-cd-troubleshooting, .github/skills/ci-cd-troubleshooting and .opencode/skills/ci-cd-troubleshooting in your project.

What does CI/CD Failure Troubleshooting need to run?

Going by SKILL.md and its folder, CI/CD Failure Troubleshooting needs the command-line tools its instructions call (bundle and gh). Our summary lists: The GitHub CLI (`gh`) with access to the repository's runs.

Does CI/CD Failure Troubleshooting access the network?

SKILL.md contains no URLs. Its commands use gh, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is CI/CD Failure Troubleshooting safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does CI/CD Failure Troubleshooting use?

CI/CD Failure Troubleshooting is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does CI/CD Failure Troubleshooting use?

About 1.9k tokens (SKILL.md is roughly 7.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to CI/CD Failure Troubleshooting?

Skills that share tags, products or a category with CI/CD Failure Troubleshooting: Debugging CI Failures (PostHog/posthog-foss, 721 stars), Authoring CI Workflows (PostHog/posthog-foss, 721 stars), GitHub Actions Failure Analysis (ykdojo/claude-code-tips, 10k stars) and ONNX Runtime CI Management (microsoft/onnxruntime, 22k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains CI/CD Failure Troubleshooting?

ruby-git (a GitHub organization) maintains it in ruby-git/ruby-git, which has 1,799 GitHub stars. The repository holds 30 skills in this directory. The repository was last updated on October 2, 2026.

Source: ruby-git/ruby-git on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.