commit-elegant

Creates elegant git commits using emoji conventional commit format. Handles pre-commit verification, auto-staging, analyzes diffs for logical grouping, suggests splitting large changes into focused commits, and writes clear imperative commit messages. Use this skill when the user wants to commit changes, stage files, or craft a commit message. Supports --no-verify to skip pre-commit checks.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "commit-elegant" with this command: npx skills add rockykusuma/agent-skills/rockykusuma-agent-skills-commit-elegant

Commit Elegant

A structured workflow for crafting clean, expressive git commits using emoji conventional commit format.

Workflow

  1. Pre-commit checks (skip if --no-verify is passed):
    • Detect the project's lint/typecheck/docs commands (check package.json scripts, Makefile, etc.).
    • Run them. If any fail, show the errors and ask the user: fix first or proceed anyway?
  2. Check staged files — run git status.
    • If files are already staged, only commit those — do not auto-add.
    • If 0 files are staged, run git add -A to add all modified and new files.
  3. Diff — run git diff --staged to understand what is being committed.
  4. Analyze — determine if the diff contains multiple distinct logical concerns (different types, different domains, unrelated files).
  5. Split or single — if multiple distinct concerns exist, present the proposed split to the user before executing. Otherwise, proceed with one commit.
  6. Commit — for each commit, write a message in the format below and run git commit -m "<message>".
  7. Verify — review the committed diff to confirm the message accurately represents the change.

Commit Message Format

Subject line (required)

<emoji> <type>[(<scope>)][!]: <short imperative description>
  • (<scope>) is optional — use when the change is clearly scoped to a module, package, or domain. Scope must be a noun (e.g., auth, parser, ui).
  • ! is optional — append immediately before : to flag a breaking change (e.g., feat(api)!: remove v1 endpoints).
  • First line ≤ 72 characters.
  • Use present-tense, imperative mood: "add feature", not "added feature".
  • Do NOT include a Co-Authored-By line.

Body (optional)

Add a body when the "why" is not obvious from the subject alone:

<emoji> <type>: <subject>

<body explaining why, not what>

[optional footer(s)]
  • Separate subject from body with a blank line.
  • Wrap body lines at 72 characters.
  • Use body for motivation, context, or trade-off reasoning — not restating the diff.

Footers (optional)

Footers go after the body, separated by a blank line. Common footers:

  • BREAKING CHANGE: <explanation> — signals a breaking API change (correlates with SemVer MAJOR).
  • Refs: #<issue> — links to an issue or ticket.
  • Reviewed-by: <name> — credits a reviewer.
  • Footer tokens use - instead of spaces (e.g., Acked-by), except BREAKING CHANGE.
  • If ! is used in the subject, BREAKING CHANGE: footer may be omitted.

SemVer Correlation

  • fix → PATCH release
  • feat → MINOR release
  • BREAKING CHANGE (any type) → MAJOR release

Emoji + Type Reference

EmojiTypeUse for
featNew feature
🐛fixBug fix
🚑️fixCritical hotfix
🔒️fixSecurity fix
🚨fixFix compiler/linter warnings
🩹fixSimple non-critical fix
✏️fixFix typos
🔇fixRemove logs
🔥fixRemove code or files
📝docsDocumentation changes
💡docsAdd or update source comments
💄styleFormatting/style (no logic change)
🎨styleImprove code structure/format
♻️refactorRefactor (no feature, no fix)
🚚refactorMove or rename resources
⚰️refactorRemove dead code
⚡️perfPerformance improvement
testAdd or update tests
🧪testAdd a failing test
📸testAdd or update snapshots
🔧choreTooling, configuration
🙈choreAdd or update .gitignore
📦️choreAdd or update compiled files/packages
choreAdd a dependency
choreRemove a dependency
🔖choreRelease/version tag
📌chorePin dependencies to specific versions
👥choreAdd or update contributors
🔀choreMerge branches
👷ciAdd or update CI build system
🚀ciCI/CD improvements
💚fixFix CI build
⏪️revertRevert changes
🗑️revertRemove (deprecated/dead things)
💥featIntroduce breaking changes
🏷️featAdd or update types
🦺featAdd or update validation logic
👔featAdd or update business logic
🌐featInternationalization/localization
📱featResponsive design
🚸featImprove UX/usability
♿️featImprove accessibility
🔊featAdd or update logs
📈featAdd or update analytics/tracking
🧵featMultithreading/concurrency
🚩featFeature flags
🔍️featImprove SEO
💬featAdd or update text and literals
🥅fixCatch errors
👽️fixUpdate code due to external API changes
🗃️dbPerform database related changes
🏗️refactorArchitectural changes
🧑‍💻choreImprove developer experience
🌱choreAdd or update seed files
🎉choreBegin a project
📄choreAdd or update license
🤡testMock things
⚗️experimentPerform experiments
🚧wipWork in progress
💫uiAnimations and transitions
🍱assetsAdd or update assets
🥚featAdd or update easter egg
✈️featImprove offline support

