본문으로 건너뛰기
cccskills
무료GitHub에 공개

git-bisect-assistant

Automatically performs git bisect to identify the first bad commit that introduced a bug or failure. Use when debugging regressions, tracking down when a test started failing, or identifying which commit broke functionality. Handles flaky tests with retry logic and provides comprehensive reports with bisect logs and confidence levels.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(2)

  • SKILL.md4.7 KB
  • scripts/git_bisect_runner.py8.0 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Git Bisect Assistant

Automates the git bisect process to efficiently identify the first bad commit responsible for a bug or test failure.

Quick Start

Basic usage pattern:

python scripts/git_bisect_runner.py \
  --good <known-good-commit> \
  --bad <known-bad-commit> \
  --test "<test-command>"

Example:

python scripts/git_bisect_runner.py \
  --good v1.0.0 \
  --bad HEAD \
  --test "pytest tests/test_feature.py::test_specific_case"

Workflow

  1. Gather Information

    • Identify the known good revision (commit, tag, or branch)
    • Identify the known bad revision (defaults to HEAD)
    • Determine the test command that fails on bad commits and passes on good commits
  2. Run Bisect

    • Execute the git_bisect_runner.py script with appropriate parameters
    • The script will automatically test commits and narrow down the culprit
  3. Review Results

    • Examine the identified bad commit
    • Review the bisect log showing all tested commits
    • Check confidence level and assumptions

Parameters

Required

  • --good: Known good revision (commit hash, tag, or branch name)
  • --test: Shell command to test each commit. Exit code 0 = good, non-zero = bad

Optional

  • --bad: Known bad revision (default: HEAD)
  • --repo: Repository path (default: current directory)
  • --retries: Number of test runs per commit for flaky tests (default: 1)
  • --timeout: Test execution timeout in seconds (default: no timeout)

Handling Flaky Tests

For non-deterministic tests, use --retries to run the test multiple times per commit:

python scripts/git_bisect_runner.py \
  --good abc123 \
  --bad HEAD \
  --test "npm test" \
  --retries 3

The script uses majority voting: if a test passes 2 out of 3 times, the commit is marked as good.

Test Command Guidelines

The test command should:

  • Exit with code 0 for good commits (test passes)
  • Exit with non-zero code for bad commits (test fails)
  • Be deterministic or use --retries for flaky tests
  • Complete within reasonable time or use --timeout

Examples:

# Python test
--test "pytest tests/test_auth.py -v"

# Shell script
--test "./scripts/verify_build.sh"

# Compilation check
--test "make && ./bin/app --version"

# Multiple commands
--test "npm install && npm test"

Output Report

The script generates a comprehensive report including:

  • First Bad Commit: Hash and commit message of the culprit
  • Confidence Level: Assessment based on test stability and retry logic
  • Assumptions: Any assumptions made during bisect (retries, timeouts)
  • Tested Commits: Complete list of all commits tested with results
  • Bisect Log: Detailed log of the bisect process

Common Scenarios

Scenario 1: Test Started Failing

User: "The integration tests started failing sometime in the last 20 commits"

python scripts/git_bisect_runner.py \
  --good HEAD~20 \
  --bad HEAD \
  --test "pytest tests/integration/"

Scenario 2: Feature Broke After Release

User: "Feature X worked in v2.1.0 but is broken now"

python scripts/git_bisect_runner.py \
  --good v2.1.0 \
  --bad HEAD \
  --test "python -c 'import app; assert app.feature_x() == expected'"

Scenario 3: Flaky Test Investigation

User: "A test fails intermittently, need to find when it started"

python scripts/git_bisect_runner.py \
  --good main \
  --bad feature-branch \
  --test "pytest tests/test_flaky.py" \
  --retries 5 \
  --timeout 30

Tips

  • Ensure clean state: Commit or stash changes before running bisect
  • Fast tests: Use focused tests rather than full test suites for faster bisect
  • Build requirements: Include build steps in test command if needed
  • Dependencies: Ensure test command handles dependency installation if needed across commits
  • Timeout wisely: Set timeout slightly longer than expected test duration
  • Retry count: Use 3-5 retries for flaky tests to get reliable results

Troubleshooting

Bisect fails to start: Verify good and bad revisions exist and are valid git references

Test command fails unexpectedly: Test the command manually on a known good/bad commit first

Inconsistent results: Increase --retries or check for environmental factors affecting tests

Timeout too short: Increase --timeout or optimize test command

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Applies abstract interpretation using different abstract domains (intervals, octagons, polyhedra, sign, congruence) to statically analyze program variables and infer invariants, value ranges, and relationships. Use when analyzing program properties, inferring loop invariants, detecting potential errors, or understanding variable relationships through static analysis.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ArabelaTso/Skills-4-SE2552026년 8월 21일 업데이트

Uses abstract interpretation to automatically infer loop invariants, function preconditions, and postconditions for formal verification. Generates invariants that capture program behavior and support correctness proofs in Dafny, Isabelle, Coq, and other verification systems. Use when adding formal specifications to code, generating verification conditions, inferring contracts for functions, or discovering loop invariants for proofs.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ArabelaTso/Skills-4-SE2552026년 8월 21일 업데이트

Performs abstract interpretation over source code to infer possible program states, variable ranges, and data properties without executing the program. Reports potential runtime errors including out-of-bounds accesses, null dereferences, type inconsistencies, division by zero, and integer overflows. Use when analyzing code for potential runtime errors, performing static analysis, checking safety properties, or verifying program behavior without execution.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ArabelaTso/Skills-4-SE2552026년 8월 21일 업데이트

Performs abstract interpretation to produce summarized execution traces and high-level program behavior representations. Highlights key control flow paths, variable relationships, loop invariants, function summaries, and potential runtime states using abstract domains (intervals, signs, nullness, etc.). Use when analyzing program behavior, understanding execution paths, computing loop invariants, tracking variable ranges, detecting potential runtime errors, or generating program summaries without concrete execution.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ArabelaTso/Skills-4-SE2552026년 8월 21일 업데이트

Create ACSL (ANSI/ISO C Specification Language) formal annotations for C/C++ programs. Use this skill when working with formal verification, adding function contracts (requires/ensures), loop invariants, assertions, memory safety annotations, or any ACSL specifications. Supports Frama-C verification and generates comprehensive formal specifications for C/C++ code.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ArabelaTso/Skills-4-SE2552026년 8월 21일 업데이트

CLI-based browser automation with persistent page state using ref-based element interaction. Use when users ask to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ArabelaTso/Skills-4-SE2552026년 8월 21일 업데이트

ArabelaTso의 스킬 모두 보기

이 스킬의 문제 신고