commit-analysis

SKILL.md

Commit Analysis & Regression Detection

Overview

Automated tools for detecting regressions and analyzing code changes:

Tool Purpose Speed
scripts/smart_commit_analyzer.py Auto-evolving regression detection Fast
scripts/analyze_commits_ai.py AI semantic analysis (DeepSeek) Slow
scripts/analyze_git_changes.py Git history statistics Fast

Recommended Tool: smart_commit_analyzer.py

This is the primary regression detection tool. Rules are automatically generated from git history.

Commands

# Full analysis (update rules + validate)
python3 scripts/smart_commit_analyzer.py

# Update rules only (scan git for new fixes)
python3 scripts/smart_commit_analyzer.py --update

# Validate only (check existing rules)
python3 scripts/smart_commit_analyzer.py --validate

# Show all rules
python3 scripts/smart_commit_analyzer.py --show-rules

# JSON output (for CI/CD)
python3 scripts/smart_commit_analyzer.py --json

Expected Output

๐Ÿ” Smart Commit Analyzer
============================================================

Step 1: ไปŽ Git ๅކๅฒๆ›ดๆ–ฐ่ง„ๅˆ™ๅบ“...
๐Ÿ“Š ๆ‰ซๆๅˆฐ 78 ไธชไฟฎๅคๆไบค
โœ… ๆ–ฐๅขž 5 ๆก่ง„ๅˆ™

Step 2: ้ชŒ่ฏๆ‰€ๆœ‰่ง„ๅˆ™...

============================================================
๐Ÿ“‹ ้ชŒ่ฏ็ป“ๆžœ
============================================================
โœ… ้€š่ฟ‡: 70
โŒ ๅคฑ่ดฅ: 2
โš ๏ธ  ่ญฆๅ‘Š: 3
โญ๏ธ  ่ทณ่ฟ‡: 0

How It Works

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Step 1: git log --grep="fix"                           โ”‚
โ”‚          โ†’ Auto-discover all fix commits                โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                            โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Step 2: git show <commit> -- <file>                    โ”‚
โ”‚          โ†’ Extract key code patterns from diffs         โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                            โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Step 3: Save to configs/auto_generated_rules.json      โ”‚
โ”‚          โ†’ Rules auto-grow with new fix commits         โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                            โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Step 4: Validate all rules                             โ”‚
โ”‚          โ†’ Detect regressions (missing patterns)        โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

AI Deep Analysis (Optional)

Requires DEEPSEEK_API_KEY environment variable.

# Analyze last 10 commits with AI
python3 scripts/analyze_commits_ai.py --commits 10

# JSON output
python3 scripts/analyze_commits_ai.py --commits 10 --json

Git History Analysis

# Analyze last 50 commits
python3 scripts/analyze_git_changes.py

# Show only fix commits
python3 scripts/analyze_git_changes.py --fix-only

# Analyze more commits
python3 scripts/analyze_git_changes.py --commits 100

GitHub Actions Integration

These tools run automatically on every push/PR via .github/workflows/commit-analysis.yml:

Job Tool Trigger
Smart Regression Detection scripts/smart_commit_analyzer.py Always
AI Deep Analysis scripts/analyze_commits_ai.py If DEEPSEEK_API_KEY set

Key Files

File Purpose
scripts/smart_commit_analyzer.py Main regression detection tool
configs/auto_generated_rules.json Auto-generated validation rules
scripts/analyze_commits_ai.py AI-powered analysis
scripts/analyze_git_changes.py Git history parser
.github/workflows/commit-analysis.yml GitHub Actions workflow

When to Run

  • Before committing: python3 scripts/smart_commit_analyzer.py
  • Before merging PR: Automatic via GitHub Actions
  • After pulling updates: python3 scripts/smart_commit_analyzer.py --validate
  • Investigating regressions: python3 scripts/smart_commit_analyzer.py --show-rules

Interpreting Results

Status Meaning Action
โœ… Passed Pattern found in code None
โŒ Failed Pattern missing (potential regression) Investigate
โš ๏ธ Warning Pattern may have been refactored Review
โญ๏ธ Skipped File not found (renamed/deleted) Update rules
Weekly Installs
10
GitHub Stars
1
First Seen
Feb 11, 2026
Installed on
amp10
gemini-cli10
github-copilot10
codex10
kimi-cli10
opencode10