diff --git a/.claude/commands/commit-push.md b/.claude/commands/commit-push.md index eae7e28e3..6080278b8 100644 --- a/.claude/commands/commit-push.md +++ b/.claude/commands/commit-push.md @@ -4,53 +4,22 @@ description: Optionally checks, then commits and pushes code to the remote repos argument-hint: check | force allowed-tools: - Bash(git branch*) - - Bash(git checkout*) - - Bash(git add*) - Bash(git status*) - - Bash(git commit*) - Bash(git push*) - - Bash(git diff*) - - Bash(git log*) - Skill model: claude-haiku-4-5 --- Arguments: $ARGUMENTS -If the argument is "force", skip the check step. Otherwise (default), run the `/check` command first to lint, build, and test the code. If any of the checks fail, stop and report the errors. +1. Run `/commit $ARGUMENTS` to commit the changes. -Once ready, commit and push the code by following these steps: - -1. Run these bash commands in parallel to understand the current state: - - - `git status` to see all untracked files - - `git diff HEAD` to see both staged and unstaged changes - - `git log --oneline -10` to see recent commit messages for style consistency - -2. If you are on the `main` branch, create a new feature branch using `git branch` and switch to it. - -3. Analyze all changes and draft a commit message: - - - Summarize the nature of the changes (new feature, enhancement, bug fix, refactoring, test, docs, etc.) - - Use the conventional commit format: `type(scope): description` - - Keep the first line under 72 characters - - Do not commit files that likely contain secrets (.env, credentials.json, etc.) - -4. Stage and commit the changes: - - - Add relevant files using `git add` - - Create the commit with a message ending with: - ``` - Co-Authored-By: Claude - ``` - - Use a HEREDOC for the commit message to ensure proper formatting - -5. Push to the remote repository: +2. Push to the remote repository: - Run `git push` to push the commit - If the branch has no upstream, use `git push -u origin ` -6. Report the results including: +3. Report the results including: - The commit hash - The commit message - The push status diff --git a/.claude/commands/commit.md b/.claude/commands/commit.md new file mode 100644 index 000000000..141475855 --- /dev/null +++ b/.claude/commands/commit.md @@ -0,0 +1,50 @@ +--- +name: commit +description: Optionally checks, then commits code to the current or a new feature branch. +argument-hint: check | force +allowed-tools: + - Bash(git branch*) + - Bash(git checkout*) + - Bash(git add*) + - Bash(git status*) + - Bash(git commit*) + - Bash(git diff*) + - Bash(git log*) + - Skill +model: claude-haiku-4-5 +--- + +Arguments: $ARGUMENTS + +If the argument is "force", skip the check step. Otherwise (default), run the `/check` command first to lint, build, and test the code. If any of the checks fail, stop and report the errors. + +Once ready, commit and push the code by following these steps: + +1. Run these bash commands in parallel to understand the current state: + + - `git status` to see all untracked files + - `git diff HEAD` to see both staged and unstaged changes + - `git log --oneline -10` to see recent commit messages for style consistency + +2. If you are on the `main` branch, create a new feature branch using `git branch` and switch to it. + +3. Analyze all changes and draft a commit message: + + - Summarize the nature of the changes (new feature, enhancement, bug fix, refactoring, test, docs, etc.) + - Use the conventional commit format: `type(scope): description` + - Keep the first line under 72 characters + - Do not commit files that likely contain secrets (.env, credentials.json, etc.) + +4. Stage and commit the changes: + + - Add relevant files using `git add` + - Create the commit with a message ending with: + ``` + Co-Authored-By: Claude + ``` + - Use a HEREDOC for the commit message to ensure proper formatting, **unless** you are sandboxed, in + which case use a plain string because HEREDOCs are not supported. + +5. Report the results including: + - The commit hash + - The commit message