Root Cause Debugging
jsmastery-pro/skills
Runs a reproduce, localize, hypothesize, test, fix and verify loop to find a bug's root cause, applies the minimal fix and hands off a regression test.
Analyze failing tests to detect functional bugs in code. An agent skill from ArabelaTso/Skills-4-SE.
$ npx skills add ArabelaTso/Skills-4-SE --skill test-guided-bug-detector -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install ArabelaTso/Skills-4-SE test-guided-bug-detector --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/test-guided-bug-detector .claude/skills/test-guided-bug-detector && rm -rf skills-srcUse ~/.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/
Install the "test-guided-bug-detector" agent skill from https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/test-guided-bug-detector into .claude/skills/test-guided-bug-detector/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "test-guided-bug-detector", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/test-guided-bug-detectorType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add ArabelaTso/Skills-4-SE --skill test-guided-bug-detector -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install ArabelaTso/Skills-4-SE test-guided-bug-detector --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/test-guided-bug-detector .agents/skills/test-guided-bug-detector && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "test-guided-bug-detector" agent skill from https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/test-guided-bug-detector into .agents/skills/test-guided-bug-detector/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "test-guided-bug-detector", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add ArabelaTso/Skills-4-SE --skill test-guided-bug-detector -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install ArabelaTso/Skills-4-SE test-guided-bug-detector --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/test-guided-bug-detector .cursor/skills/test-guided-bug-detector && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "test-guided-bug-detector" agent skill from https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/test-guided-bug-detector into .cursor/skills/test-guided-bug-detector/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "test-guided-bug-detector", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/ArabelaTso/Skills-4-SE.git --path skills/test-guided-bug-detector--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add ArabelaTso/Skills-4-SE --skill test-guided-bug-detector -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install ArabelaTso/Skills-4-SE test-guided-bug-detector --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/test-guided-bug-detector .gemini/skills/test-guided-bug-detector && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "test-guided-bug-detector" agent skill from https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/test-guided-bug-detector into .gemini/skills/test-guided-bug-detector/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "test-guided-bug-detector", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install ArabelaTso/Skills-4-SE test-guided-bug-detectorInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add ArabelaTso/Skills-4-SE --skill test-guided-bug-detector -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/test-guided-bug-detector .github/skills/test-guided-bug-detector && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "test-guided-bug-detector" agent skill from https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/test-guided-bug-detector into .github/skills/test-guided-bug-detector/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "test-guided-bug-detector", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add ArabelaTso/Skills-4-SE --skill test-guided-bug-detector -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install ArabelaTso/Skills-4-SE test-guided-bug-detector --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/test-guided-bug-detector .opencode/skills/test-guided-bug-detector && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "test-guided-bug-detector" agent skill from https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/test-guided-bug-detector into .opencode/skills/test-guided-bug-detector/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "test-guided-bug-detector", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
test-guided-bug-detectorAnalyze failing tests to detect functional bugs in code. An agent skill from ArabelaTso/Skills-4-SE.
Test Guided Bug Detector is an agent skill from ArabelaTso/Skills-4-SE. Analyze failing tests to detect functional bugs in code. Takes repository and failing test output as input, analyzes execution behavior, assertions, and stack traces to identify suspicious code regions and root causes. Use when debugging test failures, investigating regression bugs, or understanding why tests fail. Explains the bug mechanism, identifies affected code, and suggests fixes based on test expectations vs actual behavior.
Its SKILL.md is about 2.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `references/analysis_strategies.md`, `references/bug_patterns.md` and `references/failure_types.md`).
It sits in Development, covering Failing and flaky tests, Debugging and Root cause analysis. The repository describes itself as: A curated list of 180+ useful Claude Skills for Software Engineering and resources for customizing AI for SE workflows. The licence is Apache-2.0.
7 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 4f38503. It shows what the files ask for, not the result of running them.
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.
Shell commands in SKILL.md call:
pytestFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Test Guided Bug Detector loads about 2.8k tokens when it runs, and up to ~8.3k if it reads all its reference files. Until then it costs about 115 tokens; SKILL.md has 586 words of instructions outside code blocks.
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.
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.
The full file from ArabelaTso/Skills-4-SE at commit 4f38503, republished under its Apache-2.0 licence (© ArabelaTso). 586 words, ~2,755 tokens.
.claude/skills/test-guided-bug-detector/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.Analyze failing tests to detect and explain functional bugs in code.
When tests fail, they provide valuable clues about bugs in the code. This skill analyzes:
The goal is to identify the root cause bug and explain why the test exposes it.
Failing Test Output
↓
Parse Failure Information
↓
Identify Test Expectations
↓
Trace Execution Path
↓
Analyze Discrepancy
↓
Identify Suspicious Code
↓
Explain Bug Mechanism
↓
Suggest FixExtract key information from test output:
What to extract:
Example:
FAILED tests/test_calculator.py::test_divide - AssertionError: assert 0 == 5
Expected: 5
Actual: 0
Stack trace:
File "tests/test_calculator.py", line 15, in test_divide
assert divide(10, 2) == 5
File "src/calculator.py", line 8, in divide
return a // bDetermine what the test is trying to verify:
Questions to answer:
Example:
def test_divide():
# Intent: Verify division returns correct result
result = divide(10, 2)
assert result == 5 # Expects 10 / 2 = 5Follow the code path from test to failure:
Trace elements:
Example trace:
test_divide()
→ divide(10, 2)
→ return a // b (integer division)
→ returns 5
→ assert 5 == 5 ✓ Should pass!Find where expected and actual diverge:
Common discrepancies:
Example:
# Expected: 10 / 2 = 5.0
# Actual: 10 // 2 = 5 (but test got 0?)
# Discrepancy: Something else is wrong!Examine code for bug patterns:
Bug patterns to check:
Example analysis:
def divide(a, b):
result = 0 # BUG: Initialized but never updated!
return a // b # This line is unreachable? No, wait...
# Actually, this returns correctly, but...Describe how the bug causes the failure:
Explanation structure:
Propose concrete fix with explanation:
Fix components:
For detailed bug patterns and detection strategies, see references/bug_patterns.md.
Categories include:
For analyzing different types of test failures, see references/failure_types.md.
Failure types:
Input: Failing test
# Test file: tests/test_list_utils.py
def test_remove_duplicates():
input_list = [1, 2, 2, 3, 3, 3, 4]
result = remove_duplicates(input_list)
assert result == [1, 2, 3, 4]
assert input_list == [1, 2, 2, 3, 3, 3, 4] # Original unchanged
# Test output:
# FAILED - AssertionError: assert [1, 2, 3, 4] == [1, 2, 2, 3, 3, 3, 4]
# The second assertion failed!
# Implementation: src/list_utils.py
def remove_duplicates(lst):
seen = set()
i = 0
while i < len(lst):
if lst[i] in seen:
lst.pop(i) # BUG: Modifies input list!
else:
seen.add(lst[i])
i += 1
return lstOutput: Bug analysis
# Bug Analysis Report
## Test Failure Summary
**Test:** test_remove_duplicates
**Location:** tests/test_list_utils.py:2
**Failure Type:** Assertion failure
**Failed Assertion:** `assert input_list == [1, 2, 2, 3, 3, 3, 4]`
## Expected vs Actual
**Expected:** Original list unchanged: `[1, 2, 2, 3, 3, 3, 4]`
**Actual:** Original list modified: `[1, 2, 3, 4]`
## Root Cause
**Bug Location:** src/list_utils.py:7
**Bug Type:** Unintended side effect (input mutation)
**Problematic Code:**
```python
lst.pop(i) # Modifies the input list directlylst.pop(i)lst
affect the original input_listtest_remove_duplicates()
input_list = [1, 2, 2, 3, 3, 3, 4]
↓
remove_duplicates(input_list) # lst points to same list as input_list
i=0: lst[0]=1, not in seen, add to seen, i=1
i=1: lst[1]=2, not in seen, add to seen, i=2
i=2: lst[2]=2, in seen, lst.pop(2) # Removes from input_list!
# Now lst = input_list = [1, 2, 3, 3, 3, 4]
i=2: lst[2]=3, not in seen, add to seen, i=3
i=3: lst[3]=3, in seen, lst.pop(3) # Removes from input_list!
# Now lst = input_list = [1, 2, 3, 3, 4]
i=3: lst[3]=3, in seen, lst.pop(3) # Removes from input_list!
# Now lst = input_list = [1, 2, 3, 4]
i=3: lst[3]=4, not in seen, add to seen, i=4
return lst # Returns [1, 2, 3, 4]
↓
result = [1, 2, 3, 4] ✓ First assertion passes
input_list = [1, 2, 3, 4] ✗ Second assertion fails!lst.pop(i) # Direct mutation of inputSuspicion Level: HIGH Reason: Modifies input list, violating immutability expectation
return lst # Returns reference to modified inputSuspicion Level: MEDIUM Reason: Returns same object as input, not a new list
Option 1: Create a copy (Recommended)
def remove_duplicates(lst):
result = [] # Create new list
seen = set()
for item in lst:
if item not in seen:
seen.add(item)
result.append(item)
return resultWhy this fixes it:
Option 2: Explicit copy
def remove_duplicates(lst):
lst = lst.copy() # Work on a copy
seen = set()
i = 0
while i < len(lst):
if lst[i] in seen:
lst.pop(i)
else:
seen.add(lst[i])
i += 1
return lstWhy this fixes it:
lst.copy() creates a shallow copyTo verify the fix:
pytest tests/test_list_utils.py::test_remove_duplicatesdef test_remove_duplicates_immutable():
original = [1, 2, 2, 3]
original_copy = original.copy()
result = remove_duplicates(original)
assert original == original_copy # Verify no mutationThis bug could affect:
remove_duplicates doesn't modify inputremove_duplicates
## Analysis Strategies
For detailed analysis strategies by language and framework, see [references/analysis_strategies.md](references/analysis_strategies.md).
Strategies include:
- Python (pytest, unittest)
- JavaScript (Jest, Mocha)
- Java (JUnit)
- C/C++ (Google Test)
- Go (testing package)
## Best Practices
1. **Start with the failure message** - It often points directly to the bug
2. **Understand test intent** - Know what should happen
3. **Trace execution carefully** - Follow the actual code path
4. **Look for common patterns** - Many bugs follow known patterns
5. **Consider edge cases** - Bugs often hide at boundaries
6. **Check assumptions** - Verify what the code assumes
7. **Explain clearly** - Make the bug mechanism understandable
## Red Flags
Watch for these suspicious patterns:
**High-priority red flags:**
- Uninitialized variables
- Missing return statements
- Wrong operators (== vs =, // vs /)
- Off-by-one errors (< vs <=)
- Null/None without checks
- Mutable default arguments
- Side effects in pure functions
**Medium-priority warnings:**
- Complex conditionals
- Nested loops with breaks
- Exception swallowing
- Type conversions
- Global state access
## Report Template
```markdown
# Bug Analysis Report
## Test Failure Summary
- Test name and location
- Failure type
- Failed assertion/error
## Expected vs Actual
- What should happen
- What actually happened
## Root Cause
- Bug location (file:line)
- Bug type
- Problematic code snippet
## Bug Mechanism
- Step-by-step explanation
- Why it's wrong
- How test exposes it
## Execution Trace
- Detailed trace from test to failure
- Variable values at key points
## Suspicious Code Regions
- Primary suspects with evidence
- Secondary suspects
## Recommended Fix
- Proposed code change
- Explanation of why it fixes the bug
- How to verify
## Related Issues
- Other code that might be affectedFor detailed guidance:
© ArabelaTso, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 3 other files (references) in skills/test-guided-bug-detector of ArabelaTso/Skills-4-SE.
Open the folder on GitHubat commit 4f38503
Test Guided Bug Detector 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.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Test Guided Bug Detector this skillArabelaTso/Skills-4-SE | 253 | — | ~2.8k | Automated safety check: Pass | Apache-2.0 | |
| Root Cause Debuggingjsmastery-pro/skills | 1.4k | — | ~1.8k | Automated safety check: Notes | MIT | |
| Superpowers Systematic Debuggingchristopherarter/superpowers-reasonix | 102 | — | ~2k | Automated safety check: Pass | MIT | |
| Minimal Code Fixcobusgreyling/loop-engineering | 11k | 1 repos | ~345 | Automated safety check: Notes | MIT | |
| Failure Diagnosis LoopTotoro-jam/battle-tested-patterns | 344 | — | ~319 | Automated safety check: Pass | MIT | |
| Hypothesis-Driven DebuggingLichAmnesia/lich-skills | 234 | — | ~2.5k | Automated safety check: Pass | MIT |
jsmastery-pro/skills
Runs a reproduce, localize, hypothesize, test, fix and verify loop to find a bug's root cause, applies the minimal fix and hands off a regression test.
christopherarter/superpowers-reasonix
Any bug, failing or flaky test, or surprise behavior?. An agent skill from christopherarter/superpowers-reasonix.
cobusgreyling/loop-engineering
Makes the smallest code change that fixes one well-scoped problem, such as a CI failure, review comment or typo, without refactoring anything unrelated.
Totoro-jam/battle-tested-patterns
Walks the agent through a fixed loop for failing tests and build errors: reproduce, isolate, hypothesize, instrument, fix, verify, then add a regression test.
LichAmnesia/lich-skills
Replaces trial-and-error fixing with an observe, hypothesize, experiment and conclude loop kept in DEBUG.md, where no fix is allowed before evidence supports a cause.
cbrock84/headcount
Finds the root cause of a bug, test failure, or unexpected behavior before proposing any fix.
ArabelaTso/Skills-4-SE
Generate prioritized CVE watchlists and actionable security recommendations for repositories.
ArabelaTso/Skills-4-SE
Automatically migrate Python web applications between frameworks (Flask → FastAPI, Django → FastAPI).
ArabelaTso/Skills-4-SE
Generate test cases using metamorphic testing by applying transformations based on metamorphic properties.
ArabelaTso/Skills-4-SE
Instruments programs to capture execution traces specifically for reproducing reported bugs, enabling consistent replay and diagnosis of failures.
ArabelaTso/Skills-4-SE
Automatically migrate Spring MVC applications to Spring Boot.
ArabelaTso/Skills-4-SE
Instrument programs (Python, C/C++, Java) to capture snapshots of key program states at runtime, including variables, memory, and call stacks.
Categories
Analyze failing tests to detect functional bugs in code. An agent skill from ArabelaTso/Skills-4-SE. Test Guided Bug Detector is an agent skill from ArabelaTso/Skills-4-SE. Analyze failing tests to detect functional bugs in code.
Test Guided Bug Detector fits situations like: debugging test failures; investigating regression bugs; understanding why tests fail.
Run `npx skills add ArabelaTso/Skills-4-SE --skill test-guided-bug-detector -a claude-code`. Or copy the skill folder (skills/test-guided-bug-detector in ArabelaTso/Skills-4-SE) into .claude/skills/test-guided-bug-detector in your project. Claude Code loads it when a task matches its description.
Run `npx skills add ArabelaTso/Skills-4-SE --skill test-guided-bug-detector -a codex`. Or copy the skill folder (skills/test-guided-bug-detector in ArabelaTso/Skills-4-SE) into .agents/skills/test-guided-bug-detector in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ArabelaTso/Skills-4-SE --skill test-guided-bug-detector -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-guided-bug-detector, .gemini/skills/test-guided-bug-detector, .github/skills/test-guided-bug-detector and .opencode/skills/test-guided-bug-detector in your project.
Going by SKILL.md and its folder, Test Guided Bug Detector needs the command-line tools its instructions call (pytest). Our summary lists: Python 3.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
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.
Test Guided Bug Detector is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.8k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 5.5k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Test Guided Bug Detector: Root Cause Debugging (jsmastery-pro/skills, 1.4k stars), Superpowers Systematic Debugging (christopherarter/superpowers-reasonix, 102 stars), Minimal Code Fix (cobusgreyling/loop-engineering, 11k stars) and Failure Diagnosis Loop (Totoro-jam/battle-tested-patterns, 344 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
ArabelaTso (a GitHub user) maintains it in ArabelaTso/Skills-4-SE, which has 253 GitHub stars. The repository holds 150 skills in this directory. The repository was last updated on August 21, 2026.
Source: ArabelaTso/Skills-4-SE on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.