3.2 KiB
3.2 KiB
| description |
|---|
| Commit staged and unstaged changes following Conventional Commits, splitting big changes into smaller logical commits. |
User Input
$ARGUMENTS
You MUST consider the user input before proceeding (if not empty).
Outline
- Resolve remote URL: Run
git remote get-url originto get the remote URL. All commit references produced by this skill MUST use the remote URL format (e.g.,<remote-url>/commit/<hash>). Never output bare hashes without the full remote link. - Run
git statusto see all changed and untracked files. - Run
git diffandgit diff --stagedto understand the changes. - Run
git log --oneline -5to see recent commit style. - Analyze and group changes into logical commits. Review all changed files and determine if they can be separated into smaller, focused commits. Group by:
- Purpose: Bug fix vs feature vs docs vs config — never mix these in one commit.
- Scope: Changes to different modules (frontend, backend, specs, config) should be separate commits unless they are tightly coupled and meaningless without each other.
- Independence: If a subset of changes can stand on its own and still make sense, it should be its own commit.
- Present the proposed commit grouping to the user for approval before proceeding.
- For each logical group, stage only the relevant files using
git add <file>(never usegit add -Aorgit add .) and commit them individually. - Write a commit message following the Conventional Commits specification.
- After each successful commit, report the commit hash as a full remote link:
<remote-url>/commit/<hash>(using the URL resolved in step 1).
Commit Message Format
<type>(<scope>): <short summary>
<optional body>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Types
feat: A new featurefix: A bug fixdocs: Documentation only changesstyle: Changes that do not affect the meaning of the code (white-space, formatting)refactor: A code change that neither fixes a bug nor adds a featureperf: A code change that improves performancetest: Adding missing tests or correcting existing testsbuild: Changes that affect the build system or external dependenciesci: Changes to CI configuration files and scriptschore: Other changes that don't modify src or test files. Claude config files can be categorized here. Examplechore(claude)
Scope
Use the relevant module or area in parentheses:
frontend— SvelteKit or other frontend changesbackend— Spring Boot or other backend changesmonitoring— Prometheus, or Grafana changesserver— Docker, Docker Compose, Kubernetes changes- Omit scope if the change spans multiple areas
- Append - with application name if available. Example
backend-auth.
Rules
- The summary must be lowercase, imperative mood, no period at the end
- Keep the summary under 70 characters
- Use the body for additional context when the summary alone is not sufficient
- Always end with the
Co-Authored-Bytrailer - Use a HEREDOC to pass the commit message to
git commit -m - NEVER use
--no-verifyor skip pre-commit hooks - NEVER amend a previous commit unless explicitly asked