git-hunks
Installation
SKILL.md
git-hunks
Non-interactive hunk staging for automated workflows. Replaces git add -p when terminal
interaction is unavailable.
Commands
git hunks list # Show unstaged hunks with stable IDs
git hunks list --staged # Show staged hunks
git hunks add '<id>' ['<id>'...] # Stage specific hunks by ID
Hunk ID Format
IDs use the pattern file:@-old,len+new,len, derived from diff @@ headers. IDs remain stable as
other hunks are staged (unlike line-based approaches).
Workflow
git hunks listto see all unstaged hunks- Identify which hunks belong to the current logical change
git hunks add 'file:@-10,5+10,7'to stage specific hunksgit status -sbto verify staging- Proceed with commit
Shell Quoting
MUST quote hunk IDs to prevent glob expansion of @ and + characters. Single quotes are safest:
git hunks add 'path/to/file:@-10,5+10,7'.
Related skills
More from rcdailey/dotfiles
csharp-coding
Use when writing or modifying C# code
26gh-gist
Use when creating or updating GitHub gists for document sharing
1gh-api
Use when managing draft PRs, posting PR comments, or querying GitHub Discussions
1agents-authoring
Use when creating or updating AGENTS.md files
1gh-pr-review
Use when posting code review comments on pull requests via gh-review
1humanizer
>-
1