Get the FREE Ultimate OpenClaw Setup Guide →
npx machina-cli add skill aztack/shrtLnk/gen-commit-msg --openclaw
Files (1)
SKILL.md
4.3 KB

Commit Grouped by Logic

Group current git changes by logic and commit them using English Conventional Commit format.

Commit Rules

Scope Rules

  • shared: Changes related to shared modules
  • api: Changes related to backend API
  • fe: Changes related to frontend
  • Global scope: Changes that do not belong to the above scopes (no scope in commit message)

Commit Order

Commit according to dependencies, in the following order:

  1. Global configurations and dependencies (e.g., package.json, tsconfig.json, etc.)
  2. Changes in the shared module
  3. Changes in the api backend
  4. Changes in the fe frontend
  5. Project progress and documentation updates (e.g., README.md, docs/, etc.)
  6. Last commit: lock file (use fixed message: "chore: update lock file")

Ignored Files

  • Changes in .bootstrap.ts files will be ignored.

Execution Workflow

  1. Analyze changes: Read git status and git diff to analyze all changed files.
  2. Logical grouping: Group files based on file paths and change content.
  3. Generate commit messages: Generate English commit messages for each group following the Conventional Commit format.
  4. Display plan: List the files included in each commit group and the corresponding commit message.
  5. Wait for review: Do not commit automatically; wait for user review and confirmation.
  6. Accept adjustments: Users may request to exclude certain files or adjust the grouping.

Commit Message Format

Use Conventional Commit format with English descriptions:

<type>(<scope>): <description>

[optional body]

Type

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation update
  • style: Formatting adjustment (no functional changes)
  • refactor: Refactoring
  • perf: Performance optimization
  • test: Test-related
  • chore: Build, config, dependencies, etc.

Examples

  • feat(api): add user authentication endpoint
  • fix(fe): fix login page styling issue
  • refactor(shared): refactor utility functions module
  • docs: update project documentation
  • chore: update lock file

Execution Steps

When the user calls this skill:

  1. Run git status --porcelain to get all changed files.
  2. Run git diff to get the change content.
  3. Filter out .bootstrap.ts files.
  4. Determine scope based on file paths:
    • Contains /shared/ or packages/shared/ → shared
    • Contains /api/ or apps/*-api/ → api
    • Contains /fe/, apps/*-fe/, or /frontend/ → fe
    • Lock files (package-lock.json, yarn.lock, pnpm-lock.yaml, etc.) → separate group
    • Others → global scope
  5. Determine type (feat, fix, refactor, docs, chore, etc.) based on change content.
  6. Sort groups by dependency order.
  7. Generate English commit message for each group.
  8. Display the commit plan clearly:
    Commit 1: feat(shared): add new utility functions
    Files:
    - packages/shared/utils/helper.ts
    - packages/shared/types/index.ts
    
    Commit 2: feat(api): implement user management API
    Files:
    - apps/metamove-api/src/controllers/user.ts
    - apps/metamove-api/src/routes/user.ts
    
    ...
    
    Commit N: chore: update lock file
    Files:
    - package-lock.json
    
  9. Clearly inform the user: Please review the above commit plan; I will proceed with the commits after your confirmation.
  10. If the user requests to exclude certain files, readjust the grouping and plan.

Notes

  • Do not commit automatically: You must wait for explicit user confirmation before executing git add and git commit.
  • Flexible adjustments: Users may request to modify groupings or exclude certain files.
  • Maintain atomicity: Each commit should be a logical unit.
  • English descriptions: Use English for the description part of the commit message.
  • Lock file last: Always place the lock file in the final commit.

Argument Explanation

The optional $ARGUMENTS can be used to specify file patterns to exclude, for example:

/commit-grouped "*.test.ts"

This will exclude all test files.

Source

git clone https://github.com/aztack/shrtLnk/blob/master/.claude/skills/gen-commit-msg/SKILL.mdView on GitHub

Overview

Automatically cluster current git changes by logic and prepare English Conventional Commit messages. Supports scoped grouping (shared, api, fe) or global scope, orders commits by dependency, and presents a reviewable plan before any commit.

How This Skill Works

The tool runs git status --porcelain and git diff to collect changes, filters out .bootstrap.ts, assigns scopes based on file paths (shared, api, fe) or global, groups files by logical change, and generates Conventional Commit messages (feat, fix, docs, chore, etc.) for each group. It outputs a plan showing files per commit and message; it does not auto-commit until you review and confirm.

When to Use It

  • When multiple changes across shared, api, or fe modules need organized commits.
  • When building a clean, reviewable Conventional Commit history for a release.
  • When excluding certain files with a pattern using the exclude option.
  • When dependencies require commits to be ordered by impact and scope.
  • When performing a final, separate commit to update lock files (e.g., package-lock.json).

Quick Start

  1. Step 1: Run commit-grouped [lang=en], [scope=shared|api|fe], [exclude=file-pattern].
  2. Step 2: Review the generated commit plan and the files included in each group.
  3. Step 3: Confirm to apply commits; the tool will not auto-commit without explicit confirmation.

Best Practices

  • Run git status and git diff to understand all changes before grouping.
  • Use the exclude pattern to omit files that should not be committed in a group.
  • Keep each commit focused on a single logical change to improve traceability.
  • Choose the appropriate Conventional Commit type (feat, fix, docs, refactor, chore) for each group.
  • Review the generated commit plan thoroughly and adjust groupings if needed.

Example Use Cases

  • Commit 1: feat(shared): add date utilities for formatting
  • Files: - packages/shared/utils/date.ts - packages/shared/types/index.ts
  • Commit 2: fix(api): correct user authentication endpoint
  • Files: - apps/metamove-api/src/controllers/auth.ts - apps/metamove-api/src/routes/auth.ts
  • Commit 3: feat(fe): implement analytics dashboard widget
  • Files: - apps/metermove-fe/src/components/AnalyticsWidget.jsx
  • Commit 4: docs: update coding standards
  • Files: - docs/coding-standards.md
  • Commit 5: chore: update lock file
  • Files: - package-lock.json

Frequently Asked Questions

Add this skill to your agents

Related Skills

Sponsor this space

Reach thousands of developers