When to Split Commits

Split when changes span:

  1. Different concerns — unrelated parts of the codebase
  2. Different types — e.g., mixing a feature with a refactor or a test
  3. Different file domains — e.g., source code vs. CI config vs. documentation
  4. Logical independence — changes that are easier to understand or review separately
  5. Size — very large diffs that would be clearer if broken down

When splitting, present the proposed list of commits to the user before executing them.

How to split mechanically

  1. Unstage everything: git reset HEAD
  2. For each proposed commit, selectively stage the relevant files:
    • git add <file1> <file2> for whole files
    • git add -p <file> for partial hunks within a file
  3. Commit, then repeat for the next group.

Edge Cases

  • Amend: If the user says "amend", use git commit --amend and rewrite the message to reflect the combined change.
  • Empty commit: Never create an empty commit unless explicitly requested (git commit --allow-empty).
  • Merge commits: Do not rewrite merge commit messages — leave them as generated by git.
  • Fixup: If a change is a direct fix to the previous commit, suggest git commit --fixup=HEAD for later interactive rebase, or amend if the user prefers.
  • Wrong type: If a commit was made with the wrong type, suggest git rebase -i to reword it before pushing. After push, note that cleanup depends on the team's workflow.
  • Multi-type change: If a single change conforms to more than one type, always split into multiple commits.

Examples

Good single commit messages:

✨ feat: add user authentication system
🐛 fix: resolve memory leak in rendering process
📝 docs: update API documentation with new endpoints
♻️ refactor: simplify error handling logic in parser
🚨 fix: resolve linter warnings in component files
🧑‍💻 chore: improve developer tooling setup process
👔 feat: implement business logic for transaction validation
🩹 fix: address minor styling inconsistency in header
🚑️ fix: patch critical security vulnerability in auth flow
🎨 style: reorganize component structure for better readability
🔥 fix: remove deprecated legacy code
🦺 feat: add input validation for user registration form
💚 fix: resolve failing CI pipeline tests
📈 feat: implement analytics tracking for user engagement
🔒️ fix: strengthen authentication password requirements
♿️ feat: improve form accessibility for screen readers

Good with scope:

✨ feat(auth): add JWT-based user authentication
🐛 fix(api): resolve null pointer in user endpoint
♻️ refactor(db): simplify query builder interface

Good with ! breaking change:

💥 feat(api)!: remove deprecated v1 endpoints
🔧 chore!: drop support for Node 14

Good with body and footer:

⚡️ perf: lazy-load dashboard widgets

Reduces initial bundle size by 40%. Widgets now load on scroll
into viewport instead of all at mount time.

Refs: #452

Good with breaking change footer:

✨ feat: allow config object to extend other configs

BREAKING CHANGE: `extends` key in config file is now used
for extending other config files.

Good split sequence:

✨ feat: add new solc version type definitions
📝 docs: update documentation for new solc versions
🔧 chore: update package.json dependencies
🏷️ feat: add type definitions for new API endpoints
🧵 feat: improve concurrency handling in worker threads
🚨 fix: resolve linting issues in new code
✅ test: add unit tests for new solc version features
🔒️ fix: update dependencies with security vulnerabilities

Anti-Patterns

Avoid these:

# Too vague
🔧 chore: update stuff
🐛 fix: fix bug
✨ feat: changes

# Past tense
🐛 fix: fixed the login issue

# Too long
✨ feat: add user authentication system with JWT tokens and refresh token rotation and session management

# Mixing concerns in one commit
✨ feat: add auth system and fix header styling and update docs

# Meaningless scope
🐛 fix(code): resolve bug

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Automation

pull-request-elegant

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

commit-push-elegant

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

vercel-composition-patterns

React composition patterns that scale. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or designing reusable APIs. Triggers on tasks involving compound components, render props, context providers, or component architecture. Includes React 19 API changes.

Repository Source
23K85.7K
vercel