prepare-commit-changes

Stage specific code hunks for Git commits using hunk ID formats.

10|1|Updated Jan 18, 2026
One-click install
npx skills add https://github.com/Awish021/opencode --skill prepare-commit-changes
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prepare-commit-changes
Source: https://github.com/Awish021/opencode/tree/main/skills/prepare-commit-changes
Command: npx skills add https://github.com/Awish021/opencode --skill prepare-commit-changes

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill allows users to precisely select and stage individual hunks of code for a commit, offering granular control over version control.

Core Features & Use Cases

  • Selective Staging: Stage only the specific lines or blocks of code you intend to commit.
  • Hunk Identification: Uses a stable file:@-old,len+new,len format for precise hunk referencing.
  • Use Case: After making several unrelated changes across multiple files, use this skill to stage only the bug fix hunks, leaving other feature-related hunks unstaged for a later commit.

Quick Start

Use the prepare-commit-changes skill to stage hunk 'src/main.c:@-10,6+10,7'.

Frequently Asked Questions about prepare-commit-changes

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I stage specific code hunks for a git commit?

You can stage specific code hunks for a git commit by using a defined hunk ID format and the `git hunks add` command, ensuring only explicitly selected code blocks are staged for the final commit.

What is the hunk ID format used for selective git staging?

The selective git staging mechanism uses a stable hunk identification format structured as `file:@-old,len+new,len`, providing precise referencing for individual code blocks across modified files.

How can I list unstaged and staged hunks before committing?

Listing unstaged and staged hunks before committing is supported natively by the skill's functionality, which displays all available code blocks and their current version control staging status for review.

How do I separate unrelated changes into different git commits?

Separating unrelated changes into different git commits requires selectively staging only the targeted bug fix or feature hunks via their hunk IDs, leaving other modified code blocks unstaged for a later commit.

Does staging selected hunks prevent accidental commits of other code?

Staging selected hunks effectively prevents accidental commits because the system ensures only explicitly selected hunks are staged, automatically excluding all other modified lines from the version control commit.