Skip to content

Commit 7809bb6

Browse files
docs: add PR creation guidelines to prevent stale local ref comparisons
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent d0162fe commit 7809bb6

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

AGENTS.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@ When the user asks to "create a prompt" (or similar), return the prompt directly
127127
Do not create a markdown file unless the user explicitly asks for a file.
128128
If ambiguous, prefer chat output.
129129

130+
## No Timeline Estimates
131+
132+
**Never include time estimates, durations, or effort assessments** in plans, summaries, or implementation outputs. This includes phrases like "~30 minutes", "2-3 hours", "Phase 1 (Day 1)", "Quick win", or any similar timeline/effort language. AI-generated timeline estimates are unreliable and misleading. Only include difficulty complexity risk estimates when appropiate.
133+
130134
## Critical Patterns
131135

132136
### Streaming Responses (MUST)
@@ -180,6 +184,7 @@ catch { if (previous) setState(previous) }
180184

181185
### 🚫 Forbidden
182186

187+
- **Creating git branches** — NEVER create new branches unless the user explicitly asks for a branch to be created. Implementation plans, feature work, and all other tasks must be done on the current branch. Branch creation requires explicit user instruction.
183188
- Read/write `.env*` files
184189
- Force push or commit secrets
185190
- `// @ts-ignore` (never acceptable)
@@ -232,6 +237,15 @@ Use `ultrathink` for complex architectural decisions.
232237

233238
See `.agents/workflows/development-cycle.md` for details.
234239

240+
## Pull Requests
241+
242+
When creating a pull request:
243+
244+
1. **Always fetch first** — Run `git fetch origin` before comparing branches
245+
2. **Compare against remote** — Use `origin/main` (not local `main`) for diffs and commit logs. Local `main` may be stale.
246+
3. **Verify commit count** — Run `git log origin/main..HEAD --oneline` and confirm the number matches what GitHub will show
247+
4. **Scope the description** — The PR body must reflect only the commits unique to the branch, not the full history since an outdated local ref
248+
235249
---
236250

237251
*~200 lines. For detailed patterns, see `.cursor/rules/` and `.agents/skills/`.*

CLAUDE.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This file contains Claude-specific behaviors, preferences, and context for the N
1414
### Response Style
1515
- Be concise; avoid over-explaining obvious code
1616
- Use code references (`startLine:endLine:filepath`) when discussing existing code
17-
- Prefer showing small, focused diffs over full file rewrites
17+
- **Never include timeline or effort estimates** (e.g., "~30 min", "2 hours", "Day 1") unless the user explicitly asks for them — AI time estimates are unreliable
1818

1919
### Tool Usage
2020
- **Maximize parallel tool calls** when operations are independent
@@ -184,6 +184,7 @@ Before writing code, follow this sequence:
184184

185185
### Forbidden Actions
186186

187+
- **Creating git branches** — NEVER create new branches unless the user explicitly asks for a branch to be created. Implementation plans, feature work, and all other tasks must be done on the current branch. Branch creation requires explicit user instruction.
187188
- Setting ESLint rules to `"off"` or `"warn"` to bypass errors
188189
- Adding `// @ts-ignore` (never acceptable)
189190
- Adding `eslint-disable` comments without documented reason
@@ -217,6 +218,7 @@ When debugging issues:
217218
- **Auth**: Uses Clerk for authentication; avoid touching `middleware.ts` without review
218219
- **File Storage**: Uses Convex storage for file uploads
219220
- **Model terminology**: See `.agents/context/glossary.md` for precise definitions
221+
- **Pull requests**: Always `git fetch origin` first and compare against `origin/main`, never local `main`. Local main can be arbitrarily stale, causing commit/diff inflation in PR descriptions.
220222

221223
---
222224

0 commit comments

Comments
 (0)