Skip to content
Skills Library
Programming · Analysis

commit-detection

/commit-detection

Detects optimal commit type from git changes. Use when analyzing commits, determining commit type, or before committing.

Repository
agents ↗
Licence
MIT
Last repository change
12.10.2026

Assessment and security

95/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content30 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 12.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Detects optimal commit type from git changes. Use when analyzing commits, determining commit type, or before committing.

Original author description

Detects optimal commit type from git changes. Use when analyzing commits, determining commit type, or before committing.

How it works

  1. Detection Algorithm
  2. Quick Reference
  3. Post-Commit Actions
  4. Examples
Original SKILL.md headings · 125 lines, 487 words
SKILL.md preview
---
name: commit-detection
description: Detects optimal commit type from git changes. Use when analyzing commits, determining commit type, or before committing.
allowed-tools: Bash, Read, Grep
---

<objective>
Detects the optimal conventional commit type (feat/fix/docs/style/refactor/perf/test/build/ci/chore) from staged and unstaged git changes, using file-pattern categorization (docs/test/config/ci/build/src) plus diff-keyword heuristics ("fix", "bug", "optimize", etc.), and derives a scope suggestion from the primary changed directory (e.g. `src/api/auth.ts` → `auth`). Covers the full detection algorithm, the rule cascade, scope extraction, and worked examples. Does not perform the commit itself — routes to the matching `/commit-pro:<type>` command, or to the `commit` skill for full smart analysis when no rule matches cleanly.
</objective>

# Commit Type Detection Skill

Expert knowledge for detecting the optimal conventional commit type.

## Detection Algorithm

### Step 1: Gather Data

```bash
# Get modified files
git diff --name-only
git diff --staged --name-only

# Get change statistics
git diff --stat
git diff --staged --stat

# Check for keywords in diff
git diff | grep -i "fix\|bug\|error" | head -5
```

### Step 2: Categorize Files

| Category | File Patterns |
|----------|---------------|
| docs | `*.md`, `*.txt`, `*.rst`, `README*`, `CHANGELOG*` |
| test | `*.test.*`, `*.spec.*`, `__tests__/*`, `test/*` |
| config | `*.json`, `*.yml`, `*.yaml`, `*.toml`, `.*rc` |
| ci | `.github/*`, `.gitlab-ci.yml`, `Jenkinsfile` |
| build | `package.json`, `Makefile`, `webpack.*`, `vite.*` |
| style | Only whitespace, formatting changes |
| src | `*.ts`, `*.js`, `*.py`, `*.go`, `*.rs`, etc. |

### Step 3: Apply Rules

```
IF only docs files changed:
  → docs

IF only test files changed:
  → test

IF only config/build files changed:
  → chore

IF only CI files changed:
  → ci

IF diff contains "fix", "bug", "error", "issue", "resolve":
  → fix

IF new files added with business logic:
  → feat

IF files renamed/moved without logic change:
  → refactor

IF performance keywords ("optimize", "perf", "speed", "cache"):
  → perf

IF formatting only (whitespace, semicolons):
  → style

DEFAULT:
  → Use /commit-pro:commit for smart analysis
```

### Step 4: Determine Scope

Extract scope from primary directory:

```
src/components/Button.tsx → ui or button
src/api/auth.ts → auth
lib/utils/date.ts → utils
server/routes/user.ts → user
```

## Quick Reference

| Type | When | Version Bump |
|------|------|-------------|
| `feat` | New functionality | PATCH |
| `fix` | Bug correction | PATCH |
| `docs` | Documentation only | PATCH |
| `style` | Formatting only | PATCH |
| `refactor` | Code restructure | PATCH |
| `perf` | Performance | PATCH |
| `test` | Tests only | PATCH |
| `build` | Build/deps | PATCH |
| `ci` | CI/CD config | PATCH |
| `chore` | Maintenance | PATCH |

> MINOR/MAJOR bumps are **manual user decisions**, never automatic.

## Post-Commit Actions

See the `post-commit` skill for universal CHANGELOG, version bump, and tag logic (works for all repos).

## Examples

**Example 1: Only README changed**
```
Files: README.md
→ /commit-pro:docs
```

**Example 2: New component + test**
```
Files: src/Button.tsx, src/Button.test.tsx
→ /commit-pro:feat (primary is new feature)
```

**Example 3: Fix in existing file**
```
Files: src/api/auth.ts
Diff contains: "fix login bug"
→ /commit-pro:fix
```

Versions

The database has no other skills named commit-detection.

Database snapshot: 13.11.2026 · package version d505b22995d4 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100commit
    Write a commit message and create a git commit. Use when the user wants to commit changes, asks for a commit message, or says "commit this" or "make a commit".
  • 100git-commit
    Use this skill when user asks to "commit changes", "create a commit", "stage and commit", or wants help with git commit workflow.
  • 100at-commit
    Generate a Conventional Commits message from staged changes and wait for confirmation before committing. Use when the user asks to commit or generate a commit message.
  • 100git-commit
    Execute git commit with conventional commit message analysis, intelligent staging, and message generation. Use when user asks to commit changes, create a git commit, or mentions "/commit". Supports: (1) Auto-detecting type and scope from changes, (2) Creating a feature branch…
  • 100commit-message
    Generate conventional commit messages - use when creating commits, writing commit messages, or asking for git commit help
  • 100conventional-commit-gen
    Analyzes git diff to generate commit messages following the Conventional Commits spec, with automatic scope detection and commit type inference. Trigger when users ask to write or generate a commit message, mention Conventional Commits, git commits, standardized commits, scope…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.