Add a staged expert /review command for pull requests - #68867
Open
PureWeen wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The workflow’s safety/documentation comments are currently inconsistent with the generated workflow behavior, which can mislead future audits and maintenance.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Lite
Findings: 1
New issues introduced by this change (1)
| Severity | Finding |
|---|---|
.github/workflows/pull-request-review.md — The comment claims the activation job sparse-checks out only .github, but the compiled workflow… |
What changed in this PR
Adds a staged, maintainer-invoked /review slash-command workflow for ASP.NET Core pull requests, plus a locally runnable review-pull-request skill and domain reference corpus to keep hosted and local review criteria consistent.
Changes:
- Introduces a new read-only (staged) Agentic Workflow that listens for the
reviewslash command and renders review output to the workflow summary. - Adds the
review-pull-requestskill contract that freezes PR evidence, routes to at most two domain references plus cross-cutting, validates findings, and outputs a structured result. - Adds domain reference documents (cross-cutting + area-specific) used by the workflow’s inline reviewer agents and by local runs of the skill.
| File | Description |
|---|---|
| .github/workflows/pull-request-review.md | New staged /review command workflow definition, including routing logic and inline reviewer agent blocks. |
| .github/workflows/pull-request-review.lock.yml | Generated workflow YAML produced by gh aw compile for the staged /review workflow. |
| .github/skills/review-pull-request/SKILL.md | New local skill contract describing evidence freezing, routing, validation gates, and output format. |
| .github/skills/review-pull-request/references/auth-security-reviewer.md | Auth/security domain review checklist and constraints used when routing security-related changes. |
| .github/skills/review-pull-request/references/blazor-components-reviewer.md | Blazor/Components domain review checklist and constraints used when routing Components changes. |
| .github/skills/review-pull-request/references/cross-cutting-reviewer.md | Cross-cutting review checklist applied to every routed review. |
| .github/skills/review-pull-request/references/grpc-reviewer.md | gRPC integration domain review checklist and constraints. |
| .github/skills/review-pull-request/references/hosting-di-reviewer.md | Hosting/DI domain review checklist and constraints. |
| .github/skills/review-pull-request/references/minimal-api-openapi-reviewer.md | Minimal API/OpenAPI domain review checklist and constraints. |
| .github/skills/review-pull-request/references/mvc-razor-routing-reviewer.md | MVC/Razor/routing domain review checklist and constraints. |
| .github/skills/review-pull-request/references/native-interop-reviewer.md | Native IIS interop domain review checklist and constraints. |
| .github/skills/review-pull-request/references/servers-networking-reviewer.md | Servers/networking domain review checklist and constraints. |
| .github/skills/review-pull-request/references/signalr-reviewer.md | SignalR domain review checklist and constraints. |
Suppressed comments (1)
.github/workflows/pull-request-review.md:118
- This comment says the workspace is empty because
checkout: false, but the generated workflow restores.github/skills/agents from the activation artifact into the workspace. The key safety property is “no pull request head checkout + no credentials”, so the wording should avoid asserting an empty workspace.
# To be precise rather than reassuring: the compiler still grants the agent a `write` tool inside
# the sandbox container. That is not a path back to this repository — the workspace is empty
# because `checkout: false`, credentials are excluded from the container, and no safe output can
# commit or push. It does mean "read-only" describes this workflow's effect on GitHub, not an
# absence of any filesystem capability in the sandbox.
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+89
to
+92
| # The inline reviewer agents below single-source their bodies from the skill's `references/` | ||
| # via `{{#runtime-import}}`. Those macros resolve in the activation job, which sparse-checks-out | ||
| # `.github` (only) from this workflow's own ref — never the contributor head — before any pull | ||
| # request checkout, so this is unaffected by `checkout: false`. |
PureWeen
force-pushed
the
pureween-manual-pr-reviewer
branch
from
September 2, 2026 18:41
58c6ff5 to
7c3f6be
Compare
PureWeen
marked this pull request as draft
September 2, 2026 18:50
PureWeen
marked this pull request as ready for review
September 2, 2026 20:05
PureWeen
force-pushed
the
pureween-manual-pr-reviewer
branch
from
September 3, 2026 04:19
6027a27 to
c8ae4e2
Compare
PureWeen
changed the base branch from
main
to
pureween-review-pull-request-skill
September 3, 2026 04:19
Adds the maintainer-invoked `/review` gh-aw workflow and its generated lock. A trusted pre-agent job freezes the exact head SHA, and the agent reviews that frozen commit through read-only GitHub tools using the repository-local `review-pull-request` skill. Publication is capped at five inline comments and exactly one COMMENT-only review. Both handlers are pinned to the frozen SHA, and both are held in gh-aw staged mode so maintainers can evaluate the output before it is ever posted. This is stacked on the skill: the workflow declares `skills: [.github/skills/review-pull-request]` and does not compile without it. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 23284af6-fe88-4424-a958-1cd6ea24c056
PureWeen
force-pushed
the
pureween-manual-pr-reviewer
branch
from
September 3, 2026 04:22
c8ae4e2 to
1271b07
Compare
PureWeen
changed the base branch from
pureween-review-pull-request-skill
to
main
September 3, 2026 04:24
PureWeen
changed the base branch from
main
to
pureween-review-pull-request-skill
September 3, 2026 04:24
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.

