Skip to content

Improves pr-review skill based on evaluation against merged PRs - #7662

Merged
waldekmastykarz merged 4 commits into
pnp:mainfrom
waldekmastykarz:pr-review-skill-improvements
Oct 28, 2026
Merged

waldekmastykarz merged 4 commits into
pnp:mainfrom
waldekmastykarz:pr-review-skill-improvements

Conversation

@waldekmastykarz

Copy link
Copy Markdown
Member

Improves the pr-review agent skill (.github/skills/pr-review/) based on running it blind on the original commits of 10 recently merged PRs (#7632, #7619, #7616, #7613, #7611, #7599, #7596, #7595, #7586, #7585) and comparing its output with actual human and Copilot review feedback. The skill caught ~19/27 real issues (2 partial, 6 missed), was too strict with its verdict, and flagged pre-existing issues as blocking.

No linked issue: this is a maintainer tooling change that only touches the skill files.

Changes

  • Verdict: only Errors trigger REQUEST_CHANGES; Warnings/Suggestions only → COMMENT; zero findings → APPROVE.
  • Scope policy: read as widely as needed, but only issues the PR introduces or exposes (incl. unchanged code whose behavior changes because of the PR, and copied bad patterns) can block. Pre-existing issues go under a non-blocking "Noticed, out of scope" heading. Heuristic: "Would this still be a problem if the PR were reverted?"
  • Severity calibration: security issues and regressions in behavior users rely on are always Errors.
  • Consistency fixes: "four categories", Documentation category added to findings and inline comment format, file-reference link format defined (blob URL at the reviewed SHA with #L anchors).
  • Phase 1: read linked issues, review a specific commit, build/test/lint in a separate worktree (and say so if not run).
  • Breaking changes/removals: release-notes wording, upgrade guidance, leftover references, unknown-options behavior.
  • Refactors/migrations: behavior parity (aliases, option sets, customCode: 'optionSet'/'required', zod.coercedEnum, unknown options, docs).
  • Test conventions: behavior-describing test names, exact URL/body assertions, settingsNames constants, asserting changed arguments.
  • Output docs: only text output applies defaultProperties; verify each format's sample.
  • New references/area-checklists.md: SPFx upgrade/doctor rules, docs site, telemetry/infrastructure.

Validation

Documentation-only change to agent skill files; no build or tests apply. The skill was not re-run against PRs as part of this change.

- Verdict: only Errors request changes; Warnings/Suggestions comment
- Adds scope policy for pre-existing vs PR-introduced issues
- Calibrates severity for security issues and regressions
- Fixes category inconsistencies, defines file link format
- Reads linked issues, supports reviewing specific commits,
  adds guidance on building/testing in a separate worktree
- Adds checks for breaking changes, migrations, test conventions
  and output format samples
- Adds area-specific checklists for SPFx rules, docs site and
  telemetry/infrastructure

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 6ac661ee-4c24-4321-85a6-da14f7c6feb0

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The review guidance contains inaccuracies in PR diff selection, SPFx support checks, and CSV/Markdown property handling that can cause missed changes or false findings.

3 open issues
What changed in this PR

Refines the pr-review skill using feedback from 10 merged PRs, aiming to reduce false positives and better distinguish blocking issues from advisory feedback.

Changes:

  • Calibrates severity, verdicts, and scope rules for introduced versus pre-existing issues.
  • Expands guidance for commit-specific reviews, isolated validation, migrations, tests, and output documentation.
  • Adds focused checklists for SPFx, the docs site, and telemetry/infrastructure.
File Description
.github/​skills/​pr-review/​SKILL.md Updates review workflow, scope, severity, validation, and reporting guidance.
.github/​skills/​pr-review/​references/​area-checklists.md Adds area-specific checks for SPFx, docs, and shared infrastructure.

Review effort: Balanced

Comment thread .github/skills/pr-review/SKILL.md Resolved
Comment thread .github/skills/pr-review/SKILL.md Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved inaccuracies in diff selection and review checks can hide historical PR changes, run unintended tests, and flag valid behavior as defects.

5 open issues

Review effort: Balanced

Comment thread .github/skills/pr-review/SKILL.md Resolved
Comment thread .github/skills/pr-review/SKILL.md Resolved
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The latest-head review workflow does not fetch the PR head before creating a worktree, so it can fail with an invalid-reference error when the commit is absent locally, particularly for fork PRs.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Medium severity Fetch PR head before creating worktree for latest-head reviews

.github/​skills/​pr-review/​SKILL.md:48

For an ordinary latest-head review, the preceding steps never fetch the PR head (gh pr view and gh pr diff only read API data), so this fails with invalid reference when that commit is absent locally, notably for fork PRs. Consider fetching the PR head from the base repository before creating the worktree; the existing fetch only covers the specific-commit workflow.

5 resolved since last review

Review effort: Balanced

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@waldekmastykarz

Copy link
Copy Markdown
Member Author

Addressed the latest Copilot review in d898939. The validation workflow now fetches pull/<number>/head from the base repository before creating the worktree, so latest-head reviews work when the commit is not already available locally, including fork PRs. Verified with exact aliases nrb && nt: 16,288 tests passed with 100% statements, branches, functions, and lines coverage.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Validation commands check out the latest PR head instead of the reviewed SHA, allowing later fixes to mask defects in the revision under review.

1 open issue

Review effort: Balanced

Comment thread .github/skills/pr-review/SKILL.md Resolved
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Human assessment is needed to distinguish actual PR changes from merged target-branch changes that the diff may incorrectly flag as blocking findings.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@waldekmastykarz
waldekmastykarz merged commit 0191797 into pnp:main Oct 28, 2026
10 checks passed
@waldekmastykarz
waldekmastykarz deleted the pr-review-skill-improvements branch October 28, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants