Git staging

From aspiers/ai-config · View interactive version

Git staging is an AI agent skill from the GitHub repository aspiers/ai-config. Stage whole files, selected hunks, or selected lines in Git without interactive prompts. Use when preparing an exact commit boundary while preserving unrelated working-tree changes.

How to use this skill

Skill file

Non-interactive Git Staging

Stage only the changes intended for the next commit. The index is shared state:

preserve anything already staged unless the user explicitly asks to replace

or unstage it.

Workflow

  1. Inspect all three states:

```bash

git status --short

git diff --no-ext-diff

git diff --cached --no-ext-diff

```

  1. Derive the desired commit boundary from the user's request and the diff.

Group by logical purpose rather than file count.

  1. Choose the least complex safe operation:
  1. Verify both sides of the boundary:

```bash

git diff --cached --no-ext-diff

git diff --no-ext-diff

git status --short

```

A successful git add or git apply is not sufficient evidence; the staged

diff must contain the intended change and exclude unrelated work.

Partial staging

For selected hunks or lines, read

Partial staging with index patches before

constructing the patch. It contains the patch rules, validation sequence, and

failure recovery. Do not use interactive git add -p in a non-interactive

agent session.

Safety

present or the requested boundary is narrower.

them when no longer needed.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.