en un clic
en un clic
| name | gfix |
| description | Amend a git commit further back in the history. |
| allowed-tools | Bash, Read, Glob, Grep, Edit, Write, Agent, AskUserQuestion |
| argument-hint | <instructions> |
Use the gfix shell command to fold staged changes into a commit that is not the most recent. This is the preferred way to amend historical commits in this repo.
Source: ~/code/dotfiles/plugins/git.zsh (the gfix function)
gfix [-m <message>] <commit-sha> does the following:
-m: git commit --fixup <commit-sha> (content-only fixup)-m <message>: creates a manual amend! commit with subject amend! <original-subject> and body <message>, which autosquash then folds into the target (replacing its message, and including any staged changes; --allow-empty is used if nothing is staged)GIT_SEQUENCE_EDITOR=true git rebase -i --autosquash <commit-sha>^ to automatically squash the fixup into the target commitUse gfix when you need to amend a commit that is not the HEAD commit. For example:
If you only need to amend the most recent commit, use git commit --amend instead.
Determine the safe range — The target commit must be within the current branch's own commits, not on or before the base branch. Use detect_base_branch to find the base branch. As a last resort, ask the user.
The target commit must appear in git log --oneline <base-branch>..HEAD. If it does not, stop and tell the user — rewriting shared history would cause problems.
Identify the target commit — Use $ARGUMENTS to understand what the user wants fixed. List the safe commits with git log --oneline <base-branch>..HEAD and examine their diffs to find the commit that introduced the code the user wants changed.
Make and stage the changes — Edit the files, then git add only the files that belong to the target commit.
Run gfix — Pass the target commit SHA. Add -m <message> to also rewrite the target commit's message:
gfix <commit-sha>
gfix -m "new commit message" <commit-sha>
Handle rebase conflicts — If the rebase hits conflicts:
git add the resolved filesgit rebase --continueVerify — Run git log --oneline -10 to confirm the history looks correct. If relevant tests exist, run them.
Review and merge open Dependabot pull requests
Evaluate pending (unsubmitted) review comments on the current branch's PR and, after user confirmation, address each in a separate sub-agent and separate commit.
Evaluate unresolved review comments on the current branch's PR and, after user confirmation, address each in a separate sub-agent and separate commit.
Walk through PR changes from the user's perspective. Traces each UI change through its full vertical slice — what the user sees, what it triggers, and how the server handles it. Use when asked to walk through what changed, review a PR, or summarize branch changes.
Run bin/claude-review --print and automatically fix all reported issues, committing each fix individually.
Summarize work done since the last standup across the user's configured repos — merged PRs, open PR reviews, PRs/commits authored, and a per-repo summary of code changes.