arabelatso/szz-bug-introducing-commit-identifier
Identifies bug-introducing commits using SZZ-style analysis based on bug-fixing commits, commit history, and code blame information. Use this skill when you need to trace bugs back to their origin, identify which commits introduced bugs, analyze bug-fix commits to find root causes, perform software repository mining for bug analysis, or conduct empirical studies on software defects. Triggers when users ask to find bug-introducing commits, identify when a bug was introduced, trace bug origins, perform SZZ analysis, or analyze bug-fixing commits.
npx skills add https://github.com/ArabelaTso/Skills-4-SE --skill szz-bug-introducing-commit-identifier
This skill performs SZZ (Śliwerski-Zimmermann-Zeller) algorithm analysis to identify bug-introducing commits in git repositories. Given a bug-fixing commit, it traces modified lines back through version history using git blame to find candidate commits that originally introduced the buggy code.
Start by identifying the commit that fixes the bug. This can be obtained from:
Use the provided script to perform the analysis:
python scripts/szz_analyzer.py <fix-commit-hash>
Options:
--repo <path>: Specify repository path (default: current directory)--json: Output results in JSON format for programmatic processing--top <n>: Number of top candidates to show (default: 10)Example:
python scripts/szz_analyzer.py abc123def --repo /path/to/repo --top 5
The script outputs a ranked list of candidate bug-introducing commits with:
Always manually review the top candidates:
High Confidence (0.8-1.0):
Medium Confidence (0.5-0.8):
Low Confidence (0.0-0.5):
The script automatically filters common false positives:
Automatically Filtered Lines:
Reduced Confidence for:
User: "Find which commit introduced the bug fixed in commit abc123"
→ Run: python scripts/szz_analyzer.py abc123
→ Review top candidates and examine their changes
User: "Who introduced the authentication bug?"
→ First identify the fix commit
→ Run SZZ analysis
→ Check the author field of top candidates
User: "Analyze all bug-introducing commits from the last release"
→ Identify all bug-fix commits
→ Run SZZ analysis on each
→ Aggregate results to find patterns
User: "Generate dataset of bug-introducing commits for analysis"
→ Run SZZ analysis with --json flag
→ Process JSON output for statistical analysis
Use JSON output for integration with other tools:
import subprocess
import json
result = subprocess.run(
['python', 'scripts/szz_analyzer.py', 'abc123', '--json'],
capture_output=True,
text=True
)
candidates = json.loads(result.stdout)
for candidate in candidates:
print(f"{candidate['commit_hash']}: {candidate['confidence_score']}")
Analyze multiple bug fixes:
for commit in $(git log --grep="fix:" --format="%H"); do
echo "Analyzing fix: $commit"
python scripts/szz_analyzer.py $commit --top 3
done
The main analysis script that performs SZZ algorithm implementation. It:
Comprehensive documentation on the SZZ algorithm including:
Read this reference when you need deeper understanding of the algorithm, want to customize filtering heuristics, or need to explain the methodology to users.
Take arabelatso/szz-bug-introducing-commit-identifier from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.