commit-grouped
npx machina-cli add skill aztack/shrtLnk/gen-commit-msg --openclawCommit 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:
- Global configurations and dependencies (e.g., package.json, tsconfig.json, etc.)
- Changes in the shared module
- Changes in the api backend
- Changes in the fe frontend
- Project progress and documentation updates (e.g., README.md, docs/, etc.)
- Last commit: lock file (use fixed message: "chore: update lock file")
Ignored Files
- Changes in
.bootstrap.tsfiles will be ignored.
Execution Workflow
- Analyze changes: Read
git statusandgit diffto analyze all changed files. - Logical grouping: Group files based on file paths and change content.
- Generate commit messages: Generate English commit messages for each group following the Conventional Commit format.
- Display plan: List the files included in each commit group and the corresponding commit message.
- Wait for review: Do not commit automatically; wait for user review and confirmation.
- 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 featurefix: Bug fixdocs: Documentation updatestyle: Formatting adjustment (no functional changes)refactor: Refactoringperf: Performance optimizationtest: Test-relatedchore: Build, config, dependencies, etc.
Examples
feat(api): add user authentication endpointfix(fe): fix login page styling issuerefactor(shared): refactor utility functions moduledocs: update project documentationchore: update lock file
Execution Steps
When the user calls this skill:
- Run
git status --porcelainto get all changed files. - Run
git diffto get the change content. - Filter out
.bootstrap.tsfiles. - Determine scope based on file paths:
- Contains
/shared/orpackages/shared/→ shared - Contains
/api/orapps/*-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
- Contains
- Determine type (feat, fix, refactor, docs, chore, etc.) based on change content.
- Sort groups by dependency order.
- Generate English commit message for each group.
- 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 - Clearly inform the user: Please review the above commit plan; I will proceed with the commits after your confirmation.
- 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 addandgit 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
- Step 1: Run commit-grouped [lang=en], [scope=shared|api|fe], [exclude=file-pattern].
- Step 2: Review the generated commit plan and the files included in each group.
- 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