Skip to content

Commit be7beda

Browse files
andrewgazelkacodex
andauthored
AGENTS: default to worktree branches (#120)
## Summary - make short-lived branches and separate worktrees the default for all changes - switch the landing flow from direct pushes to PRs targeting main with auto-merge when available ## Checks - nix run .#lint Co-authored-by: Codex <codex@openai.com>
1 parent 0408bd5 commit be7beda

1 file changed

Lines changed: 13 additions & 9 deletions

File tree

AGENTS.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,24 @@ operators will look first.
2626

2727
## Workflow
2828

29-
Pull before starting. Work directly on `main` in the shared checkout unless the
30-
user asks for a branch or separate worktree. Commit and push after making
31-
changes by default.
29+
Pull `main` before starting. Always make changes on a short-lived branch in a
30+
separate worktree by default, including small docs edits. Keep the shared `main`
31+
checkout as the clean landing zone for pulls, branch bases, and final syncs.
3232

33-
If the shared checkout already has unrelated edits, name the paths and the one
34-
line summary of what they appear to be doing, then move the new work into a
35-
temporary worktree:
33+
Create the branch and worktree from the updated `main` checkout. Use the
34+
`codex/` branch prefix unless the user asks for a different name:
3635

3736
```sh
38-
git worktree add ../<short-name>-<branch> -b <branch> main
37+
git worktree add ../<short-name>-<branch> -b codex/<branch> main
3938
```
4039

41-
Land that work with `git push origin <branch>:main`, then remove the worktree
42-
and delete the branch. Avoid stashing operator work out of the way.
40+
If the shared checkout already has unrelated edits, name the paths and the one
41+
line summary of what they appear to be doing before creating the new worktree.
42+
Avoid stashing operator work out of the way.
43+
44+
After local checks pass, push the branch and open a PR targeting `main`. Enable
45+
auto-merge when branch protection and review state allow it. Remove the worktree
46+
and delete the local branch after the PR has merged.
4347

4448
Commit one logical change at a time. Use the pathspec form so unrelated staged
4549
or unstaged files cannot ride along:

0 commit comments

Comments
 (0)