Repository navigation
feat(claude-code): add git-commit skill #159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
b5d597b
feat(claude-code): add git-commit skill
himura467 1dba0ee
refactor(claude-code): skip install if claude is already installed
himura467 193c9fb
docs(claude-code): fix git status description in git-commit skill
himura467 5488a56
fix(claude-code): guard skills glob loop against empty matches
himura467 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| --- | ||
| name: git-commit | ||
| description: Stage and commit changes using Conventional Commits, creating a new branch first if on a protected branch | ||
| --- | ||
|
|
||
| Run the following steps: | ||
|
|
||
| 1. Run these bash commands in parallel: | ||
| - `git status` to see staged, unstaged, and untracked changes | ||
| - `git diff` to see unstaged changes | ||
| - `git diff --cached` to see staged changes | ||
| - `git log --oneline -5` to understand the repo's commit message style | ||
| - `git branch --show-current` to get the current branch name | ||
|
|
||
| 2. If the current branch is `main`, `master`, `develop`, or `devel`: | ||
| - Propose a branch name and ask the user to confirm or provide their own; use `-` as the delimiter — never `/` | ||
| - Create and switch to the new branch before committing | ||
|
|
||
| 3. Analyze all changes and draft a commit message following [Conventional Commits](https://www.conventionalcommits.org/): | ||
| - Format: `<type>[optional scope]: <description>` | ||
| - Type is mandatory; common types: `fix`, `feat`, `build`, `chore`, `ci`, `docs`, `style`, `refactor`, `perf`, `test` | ||
| - Add `!` after the type/scope or a `BREAKING CHANGE:` footer for breaking changes | ||
| - Do not commit files that likely contain secrets (.env, credentials, etc.) — warn the user if asked | ||
|
|
||
| 4. Run the following sequentially: | ||
| - Stage the relevant files (`git add <files>` — prefer specific files over `git add -A`) | ||
| - After staging, create the commit using a HEREDOC to pass the message: | ||
|
|
||
| ```bash | ||
| git commit -m "$(cat <<'EOF' | ||
| <commit message here> | ||
| EOF | ||
| )" | ||
| ``` | ||
|
|
||
| If the commit fails due to a pre-commit hook, fix the underlying issue and create a NEW commit — never amend unless the user explicitly asks. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.