git-commit-staging

Stage Git changes at file, hunk, or line-range granularity using the pgs CLI.

2|Updated Mar 15, 2026
One-click install
npx skills add https://github.com/UtsavBalar1231/pgs --skill git-commit-staging
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-commit-staging
Source: https://github.com/UtsavBalar1231/pgs/tree/main/skills/git-commit-staging
Command: npx skills add https://github.com/UtsavBalar1231/pgs --skill git-commit-staging

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automates the precise staging of Git changes at the file, hunk, or line-granularity level, overcoming the limitations of interactive Git commands for AI agents.

Core Features & Use Cases

  • Atomic Commits: Split large changes into small, focused commits for better review and revertability.
  • Selective Staging: Stage only specific hunks or line ranges within a file, ignoring unrelated modifications.
  • Non-Interactive Workflow: Enables AI agents and scripts to manage Git staging without requiring a TTY.
  • Use Case: You've made several unrelated changes in one file (e.g., a bug fix and a new feature). Use this Skill to stage only the bug fix for an immediate commit, leaving the feature changes unstaged for a later commit.

Quick Start

Use the git-commit-staging skill to stage the specific hunk with ID 'abc123def456'.

Frequently Asked Questions about git-commit-staging

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

FAQPage Schema
How do I stage specific git hunks or line ranges non-interactively?

To stage specific git hunks or line ranges non-interactively, you can use this Skill to automate selective staging at file, hunk, or line-granularity levels without requiring a TTY. It leverages the pgs CLI to provide content-addressed hunk IDs and structured output.

What is the best way to split large git changes into atomic commits for AI workflows?

The best way to split large git changes into atomic commits for AI workflows is using this Skill to selectively stage only targeted modifications. It enables scripts and AI agents to manage precise git staging without interactive prompts, facilitating focused, easily revertable commits.

Do I need the pgs CLI installed to stage git changes at line granularity?

Yes, you need the pgs CLI installed and accessible to stage git changes at line granularity. This Skill relies on the pgs command-line tool to enable non-interactive staging and provide the structured output required for automated workflows.

Can I stage only a bug fix while leaving unrelated feature changes unstaged in the same file?

Yes, you can stage only a bug fix while leaving unrelated feature changes unstaged in the same file. This Skill enables selective staging at the hunk or line-range level, allowing you to isolate specific modifications for an immediate atomic commit.

Why does non-interactive git staging fail when running scripts without a TTY?

Non-interactive git staging often fails without a TTY because standard git commands require interactive input for hunk selection. This Skill overcomes that limitation by using the pgs CLI to automate staging operations and provide structured output for scripts.