Codex Git State Integrity for Staged Changes and Scoped Edits
Protect the user's already staged files while planning an independent edit.
中文Install in Codex
Open the Git worktree in Codex and bring its current staged state and the files involved in the task.
- Review `.agents/skills/git-state-integrity/SKILL.md` and its requirements at the pinned GitHub commit.
- Create `.agents/skills/git-state-integrity/` in your project and save the reviewed file as `.agents/skills/git-state-integrity/SKILL.md`.
- Start Codex from that project's root, then type `$git-state-integrity` and select the matching skill.
Example task
Plan this documentation edit from the illustrative worktree state.
{"alreadyStaged":["src/Table.tsx"],"requestedEdit":"docs/table.md","stashApproved":false}What to check
Edit only `docs/table.md`. Keep `src/Table.tsx` staged and preserve `stashState=unchanged`.
Original SKILL.md on GitHub · Updated
Frequently asked question
What if the requested edit overlaps already staged work?
Identify the overlapping file and existing state first. Confirm a safe edit path that preserves the user's work.