From coding
Analyzes changes and creates atomic commits with conventional commit messages and appropriate emoji. Automatically runs pre-commit checks and suggests splitting large changes into multiple commits when appropriate.
How this skill is triggered — by the user, by Claude, or both
Slash command
/coding:commitThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Analyzes changes and creates atomic commits with conventional commit messages and appropriate emoji. Automatically runs pre-commit checks and suggests splitting large changes into multiple commits when appropriate.
Analyzes changes and creates atomic commits with conventional commit messages and appropriate emoji. Automatically runs pre-commit checks and suggests splitting large changes into multiple commits when appropriate.
What this command does NOT do:
git push in any form -- this is a HARD prohibition; the agent must NEVER execute any push command, even if the user asks for it within this skill's scopeNote:
--retrospectivemodifies local commit history via interactive rebase, but never force-pushes.
When to REJECT:
Step 0: Pre-Flight Safety
|
v
Step 1: Planning
|-- Analyze requirements (record --no-verify, --retrospective flags)
|-- Pre-commit verification (skip if --no-verify)
|-- Change classification <-- IF/ELSE branch point
| IF --retrospective: git-blame classification + fixup mapping
| ELSE: splitting heuristic + dependency tree
|-- Risk assessment
|
v
Step 2: Confirmation <-- IF/ELSE branch point
| IF --retrospective: fixups + new commits + projected history
| ELSE: standard commit plan
|
v
Step 3: Execution <-- IF/ELSE branch point
| IF --retrospective: fixup commits -> new commits -> rebase -> git log
| ELSE: stage + commit per group
|
v
Step 4: Post-Commit Verification (skip if --no-verify)
|
v
Step 5: Integrity Verification
|
v
Step 6: Reporting
ultrathink: you'd perform the following steps
Backup Repository
$TMPDIR on macOS, /tmp on Linux)date +%s).git) to <tmp>/git-backups/<repo-name>-<timestamp> via cp -RBaseline Tree Fingerprint
git -C <tmp>/git-backups/<repo-name>-<timestamp> add -A && git -C <tmp>/git-backups/<repo-name>-<timestamp> write-treeAnalyze Requirements
--no-verify flag (skips both pre-commit checks in Step 1 and post-commit verification in Step 4)--retrospective flag (record as mode variable; workflow continues linearly through all steps)Pre-commit Verification
--no-verify flag presentChange Classification -- Mandatory
Classify EVERY changed file by logical concern. Source code and its tests belong TOGETHER in the same commit (per TDD standards).
IF --retrospective:
Analyze every changed hunk and determine whether it belongs to an existing commit or is new work. There is NO arbitrary limit on the number of commits produced -- let the changes dictate the grouping.
Classification strategies (apply in order):
| Priority | Strategy | Command | Signal |
|---|---|---|---|
| Primary | git blame on changed lines | git blame <file> on the pre-change version | Identifies the commit SHA that introduced the lines being modified |
| Secondary | File history | git log --follow <file> | Shows which commits previously touched the file |
| Tertiary | Keyword match | git log --all --oneline | Matches commit subjects to change intent |
Classification rules:
Map fixup targets: For each fixup group, run git blame on the affected lines to find the original commit SHA, cross-reference with git log to confirm it exists in the current branch, and record the mapping: change hunk -> target SHA.
Edge cases:
git add -p to stage individual hunks into separate fixup commitsELSE:
Splitting heuristic -- group by:
| Priority | Split by | Example commits |
|---|---|---|
| 1st | Infrastructure vs features | init: lay the foundation separate from feature code |
| 2nd | Module / feature boundary | feat(auth): add login vs feat(search): add query |
| 3rd | Change type within a module | feat(auth): add login vs docs(auth): add API docs |
What goes TOGETHER in one commit:
What gets SEPARATE commits:
Dependency tree ordering:
After classifying files into groups, build a dependency tree between the groups:
Self-containment through incremental file evolution:
Shared files (package.json, tsconfig.json, config files) must NOT be committed as their final version in the first commit. Instead, each commit includes only the entries relevant to what it introduces.
vitest.config.e2e.ts goes with the e2e test commit, not the init commit. The bin field in package.json goes with the CLI commit.Concrete examples of incremental evolution:
bin, NO feature-specific exports, NO module-specific subpath importsbin field, ADD exports["./cli"]exports["./pull"] or imports["#pull"] if applicableEND IF
Rules (apply to both modes):
Risk Assessment
Present a structured commit plan to the user BEFORE any git write operations.
IF --retrospective:
## Retrospective Commit Plan
### Fixups
Target: abc1234 feat(auth): add login endpoint
- Fix validation bug in auth.ts
- Add missing error handler in auth.ts
Target: def5678 test(auth): add login tests
- Fix assertion in login.spec.ts
### New Commits
<emoji> feat(auth): add logout endpoint
Files: auth.ts, auth.spec.ts
### Projected History (after rebase)
abc1234' feat(auth): add login endpoint [amended]
def5678' test(auth): add login tests [amended]
ghi9012 feat(auth): add logout endpoint [new]
Proceed? [Y/n]
ELSE:
## Commit Plan
Pre-commit checks: [PASS / SKIP (--no-verify)]
### Commit 1
<emoji> <type>(scope): <description>
Files: <file list>
### Commit 2
<emoji> <type>(scope): <description>
Files: <file list>
Proceed? [Y/n]
END IF
IF --retrospective:
Create fixup commits (one per target):
git add -p for mixed-hunk files)git commit --fixup=<target-SHA>Create new commits for remaining changes:
Rebase to squash fixups:
GIT_SEQUENCE_EDITOR=true git rebase --interactive --autosquash <base><tmp>/git-backups/<repo-name>-<timestamp> as reference for the intended final state (the backup reflects the full final working tree -- resolution may only need a portion of the backup file). Attempt auto-resolution; if complex, delegate to a teammate to resolve, then continue the rebaseDisplay resulting history:
git log --oneline <base>..HEADELSE:
File Staging
Commit Splitting
git add -p when needed) for each logical commit<tmp>/git-backups/<repo-name>-<timestamp> as reference for the intended final state. Note: the backup reflects the final working tree -- merge conflict resolution may only need a subset of the backup file's content, not necessarily the entire file.Commit Message Generation
Commit Guidelines belowCommit Creation
END IF
Skip this entire step if
--no-verifyis set.
After all commits are created, verify each affected commit passes quality checks.
GIT_SEQUENCE_EDITOR=true git rebase --interactive --autosquash to absorb fixup commits. Note: when preceded by retrospective execution (Step 3), this rebase applies only to fixup commits from the verification loop itself, not a re-run of the retrospective rebase.Verification output table:
Commit | Lint | Coverage | Tests | Status
-------------|------|----------|-------|---------
abc1234 feat | PASS | 98% | PASS | OK
def5678 fix | PASS | 97% | PASS | OK
Invariant: The baseline tree SHA (Step 0) and
HEAD^{tree}represent the same file set. They MUST be identical after a faithful commit chain. Any mismatch means content was lost or corrupted during commits/rebases.
Compute post-commit tree: git rev-parse HEAD^{tree}
Assert equality against the baseline tree SHA from Step 0
PASS — SHAs are identical: integrity confirmed. Proceed to Step 6.
FAIL — SHAs differ: this is a hard failure. Content was dropped, altered, or missed during the commit process.
GIT_ALTERNATE_OBJECT_DIRECTORIES=<tmp>/git-backups/<repo-name>-<timestamp>/.git/objects git diff-tree -r <baseline-tree> HEAD^{tree}Post-commit Validation
Quality Assurance
Output Format:
[OK/FAIL] Command: commit
## Summary
- Files committed: [count]
- Commits created: [count]
- Pre-commit checks: [PASS/SKIP/FAIL]
## Actions Taken
1. [Pre-commit check results]
2. [Staging actions]
3. [Commit creation]
## Commit Messages
- [Emoji Type: Description]
## Next Steps (if applicable)
- [Push to remote]
- [Create pull request]
/commit
# Runs pre-commit checks, presents plan, creates single commit
/commit --no-verify
# Skips pre-commit and post-commit verification for quick commits
/commit
# Detects multiple logical changes:
# Commit 1: feat: add user authentication
# Commit 2: docs: update API documentation
# Commit 3: fix: resolve memory leak
/commit
# Initial project with 170 files.
# Dependency tree analysis -> topological commit order:
#
# [config] -> [types] -> [utils] -> [api client] -> [cache] [formatters]
# | | |
# [pull] [push] [diff] [search]
# | | | |
# [cli entrypoint]
# |
# [e2e tests]
# |
# [docs]
#
# Commits (bottom-up from dependency leaves):
#
# 1. init: lay the foundation for the project
# 2. feat: add Notion API types, config schema, and constants
# 3. feat: add shared utilities and helpers
# 4. feat(api): implement Notion API client with auth and rate limiting
# 5. feat(cache): add local caching layer with invalidation
# 6. feat(format): add output formatters for JSON, markdown, and table
# 7. feat(pull): implement page and database pull with transformation
# 8. feat(push): implement page and database push with conflict detection
# 9. feat(diff): implement block-level content diffing
# 10. feat(search): implement full-text and filtered search
# 11. feat(cli): add CLI entrypoint, command router, and help system
# 12. test(e2e): add end-to-end test suite with fixtures
# 13. docs: add README, architecture guide, and API reference
#
# Each commit evolves shared files incrementally (package.json, tsconfig,
# constants, barrel exports) -- no forward references allowed.
/commit --retrospective
# Classifies changes as fixups to prior commits or new commits.
# Uses git blame to map changed hunks to original commit SHAs.
# Presents retrospective plan (fixups + new + projected history).
# Creates fixup commits, rebases to squash, verifies chain.
# Combine with --no-verify to skip pre/post-commit checks.
/commit
# Error: No changes to commit
# Suggestion: Make changes first or check git status
/commit
# Pre-commit checks failed:
# - Lint errors: 5
# - Build failed: TypeScript compilation errors
# Options: Fix issues or use --no-verify to skip
Message Format:
<type>: <description> for global or non-project/feature specific changes<type>(<scope>): <description> for project or feature specific changes -- use short package name as scope, dropping the catalog prefix (e.g., @theriety/, @amino/). For cross-package concerns, name the concern. For global changes, omit scope.Atomic Commits:
Split Criteria:
NEVER refuse to split for ANY of these reasons:
- "artificial splitting would create false intermediate states" -- creating ideal logical commits IS the purpose of this skill
- "this is the initial commit" or "no prior commits exist" -- initial commits follow the exact same splitting rules
- "files are interdependent" or "everything is one feature" -- all code is interdependent; split by concern anyway
A file MAY appear in multiple commits if different hunks serve different logical purposes.
npx claudepluginhub alvis/.claude --plugin codingGuides systematic git commits: checks staging status, reviews diffs, splits changes into atomic commits, formats conventional messages. Use before PRs or when committing code.
Creates bite-sized, testable implementation plans from specs or requirements, with file structure and task decomposition. Activates before coding multi-step tasks.