Skip to content

Commit f03143a

Browse files
T-GroCopilot
andcommitted
Add Wave 5 delivery instructions to expert-reviewer agent
The expert-reviewer agent had 19 review dimensions and 4 analysis waves but zero instructions about posting the review to GitHub. Copilot would analyze thoroughly but never execute gh commands to create inline comments on the PR. Add Wave 5: Deliver Review as Inline Comments — mandatory final wave that instructs the agent to post findings via gh api as a review with inline comments at the correct file+line from the diff, deduplicate against existing reviews, and apply the AI-reviewed label. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 8adfa2b commit f03143a

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

.github/agents/expert-reviewer.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,49 @@ Execute review in five waves, each building on the previous.
473473
3. Verify build and packaging correctness.
474474
4. Confirm all test baselines are updated and explained.
475475

476+
### Wave 5: Deliver Review as Inline Comments
477+
478+
**This wave is mandatory.** Analysis without posting is worthless — the review MUST appear on the PR as posted inline comments at the correct file and line.
479+
480+
1. **Deduplicate first.** Check existing reviews to avoid duplicate content:
481+
```bash
482+
gh api repos/{owner}/{repo}/pulls/{number}/reviews --jq 'length'
483+
```
484+
If reviews from automated accounts already exist, skip posting and apply the label only.
485+
486+
2. **Post findings as a review with inline comments** at the best-fitting file and line. Use the GitHub API to create a single review with all comments:
487+
```bash
488+
gh api repos/{owner}/{repo}/pulls/{number}/reviews \
489+
--method POST \
490+
--field event=COMMENT \
491+
--field 'body=Expert AI review — see inline comments for findings.' \
492+
--field 'comments=[
493+
{"path":"src/Compiler/Checking/CheckDeclarations.fs","line":2750,"body":"**[Test Coverage]** This code path lacks a test. Add a test exercising this branch."},
494+
{"path":"src/Compiler/CodeGen/IlxGen.fs","line":1234,"body":"**[IL Emission]** Call `stripTyEqns` before this match to handle type abbreviations."}
495+
]'
496+
```
497+
Each comment needs:
498+
- `path`: file path relative to repo root (from the diff)
499+
- `line`: line number in the **new** version of the file (right side of diff)
500+
- `body`: severity tag in `**[Dimension]**` format, the issue, and suggested fix
501+
502+
3. **If no significant issues found**, post an approving review:
503+
```bash
504+
gh pr review {number} --repo {owner}/{repo} --approve \
505+
--body "Expert AI review: no significant issues found across applicable dimensions."
506+
```
507+
508+
4. **Apply the label and request human review:**
509+
```bash
510+
gh pr edit {number} --repo {owner}/{repo} --add-label AI-reviewed --add-reviewer T-Gro
511+
```
512+
513+
**Delivery rules:**
514+
- At most 10 inline comments — prioritize Behavioral over Quality over Nitpick.
515+
- Every comment must reference a specific file and line from the diff.
516+
- Never post duplicate content if reviews already exist on the PR.
517+
- If the PR is too large to review fully, note skipped areas in the review body.
518+
476519
## Folder Hotspot Mapping
477520

478521
See the `reviewing-compiler-prs` skill for the dimension selection table mapping files → dimensions.

0 commit comments

Comments
 (0)