Commit

From KilimcininKorOglu/cli-tweaks · View interactive version

Commit is an AI agent skill from the GitHub repository KilimcininKorOglu/cli-tweaks. Creates git commits with conventional commit messages: detects git state, stages explicit paths, and writes atomic type(scope): description commits. Invoke this skill for every git commit, both when the user asks ("commit", "commitle", "commit at", "commit yap", "push", "stage", "değişiklikleri comm

How to use this skill

Skill file

Commit

Creates well-formatted commits with conventional commit messages.

Usage

/commit                  # Auto-detect and handle changes
/commit --all            # Stage all changes including untracked
/commit --staged         # Only commit currently staged files
/commit --modified       # Stage and commit modified files only
/commit --no-verify      # Skip pre-commit hooks
/commit --amend          # Amend the last commit
/commit --wip            # Quick WIP commit
/commit --push           # Commit, then push (confirms before pushing)

Git Safety Protocol

Commit Message Format (Default)

Used when repo has no established style or uses conventional commits:

<type>(<scope>): <subject>

[optional body]

[optional footer(s)]

For multi-line commit messages, use HEREDOC syntax:

git commit -m "$(cat <<'EOF'
type(scope): subject line

Body paragraph explaining the why, not the what.
Additional context if needed.

Footer: value
EOF
)"

Types

| Type | Description | Example |

|------------|------------------------------------------|----------------------------------------|

| feat | New feature | feat: add user authentication |

| fix | Bug fix | fix: resolve memory leak |

| docs | Documentation | docs: update API reference |

| style | Formatting | style: format code with prettier |

| refactor | Code change (no fix/feat) | refactor: extract helper functions |

| perf | Performance | perf: optimize database queries |

| test | Tests | test: add unit tests for auth |

| chore | Maintenance | chore: update dependencies |

| ci | CI/CD changes | ci: add GitHub Actions workflow |

| security | Security fixes | security: patch XSS vulnerability |

| hotfix | Critical hotfix | hotfix: fix login crash |

| revert | Revert changes | revert: undo payment refactor |

Extended Types

Process Flow

  1. Gather Context (MANDATORY FIRST STEP): Before anything else, run these in parallel:

```bash

git status # Current state of working tree

git diff HEAD # All staged and unstaged changes

git log --oneline -10 # Recent commits for style matching

git branch --show-current # Confirm the current branch and stay on it

```

  1. Security Scan: Check changed files for secrets (.env, keys, credentials)
  2. Smart Staging Decision:
  1. Review Changes: git diff --cached --stat + git diff --cached
  2. Match Repo Style: Look at the recent git log and adopt the repo's existing style:
  1. Analyze for Logical Grouping: Check if changes belong together, suggest splitting if multiple concerns
  2. Create Commit: Use HEREDOC syntax for multi-line, simple -m for single-line
  3. Push (only if requested): Push only when the user explicitly asked (--push, or said "push" / "commit and push"). If the tree was already clean (nothing to commit), push the existing commits instead.

Smart Staging Strategy

| Situation | Action |

|----------------------|---------------------------|

| Only staged files | Commit staged files |

| Only modified files | Stage only the files for this logical change (explicit paths), then commit |

| Only untracked files | Prompt for inclusion |

| Mixed changes | Stage by logical group; ask which files belong together (never git add -i) |

| No changes | Report clean state |

Commit Rules

When to Split Commits

Options

| Option | Description | Behavior |

|-----------------|----------------------------|---------------------------|

| --all | Stage all changes | Everything incl. untracked -- use only when all changes belong in one commit |

| --staged | Commit only staged | Ignores unstaged changes |

| --modified | Stage modified only | Excludes untracked files |

| --no-verify | Skip pre-commit hooks | Bypass Husky checks |

| --amend | Modify last commit | Edit previous commit |

| --push | Commit, then push | Confirms before pushing|

| --wip | Work in progress | Quick WIP commit |

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.