About commit
A skill for reviewing repository changes and creating a Conventional Commits commit from the intended files. It emphasizes limiting scope, checking staged changes, and reporting the result.
Key features
- 01Inspect Git status and diffs
- 02Limit work to specified paths
- 03Stage only intended changes
- 04Write a Conventional Commits message
- 05Report commit hash and message
Use cases
- 01Commit selected files from a larger working tree
- 02Check for unrelated changes before committing
- 03Create a commit based on staged changes
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ goofansu/ skills --skill commitAfter installing, type/commitin Claude Code to confirm it loaded.
Details
From the project README- Infer from the prompt whether the user provided file paths, globs, or additional instructions.
- Review
git status --shortandgit diffto understand the current changes. Limit inspection to the provided file paths or globs when present. - Optionally run
git log -n 50 --pretty=format:%s | grep -E '^[a-z]+\([^)]+\):'to identify commonly used commit scopes. - Determine the intended changes:
- If the user provided file paths or globs, use only those paths.
- If the user did not provide file paths or globs, use all current changes.
- If there are no intended changes to commit, do not create a commit. Report that there is nothing to commit.
- If there are unrelated, ambiguous, generated, or risky changes, ask for clarification before committing.
- Stage only the intended changes.
- Review
git diff --stagedand create a Conventional Commits message based only on the staged diff. - Run
git commit -m "<subject>"and include-m "<body>"only when a body is useful. - Run
git status --shortandgit log -1 --onelineafter committing, then report the commit hash and message.
Comments
Markdown supported