Software Engineering / Version Control & Review
Make agent commits and pull requests reviewable
- MUST work on a branch named for the task (for example
feat/issue-42-json-output), created from the latest default branch. Never commit directly tomainor another protected branch. - MUST make each commit one logical change that builds and passes tests on its own. Keep refactors, formatting and generated files in separate commits from behaviour changes.
- MUST write commit messages that say what changed and why: a short imperative subject (for example in Conventional Commits form,
fix: reject empty tag names), and a body when the reason is not obvious. - MUST mark agent-authored work as such, with the project’s attribution convention (for example a
Co-Authored-By:trailer naming the agent) so reviewers and audits can tell. - MUST NOT force-push, rebase or otherwise rewrite history that others have fetched (shared branches,
main). Rewriting your own unpushed or unshared commits is fine. - MUST NOT commit secrets, credentials, local configuration, large binaries or build output; run secret scanning before committing (BP-0033).
- MUST fetch the remote before integrating, and integrate the latest default branch into your branch (rebase if unshared, merge if shared) before opening or updating a pull request, resolving conflicts yourself and re-running tests.
- MUST open a pull request with: what changed, why (link the issue), how it was verified (commands run and their results), what was not done, and any decisions made without the requester.
- SHOULD keep pull requests small enough to review in one sitting; split large work into a sequence of pull requests (BP-0008).
- SHOULD never mark a pull request ready, or merge it, when CI is failing or checks were skipped.
- MAY squash a branch’s commits on merge when the project prefers one commit per change.
When to apply
Section titled “When to apply”Any agent that changes a repository.
Examples
Section titled “Examples”fix: reject empty tag names in records upload
Paperless accepted "" as a tag and created an orphan.Validate before upload and return exit code 2 with the bad field.
Closes #42Co-Authored-By: <agent name> <agent email>Pull request body:
## WhatReject empty tag names before upload.## WhyCloses #42 — orphan tags created by blank values.## Verified- `bun test` → 81 pass, 0 fail- Manual: upload with tags `["", "Tax"]` → exit 2, "tag[0] is empty"## Not doneCleaning up existing orphan tags (separate issue #43).Anti-patterns
Section titled “Anti-patterns”- One 2,000-line commit “update stuff”.
git push --forceto a branch a colleague is working on.- Pull requests that say “done” with no evidence.
- Agent commits indistinguishable from human ones.
Checklist
Section titled “Checklist”- Task branch from latest default branch; no direct commits to protected branches
- Small logical commits; clear messages; agent attribution
- No rewritten shared history; no secrets or build output
- Latest default branch integrated; tests re-run
- PR states what, why, evidence, not done; CI green