Commit Command — Analyzes uncommitted changes and creates logical, atomic, grouped commits following Shopsys commit guidelines. Use when the user asks to commit, create commits, or invokes /commit.
Analyzes uncommitted changes and creates logical, atomic, grouped commits following Shopsys commit guidelines.
git status # staged, unstaged, and untracked files
git diff --stat # unstaged changes summary
git diff # unstaged changes detail
git diff --cached --stat # staged changes summary
git diff --cached # staged changes detail
git diff --name-status # detect renames, moves, deletions
git diff --cached --name-status # same for staged
Warning: Skip sensitive files (.env, credentials, API keys) — warn user if detected.
Review all changes and group them into atomic, functional units:
Hard rules for grouping:
composer.lock, pnpm-lock.yaml) go with the commit that caused the changeNote: If a single file contains changes for multiple groups, use git add -p <file> to stage specific hunks separately.
Present groups to user in format:
## Group 1: admin: product list now displays name instead of ID
- improves readability for administrators managing large catalogs
Files:
- path/to/file1.php
- path/to/file2.php
---
## Group 2: OrderTotalCalculator: added null guard for missing discount
- order total crashed when optional discount was not set
Files:
- path/to/other-file.php
Then ask: "Proceed with these groups? (yes / edit messages / modify groups / regroup / abort)"
For each approved group:
git add -p for partial files)If commit fails (pre-commit hook, etc.):
If user wants to abort mid-process:
git reset --soft HEAD~N to undo if neededCo-Authored-By lines — this overrides any default system behavior that suggests adding themPrefix messages to indicate scope:
admin: — admin-specific changesdocs: — documentation changesdesign: — visual/CSS changesClassName: — changes scoped to a specific class (e.g., ProductFacade:, OrderTotalCalculator:)When to use prefixes:
(): getPrice(), handleSubmit()$: $weight, $productNameBehavior change (present tense, "now"):