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:
- 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.ts files will be ignored.
Execution Workflow
- Analyze changes: Read
git status and git diff to 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 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:
- Run
git status --porcelain to get all changed files.
- Run
git diff to get the change content.
- Filter out
.bootstrap.ts files.
- 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
- 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 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.
1---2name: gen-commit-msg3description: Commit Grouped by Logic4---56# Commit Grouped by Logic78Group current git changes by logic and commit them using English Conventional Commit format.910## Commit Rules1112### Scope Rules13- **shared**: Changes related to shared modules14- **api**: Changes related to backend API15- **fe**: Changes related to frontend16- **Global scope**: Changes that do not belong to the above scopes (no scope in commit message)1718### Commit Order19Commit according to dependencies, in the following order:201. Global configurations and dependencies (e.g., package.json, tsconfig.json, etc.)212. Changes in the shared module223. Changes in the api backend234. Changes in the fe frontend245. Project progress and documentation updates (e.g., README.md, docs/, etc.)256. **Last commit: lock file** (use fixed message: "chore: update lock file")2627### Ignored Files28- Changes in `.bootstrap.ts` files will be ignored.2930## Execution Workflow31321. **Analyze changes**: Read `git status` and `git diff` to analyze all changed files.332. **Logical grouping**: Group files based on file paths and change content.343. **Generate commit messages**: Generate English commit messages for each group following the Conventional Commit format.354. **Display plan**: List the files included in each commit group and the corresponding commit message.365. **Wait for review**: **Do not commit automatically**; wait for user review and confirmation.376. **Accept adjustments**: Users may request to exclude certain files or adjust the grouping.3839## Commit Message Format4041Use Conventional Commit format with English descriptions:4243```44<type>(<scope>): <description>4546[optional body]47```4849### Type50- `feat`: New feature51- `fix`: Bug fix52- `docs`: Documentation update53- `style`: Formatting adjustment (no functional changes)54- `refactor`: Refactoring55- `perf`: Performance optimization56- `test`: Test-related57- `chore`: Build, config, dependencies, etc.5859### Examples60- `feat(api): add user authentication endpoint`61- `fix(fe): fix login page styling issue`62- `refactor(shared): refactor utility functions module`63- `docs: update project documentation`64- `chore: update lock file`6566## Execution Steps6768When the user calls this skill:69701. Run `git status --porcelain` to get all changed files.712. Run `git diff` to get the change content.723. Filter out `.bootstrap.ts` files.734. Determine scope based on file paths:74 - Contains `/shared/` or `packages/shared/` → shared75 - Contains `/api/` or `apps/*-api/` → api76 - Contains `/fe/`, `apps/*-fe/`, or `/frontend/` → fe77 - Lock files (package-lock.json, yarn.lock, pnpm-lock.yaml, etc.) → separate group78 - Others → global scope795. Determine type (feat, fix, refactor, docs, chore, etc.) based on change content.806. Sort groups by dependency order.817. Generate English commit message for each group.828. Display the commit plan clearly:83 ```84 Commit 1: feat(shared): add new utility functions85 Files:86 - packages/shared/utils/helper.ts87 - packages/shared/types/index.ts8889 Commit 2: feat(api): implement user management API90 Files:91 - apps/metamove-api/src/controllers/user.ts92 - apps/metamove-api/src/routes/user.ts9394 ...9596 Commit N: chore: update lock file97 Files:98 - package-lock.json99 ```1009. Clearly inform the user: **Please review the above commit plan; I will proceed with the commits after your confirmation.**10110. If the user requests to exclude certain files, readjust the grouping and plan.102103## Notes104105- **Do not commit automatically**: You must wait for explicit user confirmation before executing `git add` and `git commit`.106- **Flexible adjustments**: Users may request to modify groupings or exclude certain files.107- **Maintain atomicity**: Each commit should be a logical unit.108- **English descriptions**: Use English for the description part of the commit message.109- **Lock file last**: Always place the lock file in the final commit.110111## Argument Explanation112113The optional `$ARGUMENTS` can be used to specify file patterns to exclude, for example:114```115/commit-grouped "*.test.ts"116```117This will exclude all test files.