Skip to content

Instantly share code, notes, and snippets.

@alisherafat01
Created December 8, 2025 16:06
Show Gist options
  • Select an option

  • Save alisherafat01/9991eeb4aeece68429a36fdd416b285d to your computer and use it in GitHub Desktop.

Select an option

Save alisherafat01/9991eeb4aeece68429a36fdd416b285d to your computer and use it in GitHub Desktop.

Auto Commit Conventional

Analyze all git changes and categorize them into separate conventional commits following the conventional commit format.

What this command does:

  1. Analyzes all unstaged and staged git changes
  2. Categorizes changes by file type and path
  3. Groups related files together
  4. Creates multiple conventional commits with proper scopes and messages
  5. Uses conventional commit format: type(scope): message

Commit Types:

  • feat: New features (pages, components, hooks, API endpoints)
  • fix: Bug fixes
  • refactor: Code refactoring
  • chore: Dependencies, config files, tooling
  • style: CSS/styling changes
  • docs: Documentation changes
  • test: Test files

Example Usage:

Just invoke this command in chat: "run auto-commit-conventional" or "@auto-commit-conventional"

Implementation:

When invoked, this command will:

  1. Check git status for all changed files
  2. Categorize each file into commit groups based on:
    • File path patterns
    • File type (page, component, hook, API, etc.)
    • File purpose (auth, error handling, UI, etc.)
  3. Display grouped changes before committing
  4. Create separate commits for each category
  5. Use one-line conventional commit format
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment