docs: add guidance for creating smaller, self-contained PRs (#27155)

* docs: add guidance for creating smaller, self-contained PRs

Co-Authored-By: Volnei Munhoz <[email protected]>

* fix: remove PR size check from cubic-devin-review.yml per review feedback

Co-Authored-By: Volnei Munhoz <[email protected]>

* docs: clarify PR size limits apply to code files only

Co-Authored-By: Volnei Munhoz <[email protected]>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2026-01-22 15:06:11 -03:00
1 parent a0ff6b15f8
commit 1c09413ef4
3 files changed
+60

No files matched your search

+43
View File
@@ -30,6 +30,49 @@ You are a senior Cal.com engineer working in a Yarn/Turbo monorepo. You prioriti
- Never skip running type checks before pushing
- Never create large PRs (>500 lines or >10 files) - split them instead
## PR Size Guidelines
Large PRs are difficult to review, prone to errors, and slow down the development process. Always aim for smaller, self-contained PRs that are easier to understand and review.
### Size Limits
- **Lines changed**: Keep PRs under 500 lines of code (additions + deletions)
- **Files changed**: Keep PRs under 10 code files
- **Single responsibility**: Each PR should do one thing well
**Note**: These limits apply to code files only. Non-code files like documentation (README.md, CHANGELOG.md), lock files (yarn.lock, package-lock.json), and auto-generated files are excluded from the count.
### How to Split Large Changes
When a task requires extensive changes, break it into multiple PRs:
1. **By layer**: Separate database/schema changes, backend logic, and frontend UI into different PRs
2. **By feature component**: Split a feature into its constituent parts (e.g., API endpoint PR, then UI PR, then integration PR)
3. **By refactor vs feature**: Do preparatory refactoring in a separate PR before adding new functionality
4. **By dependency order**: Create PRs in the order they can be merged (base infrastructure first, then features that depend on it)
### Examples of Good PR Splits
**Instead of one large "Add booking notifications" PR:**
- PR 1: Add notification preferences schema and migration
- PR 2: Add notification service and API endpoints
- PR 3: Add notification UI components
- PR 4: Integrate notifications into booking flow
**Instead of one large "Refactor calendar sync" PR:**
- PR 1: Extract calendar sync logic into dedicated service
- PR 2: Add new calendar provider abstraction
- PR 3: Migrate existing providers to new abstraction
- PR 4: Add new calendar provider support
### Benefits of Smaller PRs
- Faster review cycles and quicker feedback
- Easier to identify and fix issues
- Lower risk of merge conflicts
- Simpler to revert if problems arise
- Better git history and easier debugging
## Commands
### File-scoped (preferred for speed)