Agent skill

Test Debugging

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

Debugs failing or flaky tests and improves test coverage. An agent skill from ruby-git/ruby-git.

MITAuto-check passedTesting & QA

Install Test Debugging

skills CLI
$ npx skills add ruby-git/ruby-git --skill test-debugging -a claude-code

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

GitHub CLI
$ gh skill install ruby-git/ruby-git test-debugging --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/test-debugging .claude/skills/test-debugging && 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
test-debugging
GitHub stars
1.8k
Token cost
~1.5k tokens
SKILL.md length
548 words
Files
1
Skills in repo
30
Repo updated
First seen
Licence
MIT

At a glance

Debugs failing or flaky tests and improves test coverage. An agent skill from ruby-git/ruby-git.

  • Works in 5 steps: Run and Observe the Test → Investigate Root Cause → Report Findings → …
  • Tests fail consistently
  • SKILL.md covers Contents, How to use this skill, Related skills and Step 1: Run and Observe the Test, plus 5 more sections
  • Calls bundle and git

What it does

Test Debugging is an agent skill from ruby-git/ruby-git. Debugs failing or flaky tests and improves test coverage. Use when tests fail consistently, exhibit intermittent behavior, or when adding missing test coverage.

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA, covering Failing and flaky tests, Test coverage and Debugging. The repository describes itself as: Ruby/Git is a Ruby library that can be used to create, read and manipulate Git repositories by wrapping system calls to the git binary. The licence is MIT.

When your agent uses it

  • Tests fail consistently
  • Exhibit intermittent behavior
  • Adding missing test coverage

Example prompts

  • “Use the test-debugging skill to debug failing or flaky tests and improves test coverage. An agent skill from ruby-git/ruby-git”
  • “/test-debugging”

Workflow steps

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

  1. Run and Observe the Test
  2. Investigate Root Cause
  3. Report Findings
  4. Determine Fix Strategy
  5. Verify Test 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
    • git

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

  • Network

    No URLs in SKILL.md. Its commands use git, 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

Test Debugging loads about 1.5k tokens when it runs. Until then it costs about 44 tokens; SKILL.md has 548 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.5k

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). 548 words, ~1,477 tokens.

