Skip to content

chore(git, stager): Support surgical staging#431

Merged
JeanMertz merged 3 commits intomainfrom
prr7
Mar 11, 2026
Merged

chore(git, stager): Support surgical staging#431
JeanMertz merged 3 commits intomainfrom
prr7

Conversation

@JeanMertz
Copy link
Collaborator

The assistant now has improved surgical staging capabilities with the addition of two new tools: git_add_intent and git_stage_raw_patch.

Previously, untracked files were invisible to git_list_patches, making it difficult to stage new files incrementally. The git_add_intent tool solves this by using git add --intent-to-add, which records new files in the index as empty blobs so their content appears as insertions.

Additionally, the git_stage_raw_patch tool allows the assistant to stage partial hunks by applying hand-edited unified diffs. This is particularly useful when git_list_patches provides a hunk containing mixed changes that cannot be separated by patch ID alone.

The stager persona and git-stage skill have been updated with instructions and tool definitions to utilize these new workflows. The summary for git_list_patches was also updated to clarify its use of --unified=0, aligning with the requirements for surgical editing.

The assistant now has improved surgical staging capabilities with the
addition of two new tools: `git_add_intent` and `git_stage_raw_patch`.

Previously, untracked files were invisible to `git_list_patches`, making
it difficult to stage new files incrementally. The `git_add_intent` tool
solves this by using `git add --intent-to-add`, which records new files
in the index as empty blobs so their content appears as insertions.

Additionally, the `git_stage_raw_patch` tool allows the assistant to
stage partial hunks by applying hand-edited unified diffs. This is
particularly useful when `git_list_patches` provides a hunk containing
mixed changes that cannot be separated by patch ID alone.

The `stager` persona and `git-stage` skill have been updated with
instructions and tool definitions to utilize these new workflows. The
summary for `git_list_patches` was also updated to clarify its use of
`--unified=0`, aligning with the requirements for surgical editing.

Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
@JeanMertz JeanMertz merged commit 8435573 into main Mar 11, 2026
23 of 32 checks passed
@JeanMertz JeanMertz deleted the prr7 branch March 11, 2026 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant