Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

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от 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 fixes
  • bugfix: - Explicit bug fixes
  • hotfix: - Urgent production fixes
  • patch: - Small fixes
  • revert: - Reverting broken changes
  • security: - Security fixes

Exclude types (not fixes):

  • feat: - New features
  • docs: - Documentation
  • chore: - Maintenance tasks
  • style: - Formatting, no logic change
  • refactor: - Code restructuring, no behavior change
  • test: - Test additions
  • build: - Build system changes
  • ci: - CI/CD configuration
  • perf: - 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:

  1. Files changed: Which modules/components affected
  2. Code patterns: What types of changes made
  3. Logic changes: What behavior was modified
  4. 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
Полный SKILL.md на GitHub

Установить Commit Analysis в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/pattern-detection.md

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), без исполняемых скриптов.

Похожие скиллы

Сравнить Commit Analysis с