Skip to content

Add review-public-api Copilot skill - #67335

Merged
javiercn merged 1 commit into
mainfrom
javiercn/review-public-api
Jul 28, 2026
Merged

javiercn merged 1 commit into
mainfrom
javiercn/review-public-api

Conversation

@javiercn

@javiercn javiercn commented Jun 21, 2026 •

Copy link
Copy Markdown
Member

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-review team 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 (public record/record struct) versus the ones it adopts (required/init over constructor-overload proliferation). Documentation/markdown only; no product code.

How it was built

Mined from the repo itself, three sources:

  1. API-review decisions — 449 decided issues (api-approved / api-needs-work / declined) with all comments (the conventions doc is a stub; the rules live in the threads). A disjoint slice was held out for evaluation.
  2. The shipped public-API surface — all 172 PublicAPI.Shipped.txt files (~24k members) plus representative implementations, for quantified cross-cutting conventions (Task-over-ValueTask + Async suffix; CancellationToken last + default; read-only returns; the type-suffix taxonomy; the method-family contract — Add* registers services in Microsoft.Extensions.DependencyInjection, Use*/Map* in Microsoft.AspNetCore.Builder, regardless of the feature namespace).
  3. A type↔assembly study — 151 assemblies / 2,956 types + .csproj dependency & 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 *.Abstractions vs ≈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 implementing IResult + granular metadata interfaces; behavioral attributes implementing framework interfaces; reuse-an-existing-extension-point; companion-type clusters).
  4. A modern-C# language-feature study — the canonical "what's new in C#" feature set (C# 8→latest) cross-checked against the shipped public surface to separate genuine negative space from adoption-curve scarcity. Conclusion: public record/record struct is the one feature deliberately avoided (its synthesized equality/with/Deconstruct/copy-ctor freeze into the binary + ref-assembly contract and can't be evolved), while required/init are recommended over constructor-overload proliferation, and static abstract/default-interface-methods are allowed with concrete justification. Implementation-style idioms invisible at the API boundary are out of scope.

Validation

Grounding report

Grounding report — review-public-api skill

This 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 a
stub — 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-review team actually makes — especially the first question they ask, "should
this API exist at all?", and the recurring shape fixes (sealing, CancellationToken, naming the
mechanism, 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 declined api-suggestion (40), plus
the open api-ready-for-review queue — with all 3,789 comments (the discussion, not just the
verdict). 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.txt files (~24k members) — for quantified, cross-cutting
conventions (E36–E42): Task-over-ValueTask (≈82/18) with an Async suffix; CancellationToken
last + = default; read-only collection/dictionary returns; the type-suffix taxonomy; and the
method-family contract — Add* registers services in Microsoft.Extensions.DependencyInjection,
Use*/Map* add middleware/endpoints in Microsoft.AspNetCore.Builder regardless of the feature's
own 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 .csproj dependency/packaging metadata and source-confirmed type kinds, we derived which
kind of type belongs in which kind of assembly (interfaces ≈46% of *.Abstractions vs ≈13% of
implementations; 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/handler
inheritance chains, results implementing IResult + granular metadata interfaces, behavioral
attributes 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/WebApplication IntelliSense, 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 = default on new async methods and Task-over-
ValueTask for 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

  • Corpus scope (D1). We mined the entire decided corpus rather than a recent window, so durable
    long-standing conventions aren't lost; we discarded only the early, never-decided api-suggestion
    issues as low-signal.
  • Output format (D2). We chose per-type bullet changes + a diff against the existing repo API
    over freeform prose, because prose hides the concrete delta — and explicitly diff against the current
    surface, not the submitter's proposal, per the requested contract.
  • Need vs shape (D3). The skill judges whether to add the API at all, not just its shape, because
    that is the most common real decline reason.
  • Train/validation split (D4). We hold out issues we never tuned against, so the eval measures
    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-review queue), each pass
fixing 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 of
synthesizing 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 never
saw — 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