Adds a
/reviewcommand that gives a pull request the full domain-aware Expert Reviewer treatment.This is staged. A run renders its inline comments and final COMMENT-only review in the workflow summary instead of posting them. That lets maintainers evaluate it on real pull requests before deliberately enabling publication.
How it works
A maintainer comments
/reviewon a pull request. A trusted pre-agent job freezes the exact head SHA, then the workflow reads the authoritative file list, diff, PR body, and existing feedback from GitHub and fetches that frozen commit inside the gh-aw sandbox.It routes every changed domain to the corresponding ASP.NET Core expert criteria: servers and networking, MVC/Razor/routing, Blazor and Components, SignalR, auth and security, hosting and DI, minimal APIs and OpenAPI, gRPC, native IIS interop, plus cross-cutting review on every change. Shared paths run all applicable domains. Each routed review dimension gets a fresh workflow-local subagent rather than another pass in the orchestrator's context.
Candidates are not published from source inspection alone when behavior needs proof. The orchestrator traces the real call path and can run the smallest targeted build or red/green test at the frozen commit inside the sandbox. Every retained finding must point at a changed line, identify a concrete trigger and material consequence, cite its source, primary-contract, or empirical proof, and survive deduplication against existing feedback. Output is capped at five findings; an all-clear is a normal result.
Very large pull requests are declined instead of being partially reviewed and presented as complete.
Boundaries
The GitHub-facing agent permissions remain read-only. The workflow cannot approve or request changes, create or edit issues, commit, push, or mutate the pull request branch. Temporary validation edits and test execution stay inside the disposable gh-aw sandbox.
The only declared publication surfaces are up to five inline comments and exactly one COMMENT review. Both remain in gh-aw staged mode. Both handlers are structurally pinned to the SHA captured by the trusted pre-agent job, and the agent also fails closed if the live head changes while it is reviewing.
Inherited OTLP telemetry is explicitly disabled for this workflow because gh-aw v0.87.10 otherwise forwards the organization header aggregate into the agent environment. This keeps contributor-controlled build and test hooks from inheriting telemetry credentials.
No globally discoverable
.github/agentsor routing-only.github/instructionsfiles are added. The full expert topology is implemented with one repository skill, private domain references, and workflow-local inline agents.Live validation
The workflow has been run end to end inside a fork, with a temporary fork-only trigger guard, against a pinned copy of a real analyzer change. Every job succeeded. The trusted pre-agent job froze the head SHA, the agent installed the repository-local skill, read the authoritative diff, checked out the frozen commit inside the sandbox, built and ran the analyzer test project, confirmed the defect with a disposable red probe, and emitted one inline finding plus one COMMENT review. Both stayed in staged mode — the pull request received no review and no inline comments.
That run is also what produced the guard-policy shape used here. A scalar
allowed-reposcompiles to a bare string, and MCP Gateway v0.4.14 rejects any scalar guard policy that is notallorpublic, so the gateway failed at startup. The list form starts cleanly and keeps the same single-repository scope. Without that fix this workflow could not have run here at all.Known gap from the same run: on a small diff the agent chose the single-orchestrator path rather than dispatching the per-dimension subagent panel. It reported that choice in its result instead of implying panel coverage, which is the behaviour the skill requires, but making the panel dispatch mechanically enforced is the next iteration here. That is a further reason to land the skill separately in #69011.
The generated lock was compiled with gh-aw
v0.87.10and verified to compile cleanly on this stacked branch.This remains advisory and intentionally staged while maintainers evaluate the usefulness and accuracy of its output on real pull requests.