Download SKILL.mdSave it as .claude/skills/test-debugging/SKILL.md (or your agent's skills folder).
name
test-debugging
description
Debugs failing or flaky tests and improves test coverage. Use when tests fail consistently, exhibit intermittent behavior, or when adding missing test coverage.

Test Debugging & Maintenance Workflow

When asked to debug tests or improve test coverage, follow this workflow to identify problems, determine root causes, and apply appropriate fixes.

Contents

How to use this skill

Attach this file to your Copilot Chat context, then invoke it with the failing test file, test name, or flakiness symptom. Stop at Step 3 for diagnosis-only requests unless the user asks for implementation.

  • RSpec Unit Testing Standards — rules governing test isolation, determinism, and order independence (Rules 25–28); consult when flakiness is caused by a test design violation rather than a production bug
  • Development Workflow — required TDD process when fixes involve production code
  • CI/CD Troubleshooting — investigate failures that appear only in CI

Step 1: Run and Observe the Test

  1. Run the failing test:

    bash
    # RSpec unit test
    bundle exec rspec spec/unit/git/commands/<command>_spec.rb
    
    # RSpec integration test
    bundle exec rspec spec/integration/git/commands/<command>_spec.rb
    
    # Specific example, by line number
    bundle exec rspec spec/unit/git/commands/<command>_spec.rb:42
  2. For suspected flaky tests, run multiple times:

    bash
    for i in {1..20}; do
      echo "Run $i"
      bundle exec rspec <spec_file> || break
    done
  3. Check test isolation — run the test alone vs. within the full suite:

    bash
    bundle exec rspec <spec_file>   # alone
    bundle exec rake default        # full suite

Step 2: Investigate Root Cause

  1. Read the full error including stack trace. Identify exact failing line and expected vs. actual values.

  2. Check recent changes with git log and git blame on the test file and related production code.

  3. For flaky tests, look for:

    • Shared state between tests (global/class variables, shared filesystem resources)
    • Timing dependencies or race conditions
    • Non-deterministic behavior (time-dependent logic, unordered iteration)
    • Test execution order dependencies
  4. For environment issues, check:

    • Platform differences (paths, line endings, permissions)
    • Git version differences (use git --version)
    • Ruby version differences

Step 3: Report Findings

Present diagnostic findings to the user:

markdown
# Test Failure Diagnosis: <test_name>

**Failure Type:** [Consistent / Flaky / Coverage Gap]
**Test File:** <path/to/test_file.rb>

## Error
<error message and relevant stack trace>

## Root Cause
<Explanation of why the test is failing>

## Recommended Fix
<Specific recommendation>

**Would you like me to implement this fix?**

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

Show full SKILL.md (252 more words)Show less

Step 4: Determine Fix Strategy

ScenarioStrategyCommit Type
Production code bug (test caught a real bug)Fix production code using the development-workflow TDD process. The failing test is the RED step.fix(component): <description>
Test needs updating (intentional API change)Get user confirmation first. Update test assertions.test(component): update test for <change>
Flaky test (non-determinism)Make test deterministic. Run 20+ times to verify.test(component): fix flaky test in <test_name>
Missing test coverageAdd tests using the development-workflow TDD process.test(component): add tests for <feature>
Test refactoringImprove readability/reduce duplication. Keep tests green.refactor(test): improve <test_name>
Environment/setup issueFix environment, document requirements. No code commit needed.—

CRITICAL: Get user confirmation before modifying existing tests.

Step 5: Verify Test Fix

bash
# Run the specific test
bundle exec rspec <spec_file>

# For flaky test fixes, run many times
for i in {1..50}; do
  echo "Run $i"
  bundle exec rspec <spec_file> || break
done

# Run full suite
bundle exec rake default

Project-Specific Considerations

Test framework: This project uses RSpec exclusively (spec/unit/ and spec/integration/).

Test helpers: Use the 'in an empty repository' shared context (and other spec/support/contexts/ shared contexts) plus Git::IntegrationTestHelpers methods (e.g. write_file) for integration specs. Use let/let! and verifying doubles for unit specs — see RSpec Unit Testing Standards.

Mocking: The project uses RSpec doubles (instance_double, class_double) for unit specs. Be careful with stubs — they can mask real issues.

Test data: Integration specs create temporary repos on the fly (e.g. via Dir.mktmpdir and the shared contexts above). Static fixture files in spec/support/fixtures/ exist for a small number of specs that need pre-built content (e.g. spec/integration/git/command_line_spec.rb); prefer dynamic helpers for new specs. Clean up any state created outside those helpers.

CI vs. local differences: If tests pass locally but fail in CI, use the ci-cd-troubleshooting skill.

© 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/test-debugging of ruby-git/ruby-git.

Open the folder on GitHubat commit f3bf20f

Compare with similar skills

Test Debugging 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.

Test Debugging compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Test Debugging this skillruby-git/ruby-git1.8k—~1.5kAutomated safety check: PassMIT
Test BlindspotsNeeeophytee/finding-unknowns-skills343—~676Automated safety check: PassMIT
Activitypub TestingMicrock/ordinary-claude-skills401—~712Automated safety check: PassCustom licence
Offloadimbue-ai/offload125—~3.1kAutomated safety check: PassMIT
Fix BugMelbourneDeveloper/dart_node1131 repos~709Automated safety check: NotesNone
Dd Unblock PRDataDog/pup1k—~1.7kAutomated safety check: PassApache-2.0

Similar skills

  • Test Blindspots

    Neeeophytee/finding-unknowns-skills

    Find consequential behavior that a passing test suite does not establish, using focused exploratory checks.

    343 GitHub stars~676 tokensUpdated 9 days ago
    Testing & QAAuto-check passed
  • Activitypub Testing

    Microck/ordinary-claude-skills

    Testing patterns for PHPUnit and Playwright E2E tests. An agent skill from Microck/ordinary-claude-skills.

    401 GitHub stars~712 tokensUpdated 1 mo ago
    Testing & QAAuto-check passed
  • Offload

    imbue-ai/offload

    Activate when you see offload.toml in a repo, offload referenced in build targets (justfile, Makefile, scripts), or when you need to run a large test suite in parallel.

    125 GitHub stars~3.1k tokensUpdated 11 days ago
    Testing & QAAuto-check passed
  • Fix Bug

    MelbourneDeveloper/dart_node

    Fix a bug using test-driven development. An agent skill from MelbourneDeveloper/dart_node.

    113 GitHub starsUsed in 1 repo~709 tokens
    Testing & QAAuto-check: notes
  • Dd Unblock PR

    DataDog/pup

    Official

    Load when investigating a failing PR CI pipeline or checking PR health.

    1k GitHub stars~1.7k tokensUpdated today
    Testing & QAAuto-check passed
  • Mutation Testing

    ThibautBaissac/rails_ai_agents

    Run mutant, read mutation reports, fix alive mutations, and verify coverage.

    665 GitHub stars~1.7k tokensUpdated 4 mo ago
    Testing & QAAuto-check: notes

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
  • Diagnoses and fixes failing GitHub Actions runs by identifying the failure, fetching only the relevant logs, finding the root cause and reproducing it locally.

    1.8k GitHub stars~1.9k 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

Categories

Questions about Test Debugging

What does Test Debugging do?

Debugs failing or flaky tests and improves test coverage. An agent skill from ruby-git/ruby-git. Test Debugging is an agent skill from ruby-git/ruby-git. Debugs failing or flaky tests and improves test coverage.

When should I use Test Debugging?

Test Debugging fits situations like: tests fail consistently; exhibit intermittent behavior; adding missing test coverage.

How do I install Test Debugging in Claude Code?

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

How do I install Test Debugging in Codex?

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

Can I use Test Debugging 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 test-debugging -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/test-debugging, .gemini/skills/test-debugging, .github/skills/test-debugging and .opencode/skills/test-debugging in your project.

What does Test Debugging need to run?

Going by SKILL.md and its folder, Test Debugging needs the command-line tools its instructions call (bundle and git).

Does Test Debugging access the network?

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

Is Test Debugging 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 Test Debugging use?

Test Debugging 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 Test Debugging use?

About 1.5k tokens (SKILL.md is roughly 5.9k 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 Test Debugging?

Skills that share tags, products or a category with Test Debugging: Test Blindspots (Neeeophytee/finding-unknowns-skills, 343 stars), Activitypub Testing (Microck/ordinary-claude-skills, 401 stars), Offload (imbue-ai/offload, 125 stars) and Fix Bug (MelbourneDeveloper/dart_node, 113 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Test Debugging?

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.