From builder-skills
Commit session changes with intelligent splitting for large changesets
How this skill is triggered — by the user, by Claude, or both
Slash command
/builder-skills:commit [--dry-run] [--single] [--all] [--message <msg>][--dry-run] [--single] [--all] [--message <msg>]The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Analyze uncommitted changes, group them intelligently by logic (not just paths), and create well-structured commits.
Analyze uncommitted changes, group them intelligently by logic (not just paths), and create well-structured commits.
Respond and reason in whatever language the user addressed you in — write user-facing text (the commit plan, the execution summary, questions, error messages) in that language and think in it too.
Critical exception — commit messages are ALWAYS in English, regardless of the user's language. The user's language affects only the report shown to the user, never the text written into git. Likewise, never translate code, identifiers, file paths, or commands.
--amend — always create a new commit.Co-Authored-By: lines,
"Generated with Claude" / "🤖 Generated with..." footers, or any text crediting an AI model
or tool. Commit messages contain only the change description.Arguments provided via $ARGUMENTS:
Examples:
/commit - Auto-analyze and commit (split if needed)/commit --dry-run - Preview what would be committed/commit --single - Force single commit/commit --message "feat: Add user auth" - Use specific messageBy default, ONLY commit files that were changed during this session. Do NOT commit pre-existing uncommitted changes.
How to determine session changes:
gitStatus snapshot taken at session start. Parse the list of dirty files from it.git status --porcelain now to get the current dirty files.Override: If the user explicitly asks to commit all changes (e.g., /commit --all), skip this filter and commit everything.
# Get all changed files (then filter to session-only as per Step 0)
git status --porcelain
# Get recent commits for style reference
git log --oneline -10 --format='%s'
# Get diff ONLY for session-changed files (pass file paths explicitly)
git diff HEAD -- <session-changed-file1> <session-changed-file2> ...
Key insight: Distinguish between core changes and ripple effects.
Core changes (commit separately):
Ripple changes (group together):
Detection patterns:
A. Detect ripple patterns first:
Example: Button.tsx changes Button props interface
+ 20 files updating Button usage
Commit 1: "refactor: Add variant prop to Button component"
- components/ui/Button.tsx (the definition)
- types/components.ts (if types changed)
Commit 2: "refactor: Update Button usages for new variant prop"
- All 20 files with usage updates
B. Group by logical feature:
types/*.ts + components/*.tsx + hooks/*.tsapp/api/*/route.ts + components/*hooks/use*.ts + components using itC. Path-based fallback:
| Path Pattern | Category |
|---|---|
components/** | Components |
app/** | Pages/Routes |
lib/** | Utilities |
hooks/** | Hooks |
types/** | Types |
utils/** | Utilities |
styles/** | Styles |
public/** | Assets |
Single commit when:
--single flag provided, OR--message flag providedMulti-commit when:
Commit messages are always written in English (see Language).
Do NOT include any co-author or attribution trailers (no Co-Authored-By:, no "Generated with
Claude" footer, no AI/model credit). The message holds only <type>: <description> and an
optional body.
Format:
<type>: <Short description (imperative, <70 chars)>
<Optional body explaining why>
Types:
feat: - New functionalityfix: - Bug fixesrefactor: - Code restructuringchore: - Maintenance, toolingdocs: - Documentationtest: - Test changesstyle: - Styling changes (CSS, formatting)For each commit group:
git add . or git add -A):git add path/to/file1.tsx path/to/file2.ts
git commit -m "$(cat <<'EOF'
feat: Add authentication service
Implement OAuth2 flow with refresh token support.
EOF
)"
git log -1 --oneline
All user-facing text below is rendered in the user's language. The commit messages embedded in it stay in English.
## Commit Plan (Dry Run)
**Files changed**: 25
**Proposed commits**: 2
### Commit 1: Core Change
**Type**: refactor
**Files** (2):
- components/ui/Button.tsx
- types/components.ts
**Message**:
> refactor: Add size prop to Button component
---
### Commit 2: Usage Updates
**Type**: refactor
**Files** (23):
- components/header/NavButton.tsx
- components/forms/SubmitButton.tsx
- ... (21 more files)
**Message**:
> refactor: Update Button usages with size prop
---
Run `/commit` to execute.
## Commits Created
### Commit 1/2
$ git add components/ui/Button.tsx types/components.ts
$ git commit -m "refactor: Add size prop..."
[main abc1234] refactor: Add size prop to Button component
2 files changed, 25 insertions(+), 8 deletions(-)
### Commit 2/2
$ git add components/header/NavButton.tsx ...
$ git commit -m "refactor: Update Button usages..."
[main def5678] refactor: Update Button usages with size prop
23 files changed, 46 insertions(+), 46 deletions(-)
---
**Summary**: Created 2 commits
def5678 refactor: Update Button usages with size prop
abc1234 refactor: Add size prop to Button component
| Scenario | Action |
|---|---|
| No changes | Report "No changes to commit" and exit |
| Pre-commit hook fails | Show error, offer to fix, create NEW commit (never amend) |
| Merge conflicts | Report files with conflicts, ask user to resolve |
If commit fails due to pre-commit hooks:
User: /commit
Claude: Analyzing uncommitted changes...
$ git status --porcelain
M components/ui/Card.tsx
M types/ui.ts
M components/dashboard/StatsCard.tsx
M components/dashboard/UserCard.tsx
M components/products/ProductCard.tsx
M app/page.tsx
... (15 more files)
Analyzing diffs...
Detected ripple pattern:
- Card.tsx: Changed Card component props (added `elevated` prop)
- types/ui.ts: Added CardProps type update
- 15 other files: Updating Card usage
Splitting into 2 commits:
### Commit 1/2: Core Change
$ git add components/ui/Card.tsx types/ui.ts
$ git commit -m "$(cat <<'EOF'
feat: Add elevated prop to Card component
Add visual elevation option with shadow effects.
EOF
)"
[main a1b2c3d] feat: Add elevated prop to Card component
2 files changed, 18 insertions(+), 4 deletions(-)
### Commit 2/2: Usage Updates
$ git add components/dashboard/StatsCard.tsx components/dashboard/UserCard.tsx ...
$ git commit -m "$(cat <<'EOF'
refactor: Update Card usages with elevated prop
EOF
)"
[main d4e5f6g] refactor: Update Card usages with elevated prop
15 files changed, 30 insertions(+), 15 deletions(-)
---
**Summary**: Created 2 commits
d4e5f6g refactor: Update Card usages with elevated prop
a1b2c3d feat: Add elevated prop to Card component
User: /commit
Claude: Analyzing uncommitted changes...
$ git status --porcelain
M components/forms/LoginForm.tsx
Found 1 changed file. Creating single commit...
$ git add components/forms/LoginForm.tsx
$ git commit -m "$(cat <<'EOF'
fix: Handle empty email validation gracefully
Add check for empty string before email format validation.
EOF
)"
[main x1y2z3a] fix: Handle empty email validation gracefully
1 file changed, 5 insertions(+), 2 deletions(-)
---
**Summary**: Created 1 commit
x1y2z3a fix: Handle empty email validation gracefully
Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub a-v-ershov/builder-skills --plugin builder-skills