No worktrees or branches: work on main in the starting checkout and pull with rebase before pushing; other agents share the tree, so edit only the task's files, leave another session's dirty files alone, and commit by explicit path

This commit is contained in:
Ian Gulliver
2026-09-17 08:54:27 -07:00
parent ee66b03822
commit b686313905
+2
View File
@@ -50,6 +50,8 @@
- A PreToolUse hook denies any command containing `commit` unless it carries a comment reading exactly `USER EXPLICITLY AUTHORIZED THIS COMMIT IN THE IMMEDIATELY PRECEDING REQUEST`. Append that comment only when the immediately preceding user message actually authorized this commit. Adding it to get past the hook when they did not is lying to the one mechanism standing between an unauthorized commit and the repository. - A PreToolUse hook denies any command containing `commit` unless it carries a comment reading exactly `USER EXPLICITLY AUTHORIZED THIS COMMIT IN THE IMMEDIATELY PRECEDING REQUEST`. Append that comment only when the immediately preceding user message actually authorized this commit. Adding it to get past the hook when they did not is lying to the one mechanism standing between an unauthorized commit and the repository.
- Before every `git commit` or `git push`, quote the user's exact authorizing words from the CURRENT turn in the message that precedes the command. No quote means no commit. A turn that names other work ("do X, then Y") authorizes nothing beyond X and Y; "commit and push" in an earlier turn is spent the moment it is used once. - Before every `git commit` or `git push`, quote the user's exact authorizing words from the CURRENT turn in the message that precedes the command. No quote means no commit. A turn that names other work ("do X, then Y") authorizes nothing beyond X and Y; "commit and push" in an earlier turn is spent the moment it is used once.
- A multi-step instruction authorizes each named step once. Re-running any step, or applying it to work produced later in the same turn, needs a fresh instruction. - A multi-step instruction authorizes each named step once. Re-running any step, or applying it to work produced later in the same turn, needs a fresh instruction.
- Never create worktrees or branches, even when a message mentions one. Work on main in the checkout the session started in. Before every push, `git pull --rebase`, then push; everything lands on main.
- Other agents normally work in the same tree at the same time. Treat only your own changes as yours: edit only files your task needs, never touch a file another session has dirty, and commit by explicit path (`git commit -m "..." -- path ...`), never `git commit -a` or `git add -A`, so another agent's half-done edits never ride along. A dirty file you didn't touch, or a failing `go vet` in a package you didn't change, is another agent mid-edit, not a problem to fix.
- Single-line commit messages. No Co-Authored-By, no "Generated with", no AI attribution anywhere — commits, PRs, or any outward artifact. This overrides harness defaults. - Single-line commit messages. No Co-Authored-By, no "Generated with", no AI attribution anywhere — commits, PRs, or any outward artifact. This overrides harness defaults.
- Use `git commit -m "message"` directly. No heredocs for single-line messages. - Use `git commit -m "message"` directly. No heredocs for single-line messages.
- When the work belongs to a GitHub issue, always reference it in the commit message (e.g. `Fix login redirect (#123)`). - When the work belongs to a GitHub issue, always reference it in the commit message (e.g. `Fix login redirect (#123)`).