Version control and review
Every change goes through version control in small steps. Automated checks and a second pair of eyes approve it before it reaches the main branch.
- Required 2
- Recommended 12
Required
Protect the main branch
ENG-15Nobody pushes straight to the main branch. Every change arrives through a pull request with passing checks and a recorded review. A team approves with a second person, and a team of one with an AI or bot review.
Protect the accounts that can change the code
ENG-20Require two-factor login for everyone with write access to the code host. Remove a person's access when they leave, on the same day as their other keys.
Recommended
Keep every change in version control
ENG-13Keep code, settings, build scripts, infrastructure and database changes in version control. Only secrets stay out.
Make small changes on short-lived branches
ENG-14Merge small changes often. A branch lives for at most 5 working days, and a change does one thing.
Run the checks on every change
ENG-16Run the full check on a clean machine for every push and pull request, not only on a developer's computer.
Test each change on top of the latest main before merging
ENG-60Merge through a merge queue, or require every branch to be up to date with main. Then the checks run on the exact code that main will hold.
Fix a broken main branch first
ENG-17When the check fails on the main branch, fixing it comes before any other work. Revert the change that broke it if a fix takes longer than one hour.
Update dependencies in small automatic steps
ENG-18Let a bot open a pull request for each dependency update. Merge patch and minor updates when the checks pass, and have a person review each major update.
Require an owner's review for sensitive code
ENG-19Name the owners of payment, login, permission, deploy and CI files. Require one of them to approve every change to those files.
Change the docs in the same pull request
ENG-29Keep docs in the repository next to the code they describe, and update them in the pull request that changes the behaviour.
Name the principle and the fix in every finding
ENG-61Every finding names the broken principle, the exact file and line, and a concrete fix. "This feels messy" is not a finding.
Report problems beyond the diff
ENG-62When the review finds other code that breaks the same rules, report it too, as a separate list.
Answer every question by number
ENG-63Answer every review question with its number, even when the answer is "no problems found". A skipped number counts as not reviewed.
Verify every finding from scratch
ENG-64Check each finding again with a reviewer who starts fresh, such as a second person or a new AI agent. Drop findings that don't hold up.
Read this with
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/engineering/version-control-and-review">Agent Wranglers engineering playbook</a>. In code you write, add a comment next to it with the same link.