feat: inject sorted git diff into broad review rule prompts - #325
Closed
nhorton wants to merge 4 commits into
Closed
feat: inject sorted git diff into broad review rule prompts#325nhorton wants to merge 4 commits into
nhorton wants to merge 4 commits into
Conversation
Rules with strategy all_changed_files or matches_together and a **/* matcher now get git diff main..HEAD pre-fetched and injected into the review instruction file. The diff is sorted by filepath to group files by directory, reducing reviewer turn count. Diff is scoped to the rule's source_dir so subdirectory .deepreview files get narrower diffs. Also streamlines the /review skill to skip the get_configured_reviews call and go straight to get_review_instructions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The git diff injected into broad review prompts now includes: - A `git diff --stat` summary at the top for quick change overview - 8 lines of context (-U8) instead of the default 3, so reviewers can understand hunk placement without reading full files Also adds tagged test for REVIEW-REQ-004.11.5 (field default) and moves REVIEW-REQ-005.7 to end of file for sequential section order. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…tructure Moves the REVIEW-REQ-004.11.6 traceability comments from before the test function to before the requirement-specific assertions. This way the mock setup (which changes when implementation details like number of git calls change) is not guarded, while the actual pathspec assertions remain protected. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Traceability comments for REVIEW-REQ-004.11.6 were inside the method body; the project convention requires them immediately before the def line. Also includes lint auto-formatting. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Author
|
This did not seem to really help |
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.
Summary
all_changed_filesormatches_togetherstrategy and a**/*matcher now getgit diff main..HEADpre-fetched and injected into the review instruction file, reducing reviewer turn countsource_dirso subdirectory.deepreviewfiles get narrower diffs/reviewskill to skipget_configured_reviewsand go straight toget_review_instructionsTest plan
_should_inject_diff,_get_git_diffwith scoping,_sort_diff_by_path, diff injection inmatch_files_to_rules, diff rendering inbuild_instruction_file/reviewrun passed with no findings🤖 Generated with Claude Code