- Delete unused or obsolete files when your changes make them irrelevant (refactors, feature removals, etc.), and revert files only when the change is yours or explicitly requested. If a git operation leaves you unsure about other agents' in-flight work, stop and coordinate instead of deleting.
- Before attempting to delete a file to resolve a local type/lint failure, stop and ask the user. Other agents are often editing adjacent files; deleting their work to silence an error is never acceptable without explicit approval.
- NEVER edit
.envor any environment variable files—only the user may change them. - Coordinate with other agents before removing their in-progress edits—don't revert or delete work you didn't author unless everyone agrees.
- Moving/renaming and restoring files is allowed.
- ABSOLUTELY NEVER run destructive git operations (e.g.,
git reset --hard,rm,git checkout/git restoreto an older commit) unless the user gives an explicit, written instruction in this conversation. Treat these commands as catastrophic; if you are even slightly unsure, stop and ask before touching them. (When working within Cursor or Codex Web, these git limitations do not apply; use the tooling's capabilities as needed.) - Never use
git restore(or similar commands) to revert files you didn't author—coordinate with other agents instead so their in-progress work stays intact. - Always double-check git status before any commit
- Keep commits atomic: commit only the files you touched and list each path explicitly. For tracked files run
git commit -m "<scoped message>" -- path/to/file1 path/to/file2. For brand-new files, use the one-linergit restore --staged :/ && git add "path/to/file1" "path/to/file2" && git commit -m "<scoped message>" -- path/to/file1 path/to/file2. - Quote any git paths containing brackets or parentheses (e.g.,
src/app/[candidate]/**) when staging or committing so the shell does not treat them as globs or subshells. - When running
git rebase, avoid opening editors—exportGIT_EDITOR=:andGIT_SEQUENCE_EDITOR=:(or pass--no-edit) so the default messages are used automatically. - Never amend commits unless you have explicit written approval in the task thread.
Created
October 14, 2025 14:41
-
Star
(205)
You must be signed in to star a gist -
Fork
(37)
You must be signed in to fork a gist
-
-
Save steipete/d3b9db3fa8eb1d1a692b7656217d8655 to your computer and use it in GitHub Desktop.
Agent rules for git
Author
steipete
commented
May 20, 2026
via email
see my agent-scripts repo
…On Wed, May 20, 2026 at 4:03 AM Felixy celeste ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
@steipete <https://github.com/steipete> so true, what you use then
—
Reply to this email directly, view it on GitHub
<https://gist.github.com/steipete/d3b9db3fa8eb1d1a692b7656217d8655#gistcomment-6157984>
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAOI7IDA6J6DLMJDFPG3UL43UOA3BFKMF2HI4TJMJ2XIZLTSOBKK5TBNR2WLKJRG4YTINRQGU3TLJDOMFWWLKDBMN2G64S7NFSIFJLWMFWHKZNEORZHKZNENZQW2ZN3ORUHEZLBMRPXAYLSORUWG2LQMFXHIX3BMN2GS5TJOR4YFJLWMFWHKZNEM5UXG5FENZQW2ZNLORUHEZLBMRPXI6LQMWWHG5LCNJSWG5C7OR4XAZNLI5UXG5CDN5WW2ZLOOSTHI33QNFRXHEMCUR2HS4DFURTWS43UUV3GC3DVMWUTCNBRG42TGMJXG2TXI4TJM5TWK4VGMNZGKYLUMU>
.
You are receiving this email because you were mentioned.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment