git-bisect-debugging
БесплатноЗапускает вложенные скриптыНе проверенThis skill should be used when the user asks to "find which commit broke this", "debug a regression", "bisect to find the bug", or says "this used to work"…
от sjungling★ 15 звёзд на GitHubОб этом скилле
Git Bisect Debugging
Overview
Systematically identify which commit introduced a bug or regression using git bisect. Binary search through commit history to find the exact commit that introduced the issue. Main agent orchestrates, subagents execute verification at each step.
Announce at start: "I'm using git-bisect-debugging to find which commit introduced this issue."
Quick Reference
| Phase | Key Activities | Output |
|---|---|---|
| 1. Setup & Verification | Identify good/bad commits, verify clean state | Confirmed commit range |
| 2. Strategy Selection | Choose automated/manual/hybrid approach | Test script or verification steps |
| 3. Execution | Run bisect with subagents | First bad commit hash |
| 4. Analysis & Handoff | Show commit details, analyze root cause | Root cause understanding |
Limitations (By Design)
This skill focuses on straightforward scenarios. It does NOT handle:
- Complex merge commit issues (would need
--first-parent) - Flaky/intermittent test failures (would need statistical approaches)
- Build system failures across many commits (would need advanced skip strategies)
For these scenarios, manual git bisect with user guidance is recommended.
Rules
Announce the skill and track the four phases in a checklist. Then:
- Phase 1: confirm the working directory is clean and the good commit is verified good and the bad commit verified bad. A bisect over a wrong range wastes the whole run; if a check fails, fix it before proceeding.
- Phase 2: ask the user which strategy to use (automated, manual, hybrid) rather than defaulting to automated.
- Phase 3: test each commit in an isolated subagent so the main context stays clean.
- Phase 4: after finding the bad commit, hand off to systematic-debugging to investigate root cause, not just what changed.
The Process
Copy this checklist to track progress:
Git Bisect Progress:
- [ ] Phase 1: Setup & Verification (good/bad commits identified)
- [ ] Phase 2: Strategy Selection (approach chosen, script ready)
- [ ] Phase 3: Execution (first bad commit found)
- [ ] Phase 4: Analysis & Handoff (root cause investigation complete)
Phase 1: Setup & Verification
Purpose: Ensure git bisect is appropriate and safe to run.
Steps:
Verify prerequisites:
- Verify the current directory is a git repository
- Verify working directory is clean (
git status) - If uncommitted changes exist, abort and ask user to commit or stash
Identify commit range:
- Ask user for good commit (where it worked)
- Suggestions: last release tag, last passing CI, commit from when it worked
- Commands to help:
git log --oneline,git tag,git log --since="last week"
- Ask user for bad commit (where it is broken)
- Usually:
HEADor a specific commit where issue is confirmed
- Usually:
- Calculate estimated steps: ~log2(commits between good and bad)
- Ask user for good commit (where it worked)
Verify the range:
- Checkout bad commit and verify issue exists
- Checkout good commit and verify issue does not exist
- If reversed, offer to swap them
- Return to original branch/commit
Safety checks:
- Warn if range is >1000 commits (ask for confirmation)
- Verify good commit is ancestor of bad commit
- Note current branch/commit for cleanup later
Output: Confirmed good commit hash, bad commit hash, estimated steps
Phase 2: Strategy Selection
Purpose: Choose the most efficient bisect approach.
Assessment: Determine whether an automated test script can deterministically identify good vs bad.
MANDATORY: Use AskUserQuestion to present three approaches:
- Automated -- test script runs automatically (best for: test failures, crashes, deterministic behavior)
- Manual -- user verifies each commit (best for: UI/UX changes, subjective issues)
- Hybrid -- script + manual confirmation (best for: mostly automated with judgment calls)
If automated or hybrid selected:
Write a test script following the template at ./scripts/bisect-test-template.sh. Key guidelines:
- Make it deterministic (no random data, use fixed seeds)
- Make it fast (runs ~log2(N) times)
- Exit codes: 0 = good, 1 = bad, 125 = skip
- Include build/setup (each commit might need different deps)
- Test ONE specific thing, not the entire suite
If manual selected:
Write specific verification steps for the subagent with concrete actions and expected outcomes. Avoid vague instructions like "see if it works."
Output: Selected approach, test script or verification steps
Phase 3: Execution
Architecture: Main agent orchestrates bisect, subagents verify each commit in isolated context.
For detailed subagent prompt templates and error handling patterns, see ./references/execution-patterns.md.
Execution summary:
- Run
git bisect start <bad> <good> - Loop: launch subagent via Task tool to verify current commit -> report good/bad/skip -> ru
Установить git-bisect-debugging в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл git-bisect-debugging?
This skill should be used when the user asks to "find which commit broke this", "debug a regression", "bisect to find the bug", or says "this used to work". Automatically activates for performance regressions, test failures that appeared recently, or any issue known to have worked at a previous commit. Can be invoked from systematic-debugging or used standalone. Not for general debugging without a known-good commit or regression history.
Как установить скилл git-bisect-debugging?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл git-bisect-debugging запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic