refactor: tighten the review prompt without losing information#19
Closed
mtrunkat wants to merge 1 commit into
Closed
Conversation
Compress prose throughout the prompt — same patterns, examples, rubric, workflow, and constraints, fewer words. Word count drops ~30% (2870 → ~2000), line count ~16% (183 → 153). Main collapses: * Pattern #3 (sharded shard-key) drops the redundant "in filter / $match" recitation already covered by the call list. * Pattern #8 (sharded readConcern) folds the "reason from the principle" postscript into the lead sentence. * Suggested-action template gets the same 3-tier preference but as a compact list instead of a sprawling sentence. * Severity rubric collapses each tier from a bulleted sub-list to a single comma-joined line that re-uses pattern names. * Steps 3-5 of the workflow lose throat-clearing. * Bash sandbox notes and Hard constraints strip filler words. No content removed. All 10 patterns, 7 examples, 5 workflow steps, 9 hard constraints, and the full suggested-action template preserved.
There was a problem hiding this comment.
Pull request overview
Refactors mongodb-query-index-check/prompts/review.md to be significantly more concise while preserving the same operational guidance for the MongoDB index-review bot (patterns, examples, rubric, workflow, constraints).
Changes:
- Condenses “Input data”, “What to look for”, and the “Common change patterns” sections into shorter, denser wording.
- Collapses the severity rubric and suggested-action guidance into more compact bullet/numbered formats.
- Tightens workflow and sandbox/constraints prose while keeping the same steps and requirements.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| 2. Collect comments whose `author` is `github-actions`, whose containing thread is not `is_outdated`, and whose `body` starts with the template prefix defined in step 4 (any of the four severity emojis followed by ` **MongoDB index check`). | ||
| 3. Drop any finding whose `(path, line)` matches a collected comment. Outdated threads don't count — line numbers shift across commits, so a fresh finding on a shifted line is a new finding. | ||
| 4. If no new findings remain, compute the max severity from the original (un-filtered) findings list, write it to `$RESULT_PATH`, and exit silently. Do not submit an empty review. | ||
| 1. Call `mcp__github__pull_request_read` with `method: get_review_comments` and `pullNumber: $PR_NUMBER` (review threads have `is_outdated`; each comment has `author`, `body`, `path`, `line`). |
Comment on lines
112
to
+115
|
|
||
| - `mcp__github__pull_request_review_write` with `action: create_pending` (or `mcp__github__create_pending_pull_request_review`) to open a pending review on `$PR_NUMBER`. If you get "can only have one pending review per pull request", continue to the next step. | ||
| - `mcp__github__add_comment_to_pending_review` to add one inline comment per finding. | ||
| - `mcp__github__pull_request_review_write` with `action: submit_pending` (or `mcp__github__submit_pending_pull_request_review`) to submit the review. | ||
| 1. `mcp__github__pull_request_review_write` with `action: create_pending` (or `mcp__github__create_pending_pull_request_review`) on `$PR_NUMBER`. If "can only have one pending review per pull request" — continue. | ||
| 2. `mcp__github__add_comment_to_pending_review` — one inline per finding; `path` and `line` at the **after-state RIGHT line** of the diff. | ||
| 3. `mcp__github__pull_request_review_write` with `action: submit_pending` (or `mcp__github__submit_pending_pull_request_review`). Event = `REQUEST_CHANGES` if `$REQUEST_CHANGES_MODE` is `true`, else `COMMENT`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacks on top of #17. Compresses the prose throughout
prompts/review.mdwithout dropping any information — same 10 patterns, 7 examples, 4-tier rubric, 5-step workflow, 9 hard constraints, full 3-tier "Suggested action" template.Numbers
Where the savings come from
$match/ aggregate's first$match" recitation already covered by the call list at the top.readConcern): folds the "reason from the principle for novel cases" postscript into the lead sentence so it reads as a single rule rather than a rule + appendix.Tests
pnpm run lint/type-check/test— clean, 35/35.Generated by Claude Code