Commit Analysis
БесплатноБез исполняемых скриптовНе проверенThis skill should be used when the user asks to "analyze commits", "identify fix patterns", "detect code issues from commits", "git commit analysis", "parse…
от shfc★ 16 звёзд на GitHubОб этом скилле
Commit Analysis for Problem Pattern Detection
This skill provides techniques for analyzing git commits to identify bug fix patterns, extract root causes, and detect similar issues in code changes.
Purpose
Commit analysis transforms raw git history into actionable insights by:
- Identifying which commits represent bug fixes vs. features
- Extracting problem patterns from fix commits
- Understanding root causes from code changes
- Detecting similar patterns in new code changes
- Building knowledge bases from historical fixes
Commit Identification Strategy
Two-Stage Filtering
Use a two-stage approach to identify fix-related commits:
Stage 1: Shell-based filtering
- Fast, deterministic filtering using commit message patterns
- Excludes obvious non-fix commits (feat, docs, chore, style, refactor, test, build, ci, perf)
- Includes commits with fix-related keywords if configured
Stage 2: AI analysis
- Analyze commit messages and diffs to confirm actual fixes
- Distinguish between bug fixes, workarounds, and refactorings
- Identify root cause from changes made
Conventional Commit Pattern Recognition
Parse conventional commit format: type(scope): subject
Common fix types:
fix:- Bug fixesbugfix:- Explicit bug fixeshotfix:- Urgent production fixespatch:- Small fixesrevert:- Reverting broken changessecurity:- Security fixes
Exclude types (not fixes):
feat:- New featuresdocs:- Documentationchore:- Maintenance tasksstyle:- Formatting, no logic changerefactor:- Code restructuring, no behavior changetest:- Test additionsbuild:- Build system changesci:- CI/CD configurationperf:- Performance improvements (not fixes)
Keyword-Based Detection
When commit messages don't follow conventional format, look for keywords:
Strong fix indicators:
- fix, fixes, fixed, fixing
- bug, bugfix
- issue, resolve, resolves, resolved
- hotfix, patch
- crash, error, failure
- broken, break
Context-dependent indicators:
- handle, prevent (may indicate defensive coding, not necessarily fixing existing bug)
- improve, update (could be enhancement or fix)
- correct, adjust (likely fixes)
AI analysis needed: When keywords are ambiguous, examine the diff to determine if it's fixing existing broken behavior or adding new functionality.
Commit Diff Analysis
Structure of Analysis
For each commit identified as potential fix, analyze:
- Files changed: Which modules/components affected
- Code patterns: What types of changes made
- Logic changes: What behavior was modified
- Test changes: What test coverage was added
Identifying Root Cause from Diff
Added Validation or Bounds Checking
Pattern: New if statements, assertions, or checks added
+ if (index < 0 || index >= array.length) {
+ throw new Error("Index out of bounds");
+ }
return array[index];
Root cause: Missing input validation or boundary check
Fixed Null/Undefined Handling
Pattern: Added null checks, optional chaining, or default values
- const name = user.profile.name;
+ const name = user?.profile?.name ?? "Unknown";
Root cause: Null pointer/undefined access
Corrected Logic or Algorithm
Pattern: Changed comparison operators, loop conditions, or calculations
- if (count > threshold) {
+ if (count >= threshold) {
Root cause: Logic error, off-by-one error
Added Synchronization or Locking
Pattern: Added mutexes, locks, or atomic operations
+ mutex.lock();
shared_resource.update();
+ mutex.unlock();
Root cause: Race condition or concurrency issue
Fixed Error Handling
Pattern: Added try-catch, error checking, or improved error propagation
try {
perform_operation();
+ } catch (SpecificError e) {
+ handle_error(e);
+ throw new UserFriendlyError("Operation failed");
}
Root cause: Missing or inadequate error handling
Corrected API Usage
Pattern: Changed function calls, parameter order, or API contracts
- api.call(data, callback, options);
+ api.call(data, options, callback);
Root cause: API misuse or misunderstanding
Fixed Resource Management
Pattern: Added resource cleanup, close operations, or lifecycle management
const file = open(path);
process(file);
+ file.close();
Root cause: Resource leak
Pattern Detection
Common Problem Patterns
Identify recurring patterns across fix commits:
1. Input Validation Issues
Symptoms:
- Added bounds checking
- Added type validation
- Added format verification
Pattern signature:
# Check for additions like:
if not validate_input(x):
raise ValueError()
2. Null/None Safety Issues
Symptoms:
- Added null checks
- Added default values
- Changed to safe navigation
Pattern signature:
# Check for c
Установить Commit Analysis в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл Commit Analysis?
This skill should be used when the user asks to "analyze commits", "identify fix patterns", "detect code issues from commits", "git commit analysis", "parse commit history", or needs guidance on analyzing git commits to extract problem patterns and generate postmortem insights.
Как установить скилл Commit Analysis?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Commit Analysis запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic