Skip to content

Commit db79cfc

Browse files
committed
fix(agents): PR descriptions must be snapshots, not chronological narratives
Agents were appending "Review fixes" / "Consolidation" sections to PR descriptions after each push, producing changelog-style narratives instead of clean comparisons to main. Add snapshot principle to the PR Maintenance rule, explicit "rewrite from scratch" guidance, and prohibitions on narrating review rounds or mentioning internal workflow tools (code-reviewer, crossfire, etc.) in PR descriptions.
1 parent abe9619 commit db79cfc

3 files changed

Lines changed: 34 additions & 6 deletions

File tree

src/ai_rules/config/AGENTS.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -259,22 +259,26 @@ def test_calls_hash_password():
259259

260260
### PR Maintenance After Pushing Commits
261261

262-
**Rule:** After pushing commits to a branch with an existing open PR, always re-evaluate whether the PR title and description still accurately reflect the PR's content.
262+
**Rule:** After pushing commits to a branch with an existing open PR, re-evaluate the title and description. A PR description is a point-in-time snapshot of what this branch changes vs. main — never a timeline or narrative of how the PR evolved.
263263

264264
**Mandatory workflow after every push to an existing PR:**
265265
1. Re-read: `gh pr view <number> --json title,body`
266266
2. Evaluate: does the title/description accurately describe ALL commits on the branch — not just the latest push?
267-
3. If stale, incomplete, or misleading: `gh pr edit <number> --title "..." --body "$(cat <<'EOF'...EOF)"`
267+
3. If stale: rewrite from scratch, then update via `gh pr edit <number> --title "..." --body "$(cat <<'EOF'...EOF)"`
268268

269-
Updates are required when the PR's scope has materially changed — new direction, expanded scope, different approach. A minor fix already implied by the description probably doesn't need changes. But always evaluate; never skip the check.
269+
A minor fix already implied by the description probably doesn't need changes. But always evaluate; never skip the check.
270270

271-
-Pushing 3 feedback-driven commits and moving on without checking the description
272-
-Re-reading, evaluating against the full commit set, editing if the description is now stale
271+
-Adding a "Review fixes" or "Consolidation" section that narrates what changed after feedback
272+
-Rewriting the full description to reflect what the branch currently does vs. main
273273

274274
### PR Description Content
275275

276276
**NEVER include a "Test Plan", "Testing", or "Test plan" section in PR descriptions.** CI passing is a gate, not a finding.
277277

278+
**NEVER narrate the development process** — no "after review," "following feedback," "consolidated from," or references to review rounds. Describe the final state only.
279+
280+
**NEVER mention internal workflow tools** (code-reviewer, crossfire, test-writer, etc.) in PR descriptions.
281+
278282
### Commit Messages
279283
**Rule:** Subject states WHAT changed. Body explains WHY -- the problem, motivation, or design decision. Never narrate what's visible in `git show --stat` or the diff itself.
280284

src/ai_rules/config/skills/pr-creator/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,6 @@ EOF
116116

117117
**Formatting:** Always use HEREDOC in `gh pr create --body` | Ensure proper line breaks/bullets | Blank line before issue refs
118118

119-
**PR Maintenance:** This skill covers PR creation only. After pushing additional commits to an existing PR, follow the PR Maintenance rule in AGENTS.md: re-read the current title/description and evaluate whether they still accurately reflect all commits.
119+
**PR Maintenance:** This skill covers PR creation only. After pushing additional commits to an existing PR, follow the PR Maintenance rule in AGENTS.md: rewrite the description from scratch as a snapshot of what the branch changes vs. main.
120120

121121
Goal: Create PR descriptions making code review efficient and thorough, providing reviewers all context to understand and evaluate changes quickly.

src/ai_rules/config/skills/pr-creator/references/templates.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,30 @@ Currently, webhook failures are silently dropped, causing data sync issues for i
293293

294294
**Omit test plan entirely** -- leave test planning to humans.
295295

296+
---
297+
298+
**Chronological narrative (narrates review rounds):**
299+
```
300+
This PR adds rate limiting to the API.
301+
302+
- Add `RateLimiter` middleware with `check_rate()` method
303+
304+
## Review fixes
305+
- Renamed `check_rate()` to `enforce_limit()` per code-reviewer feedback
306+
- Moved config to `settings.py` after crossfire review
307+
- Added input validation (round 2 feedback)
308+
```
309+
310+
**Clean snapshot (describes final state vs. main):**
311+
```
312+
This PR adds rate limiting to the API to prevent abuse.
313+
314+
Authentication overhead was allowing unbounded request rates.
315+
316+
- Add `RateLimiter` middleware with configurable limits via `settings.py`
317+
- Expose `enforce_limit()` as the public interface
318+
```
319+
296320
## Brevity Principles
297321

298322
1. **Every word must earn its place** - Reviewers skim descriptions

0 commit comments

Comments
 (0)