Playbook overview

A Skill for checking staged changes

Guide, operating model and reference

The Git learning note records how unrelated edits can end up in a patch. If that check keeps coming up during handoffs, give the session a short procedure it can load when it needs it. This example uses read-only Git commands so it also works when a reviewer picks up the task. The Git learning note · Agent Skills specification

Create a folder called check-staged-changes in a location your client discovers and save this as SKILL.md. Put the linked learning note in references/git_learnings.md beside it. If the note already lives elsewhere in your repo, adjust the reference to point to the maintained copy and check that the client can follow it.

---
name: check-staged-changes
description: Inspect the staged and unstaged changes before handing off or committing a Git patch.
---

1. Read the approved task scope and [the Git learning note](references/git_learnings.md).
2. Run `git status --short`, `git diff --cached` and `git diff`.
3. Compare the staged paths and hunks with the approved scope. Report relevant work
   left unstaged and unrelated work that is already staged.
4. Leave staging as you found it. If a hunk mixes changes and you cannot
   establish ownership, include the path and the question in the handoff.

Try it in a disposable checkout with one intended change staged and one unrelated change unstaged, then repeat with the unrelated change staged. Check the report against the two diffs and verify that the index stays the same. Check whether the client discovers the Skill and loads the note during the task before relying on it. Git diff manual