Repository navigation
Add review-public-api Copilot skill - #67335
Merged
Merged
Conversation
javiercn
force-pushed
the
javiercn/review-public-api
branch
from
June 21, 2026 15:50
6d4d7cc to
865e3b0
Compare
javiercn
marked this pull request as ready for review
June 22, 2026 06:37
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new repository Copilot skill (review-public-api) intended to review proposed ASP.NET Core public APIs in the style of @dotnet/aspnet-api-review, including a prescribed workflow, conventions reference, and an evaluation scenario suite.
Changes:
- Introduces the
review-public-apiskill definition and workflow guidance under.github/skills/review-public-api/. - Adds reference documents covering process framing, output format, and a consolidated conventions/ruleset.
- Adds a held-out evaluation scenario set for the skill under
eng/skill-evals/review-public-api/.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| eng/skill-evals/review-public-api/eval.yaml | Adds held-out evaluation scenarios/assertions/rubrics for the skill. |
| .github/skills/review-public-api/SKILL.md | Defines the skill, trigger phrases, and the expected review workflow/output. |
| .github/skills/review-public-api/references/process.md | Documents the API review lifecycle and “should this exist?” framing. |
| .github/skills/review-public-api/references/output-format.md | Specifies the required structure of the skill’s output. |
| .github/skills/review-public-api/references/conventions.md | Captures repo-specific API review conventions used by the skill. |
Youssef1313
reviewed
Jun 22, 2026
javiercn
force-pushed
the
javiercn/review-public-api
branch
from
June 30, 2026 14:41
3ab34d3 to
76c7cda
Compare
javiercn
force-pushed
the
javiercn/review-public-api
branch
from
July 27, 2026 13:47
76c7cda to
fec442e
Compare
javiercn
force-pushed
the
javiercn/review-public-api
branch
from
July 27, 2026 15:33
fec442e to
5bbeadf
Compare
3 tasks
Youssef1313
reviewed
Jul 28, 2026
javiercn
force-pushed
the
javiercn/review-public-api
branch
from
July 28, 2026 10:36
cec19c8 to
b58545a
Compare
Adds a .github/skills/review-public-api skill that reviews a proposed public API for this repo the way the @dotnet/aspnet-api-review team would: it produces a verdict, a need assessment (commonality and target audience), per-type bullet changes, and a diff against the existing repo API surface. The skill is split into SKILL.md plus three reference docs covering the review process, the conventions the API review team applies, and the expected output format. Also adds a Vally eval for the skill and a generic skills-vs-baseline experiment that A/B tests any skill with a Vally eval against a no-skill baseline. These are run manually, not in CI. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 7088f3cc-6dc3-446b-9a4f-a1d420a4f53a
javiercn
force-pushed
the
javiercn/review-public-api
branch
from
July 28, 2026 10:47
b58545a to
7c282e1
Compare
Youssef1313
reviewed
Jul 28, 2026
Youssef1313
approved these changes
Jul 28, 2026
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
Adds a knowledge-driven Copilot skill under
.github/skills/review-public-api/that reviews a proposed public API the way the@dotnet/aspnet-api-reviewteam would: it judges whether the API should exist at all (modeling scenarios, environments, common-vs-rare usage, input provenance), then proposes concrete shape changes — each with grounded reasoning — and a ref-assembly diff against the existing surface. It also encodes the modern-C# "negative space" — the language features the public surface deliberately avoids (publicrecord/record struct) versus the ones it adopts (required/initover constructor-overload proliferation). Documentation/markdown only; no product code.How it was built
Mined from the repo itself, three sources:
PublicAPI.Shipped.txtfiles (~24k members) plus representative implementations, for quantified cross-cutting conventions (Task-over-ValueTask +Asyncsuffix;CancellationTokenlast + default; read-only returns; the type-suffix taxonomy; the method-family contract —Add*registers services inMicrosoft.Extensions.DependencyInjection,Use*/Map*inMicrosoft.AspNetCore.Builder, regardless of the feature namespace)..csprojdependency & packaging metadata + source-confirmed type kinds and a base/implements graph, to derive which kind of type belongs in which kind of assembly (interfaces ≈46% of*.Abstractionsvs ≈13% of implementations; abstractions are dependency sinks), the abstraction↔implementation and provider three-layer patterns, namespace-vs-assembly decoupling, shared-framework vs standalone-NuGet packaging, and type-relationship conventions (Default<X> : X; provider options/handler inheritance chains; results implementingIResult+ granular metadata interfaces; behavioral attributes implementing framework interfaces; reuse-an-existing-extension-point; companion-type clusters).record/record structis the one feature deliberately avoided (its synthesized equality/with/Deconstruct/copy-ctor freeze into the binary + ref-assembly contract and can't be evolved), whilerequired/initare recommended over constructor-overload proliferation, andstatic abstract/default-interface-methods are allowed with concrete justification. Implementation-style idioms invisible at the API boundary are out of scope.Validation
api-ready-for-reviewproposals never used to derive the rules + decided issues with known outcomes), the skill measurably improves review quality where the unaided agent is weak — aggregate +20.3%, statistically significant (95% CI excludes zero), low overfit. The baseline often fails to review at all.api-ready-for-reviewissues (API Proposal: QuickGrid static SSR support #66830, API Proposal: Media components (Image, Video, FileDownload) #66391, API Proposal: BrowserOptions for server-to-client configuration #66393) — never block when the repo isn't at hand; require a grounded Why; show the scenario model; model input provenance.Grounding report
Grounding report —
review-public-apiskillThis explains why the skill says what it says, and how confident we are that it reflects real
ASP.NET Core API-review practice. The auditable backbone — every source, finding, inference, and
decision — is in grounding-evidence.md; this narrative cites its
E#/I#/D#ids inline.
The gap
ASP.NET Core's public-API conventions are largely unwritten. The repo has a process doc
(
docs/APIReviewProcess.md, E1–E2) but its conventions doc,docs/APIReviewPrinciples.md, is astub — literally "Principle 1 / Convention 1" (E3). An unaided agent asked to review a proposed API
therefore falls back on generic .NET design guidance and misses the repo-specific decisions the
@dotnet/aspnet-api-reviewteam actually makes — especially the first question they ask, "shouldthis API exist at all?", and the recurring shape fixes (sealing,
CancellationToken, naming themechanism, binary-compat). The skill exists to encode that tacit knowledge.
What we investigated
The conventions live in the decision threads, so we mined them. We harvested 449 decided API-review
issues — every
api-approved(363),api-needs-work(30), and declinedapi-suggestion(40), plusthe open
api-ready-for-reviewqueue — with all 3,789 comments (the discussion, not just theverdict). To measure generalization rather than recall, we held out ~18% of decided issues plus the
entire open queue as a validation set and never used them to write rules (D4). Rules were distilled
from the training split by parallel passes over the threads, each rule tied to the issue(s) and a
reviewer quote that evidences it. The baseline authority is the .NET Framework Design Guidelines (E5);
this skill is the ASP.NET-Core-specific layer on top.
We then corroborated the rules against what the repo actually ships, mining the public-API surface
itself — all 172
PublicAPI.Shipped.txtfiles (~24k members) — for quantified, cross-cuttingconventions (E36–E42):
Task-over-ValueTask(≈82/18) with anAsyncsuffix;CancellationTokenlast +
= default; read-only collection/dictionary returns; the type-suffix taxonomy; and themethod-family contract —
Add*registers services inMicrosoft.Extensions.DependencyInjection,Use*/Map*add middleware/endpoints inMicrosoft.AspNetCore.Builderregardless of the feature'sown namespace — confirmed by reading the implementations, not just the signatures (E42).
We extended this into a type↔assembly study (E43–E50): across the 151 public assemblies (2,956
types) plus
.csprojdependency/packaging metadata and source-confirmed type kinds, we derived whichkind of type belongs in which kind of assembly (interfaces ≈46% of
*.Abstractionsvs ≈13% ofimplementations; abstractions are dependency sinks), the abstraction↔implementation and provider
three-layer patterns, the namespace-vs-assembly decoupling, shared-framework vs standalone-NuGet
packaging, and the type-relationship conventions (
Default<X> : X, provider options/handlerinheritance chains, results implementing
IResult+ granular metadata interfaces, behavioralattributes implementing framework interfaces, reuse-an-existing-extension-point). The full analysis is
in the session's
ANALYSIS.md; the confirmed rules are folded into the skill's conventions reference.What we concluded
The strongest, most repeated signal is need justification — reviewers decline or rework APIs that
lack demonstrated demand, that exist only for generic extensibility, that would encourage anti-patterns,
that pollute
HttpContext/WebApplicationIntelliSense, or that fuse separate concerns (E10–E13, E28).So the skill makes a need assessment (commonality + audience precedence) a mandatory, first-class
part of every review (decision D3), not an afterthought to shape.
The shape rules are likewise grounded in concrete decisions: naming the mechanism and avoiding
implementation words (E14–E15);
CancellationToken = defaulton new async methods andTask-over-ValueTaskfor callbacks (E16–E17); collection/return-type choices and named result structs (E18, E26);seal-by-default with marker/feature interfaces for real extensibility (E19–E20); binary-compat via
new overloads and restrained obsoletion, with breaking default changes gated on a major version + an
escape hatch (E21–E22); and consistency/placement with sibling APIs and namespaces (E23–E24, E29, E25).
Where the skill generalizes beyond what any single thread states, we flagged it: the requirement
that the review locate the current public type in source and diff against it (I1) is an inference, not
a quoted rule — it follows from the review being done in ref-assembly form (E2) combined with the fact
that this repo has no checked-in ref source (E7, ref assemblies are generated at build).
Roads not taken
long-standing conventions aren't lost; we discarded only the early, never-decided
api-suggestionissues as low-signal.
diffagainst the existing repo APIover freeform prose, because prose hides the concrete delta — and explicitly diff against the current
surface, not the submitter's proposal, per the requested contract.
that is the most common real decline reason.
whether the agent learned the rules, not the examples.
What we refined empirically
The skill was then hardened against real proposals (the open
api-ready-for-reviewqueue), each passfixing a concrete failure mode: it must reconstruct the existing surface from knowledge, not block
when the repo isn't at hand; every recommendation needs a grounded Why in prose (this exposed and
removed a fabricated "auto-generate a cache key" suggestion that would have defeated the proposal's
bookmarkable-URL goal); the need assessment must show its scenario model — runtime environments
(flagging where the API is inert, e.g. static SSR) and common-vs-rare usage; and the model must include
the provenance of inputs — where the consumed data comes from in real apps (blob storage, DBs,
files) and what natural identifiers/metadata exist there (decisions D5–D8). The last one corrected a
review to keep a "required"
cacheKey(callers usually already hold a natural id) instead ofsynthesizing one expensively.
How grounded it is
The claim-coverage lint over the skill's normative claims reports 29 claims, all grounded, 0 ungrounded (see the appendix). Each maps to ≥1 real issue-backed evidence row (or, for the
diff-against-source workflow step, to inference I1 which itself resolves to evidence). The held-out
A/B evaluation (
skill-validator evaluate, 5 runs) measures that the skill helps on issues it neversaw — scenarios drawn from #32443, #58110, #42467, #41946, #55656 (E30–E34); results are summarized in
the PR. This report shows why the guidance is trustworthy; the eval shows that it works.
Grounding evidence appendix (sources, findings, inferences, decisions; coverage lint)
Grounding evidence appendix
Coverage: 29 claims, 29 cited, 0 inferred, 0 ungrounded.
Sources & findings
docs/APIReviewProcess.md(repo_file)docs/APIReviewProcess.md#L26-L49(repo_file)docs/APIReviewPrinciples.md(repo_file).github/ISSUE_TEMPLATE/30_api_proposal.md(repo_file)https://learn.microsoft.com/dotnet/standard/design-guidelines/(url)dotnet/aspnetcore#66574(issue)src/** (no committed ref/*.cs)(repo_file)dotnet/aspnetcore#2715,#48421,#44320,#39126(issue)dotnet/aspnetcore#43138,#64154,#53712(issue)dotnet/aspnetcore#37425,#43237,#43013(issue)dotnet/aspnetcore#42047,#51092,#65607(issue)dotnet/aspnetcore#35478,#54071,#47567(issue)dotnet/aspnetcore#42580,#67080,#24723(issue)dotnet/aspnetcore#66798,#45869,#61031(issue)dotnet/aspnetcore#47937,#17160,#63181(issue)dotnet/aspnetcore#33700,#41899,#40506,#33700b(issue)dotnet/aspnetcore#17519,#37384,#49756,#47994(issue)dotnet/aspnetcore#38573,#50057,#34824(issue)dotnet/aspnetcore#53171,#50220,#46575,#64860(issue)dotnet/aspnetcore#64920,#46157,#52645(issue)dotnet/aspnetcore#56039,#56178,#42667,#54600(issue)dotnet/aspnetcore#46937,#47096,#62376,#49424(issue)dotnet/aspnetcore#47228,#47651,#41919(issue)dotnet/aspnetcore#46789,#63181b,#40672(issue)dotnet/aspnetcore#30354,#39855,#50522(issue)dotnet/aspnetcore#62287,#31181,#53502(issue)dotnet/aspnetcore#33452,#33700,#42749(issue)dotnet/aspnetcore#32443(issue)dotnet/aspnetcore#58110(issue)dotnet/aspnetcore#42467(issue)dotnet/aspnetcore#41946(issue)dotnet/aspnetcore#55656(issue)dotnet/aspnetcore#44320,#48421,#39126(issue)src/**/PublicAPI.Shipped.txt (172 files, 23976 lines)(repo_file)src/**/PublicAPI.Shipped.txt(repo_file)src/**/PublicAPI.Shipped.txt(repo_file)src/**/PublicAPI.Shipped.txt(repo_file)src/**/PublicAPI.Shipped.txt(repo_file)src/**/PublicAPI.Shipped.txt (extension-method declaring namespaces)(repo_file)src/Mvc/Mvc/src/MvcServiceCollectionExtensions.cs:83, src/Http/Routing/src/Builder/EndpointRoutingApplicationBuilderExtensions.cs:20, src/Http/Routing/src/Builder/EndpointRouteBuilderExtensions.cs:28, src/Http/Routing/src/Builder/RoutingEndpointConventionBuilderExtensions.cs:91(repo_file)src/**/PublicAPI.Shipped.txt + .cs declarations (151 assemblies, 2956 public types)(repo_file)src/**/*.csproj ProjectReference + PublicAPI reference graph(repo_file)src/Http/Http.Abstractions vs src/Http/Http; src/Http/Http.Features; src/Extensions/Features(repo_file)src/Security/Authentication/{Core,JwtBearer}; src/Http/Authentication.Abstractions(repo_file)src/**/PublicAPI.Shipped.txt (namespace vs assembly)(repo_file)src/**/*.csproj (IsAspNetCoreApp / IsPackable / IsShippingPackage)(repo_file)src/** type declarations (base/implements graph, 1784 edges)(repo_file)src/** implements graph (IResult 48, IEndpointMetadataProvider 30, etc.)(repo_file)Inferences
Decisions
D1: Corpus scope for rule distillation
D2: Output format for the review
difffence existing->recommendedD3: Whether the skill judges need, not just shape
D4: Train/validation partition
D5: Should each recommendation include reasoning?
D6: How the skill judges commonality
D7: Scenario modeling was in the skill but not surfaced in output
D8: Scenario model omitted input provenance