Generated from the session DB — do not hand-edit and do not ship inside the skill.
Auditable backbone for the narrative grounding report (GROUNDING.md), which cites these ids.

Coverage: 29 claims, 29 cited, 0 inferred, 0 ungrounded.

Sources & findings

ID Authority Source Question Finding
E1 source docs/APIReviewProcess.md (repo_file) What is the API review process/lifecycle? api-suggestion -> api-ready-for-review (owner marks when ready; notify @asp-net-api-reviews) -> weekly meeting -> api-approved or api-needs-work. Proposals must be in ref-assembly format. Changes during impl restart the review.
E2 source docs/APIReviewProcess.md#L26-L49 (repo_file) What makes an issue ready-for-review? Short area description + API changes in ref-assembly format. Ref-assembly used because compact (no docs/impl) makes patterns easier to notice.
E3 source docs/APIReviewPrinciples.md (repo_file) Are conventions written down? No - the principles/conventions doc is a STUB (Principle 1 / Convention 1). Defers to .NET Framework Design Guidelines. Real conventions live in issue decisions.
E4 source .github/ISSUE_TEMPLATE/30_api_proposal.md (repo_file) What is the proposal template? Sections: Background and Motivation, Proposed API (ref-assembly diff), Usage Examples, Alternative Designs, Risks. Labels api-suggestion + api-proposal.
E5 official https://learn.microsoft.com/dotnet/standard/design-guidelines/ (url) What is the baseline external authority? .NET Framework Design Guidelines are the baseline; aspnetcore API review adds repo-specific conventions on top.
E6 source dotnet/aspnetcore#66574 (issue) Example approve-with-changes decision Reviewers required IHostApplicationBuilder -> WebApplicationBuilder; concern about undetectable virtual-method override. Outcome: Approved with changes.
E7 source src/** (no committed ref/*.cs) (repo_file) Where is the existing public API surface to diff against? aspnetcore generates ref assemblies at build (Microsoft.AspNetCore.App.Ref); no checked-in ref C# source under src. The skill must locate the public type in src/**/src/ to represent the CURRENT signature for the diff.
E10 source dotnet/aspnetcore#2715,#48421,#44320,#39126 (issue) When do reviewers decline an API for lack of need? Decline/needs-work when real-world demand isn't demonstrated; generic extensibility alone doesn't justify surface; don't change idioms unless the scenario is common. "uncommon enough that I don't think providing a first class option is necessary".
E11 source dotnet/aspnetcore#43138,#64154,#53712 (issue) Reviewers reject APIs that enable anti-patterns Do not add APIs that encourage anti-patterns even if technically possible (e.g. storing refresh tokens in cookies); recommend documented alternatives / event hooks. Security ops require explicit opt-in.
E12 source dotnet/aspnetcore#37425,#43237,#43013 (issue) Intellisense pollution is a rejection reason Avoid piling convenience methods onto HttpContext/WebApplication; "top level intellisense will be too noisy"; keep HeaderNames limited to commonly-used headers. Prefer composition (empty MapGroup).
E13 source dotnet/aspnetcore#42047,#51092,#65607 (issue) Keep separate concerns separate Don't combine independently-configurable components without a strong reason (AddAuthenticationAndAuthorization); don't extend sessions with auth concerns; keep declarative vs imperative options separate.
E14 source dotnet/aspnetcore#35478,#54071,#47567 (issue) Naming: avoid implementation words; name the mechanism; scope to receiver Avoid 'Minimal'/'Action' in public names; prefer mechanism over intent (ServeMultithreadingHeaders); include server/scope in extension method name (UseKestrelHttpsConfiguration).
E15 source dotnet/aspnetcore#42580,#67080,#24723 (issue) Naming: Create/Try/Set prefixes Use Create* for static factories; Try* for optional lookups (implies nullable return + fallback, e.g. TryFindProperty); Set* for methods that always replace a key.
E16 source dotnet/aspnetcore#66798,#45869,#61031 (issue) Async APIs take a CancellationToken New async public methods returning Task/ValueTask include CancellationToken=default and flow it through the chain; document what cancellation does.
E17 source dotnet/aspnetcore#47937,#17160,#63181 (issue) Task vs ValueTask; Span vs Memory Prefer Task over ValueTask for framework callback delegates unless a hot-path justifies ValueTask; ReadOnlySpan for sync input params, Memory only when async is required.
E18 source dotnet/aspnetcore#33700,#41899,#40506,#33700b (issue) Return/param collection types Use IEnumerable for read-only input sequences; IReadOnlyList/ICollection for returns unless mutation/index needed; IEnumerable over IReadOnlyDictionary to avoid overload ambiguity; options object when params exceed a reasonable count.
E19 source dotnet/aspnetcore#17519,#37384,#49756,#47994 (issue) Seal by default Seal concrete/metadata/options/DTO types unless extensibility is explicitly justified ("seal all the things"); can unseal later. Use abstract base only when default impl + state needed.
E20 source dotnet/aspnetcore#38573,#50057,#34824 (issue) Marker interfaces & feature detection Marker interfaces (no members) are fine when presence alone conveys meaning; use feature-detection interfaces for protocol capabilities and typed rejection.
E21 source dotnet/aspnetcore#53171,#50220,#46575,#64860 (issue) Binary-compat & obsoletion Prefer new overloads over optional-param changes for binary compat; don't obsolete a working API the moment a replacement lands ("can always obsolete later"); use [Obsolete(error:false)] until actually breaking.
E22 source dotnet/aspnetcore#64920,#46157,#52645 (issue) Breaking changes & defaults Breaking default-behavior changes need a major version + an escape hatch (schema transformers); add implicit converters to ease type replacements; prefer an analyzer over a breaking interface change.
E23 source dotnet/aspnetcore#56039,#56178,#42667,#54600 (issue) Consistency with existing patterns Use generic TBuilder for IEndpointConventionBuilder extensions (MapGroup chaining); follow IServiceCollection.Add* + With* conventions; provide both attribute and extension-method forms; new IResult/TypedResults follow IEndpointMetadataProvider.
E24 source dotnet/aspnetcore#46937,#47096,#62376,#49424 (issue) Namespaces Niche/less-common types go in a feature sub-namespace, not the root/global-using namespace; concrete impls share their interface's namespace; infrastructure types go in an Infrastructure namespace; group DTOs in a .Data namespace.
E25 source dotnet/aspnetcore#47228,#47651,#41919 (issue) Nullability semantics Required services prefer non-nullable + fail-fast over silently-nullable; absent context data is nullable + init-only; nullable distinguishes set vs unset (StatusCode).
E26 source dotnet/aspnetcore#46789,#63181b,#40672 (issue) Return small named types Replace anonymous ValueTuple returns with named readonly structs; return a result struct over bool+out for Try* (works with async/pattern matching); cap generic union arity (Results<T1..TN>, N<=6/8).
E27 source dotnet/aspnetcore#30354,#39855,#50522 (issue) Discoverability Merge overlapping builder concepts (WebApplication = IApplicationBuilder+IEndpointRouteBuilder+IHost); promote frequently-configured cross-cutting concerns to first-class builder properties; expose common feature as property over extension for discoverability.
E28 source dotnet/aspnetcore#62287,#31181,#53502 (issue) Target audience framing Scope domain APIs to common end-developer scenarios and point advanced users to libraries; expose low-level building blocks for library authors only when justified; gate dangerous-but-legitimate admin APIs behind capability flags + docs.
E29 source dotnet/aspnetcore#33452,#33700,#42749 (issue) Options/builder shaping Wrap related callbacks/state in a dedicated options class for extensibility; use an options object when params exceed a reasonable count; prefer discoverable options-based config over builder methods for separation.
E30 source dotnet/aspnetcore#32443 (issue) HELD-OUT ground truth: ITicketStore + CancellationToken Approved: add CancellationToken via default interface members that delegate to existing methods (non-breaking).
E31 source dotnet/aspnetcore#58110 (issue) HELD-OUT: Get/GetOrdered on EndpointMetadataCollection needs-work: reviewers not sold; "why not extension methods?"; terseness/consistency argument weak.
E32 source dotnet/aspnetcore#42467 (issue) HELD-OUT: add 409 to DefaultApiConventions.Post declined: changing the shipped default convention is a breaking change; define your own conventions.
E33 source dotnet/aspnetcore#41946 (issue) HELD-OUT: ValueTask overloads on EventCallback declined: not aligned with framework vision; community can ship as an extension (AsTask).
E34 source dotnet/aspnetcore#55656 (issue) HELD-OUT: Description on ProducesResponseType approved: reasonable end-developer convenience consistent with existing attributes.
E35 source dotnet/aspnetcore#44320,#48421,#39126 (issue) Do reviewers optimize for the common case? Yes — "most of the time developers do not need or want to do this" (#44320); "uncommon enough that I don't think providing a first class option is necessary" (#48421); don't change an idiom for an uncommon case (#39126). Rare scenarios are served by opt-in, not by reshaping the common path.
E36 source src/**/PublicAPI.Shipped.txt (172 files, 23976 lines) (repo_file) What async/cancellation shape does the shipped surface use? Of 1090 async methods: Task 891 (82%) vs ValueTask 199 (18%); 859 (79%) carry the Async suffix; CancellationToken is the LAST parameter, named cancellationToken, with = default in 220/336 (65%); CT present on ~29% (cancellable I/O), omitted for context-bound/compute. DisposeAsync returns ValueTask.
E37 source src/**/PublicAPI.Shipped.txt (repo_file) What method-name families and receivers recur? Method first-words: Get 587, Add 586 (DI on IServiceCollection), Create 389 (static factory), Use 226 (middleware on IApplicationBuilder), Try 167 (bool+out), Set 148, Map 104 (endpoints on IEndpointRouteBuilder), Build 67, Configure 62 (Action). Extension-method classes end in Extensions and are static (371 types, 1447 extension methods).
E38 source src/**/PublicAPI.Shipped.txt (repo_file) What type-name suffixes encode role? Extensions 371, Feature 211 (IFeature capability), Provider 206 (IProvider pluggability), Context 189 (callback state), Options 182 (sealed config w/ get-set props), Attribute 159, Result 127, Factory 107, Builder 86, Metadata 62, Handler 55, Exception 44, EventArgs 17, Defaults 20 (static class of default constants).
E39 source src/**/PublicAPI.Shipped.txt (repo_file) What collection/return + nullability shapes recur? Returns favor read-only interfaces: IEnumerable 49, IReadOnlyList 23, IReadOnlyCollection 16; IList 17 / IDictionary 9 rare; concrete List 40 only where mutation is intentional. Try* -> bool + out (131/167, 78%). Maps exposed as IReadOnlyDictionary<string,object>?, not concrete Dictionary. ~26% of properties nullable (use ? only for genuinely optional).
E40 source src/**/PublicAPI.Shipped.txt (repo_file) What extensibility/generic shapes recur? Extension-method-on-builder/interface is the dominant extensibility + registration mechanism (1447 ext methods), returning the builder/service interface for chaining; generic TBuilder for convention-builder chaining; provider interfaces for pluggability; type generic arity is almost always 1 with a pragmatic tail to ~8 (Results<T1..TN>).
E41 source src/**/PublicAPI.Shipped.txt (extension-method declaring namespaces) (repo_file) Where are DI/middleware/endpoint extension methods declared regardless of feature? DI registration Add* extensions are declared in Microsoft.Extensions.DependencyInjection (303/388 Add* ext methods); middleware Use* and endpoint Map*/Require* extensions in Microsoft.AspNetCore.Builder (Use* 98 top, Map* 72 top, Require* 11/11) — independent of the feature's own namespace, so they light up with a common using. Configure* split between Microsoft.Extensions.DependencyInjection and Hosting.
E42 source 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) What do the Add*/Use*/Map*/With*/Configure* families fundamentally do internally? Add* registers services into IServiceCollection (returns the collection or a feature builder); Configure* registers an Action; Use* inserts middleware via UseMiddleware on IApplicationBuilder; Map* registers endpoints on IEndpointRouteBuilder returning an endpoint convention builder; With* attaches metadata/conventions to an endpoint via builder.Add(...) returning the same builder. Confirmed by reading implementations.
E43 source src/**/PublicAPI.Shipped.txt + .cs declarations (151 assemblies, 2956 public types) (repo_file) What type-kinds go into each assembly role? Abstractions: 46% interfaces, 5% abstract, only 3% sealed, attributes/feature-interfaces — the contract layer. Core: 44% class + 21% interface + 12% attribute (shared impl + contracts). Implementation: 39% class + 17% static/extension + 13% sealed concrete (concrete-heavy). Extensions.*: framework-agnostic primitives.
E44 source src/**/*.csproj ProjectReference + PublicAPI reference graph (repo_file) What is the dependency direction / layering? Abstractions assemblies are the hubs: high in-degree, near-zero out-degree (Http.Abstractions in=78/out=2; Hosting/Routing/Authentication/Mvc/Connections/DataProtection.Abstractions similar). Implementations depend on abstractions; abstractions depend on almost nothing. Layering flows impl -> abstractions.
E45 source src/Http/Http.Abstractions vs src/Http/Http; src/Http/Http.Features; src/Extensions/Features (repo_file) What goes in an *.Abstractions assembly vs its implementation? Abstractions hold contracts: abstract bases (HttpContext/HttpRequest/HttpResponse abstract), interfaces (IMiddleware, IHttpContextFactory), feature interfaces (IFeature), lightweight attributes/constants. Implementation holds Default/concrete sealed types (DefaultHttpContext sealed, HeaderDictionary). Some non-.Abstractions assemblies (Http.Features, Microsoft.Extensions.Features, Net.Http.Headers, Metadata) are low-level primitive/contract assemblies (feature interfaces + the IFeatureCollection primitive).
E46 source src/Security/Authentication/{Core,JwtBearer}; src/Http/Authentication.Abstractions (repo_file) How is a provider/handler family layered across assemblies? Three layers: *.Abstractions = scheme/handler/service contracts + DTOs (IAuthenticationHandler, AuthenticationOptions, AuthenticateResult); *.Core = shared engine/base classes (AuthenticationHandler, RemoteAuthenticationHandler, AuthenticationService, SchemeProvider); per-provider assembly = concrete handler + options + events + post-configure (JwtBearerHandler : AuthenticationHandler).
E47 source src/**/PublicAPI.Shipped.txt (namespace vs assembly) (repo_file) How do namespace and assembly relate? Namespace is decoupled from assembly: 34% of public types (1030/2956) have a namespace root differing from their assembly. 79 assemblies declare types in Microsoft.Extensions.DependencyInjection (DI registration) and 42 in Microsoft.AspNetCore.Builder (middleware/endpoints) regardless of the feature assembly, so they light up with a common using. (No type-forwarding seen in shipped surface.)
E48 source src/**/*.csproj (IsAspNetCoreApp / IsPackable / IsShippingPackage) (repo_file) Shared framework vs standalone NuGet? 99/151 public assemblies set IsAspNetCoreApp=true and ship in the Microsoft.AspNetCore.App shared framework (not individually packable). Optional/integration features that pull a third-party dependency ship as standalone NuGet (IsPackable/IsShipping): Caching.SqlServer (Microsoft.Data.SqlClient), Caching.StackExchangeRedis (StackExchange.Redis), Http.Polly (Polly), Logging.AzureAppServices. Rule: foundational -> shared framework; optional/integration/extra-dependency -> out-of-band package.
E49 source src/** type declarations (base/implements graph, 1784 edges) (repo_file) What type-to-type relationship conventions recur? Default:X for framework default impls (17 pairs: DefaultHttpContext:HttpContext, DefaultProblemDetailsFactory:ProblemDetailsFactory) — strong. X:IX naming pair for obvious impls (136: UrlHelperFactory:IUrlHelperFactory) — softer. Provider options/handlers derive a shared family base (JwtBearerOptions:AuthenticationSchemeOptions; JwtBearerHandler:AuthenticationHandler; OAuthOptions:RemoteAuthenticationOptions). *EventArgs:EventArgs.
E50 source src/** implements graph (IResult 48, IEndpointMetadataProvider 30, etc.) (repo_file) How do types plug into framework extension points? Result types implement IResult + granular metadata interfaces (IStatusCodeHttpResult 30, IValueHttpResult 26, IContentTypeHttpResult 11) and IEndpointMetadataProvider (30) to self-describe to OpenAPI; MVC uses IActionResult separately. Behavioral attributes implement the framework interface carrying the behavior (IFilterFactory 11, IOrderedFilter 16, IBindingSourceMetadata, IRouteTemplateProvider). Reuse the narrowest existing extension-point interface (IRouteConstraint 22, IModelBinder 17, IComponent 19) before inventing one. Features ship companion clusters (Options/Events/Context/Builder/Result/Metadata/Defaults) — coherence check, not mandatory.

Inferences

ID Statement Derived from Confidence Rationale
I1 Skill workflow must include a step to locate the current public type(s) in source and reconstruct their existing signature before diffing to the recommended shape E7,E2 high Output contract requires diff vs existing repo API, but no ref source is committed; agent reconstructs from src.

Decisions

D1: Corpus scope for rule distillation

  • Decision: Mine the entire decided corpus (approved+needs-work+declined), 449 issues
  • Options considered: [{"opt":"recent window (.NET 8-11)","cons":"misses durable older conventions"},{"opt":"entire decided corpus","pros":"complete; user asked to mine all"}]
  • Rejected because: A recent-only window would miss long-standing conventions still enforced
  • Discarded: api-suggestion issues that never reached a decision (early/undecided) — low signal

D2: Output format for the review

  • Decision: Per type/file: bullet change list + diff fence existing->recommended
  • Options considered: [{"opt":"freeform prose"},{"opt":"per-type bullets + diff vs EXISTING repo API","pros":"actionable, matches ref-assembly review"}]
  • Rejected because: Freeform prose is not actionable and hides the concrete shape delta
  • Discarded: Diffing against the submitter's proposal instead of the existing repo surface — user explicitly wants vs existing

D3: Whether the skill judges need, not just shape

  • Decision: Always include a need assessment: commonality + audience precedence
  • Options considered: [{"opt":"shape-only"},{"opt":"also judge whether to add at all","pros":"matches real review first question"}]
  • Rejected because: Shape-only would miss the most common real decline reasons
  • Discarded: —

D4: Train/validation partition

  • Decision: Hold out ~18% decided + the open ready-for-review as validation
  • Options considered: [{"opt":"distill from all, eval on same","cons":"data leakage"},{"opt":"hold out 18% decided + all open","pros":"measures generalization"}]
  • Rejected because: Evaluating on training issues measures recall not generalization
  • Discarded: —

D5: Should each recommendation include reasoning?

  • Decision: Require a Why paragraph (grounded prose) per type; drop any recommendation that cannot be justified; never suggest something that defeats a stated goal of the proposal
  • Options considered: [{"opt":"bullets + diff only","cons":"agent invented ungrounded advice (auto-generate prefix) that defeated the proposal goal"},{"opt":"require a grounded Why prose paragraph per type","pros":"forces justification; exposes ungroundable advice; matches how reviewers explain decisions"}]
  • Rejected because: Bullets+diff alone let the agent fabricate rationale-free advice
  • Discarded: —

D6: How the skill judges commonality

  • Decision: Add a scenario-modeling step (who calls it, what environments, which patterns dominate) before judging commonality, and an explicit optimize-for-the-common-case principle
  • Options considered: [{"opt":"label commonality directly","cons":"agent guesses; e.g. waffles on QuickGrid empty-prefix default"},{"opt":"first model real usage: callers, runtime environments, dominant vs rare patterns; then optimize for the common case","pros":"grounds the judgment; defends sensible defaults; serves rare cases via opt-in"}]
  • Rejected because: Labeling commonality without modeling usage produced shallow/guessed judgments
  • Discarded: —

D7: Scenario modeling was in the skill but not surfaced in output

  • Decision: Output format must show a Scenarios & environment line (environments + common-vs-rare) and carry it into per-type changes
  • Options considered: [{"opt":"keep modeling internal","cons":"agent did not visibly apply it (missed cacheKey common-case friction, AdditionalAttributes type, static-SSR inertness on API Proposal: Media components (Image, Video, FileDownload) #66391)"},{"opt":"require the need assessment to SHOW a Scenarios & environment line and carry it into per-type review","pros":"forces the agent to apply common-case + environment reasoning"}]
  • Rejected because: Internal-only modeling did not change outputs
  • Discarded: —

D8: Scenario model omitted input provenance

  • Decision: Add input-provenance to the scenario model: reason about where inputs come from and what natural identifiers/metadata exist there
  • Options considered: [{"opt":"model usage/environment only","cons":"agent judged required cacheKey as friction and proposed hashing the whole stream (expensive, defeats streaming, solves a non-problem)"},{"opt":"also model the nature/provenance of inputs and what is naturally available at the call site","pros":"a required key the caller already has (blob name/ETag/PK/path) is not real friction; make it easy to pass, not removed or synthesized"}]
  • Rejected because: Modeling usage without input provenance led to expensive/incorrect default suggestions
  • Discarded: —

Note: draft — opening for feedback on content and on adopting repo-native skills under .github/skills/.

@javiercn
javiercn force-pushed the javiercn/review-public-api branch from 6d4d7cc to 865e3b0 Compare June 21, 2026 15:50
@javiercn
javiercn marked this pull request as ready for review June 22, 2026 06:37
@javiercn
javiercn requested a review from wtgodbe as a code owner June 22, 2026 06:37
Copilot AI review requested due to automatic review settings June 22, 2026 06:37
@javiercn
javiercn requested a review from a team as a code owner June 22, 2026 06:37
@javiercn
javiercn requested a review from halter73 June 22, 2026 06:37

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.

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-api skill 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.

@javiercn
javiercn force-pushed the javiercn/review-public-api branch from 3ab34d3 to 76c7cda Compare June 30, 2026 14:41
@javiercn
javiercn changed the base branch from main to javiercn/create-worktree-skill June 30, 2026 14:41
@javiercn
javiercn force-pushed the javiercn/review-public-api branch from 76c7cda to fec442e Compare July 27, 2026 13:47
@javiercn
javiercn changed the base branch from javiercn/create-worktree-skill to main July 27, 2026 15:33
@javiercn
javiercn force-pushed the javiercn/review-public-api branch from fec442e to 5bbeadf Compare July 27, 2026 15:33
@javiercn
javiercn force-pushed the javiercn/review-public-api branch from cec19c8 to b58545a Compare July 28, 2026 10:36
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
javiercn force-pushed the javiercn/review-public-api branch from b58545a to 7c282e1 Compare July 28, 2026 10:47
@javiercn
javiercn merged commit 1d1e00c into main Jul 28, 2026
27 checks passed
@javiercn
javiercn deleted the javiercn/review-public-api branch July 28, 2026 12:51
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-rc1 milestone Jul 29, 2026
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.

3 participants