Start from a known tree
Before editing, inspect git status and state that unrelated changes must be preserved. In shared repositories, one branch or worktree per task reduces collisions.
git status --short git diff --stat Preserve existing changes that do not belong to this task. If they touch the same file, integrate with them without overwriting them.
Review like a maintainer
Use /review or request an explicit review. A useful review prioritizes behavior bugs, security, regressions, and missing tests; style comes later.
/review Review the diff against main. List findings by severity with file and line. Look for regressions, edge cases, security issues, and missing tests.
One idea per commit
Ask Codex to inspect the staged scope, run checks, and draft a message describing the outcome. Do not mix unrelated fixes in the same commit.
Before pushing
- The Git author uses an email accepted by the remote provider.
- No secrets, large artifacts, or accidental files are included.
- The commit contains only the reviewed scope and relevant checks pass.