gfix
- Repo stars 2,380
- License MIT
- Author updated Live
- Author repo dotfiles
- Domain
- Engineering
- Compatible agents
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- Trust score
- 94 / 100 · audit passed
- Author / version / license
- @ryanb · MIT
- Token usage
- Lean
- Setup complexity
- Guided setup
- External API key
- Not required
- Operating systems
- Unspecified (assume cross-platform)
- Runtime requirements
- No special requirements
- Permissions
-
- Read-only
- Write / modify
- Shell exec
- Network behavior
- Local-only
- Install commands
- 26 variants
Profile is derived at build time from SKILL.md and install vectors. Subject to drift from author intent.
Heads up: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: gfix
description: Amend a git commit further back in the history. Use the gfix shell command to fold staged change…
category: engineering
runtime: no special runtime
---
# gfix output preview
## PART A: Task fit
- Use case: Amend a git commit further back in the history. 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. runs entirely locally. Works with Claude Code, Cursor, Cline and 23 more..
- Inputs: target material, constraints, expected output, and acceptance criteria.
- Evidence boundary: follow “How gfix works / When to use gfix / Steps” and do not present inference as author intent.
## PART B: Execution result
- **01** The card summarizes the use case; runtime output centers on “Amend a git commit further back in the history. 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. runs entirely locally. Works with Claude Code, Cursor, Cline and 23 more.”.
- **02** When the source has headings, the agent prioritizes “How gfix works / When to use gfix / Steps” so the result follows the author’s structure.
- **03** Typical output includes task judgment, concrete steps, required commands or file edits, validation, and follow-up options.
- **04** Risk context follows the fingerprint: read files, write/modify files, run shell commands; mostly runs locally; usually needs no extra API key.
## Running Rules
- read files, write/modify files, run shell commands; mostly runs locally; usually needs no extra API key.
- Validate with a small sample before expanding scope.
- Return the result, validation criteria, and next iteration options. The source does not require a stable slash command. After installation, invoke the skill by name and describe the task.
Name target files or source material, expected output, forbidden changes, and whether network or shell access is allowed. Permission fingerprint: read files, write/modify files, run shell commands.
Start with a small task and check whether the result follows “How gfix works / When to use gfix / Steps”. Inspect diffs, logs, previews, or tests before expanding scope.
Confirm the final output includes a concrete result, evidence, and next action. If it stays generic, tighten inputs, boundaries, and acceptance criteria.
---
name: gfix
description: Amend a git commit further back in the history. Use the gfix shell command to fold staged change…
category: engineering
source: ryanb/dotfiles
---
# gfix
## When to use
- Amend a git commit further back in the history. Use the gfix shell command to fold staged changes into a commit that i…
- Use it when the task has clear inputs, repeatable steps, and validation criteria.
## What to provide
- Target material, scope, expected result, and forbidden changes.
- Whether network, commands, file writes, or external services are allowed.
## Execution rules
- Organize steps around “How gfix works / When to use gfix / Steps” and keep inference separate from source facts.
- read files, write/modify files, run shell commands; mostly runs locally; usually needs no extra API key.
- Validate with a small sample before expanding the task.
## Output requirements
- Return the deliverable, key evidence, validation method, and next action.
- Mark missing information as unknown; do not invent commands, platforms, or dependencies. The author source anchors workflow facts; repository files anchor sources and commands; Fluxly only adds fit, limitations, and quality judgment.
skill "gfix" {
input -> user goal + target files + boundaries + acceptance criteria
context -> How gfix works / When to use gfix / Steps
rules -> SKILL.md triggers / order / output contract
runtime -> no special runtime | read files, write/modify files, run shell commands | mostly runs locally
guardrails -> usually needs no extra API key + small-sample validation + diff/log review
output -> copyable result + checklist + next iteration
} gfix — Amend a Past Commit
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.
How gfix works
Source: ~/code/dotfiles/plugins/git.zsh (the gfix function)
gfix [-m <message>] <commit-sha> does the following:
- Guards against running during an in-progress git operation (rebase, merge, cherry-pick, etc.)
- Stashes any unstaged changes (preserving the index)
- Creates a fixup commit from whatever is currently staged:
- With no
-m:git commit --fixup <commit-sha>(content-only fixup) - With
-m <message>: creates a manualamend!commit with subjectamend! <original-subject>and body<message>, which autosquash then folds into the target (replacing its message, and including any staged changes;--allow-emptyis used if nothing is staged)
- With no
- Runs
GIT_SEQUENCE_EDITOR=true git rebase -i --autosquash <commit-sha>^to automatically squash the fixup into the target commit - Restores any stashed unstaged changes
When to use gfix
Use gfix when you need to amend a commit that is not the HEAD commit. For example:
- A review comment asks for a change to code introduced 3 commits ago
- You notice a typo or bug in an earlier commit while working on something else
- You want to keep a clean, logical commit history where each commit is self-contained
If you only need to amend the most recent commit, use git commit --amend instead.
Steps
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_branchto 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
$ARGUMENTSto understand what the user wants fixed. List the safe commits withgit log --oneline <base-branch>..HEADand 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 addonly 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:
- Read the conflicting files and resolve them
git addthe resolved filesgit rebase --continue- Repeat until the rebase finishes
Verify — Run
git log --oneline -10to confirm the history looks correct. If relevant tests exist, run them.
Decide Fit First
Design Intent
How To Use It
Boundaries And Review