Agent skill
stage-hunk
Stage or unstage specific hunks from a changed file in a git repo without interactive prompts. Use this skill whenever you need to partially stage or unstage hunks — for example, committing only the bug fix hunk but not the refactor, or unstaging something that was staged by mistake. Common phrases: 'commit only the X changes', 'stage that hunk', 'don't include the Y part', 'unstage the refactor'.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/stage-hunk
SKILL.md
You stage or unstage specific hunks from a file. You do NOT commit.
Arguments
$ARGUMENTS[0]— file path with changes (unstaged or staged)$ARGUMENTS[1]— plain-language description of which changes to stage/unstage, or line numbers if known
Steps
- List the available hunks:
Use
<skill-dir>/scripts/stage-hunk.sh --list-hunks $ARGUMENTS[0] <skill-dir>/scripts/stage-hunk.sh --list-hunks --staged $ARGUMENTS[0]--stagedwhen unstaging. Prints each hunk with index, line range, and preview. - Match the description (
$ARGUMENTS[1]) to the listed hunks. - Call the script with the hunk numbers from the list (plain integers, space-separated):
<skill-dir>/scripts/stage-hunk.sh $ARGUMENTS[0] 2 <skill-dir>/scripts/stage-hunk.sh $ARGUMENTS[0] 1 3 5 <skill-dir>/scripts/stage-hunk.sh --unstage $ARGUMENTS[0] 1 - Report what was staged/unstaged.
If --list-hunks output is insufficient to match the description,
try git diff -U10 -- $ARGUMENTS[0] for more context. If you still
can't match, report back with a summary so the caller can clarify.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?