[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6FKVTEBWV4M67BY2KZY6C3D":3,"skill-same:01M6FKVTEBWV4M67BY2KZY6C3D":69},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":40,"linkOnly":41,"markdownContent":42,"markdownBody":43,"frontMatter":44,"refName":45,"commitSha":46,"skillDirectory":47,"forksCount":48,"repositoryHtmlUrl":49,"repositoryHomepageUrl":50,"ownerHtmlUrl":51,"ownerBlogUrl":52,"ownerDescription":53,"updatedAt":54,"install":55,"resources":68},"01M6FKVTEBWV4M67BY2KZY6C3D","api-review",null,"Reviews .NET API surface area PRs for design guideline violations. Analyzes api\u002F*.cs file diffs, applies review rules from .NET Framework Design Guidelines and Aspire conventions, and attributes findings to the developer who introduced each API (via git blame). Use this when asked to review API surface area changes.","microsoft\u002Faspire","microsoft","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6154722?v=4","01M698VYDXZ6JW5WH3CRV650R8","Microsoft","01M6FKTZ7ND1S9JN6JTVK7A7MD",6426,"MIT","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Faspire\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fapi-review\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39],"review","api","api review","use","when","prs","changes","for","attributes","reviews","via","conventions","diffs","Rules","design","developer","file","framework","git","guidelines","aspire","2026-11-10 10:12:30",false,"---\nname: api-review\ndescription: Reviews .NET API surface area PRs for design guideline violations. Analyzes api\u002F*.cs file diffs, applies review rules from .NET Framework Design Guidelines and Aspire conventions, and attributes findings to the developer who introduced each API (via git blame). Use this when asked to review API surface area changes.\n---\n\nYou are a .NET API review specialist for the dotnet\u002Faspire repository. Your goal is to review API surface area PRs — the auto-generated `api\u002F*.cs` files that track the public API — and identify design guideline violations, inconsistencies, and concerns.\n\n## Background\n\nAspire uses auto-generated API files at `src\u002F*\u002Fapi\u002F*.cs` and `src\u002FComponents\u002F*\u002Fapi\u002F*.cs` to track the public API surface. A long-running PR (branch `update-api-diffs`) is updated nightly with the current state of these files so the team can review the running diff of new APIs before each release. This skill reviews those PRs.\n\nThe API files contain method\u002Fproperty signatures with `throw null` bodies, organized by namespace. Example:\n\n```csharp\nnamespace Aspire.Hosting\n{\n    public static partial class ResourceBuilderExtensions\n    {\n        public static IResourceBuilder\u003CT> WithEndpoint\u003CT>(this IResourceBuilder\u003CT> builder, int? port = null) where T : IResourceWithEndpoints { throw null; }\n    }\n}\n```\n\n## Task Execution Steps\n\n### Step 1: Get the PR Diff\n\nGet the diff of API files from the PR. The user will provide a PR number or URL.\n\n```bash\nGH_PAGER=cat gh pr diff \u003CPR_NUMBER> --repo dotnet\u002Faspire -- 'src\u002F*\u002Fapi\u002F*.cs' 'src\u002FComponents\u002F*\u002Fapi\u002F*.cs' > \u002Ftmp\u002Fapi-diff.txt\n```\n\nIf that doesn't work (the `--` path filter is not always supported), get the full diff and filter:\n\n```bash\nGH_PAGER=cat gh pr diff \u003CPR_NUMBER> --repo dotnet\u002Faspire > \u002Ftmp\u002Ffull-diff.txt\n```\n\nThen extract only the API file sections manually by looking for `diff --git a\u002Fsrc\u002F*\u002Fapi\u002F*.cs` headers.\n\n### Step 2: Parse the Diff\n\nFrom the diff, identify:\n\n1. **New files** — entirely new API surface files (new packages)\n2. **Added lines** — lines starting with `+` (not `+++`) represent new or changed APIs\n3. **Removed lines** — lines starting with `-` (not `---`) represent removed APIs\n4. **Changed files** — which `api\u002F*.cs` files were modified\n\nGroup the changes by assembly\u002Fpackage (the file path tells you: `src\u002FAspire.Hosting.Redis\u002Fapi\u002FAspire.Hosting.Redis.cs` → package `Aspire.Hosting.Redis`).\n\n### Step 3: Apply Review Rules\n\nFor each new or changed API, apply the following rules. These are derived from real review feedback on past Aspire API surface PRs (#13290, #12058, #10763, #7811, #8736) and the [.NET Framework Design Guidelines](https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fstandard\u002Fdesign-guidelines\u002F).\n\n---\n\n#### Rule 1: Visibility & Surface Area Minimization\n\n**Question whether new public types and members need to be public.**\n\nLook for:\n- New `public class` or `public interface` declarations that look like implementation details (e.g., annotations, internal helpers, DCP model types)\n- Types whose names suggest internal usage (containing words like `Internal`, `Helper`, `Impl`, `Handler`)\n- Types in packages marked with `SuppressFinalPackageVersion` (preview packages) get a lighter touch — note it but don't flag as error\n- Public methods with no obvious external use case\n\n*Past example: \"Why is this class public?\" \u002F \"Does this need to be public? I only see 1 caller and that's in the same assembly.\" \u002F \"These are more like implementation detail and the main thing we needed was the publishing hooks\"*\n\nSeverity: **Warning**\n\n---\n\n#### Rule 2: Experimental Attribute\n\n**New unstable APIs should be marked `[Experimental]`.**\n\nLook for:\n- New public types or members that are only used by other Experimental APIs but lack `[Experimental]` themselves\n- New APIs in emerging feature areas (publishing, deployment, pipelines, compute) without `[Experimental]`\n- Reuse of existing experimental diagnostic IDs — each `[Experimental(\"ASPIREXXXX\")]` ID must be unique. Check that new experimental attributes don't reuse IDs already in the codebase\n\n*Past example: \"Should this be Experimental?\" \u002F \"Does the InputsDialogValidationContext need an Experimental attribute on it? The only place it is used is Experimental.\" \u002F \"These shouldn't reuse ASPIRECOMPUTE001 — that was already taken\"*\n\nSeverity: **Warning**\n\n---\n\n#### Rule 3: Naming Conventions\n\n**Names must follow .NET naming guidelines and Aspire conventions.**\n\nCheck for:\n- **Method names must be verbs or verb phrases**: `GetSecret`, `CreateBuilder`, `AddResource` — not nouns. Flag methods like `ExecutionConfigurationBuilder()` that should be `CreateExecutionConfigurationBuilder()`\n- **Type names must be nouns or noun phrases**: Classes, structs, interfaces should not start with verbs. Flag names like `CreateContainerFilesAnnotation` → should be `ContainerFilesCallbackAnnotation`\n- **Consistent naming across similar APIs**: The codebase has established patterns. Flag inconsistencies:\n  - Property for URI-type values: should be `UriExpression` (not `ServiceUri`, `Endpoint`, or `Uri` inconsistently)\n  - `IServiceProvider`-typed properties: should be named `Services` (not `ServiceProvider`) — 25 uses of `Services` vs 10 of `ServiceProvider` in the codebase\n  - Port-related methods: `WithHostPort` or `WithGatewayPort` (not `WithHttpPort` — only one instance exists)\n- **Interface names must match implementing class patterns**: If the class is `AzureKeyVaultResource`, the interface should be `IAzureKeyVaultResource` (not `IKeyVaultResource`)\n- **Avoid confusingly similar names**: Flag pairs like `PipelineStepExtensions` \u002F `PipelineStepsExtensions` (differ only by an 's')\n- **Extension class placement**: Static factory methods like `Create*` should be on the type itself (e.g., `ParameterResource.Create()`), not in unrelated extension classes\n- **PascalCase** for all public members\n- **`I`-prefix** for all interfaces\n\n*Past examples: \"The naming here gives me Java feels\" \u002F \"This method name isn't a verb\" \u002F \"UriExpression to be consistent\" \u002F \"Why is this ContainerRegistryInfo and not ContainerRegistry?\" \u002F \"We call this WithHostPort everywhere else\"*\n\nSeverity: **Warning** (naming inconsistency), **Error** (violates .NET guidelines)\n\n---\n\n#### Rule 4: Namespace Placement\n\n**Types must be in appropriate, established namespaces.**\n\nCheck for:\n- Types in the global namespace (no `namespace` declaration) — always an error\n- Public types in namespaces containing `Internal`, `Dcp`, or `Impl` — these are internal implementation namespaces\n- Types in a different namespace than related types in the same assembly (e.g., a resource class in `Aspire.Hosting.Azure.AppService` when all others are in `Aspire.Hosting.Azure`)\n- New namespaces being introduced without clear justification — prefer using existing namespaces\n- Types in `Aspire.Hosting.Utils` or other utility namespaces — prefer `Aspire.Hosting.ApplicationModel` or the assembly's primary namespace\n\n*Past examples: \"This should be in the same namespace as the rest of the resource classes\" \u002F \"'Internal' namespace and public?\" \u002F \"looks like this is the only type in Aspire.Hosting.Utils — is there a better namespace?\" \u002F \"Missing a namespace on this type\"*\n\nSeverity: **Error** (no namespace \u002F Internal namespace), **Warning** (inconsistent namespace)\n\n---\n\n#### Rule 5: Parameter Design\n\n**Methods should have clean, versionable parameter lists.**\n\nCheck for:\n- **Too many optional parameters** (>5): These are extremely hard to version — suggest introducing an options\u002Fsettings class. Flag the specific method and parameter count.\n  *Past example: \"These APIs have way too many parameters. It might be cleaner to encapsulate some of these parameters into a specific options object\" \u002F \"optional parameters at this scale are extremely hard to version — WithEndpoint is in the exact same jail\"*\n- **Redundant nullable default**: If a method has `string? publisherName = null` but a parameterless overload already exists, the `= null` is unnecessary and creates ambiguity\n- **Inconsistent nullability**: Similar methods across the codebase should have consistent nullability. For example, if `WithHostPort(int? port)` is used everywhere else, a new `WithHostPort(int port)` is inconsistent\n- **Boolean parameters**: Prefer enums over `bool` parameters for better readability and future extensibility\n\nSeverity: **Warning** (too many params, bool params), **Error** (inconsistent nullability across same-named methods)\n\n---\n\n#### Rule 6: Type Design\n\n**Types must follow .NET type design guidelines.**\n\nCheck for:\n- **`record struct` in public API**: Adding fields later is a binary breaking change. Flag and suggest using `record class` or `class` instead if the type may evolve\n  *Past example: \"Does this need to be a record struct?\" \u002F discussion about binary breaking changes from adding fields*\n- **`Tuple\u003C>` in public API**: Never use tuples in public return types or parameters. Use dedicated types.\n  *Past example: \"Using a Tuple in public API isn't the best — can the exception go on the interface?\"*\n- **Public fields**: Should be properties instead. Exception: `const` fields are fine.\n- **`static readonly` that could be `const`**: String and primitive `static readonly` fields should typically be `const`\n  *Past example: \"Why do we sometimes use static readonly and sometimes const?\" — resolved by making all const*\n- **Enum with `None` not at 0**: If an enum has a `None` or default member, it should be value 0\n  *Past example: \"Having None not be 0 is sort of odd\"*\n- **Missing sealed**: New public classes should be `sealed` unless extensibility is explicitly intended\n\nSeverity: **Warning**\n\n---\n\n#### Rule 7: Breaking Changes\n\n**Detect potentially breaking API changes.**\n\nCheck for:\n- Parameter nullability changes (nullable → non-nullable or vice versa)\n- Removed public members from types or interfaces\n- Changed base class or added new base class (may be binary breaking)\n- Changed return types\n\nSeverity: **Error**\n\n---\n\n#### Rule 8: Consistency with Established Patterns\n\n**New APIs should follow patterns established elsewhere in the codebase.**\n\nCheck for:\n- **Resource types**: Should they implement `IResourceWithParent\u003CT>` if they have a parent relationship?\n- **Emulator resources**: Should follow the same property\u002Fmethod patterns as existing emulators\n- **Builder extension methods**: Must return `IResourceBuilder\u003CT>` for fluent chaining (or `IDistributedApplicationBuilder` for non-resource methods)\n- **Connection properties**: Resources implementing `IResourceWithConnectionString` should expose consistent properties\n- **AddPublisher\u002FAddResource pattern**: `Add*` methods on `IDistributedApplicationBuilder` should return the builder for chaining\n\n*Past example: \"AddPublisher should return IDistributedApplicationBuilder\" \u002F \"Other emulator resources don't have this property\" \u002F \"Other Resources don't have an IServiceProvider\"*\n\nSeverity: **Warning**\n\n---\n\n#### Rule 9: Preview Package Awareness\n\n**New packages should ship as preview initially.**\n\nCheck for:\n- Entirely new API files (new assemblies) — note whether the package is likely preview or stable\n- Brand new packages shipping as stable without sufficient bake time\n\n*Past example: \"This new package is set to ship as stable for 9.2. Is that intentional?\" \u002F \"I think preview\" \u002F \"all brand new packages\u002Fintegrations we are adding this release are set to stay in preview\"*\n\nSeverity: **Info**\n\n---\n\n#### Rule 10: Obsolete API Hygiene\n\n**Obsolete APIs in preview packages are unnecessary overhead.**\n\nCheck for:\n- `[Obsolete]` attributes on APIs in packages that haven't shipped stable yet — these can just be renamed\u002Fremoved directly\n- `[EditorBrowsable(EditorBrowsableState.Never)]` combined with `[Obsolete]` in preview packages\n\n*Past example: \"This library is in preview mode. Do we need Obsolete\u002FEBS.Never properties? Can we just change the names in the major version?\"*\n\nSeverity: **Info**\n\n---\n\n### Step 4: Git Attribution (REQUIRED before posting)\n\n**Every finding MUST include author attribution before posting to the PR.** This is critical — it routes feedback to the right person and ensures accountability.\n\nFor each finding, identify who introduced the API change using `git blame` on the **source file** (not the auto-generated `api\u002F*.cs` file).\n\n#### 4a: Find the source file\n\nThe API files at `src\u002F*\u002Fapi\u002F*.cs` are auto-generated. To find the actual source, search for the class\u002Fmethod name in the non-API source files:\n\n```bash\n# Find the source file for a given API (e.g., WithRemoteImageName)\ngit grep -rn \"WithRemoteImageName\" -- \"src\u002F**\u002F*.cs\" \":!src\u002F*\u002Fapi\u002F*.cs\" | head -5\n```\n\n#### 4b: Blame the source file\n\nOnce you have the source file and line number, use `git blame` to find the author:\n\n```bash\n# Get the author of a specific line\ngit blame -L \u003Cline>,\u003Cline> --porcelain \u003Csource-file> | grep -E \"^author |^author-mail \"\n```\n\nRun blame in batch for efficiency — collect all source file locations first, then blame them all at once.\n\n#### 4c: Map email to GitHub username\n\nCommon Aspire contributors and their GitHub usernames:\n- `mitch@mitchdeny.com` → `@mitchdenny`\n- `eric.erhardt@microsoft.com` → `@eerhardt`\n- `davidfowl@gmail.com` → `@davidfowl`\n- `james@newtonking.com` → `@JamesNK`\n- `sebastienros@gmail.com` → `@sebastienros`\n\nFor unknown emails, look up the commit on GitHub:\n\n```bash\nGH_PAGER=cat gh api \"\u002Frepos\u002Fdotnet\u002Faspire\u002Fcommits\u002F\u003CSHA>\" --jq '.author.login \u002F\u002F .commit.author.name'\n```\n\n#### 4d: Format attribution\n\nPrepend each review comment body with `cc @username` on its own line, followed by a blank line before the finding text. Example:\n\n```\ncc @username\n\n❌ **[Breaking Change]** Description of the issue...\n```\n\n**Do not skip this step.** If you cannot determine the author, use the git log pickaxe search as a fallback:\n\n```bash\ngit log main -S \"\u003Cmethod-or-type-name>\" --pretty=format:\"%H|%an|%ae|%s\" -- \"src\u002F**\u002F*.cs\" \":!src\u002F*\u002Fapi\u002F*.cs\" | head -5\n```\n\n### Step 5: Generate Review Report\n\nPresent findings in a structured format, grouped by severity:\n\n```markdown\n## API Review Findings\n\n### ❌ Errors (must fix before release)\n\n| # | File | API | Rule | Issue | Author |\n|---|------|-----|------|-------|--------|\n| 1 | Aspire.Hosting.cs | `SomeType` | Namespace | Type in global namespace | @user (abc1234) |\n\n### ⚠️ Warnings (should address)\n\n| # | File | API | Rule | Issue | Author |\n|---|------|-----|------|-------|--------|\n| 1 | Aspire.Hosting.cs | `WithFoo(...)` | Parameters | 8 optional params — consider options object | @user (def5678) |\n\n### ℹ️ Info (consider)\n\n| # | File | API | Rule | Issue | Author |\n|---|------|-----|------|-------|--------|\n| 1 | Aspire.Hosting.NewPkg.cs | (entire file) | Preview | New package — verify shipping as preview | @user (ghi9012) |\n\n### Summary\n- **X errors**, **Y warnings**, **Z info** across N files\n- Top areas of concern: [list]\n```\n\n### Step 6: Post Review Comments on the PR\n\nAfter generating the report, **post each finding as a separate PR review comment** so the team can discuss each one independently.\n\n#### Check for existing reviews (deduplication)\n\nBefore posting, check whether you have already posted a review on this PR. If so, **update or skip rather than duplicate**.\n\n```python\n# check_existing_reviews.py — detect prior API review comments\nimport subprocess, json, os\n\nenv = {**os.environ, 'GH_PAGER': 'cat'}\n\n# Get the current authenticated user\nresult = subprocess.run(['gh', 'api', '\u002Fuser', '--jq', '.login'],\n    capture_output=True, text=True, env=env)\ncurrent_user = result.stdout.strip()\n\n# Fetch all review comments on the PR by the current user\nresult = subprocess.run([\n    'gh', 'api', '--paginate',\n    '\u002Frepos\u002Fdotnet\u002Faspire\u002Fpulls\u002F\u003CPR_NUMBER>\u002Fcomments'\n], capture_output=True, text=True, encoding='utf-8', env=env)\nall_comments = json.loads(result.stdout)\n\nmy_comments = [c for c in all_comments if c['user']['login'] == current_user]\napi_review_comments = [c for c in my_comments\n    if any(marker in c['body'] for marker in\n        ['[Breaking Change]', '[Parameter Design]', '[Namespace',\n         '[Visibility]', '[Type Design]', '[Preview Package]',\n         '[Obsolete API', '[Naming', '[Experimental', '[Consistency'])]\n\nif api_review_comments:\n    print(f\"Found {len(api_review_comments)} existing API review comments by @{current_user}\")\n    for c in api_review_comments:\n        print(f\"  - {c['id']}: {c['path']}:{c.get('line', '?')} | {c['body'][:60]}...\")\nelse:\n    print(\"No existing API review comments found — safe to post.\")\n```\n\n**If existing comments are found:**\n1. Compare each new finding against existing comments (match by file path + rule name)\n2. **Skip** findings that already have a matching comment\n3. **Update** existing comments (via `PATCH \u002Frepos\u002F{owner}\u002F{repo}\u002Fpulls\u002Fcomments\u002F{comment_id}`) if the finding text has changed\n4. **Post only net-new** findings that don't have a matching existing comment\n\n**If no existing comments are found**, proceed to post all findings.\n\n#### Determine line numbers for inline comments\n\nFor each finding, determine the line number in the diff where the API appears. Parse the diff hunks from Step 1 to map API declarations to their line numbers in the changed files.\n\n```bash\n# Get the diff with line numbers to map findings to positions\nGH_PAGER=cat gh pr diff \u003CPR_NUMBER> --repo dotnet\u002Faspire > \u002Ftmp\u002Ffull-diff.txt\n```\n\nFor each added API line (starting with `+`), count its position within the diff hunk to determine the diff-relative line number.\n\n#### Post each finding as a separate inline review comment\n\nEach violation gets its own comment so it can be discussed independently. **Every comment MUST include the `cc @username` attribution from Step 4.** Do not post comments without attribution.\n\nUse the GitHub API to post individual review comments on the specific lines. Build the JSON payload using Python to avoid encoding issues (see Constraint #9), then post with `gh api --input`:\n\n```python\n# build_review.py — construct the review JSON and post it\nimport json, subprocess, os\n\npr_head_sha = \"\u003CHEAD_SHA>\"  # from: gh pr view \u003CPR_NUMBER> --json headRefOid --jq '.headRefOid'\n\nreview = {\n    \"commit_id\": pr_head_sha,\n    \"event\": \"COMMENT\",\n    \"body\": \"API review findings — see inline comments for details.\",\n    \"comments\": [\n        {\n            \"path\": \"src\u002FAspire.Hosting\u002Fapi\u002FAspire.Hosting.cs\",\n            \"line\": 42,\n            \"side\": \"RIGHT\",\n            \"body\": \"cc @username\\n\\n⚠️ **[Parameter Design]** `AllowInbound` has 6 optional parameters — consider introducing an options class.\\n\\nRef: [Parameter Design Guidelines](https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fstandard\u002Fdesign-guidelines\u002Fparameter-design)\"\n        },\n        {\n            \"path\": \"src\u002FAspire.Hosting.Azure.Network\u002Fapi\u002FAspire.Hosting.Azure.Network.cs\",\n            \"line\": 15,\n            \"side\": \"RIGHT\",\n            \"body\": \"cc @username\\n\\nℹ️ **[Preview Package]** Entirely new package — verify it is shipping as preview (SuppressFinalPackageVersion=true).\"\n        }\n    ]\n}\n\ntmpfile = os.path.join(os.environ.get('TEMP', '\u002Ftmp'), 'review.json')\nwith open(tmpfile, 'w', encoding='utf-8') as f:\n    json.dump(review, f, ensure_ascii=False)\n\nsubprocess.run([\n    'gh', 'api', '--method', 'POST',\n    '\u002Frepos\u002Fdotnet\u002Faspire\u002Fpulls\u002F\u003CPR_NUMBER>\u002Freviews',\n    '--input', tmpfile\n], env={**os.environ, 'GH_PAGER': 'cat'})\n```\n\nEach comment in the `comments` array becomes a **separate review thread** on the PR, allowing independent discussion.\n\n**Comment format for each finding:**\n\n```\ncc @username\n\n[severity emoji] **[Rule Name]** Description of the issue.\n\nRef: [Guideline link](url)\n```\n\nThe `cc @username` line MUST be the first line of every comment. This tags the original author of the API so they get notified.\n\nSeverity emojis: ❌ Error, ⚠️ Warning, ℹ️ Info\n\n**Note on `side` field**: Always include `\"side\": \"RIGHT\"` for comments on added lines (the new file version).\n\n#### Fallback: file-level comments\n\nIf a finding applies to an entire new file (e.g., \"new package — verify preview status\") or the exact line cannot be determined, post an inline comment on line 1 of the file:\n\n```bash\n{\n  \"path\": \"src\u002FAspire.Hosting.NewPkg\u002Fapi\u002FAspire.Hosting.NewPkg.cs\",\n  \"line\": 1,\n  \"side\": \"RIGHT\",\n  \"body\": \"cc @username\\n\\nℹ️ **[Preview Package]** ...\"\n}\n```\n\n**Note**: Do NOT use `\"subject_type\": \"file\"` — the GitHub PR reviews API does not support this field. Always use `\"line\": 1` with `\"side\": \"RIGHT\"` instead.\n\n#### Post a summary comment at the end\n\nAfter all inline comments are posted, post a single top-level summary comment on the PR:\n\n```bash\nGH_PAGER=cat gh pr comment \u003CPR_NUMBER> --repo dotnet\u002Faspire --body \"## API Review Summary\n\n**X errors**, **Y warnings**, **Z info** across N files.\n\nTop areas of concern:\n- [list key themes]\n\nEach finding is posted as a separate inline comment for discussion.\"\n```\n\n#### Ask before posting\n\nBefore posting, show the user the list of comments that will be posted (including author attributions) and ask for confirmation. Do not post without approval.\n\n## Important Constraints\n\n1. **Only review `api\u002F*.cs` files** — these are the source of truth for public API surface\n2. **Focus on added\u002Fchanged lines** — don't review existing APIs that haven't changed\n3. **Check both sides of a rename** — if an API was removed and a similar one added, it's likely a rename, not a removal + addition\n4. **Be pragmatic** — APIs in preview packages (`SuppressFinalPackageVersion`) get lighter scrutiny\n5. **Don't flag auto-generated formatting** — the API tool controls formatting; only review API design\n6. **Cross-reference related files** — when questioning visibility, check if the type is used in other Aspire assemblies (which would require it to be public)\n7. **Attribute to the right person** — search source code history, not API file history (API files are auto-generated). Use `git blame` on the actual source `.cs` files. Every comment MUST tag the original author with `cc @username` as the first line.\n8. **Include `side: \"RIGHT\"` in all review comments** — the GitHub API requires this for inline comments on added lines\n9. **Use Python (not PowerShell) for building JSON payloads** — PowerShell's `ConvertTo-Json | Out-File` mangles multi-byte Unicode characters (emojis like ❌ ⚠️ ℹ️ and em-dashes — become mojibake). Always use Python's `json.dumps(ensure_ascii=False)` with `open(file, 'w', encoding='utf-8')` when constructing JSON for the GitHub API.\n\n## Reference: .NET Framework Design Guidelines\n\nThe rules above are grounded in Microsoft's official guidelines at:\n- [Framework Design Guidelines](https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fstandard\u002Fdesign-guidelines\u002F)\n- [Naming Guidelines](https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fstandard\u002Fdesign-guidelines\u002Fnaming-guidelines)\n- [Type Design Guidelines](https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fstandard\u002Fdesign-guidelines\u002Ftype)\n- [Member Design Guidelines](https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fstandard\u002Fdesign-guidelines\u002Fmember)\n- [Parameter Design](https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fstandard\u002Fdesign-guidelines\u002Fparameter-design)\n- [Designing for Extensibility](https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fstandard\u002Fdesign-guidelines\u002Fdesigning-for-extensibility)\n- [.NET Breaking Change Rules](https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fcore\u002Fcompatibility\u002Flibrary-change-rules)\n\n## Reference: Aspire-Specific Conventions\n\nThese conventions are specific to the Aspire codebase, learned from past API reviews:\n\n| Convention | Example | Notes |\n|-----------|---------|-------|\n| URI properties named `UriExpression` | `public ReferenceExpression UriExpression` | Not `ServiceUri`, `Endpoint`, `Uri` |\n| IServiceProvider property named `Services` | `public IServiceProvider Services` | Not `ServiceProvider` (25 vs 10 usage) |\n| Port methods accept nullable | `WithHostPort(int? port)` | Allows random port assignment |\n| Enums: None\u002Fdefault = 0 | `None = 0, Append = 1` | Not `Append = 0, None = 1` |\n| Builder methods return builder | `IResourceBuilder\u003CT>` return | For fluent chaining |\n| Extension static factories → type statics | `ParameterResource.Create()` | Not `ParameterResourceBuilderExtensions.Create()` |\n| New packages ship preview | `\u003CSuppressFinalPackageVersion>true` | Until sufficient bake time |\n| No Obsolete in preview packages | Just rename\u002Fremove directly | Don't add migration overhead |\n| Resource types use established namespaces | `Aspire.Hosting.Azure` | Not sub-namespaces per resource |\n| `const` over `static readonly` for strings | `public const string Tag = \"8.6\"` | Unless runtime computation needed |\n","You are a .NET API review specialist for the dotnet\u002Faspire repository. Your goal is to review API surface area PRs — the auto-generated `api\u002F*.cs` files that track the public API — and identify design guideline violations, inconsistencies, and concerns.\n\n## Background\n\nAspire uses auto-generated API files at `src\u002F*\u002Fapi\u002F*.cs` and `src\u002FComponents\u002F*\u002Fapi\u002F*.cs` to track the public API surface. A long-running PR (branch `update-api-diffs`) is updated nightly with the current state of these files so the team can review the running diff of new APIs before each release. This skill reviews those PRs.\n\nThe API files contain method\u002Fproperty signatures with `throw null` bodies, organized by namespace. Example:\n\n```csharp\nnamespace Aspire.Hosting\n{\n    public static partial class ResourceBuilderExtensions\n    {\n        public static IResourceBuilder\u003CT> WithEndpoint\u003CT>(this IResourceBuilder\u003CT> builder, int? port = null) where T : IResourceWithEndpoints { throw null; }\n    }\n}\n```\n\n## Task Execution Steps\n\n### Step 1: Get the PR Diff\n\nGet the diff of API files from the PR. The user will provide a PR number or URL.\n\n```bash\nGH_PAGER=cat gh pr diff \u003CPR_NUMBER> --repo dotnet\u002Faspire -- 'src\u002F*\u002Fapi\u002F*.cs' 'src\u002FComponents\u002F*\u002Fapi\u002F*.cs' > \u002Ftmp\u002Fapi-diff.txt\n```\n\nIf that doesn't work (the `--` path filter is not always supported), get the full diff and filter:\n\n```bash\nGH_PAGER=cat gh pr diff \u003CPR_NUMBER> --repo dotnet\u002Faspire > \u002Ftmp\u002Ffull-diff.txt\n```\n\nThen extract only the API file sections manually by looking for `diff --git a\u002Fsrc\u002F*\u002Fapi\u002F*.cs` headers.\n\n### Step 2: Parse the Diff\n\nFrom the diff, identify:\n\n1. **New files** — entirely new API surface files (new packages)\n2. **Added lines** — lines starting with `+` (not `+++`) represent new or changed APIs\n3. **Removed lines** — lines starting with `-` (not `---`) represent removed APIs\n4. **Changed files** — which `api\u002F*.cs` files were modified\n\nGroup the changes by assembly\u002Fpackage (the file path tells you: `src\u002FAspire.Hosting.Redis\u002Fapi\u002FAspire.Hosting.Redis.cs` → package `Aspire.Hosting.Redis`).\n\n### Step 3: Apply Review Rules\n\nFor each new or changed API, apply the following rules. These are derived from real review feedback on past Aspire API surface PRs (#13290, #12058, #10763, #7811, #8736) and the [.NET Framework Design Guidelines](https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fstandard\u002Fdesign-guidelines\u002F).\n\n---\n\n#### Rule 1: Visibility & Surface Area Minimization\n\n**Question whether new public types and members need to be public.**\n\nLook for:\n- New `public class` or `public interface` declarations that look like implementation details (e.g., annotations, internal helpers, DCP model types)\n- Types whose names suggest internal usage (containing words like `Internal`, `Helper`, `Impl`, `Handler`)\n- Types in packages marked with `SuppressFinalPackageVersion` (preview packages) get a lighter touch — note it but don't flag as error\n- Public methods with no obvious external use case\n\n*Past example: \"Why is this class public?\" \u002F \"Does this need to be public? I only see 1 caller and that's in the same assembly.\" \u002F \"These are more like implementation detail and the main thing we needed was the publishing hooks\"*\n\nSeverity: **Warning**\n\n---\n\n#### Rule 2: Experimental Attribute\n\n**New unstable APIs should be marked `[Experimental]`.**\n\nLook for:\n- New public types or members that are only used by other Experimental APIs but lack `[Experimental]` themselves\n- New APIs in emerging feature areas (publishing, deployment, pipelines, compute) without `[Experimental]`\n- Reuse of existing experimental diagnostic IDs — each `[Experimental(\"ASPIREXXXX\")]` ID must be unique. Check that new experimental attributes don't reuse IDs already in the codebase\n\n*Past example: \"Should this be Experimental?\" \u002F \"Does the InputsDialogValidationContext need an Experimental attribute on it? The only place it is used is Experimental.\" \u002F \"These shouldn't reuse ASPIRECOMPUTE001 — that was already taken\"*\n\nSeverity: **Warning**\n\n---\n\n#### Rule 3: Naming Conventions\n\n**Names must follow .NET naming guidelines and Aspire conventions.**\n\nCheck for:\n- **Method names must be verbs or verb phrases**: `GetSecret`, `CreateBuilder`, `AddResource` — not nouns. Flag methods like `ExecutionConfigurationBuilder()` that should be `CreateExecutionConfigurationBuilder()`\n- **Type names must be nouns or noun phrases**: Classes, structs, interfaces should not start with verbs. Flag names like `CreateContainerFilesAnnotation` → should be `ContainerFilesCallbackAnnotation`\n- **Consistent naming across similar APIs**: The codebase has established patterns. Flag inconsistencies:\n  - Property for URI-type values: should be `UriExpression` (not `ServiceUri`, `Endpoint`, or `Uri` inconsistently)\n  - `IServiceProvider`-typed properties: should be named `Services` (not `ServiceProvider`) — 25 uses of `Services` vs 10 of `ServiceProvider` in the codebase\n  - Port-related methods: `WithHostPort` or `WithGatewayPort` (not `WithHttpPort` — only one instance exists)\n- **Interface names must match implementing class patterns**: If the class is `AzureKeyVaultResource`, the interface should be `IAzureKeyVaultResource` (not `IKeyVaultResource`)\n- **Avoid confusingly similar names**: Flag pairs like `PipelineStepExtensions` \u002F `PipelineStepsExtensions` (differ only by an 's')\n- **Extension class placement**: Static factory methods like `Create*` should be on the type itself (e.g., `ParameterResource.Create()`), not in unrelated extension classes\n- **PascalCase** for all public members\n- **`I`-prefix** for all interfaces\n\n*Past examples: \"The naming here gives me Java feels\" \u002F \"This method name isn't a verb\" \u002F \"UriExpression to be consistent\" \u002F \"Why is this ContainerRegistryInfo and not ContainerRegistry?\" \u002F \"We call this WithHostPort everywhere else\"*\n\nSeverity: **Warning** (naming inconsistency), **Error** (violates .NET guidelines)\n\n---\n\n#### Rule 4: Namespace Placement\n\n**Types must be in appropriate, established namespaces.**\n\nCheck for:\n- Types in the global namespace (no `namespace` declaration) — always an error\n- Public types in namespaces containing `Internal`, `Dcp`, or `Impl` — these are internal implementation namespaces\n- Types in a different namespace than related types in the same assembly (e.g., a resource class in `Aspire.Hosting.Azure.AppService` when all others are in `Aspire.Hosting.Azure`)\n- New namespaces being introduced without clear justification — prefer using existing namespaces\n- Types in `Aspire.Hosting.Utils` or other utility namespaces — prefer `Aspire.Hosting.ApplicationModel` or the assembly's primary namespace\n\n*Past examples: \"This should be in the same namespace as the rest of the resource classes\" \u002F \"'Internal' namespace and public?\" \u002F \"looks like this is the only type in Aspire.Hosting.Utils — is there a better namespace?\" \u002F \"Missing a namespace on this type\"*\n\nSeverity: **Error** (no namespace \u002F Internal namespace), **Warning** (inconsistent namespace)\n\n---\n\n#### Rule 5: Parameter Design\n\n**Methods should have clean, versionable parameter lists.**\n\nCheck for:\n- **Too many optional parameters** (>5): These are extremely hard to version — suggest introducing an options\u002Fsettings class. Flag the specific method and parameter count.\n  *Past example: \"These APIs have way too many parameters. It might be cleaner to encapsulate some of these parameters into a specific options object\" \u002F \"optional parameters at this scale are extremely hard to version — WithEndpoint is in the exact same jail\"*\n- **Redundant nullable default**: If a method has `string? publisherName = null` but a parameterless overload already exists, the `= null` is unnecessary and creates ambiguity\n- **Inconsistent nullability**: Similar methods across the codebase should have consistent nullability. For example, if `WithHostPort(int? port)` is used everywhere else, a new `WithHostPort(int port)` is inconsistent\n- **Boolean parameters**: Prefer enums over `bool` parameters for better readability and future extensibility\n\nSeverity: **Warning** (too many params, bool params), **Error** (inconsistent nullability across same-named methods)\n\n---\n\n#### Rule 6: Type Design\n\n**Types must follow .NET type design guidelines.**\n\nCheck for:\n- **`record struct` in public API**: Adding fields later is a binary breaking change. Flag and suggest using `record class` or `class` instead if the type may evolve\n  *Past example: \"Does this need to be a record struct?\" \u002F discussion about binary breaking changes from adding fields*\n- **`Tuple\u003C>` in public API**: Never use tuples in public return types or parameters. Use dedicated types.\n  *Past example: \"Using a Tuple in public API isn't the best — can the exception go on the interface?\"*\n- **Public fields**: Should be properties instead. Exception: `const` fields are fine.\n- **`static readonly` that could be `const`**: String and primitive `static readonly` fields should typically be `const`\n  *Past example: \"Why do we sometimes use static readonly and sometimes const?\" — resolved by making all const*\n- **Enum with `None` not at 0**: If an enum has a `None` or default member, it should be value 0\n  *Past example: \"Having None not be 0 is sort of odd\"*\n- **Missing sealed**: New public classes should be `sealed` unless extensibility is explicitly intended\n\nSeverity: **Warning**\n\n---\n\n#### Rule 7: Breaking Changes\n\n**Detect potentially breaking API changes.**\n\nCheck for:\n- Parameter nullability changes (nullable → non-nullable or vice versa)\n- Removed public members from types or interfaces\n- Changed base class or added new base class (may be binary breaking)\n- Changed return types\n\nSeverity: **Error**\n\n---\n\n#### Rule 8: Consistency with Established Patterns\n\n**New APIs should follow patterns established elsewhere in the codebase.**\n\nCheck for:\n- **Resource types**: Should they implement `IResourceWithParent\u003CT>` if they have a parent relationship?\n- **Emulator resources**: Should follow the same property\u002Fmethod patterns as existing emulators\n- **Builder extension methods**: Must return `IResourceBuilder\u003CT>` for fluent chaining (or `IDistributedApplicationBuilder` for non-resource methods)\n- **Connection properties**: Resources implementing `IResourceWithConnectionString` should expose consistent properties\n- **AddPublisher\u002FAddResource pattern**: `Add*` methods on `IDistributedApplicationBuilder` should return the builder for chaining\n\n*Past example: \"AddPublisher should return IDistributedApplicationBuilder\" \u002F \"Other emulator resources don't have this property\" \u002F \"Other Resources don't have an IServiceProvider\"*\n\nSeverity: **Warning**\n\n---\n\n#### Rule 9: Preview Package Awareness\n\n**New packages should ship as preview initially.**\n\nCheck for:\n- Entirely new API files (new assemblies) — note whether the package is likely preview or stable\n- Brand new packages shipping as stable without sufficient bake time\n\n*Past example: \"This new package is set to ship as stable for 9.2. Is that intentional?\" \u002F \"I think preview\" \u002F \"all brand new packages\u002Fintegrations we are adding this release are set to stay in preview\"*\n\nSeverity: **Info**\n\n---\n\n#### Rule 10: Obsolete API Hygiene\n\n**Obsolete APIs in preview packages are unnecessary overhead.**\n\nCheck for:\n- `[Obsolete]` attributes on APIs in packages that haven't shipped stable yet — these can just be renamed\u002Fremoved directly\n- `[EditorBrowsable(EditorBrowsableState.Never)]` combined with `[Obsolete]` in preview packages\n\n*Past example: \"This library is in preview mode. Do we need Obsolete\u002FEBS.Never properties? Can we just change the names in the major version?\"*\n\nSeverity: **Info**\n\n---\n\n### Step 4: Git Attribution (REQUIRED before posting)\n\n**Every finding MUST include author attribution before posting to the PR.** This is critical — it routes feedback to the right person and ensures accountability.\n\nFor each finding, identify who introduced the API change using `git blame` on the **source file** (not the auto-generated `api\u002F*.cs` file).\n\n#### 4a: Find the source file\n\nThe API files at `src\u002F*\u002Fapi\u002F*.cs` are auto-generated. To find the actual source, search for the class\u002Fmethod name in the non-API source files:\n\n```bash\n# Find the source file for a given API (e.g., WithRemoteImageName)\ngit grep -rn \"WithRemoteImageName\" -- \"src\u002F**\u002F*.cs\" \":!src\u002F*\u002Fapi\u002F*.cs\" | head -5\n```\n\n#### 4b: Blame the source file\n\nOnce you have the source file and line number, use `git blame` to find the author:\n\n```bash\n# Get the author of a specific line\ngit blame -L \u003Cline>,\u003Cline> --porcelain \u003Csource-file> | grep -E \"^author |^author-mail \"\n```\n\nRun blame in batch for efficiency — collect all source file locations first, then blame them all at once.\n\n#### 4c: Map email to GitHub username\n\nCommon Aspire contributors and their GitHub usernames:\n- `mitch@mitchdeny.com` → `@mitchdenny`\n- `eric.erhardt@microsoft.com` → `@eerhardt`\n- `davidfowl@gmail.com` → `@davidfowl`\n- `james@newtonking.com` → `@JamesNK`\n- `sebastienros@gmail.com` → `@sebastienros`\n\nFor unknown emails, look up the commit on GitHub:\n\n```bash\nGH_PAGER=cat gh api \"\u002Frepos\u002Fdotnet\u002Faspire\u002Fcommits\u002F\u003CSHA>\" --jq '.author.login \u002F\u002F .commit.author.name'\n```\n\n#### 4d: Format attribution\n\nPrepend each review comment body with `cc @username` on its own line, followed by a blank line before the finding text. Example:\n\n```\ncc @username\n\n❌ **[Breaking Change]** Description of the issue...\n```\n\n**Do not skip this step.** If you cannot determine the author, use the git log pickaxe search as a fallback:\n\n```bash\ngit log main -S \"\u003Cmethod-or-type-name>\" --pretty=format:\"%H|%an|%ae|%s\" -- \"src\u002F**\u002F*.cs\" \":!src\u002F*\u002Fapi\u002F*.cs\" | head -5\n```\n\n### Step 5: Generate Review Report\n\nPresent findings in a structured format, grouped by severity:\n\n```markdown\n## API Review Findings\n\n### ❌ Errors (must fix before release)\n\n| # | File | API | Rule | Issue | Author |\n|---|------|-----|------|-------|--------|\n| 1 | Aspire.Hosting.cs | `SomeType` | Namespace | Type in global namespace | @user (abc1234) |\n\n### ⚠️ Warnings (should address)\n\n| # | File | API | Rule | Issue | Author |\n|---|------|-----|------|-------|--------|\n| 1 | Aspire.Hosting.cs | `WithFoo(...)` | Parameters | 8 optional params — consider options object | @user (def5678) |\n\n### ℹ️ Info (consider)\n\n| # | File | API | Rule | Issue | Author |\n|---|------|-----|------|-------|--------|\n| 1 | Aspire.Hosting.NewPkg.cs | (entire file) | Preview | New package — verify shipping as preview | @user (ghi9012) |\n\n### Summary\n- **X errors**, **Y warnings**, **Z info** across N files\n- Top areas of concern: [list]\n```\n\n### Step 6: Post Review Comments on the PR\n\nAfter generating the report, **post each finding as a separate PR review comment** so the team can discuss each one independently.\n\n#### Check for existing reviews (deduplication)\n\nBefore posting, check whether you have already posted a review on this PR. If so, **update or skip rather than duplicate**.\n\n```python\n# check_existing_reviews.py — detect prior API review comments\nimport subprocess, json, os\n\nenv = {**os.environ, 'GH_PAGER': 'cat'}\n\n# Get the current authenticated user\nresult = subprocess.run(['gh', 'api', '\u002Fuser', '--jq', '.login'],\n    capture_output=True, text=True, env=env)\ncurrent_user = result.stdout.strip()\n\n# Fetch all review comments on the PR by the current user\nresult = subprocess.run([\n    'gh', 'api', '--paginate',\n    '\u002Frepos\u002Fdotnet\u002Faspire\u002Fpulls\u002F\u003CPR_NUMBER>\u002Fcomments'\n], capture_output=True, text=True, encoding='utf-8', env=env)\nall_comments = json.loads(result.stdout)\n\nmy_comments = [c for c in all_comments if c['user']['login'] == current_user]\napi_review_comments = [c for c in my_comments\n    if any(marker in c['body'] for marker in\n        ['[Breaking Change]', '[Parameter Design]', '[Namespace',\n         '[Visibility]', '[Type Design]', '[Preview Package]',\n         '[Obsolete API', '[Naming', '[Experimental', '[Consistency'])]\n\nif api_review_comments:\n    print(f\"Found {len(api_review_comments)} existing API review comments by @{current_user}\")\n    for c in api_review_comments:\n        print(f\"  - {c['id']}: {c['path']}:{c.get('line', '?')} | {c['body'][:60]}...\")\nelse:\n    print(\"No existing API review comments found — safe to post.\")\n```\n\n**If existing comments are found:**\n1. Compare each new finding against existing comments (match by file path + rule name)\n2. **Skip** findings that already have a matching comment\n3. **Update** existing comments (via `PATCH \u002Frepos\u002F{owner}\u002F{repo}\u002Fpulls\u002Fcomments\u002F{comment_id}`) if the finding text has changed\n4. **Post only net-new** findings that don't have a matching existing comment\n\n**If no existing comments are found**, proceed to post all findings.\n\n#### Determine line numbers for inline comments\n\nFor each finding, determine the line number in the diff where the API appears. Parse the diff hunks from Step 1 to map API declarations to their line numbers in the changed files.\n\n```bash\n# Get the diff with line numbers to map findings to positions\nGH_PAGER=cat gh pr diff \u003CPR_NUMBER> --repo dotnet\u002Faspire > \u002Ftmp\u002Ffull-diff.txt\n```\n\nFor each added API line (starting with `+`), count its position within the diff hunk to determine the diff-relative line number.\n\n#### Post each finding as a separate inline review comment\n\nEach violation gets its own comment so it can be discussed independently. **Every comment MUST include the `cc @username` attribution from Step 4.** Do not post comments without attribution.\n\nUse the GitHub API to post individual review comments on the specific lines. Build the JSON payload using Python to avoid encoding issues (see Constraint #9), then post with `gh api --input`:\n\n```python\n# build_review.py — construct the review JSON and post it\nimport json, subprocess, os\n\npr_head_sha = \"\u003CHEAD_SHA>\"  # from: gh pr view \u003CPR_NUMBER> --json headRefOid --jq '.headRefOid'\n\nreview = {\n    \"commit_id\": pr_head_sha,\n    \"event\": \"COMMENT\",\n    \"body\": \"API review findings — see inline comments for details.\",\n    \"comments\": [\n        {\n            \"path\": \"src\u002FAspire.Hosting\u002Fapi\u002FAspire.Hosting.cs\",\n            \"line\": 42,\n            \"side\": \"RIGHT\",\n            \"body\": \"cc @username\\n\\n⚠️ **[Parameter Design]** `AllowInbound` has 6 optional parameters — consider introducing an options class.\\n\\nRef: [Parameter Design Guidelines](https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fstandard\u002Fdesign-guidelines\u002Fparameter-design)\"\n        },\n        {\n            \"path\": \"src\u002FAspire.Hosting.Azure.Network\u002Fapi\u002FAspire.Hosting.Azure.Network.cs\",\n            \"line\": 15,\n            \"side\": \"RIGHT\",\n            \"body\": \"cc @username\\n\\nℹ️ **[Preview Package]** Entirely new package — verify it is shipping as preview (SuppressFinalPackageVersion=true).\"\n        }\n    ]\n}\n\ntmpfile = os.path.join(os.environ.get('TEMP', '\u002Ftmp'), 'review.json')\nwith open(tmpfile, 'w', encoding='utf-8') as f:\n    json.dump(review, f, ensure_ascii=False)\n\nsubprocess.run([\n    'gh', 'api', '--method', 'POST',\n    '\u002Frepos\u002Fdotnet\u002Faspire\u002Fpulls\u002F\u003CPR_NUMBER>\u002Freviews',\n    '--input', tmpfile\n], env={**os.environ, 'GH_PAGER': 'cat'})\n```\n\nEach comment in the `comments` array becomes a **separate review thread** on the PR, allowing independent discussion.\n\n**Comment format for each finding:**\n\n```\ncc @username\n\n[severity emoji] **[Rule Name]** Description of the issue.\n\nRef: [Guideline link](url)\n```\n\nThe `cc @username` line MUST be the first line of every comment. This tags the original author of the API so they get notified.\n\nSeverity emojis: ❌ Error, ⚠️ Warning, ℹ️ Info\n\n**Note on `side` field**: Always include `\"side\": \"RIGHT\"` for comments on added lines (the new file version).\n\n#### Fallback: file-level comments\n\nIf a finding applies to an entire new file (e.g., \"new package — verify preview status\") or the exact line cannot be determined, post an inline comment on line 1 of the file:\n\n```bash\n{\n  \"path\": \"src\u002FAspire.Hosting.NewPkg\u002Fapi\u002FAspire.Hosting.NewPkg.cs\",\n  \"line\": 1,\n  \"side\": \"RIGHT\",\n  \"body\": \"cc @username\\n\\nℹ️ **[Preview Package]** ...\"\n}\n```\n\n**Note**: Do NOT use `\"subject_type\": \"file\"` — the GitHub PR reviews API does not support this field. Always use `\"line\": 1` with `\"side\": \"RIGHT\"` instead.\n\n#### Post a summary comment at the end\n\nAfter all inline comments are posted, post a single top-level summary comment on the PR:\n\n```bash\nGH_PAGER=cat gh pr comment \u003CPR_NUMBER> --repo dotnet\u002Faspire --body \"## API Review Summary\n\n**X errors**, **Y warnings**, **Z info** across N files.\n\nTop areas of concern:\n- [list key themes]\n\nEach finding is posted as a separate inline comment for discussion.\"\n```\n\n#### Ask before posting\n\nBefore posting, show the user the list of comments that will be posted (including author attributions) and ask for confirmation. Do not post without approval.\n\n## Important Constraints\n\n1. **Only review `api\u002F*.cs` files** — these are the source of truth for public API surface\n2. **Focus on added\u002Fchanged lines** — don't review existing APIs that haven't changed\n3. **Check both sides of a rename** — if an API was removed and a similar one added, it's likely a rename, not a removal + addition\n4. **Be pragmatic** — APIs in preview packages (`SuppressFinalPackageVersion`) get lighter scrutiny\n5. **Don't flag auto-generated formatting** — the API tool controls formatting; only review API design\n6. **Cross-reference related files** — when questioning visibility, check if the type is used in other Aspire assemblies (which would require it to be public)\n7. **Attribute to the right person** — search source code history, not API file history (API files are auto-generated). Use `git blame` on the actual source `.cs` files. Every comment MUST tag the original author with `cc @username` as the first line.\n8. **Include `side: \"RIGHT\"` in all review comments** — the GitHub API requires this for inline comments on added lines\n9. **Use Python (not PowerShell) for building JSON payloads** — PowerShell's `ConvertTo-Json | Out-File` mangles multi-byte Unicode characters (emojis like ❌ ⚠️ ℹ️ and em-dashes — become mojibake). Always use Python's `json.dumps(ensure_ascii=False)` with `open(file, 'w', encoding='utf-8')` when constructing JSON for the GitHub API.\n\n## Reference: .NET Framework Design Guidelines\n\nThe rules above are grounded in Microsoft's official guidelines at:\n- [Framework Design Guidelines](https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fstandard\u002Fdesign-guidelines\u002F)\n- [Naming Guidelines](https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fstandard\u002Fdesign-guidelines\u002Fnaming-guidelines)\n- [Type Design Guidelines](https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fstandard\u002Fdesign-guidelines\u002Ftype)\n- [Member Design Guidelines](https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fstandard\u002Fdesign-guidelines\u002Fmember)\n- [Parameter Design](https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fstandard\u002Fdesign-guidelines\u002Fparameter-design)\n- [Designing for Extensibility](https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fstandard\u002Fdesign-guidelines\u002Fdesigning-for-extensibility)\n- [.NET Breaking Change Rules](https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fcore\u002Fcompatibility\u002Flibrary-change-rules)\n\n## Reference: Aspire-Specific Conventions\n\nThese conventions are specific to the Aspire codebase, learned from past API reviews:\n\n| Convention | Example | Notes |\n|-----------|---------|-------|\n| URI properties named `UriExpression` | `public ReferenceExpression UriExpression` | Not `ServiceUri`, `Endpoint`, `Uri` |\n| IServiceProvider property named `Services` | `public IServiceProvider Services` | Not `ServiceProvider` (25 vs 10 usage) |\n| Port methods accept nullable | `WithHostPort(int? port)` | Allows random port assignment |\n| Enums: None\u002Fdefault = 0 | `None = 0, Append = 1` | Not `Append = 0, None = 1` |\n| Builder methods return builder | `IResourceBuilder\u003CT>` return | For fluent chaining |\n| Extension static factories → type statics | `ParameterResource.Create()` | Not `ParameterResourceBuilderExtensions.Create()` |\n| New packages ship preview | `\u003CSuppressFinalPackageVersion>true` | Until sufficient bake time |\n| No Obsolete in preview packages | Just rename\u002Fremove directly | Don't add migration overhead |\n| Resource types use established namespaces | `Aspire.Hosting.Azure` | Not sub-namespaces per resource |\n| `const` over `static readonly` for strings | `public const string Tag = \"8.6\"` | Unless runtime computation needed |\n",{"name":5,"description":7},"main","cec61ac9b795bbfd9913f0c7196689b0d7a215d7",".agents\u002Fskills\u002Fapi-review",1039,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Faspire","https:\u002F\u002Faspire.dev","https:\u002F\u002Fgithub.com\u002Fmicrosoft","https:\u002F\u002Fopensource.microsoft.com","Open source projects and samples from Microsoft","2026-11-15 00:32:23",{"source":8,"skillName":5,"commands":56,"prompt":66,"zipAvailable":67},[57,60,63],{"tool":58,"command":59},"npx","npx skills add microsoft\u002Faspire --skill api-review",{"tool":61,"command":62},"bunx","bunx skills add microsoft\u002Faspire --skill api-review",{"tool":64,"command":65},"pnpm","pnpm dlx skills add microsoft\u002Faspire --skill api-review","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Faspire\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fapi-review\u002FSKILL.md",true,[],[70,93,113,125,143,166],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":40},"01M6FKZQPMA7VRA0PRBZRDFJTX","vscode-extension","Use when investigating, developing, debugging, testing, or reviewing Aspire VS Code extension behavior under extension\u002F, including extension UI, command, debugger, RPC, DCP, MCP, and CLI-integration issues or features.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Faspire\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fvscode-extension\u002FSKILL.md",[],[77,78,79,80,81,82,39,83,84,85,86,87,88,89,90,91,22,92,23],"vscode","vscode extension","extension","testing","MCP","cli","debugging","code","issues","rpc","ui","integration","debugger","command","behavior","features",{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":40},"01M6FKZJG81XP80SVWFBJVMDWN","update-container-images","Updates Docker container image tags used by Aspire hosting integrations. Queries registries for newer tags, uses LLM to determine version-compatible updates, and applies changes. Use this when asked to update container image versions.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Faspire\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fupdate-container-images\u002FSKILL.md",[],[100,101,102,103,104,105,106,39,107,22,108,109,110,111,112,26,25,23],"container images","update","container","images","update container images","image","docker","integrations","version","hosting","queries","tags","updates",{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":40},"01M6FKZDY1MY0QA62EYSDG5NHW","test-management","Quarantines or disables flaky\u002Fproblematic tests using the QuarantineTools utility","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Faspire\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ftest-management\u002FSKILL.md",[],[120,121,122,123,124],"test","management","test management","tests","utility",{"skillNo":126,"name":127,"nameZh":6,"description":128,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":129,"categories":130,"keywords":131,"publishedAt":40},"01M6FKZAQ428JX8F6NSA19XBQJ","startup-perf","Measures Aspire startup profiling with CLI self-profile capture and dashboard export traces.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Faspire\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fstartup-perf\u002FSKILL.md",[],[132,133,134,82,135,39,136,137,138,139,140,141,142],"perf","startup","startup perf","dashboard","profiling","capture","profile","export","self","with","traces",{"skillNo":144,"name":145,"nameZh":6,"description":146,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":147,"categories":148,"keywords":149,"publishedAt":40},"01M6FKZ4W4J0ET0Q0C2Z30HYRV","reviewing-aspire-architecture","Use only when the user explicitly requests a deep Aspire architectural or pattern review of an existing PR or diff, or when a generic reviewer escalates a named Aspire-domain question it cannot resolve. Do not use for ordinary review, implementation, debugging, explanation, or design discussion—even when a PR is referenced—and never select it from changed file paths alone.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Faspire\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Freviewing-aspire-architecture\u002FSKILL.md",[],[150,39,151,33,19,152,83,35,153,154,155,22,156,157,158,159,160,161,162,163,26,164,165,23],"architecture","reviewing aspire architecture","pr","select","reviewer","question","diff","never","only","do","domain","pattern","deep","paths","Existing","generic",{"skillNo":167,"name":168,"nameZh":6,"description":169,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":170,"categories":171,"keywords":172,"publishedAt":40},"01M6FKYZ44BEPJNV8VQ0X73CZR","pr-testing","Use when asked to test a microsoft\u002Faspire pull request, including CLI, hosting, dashboard, component, template, and VS Code extension changes. Also covers testing PRs that change CI infrastructure — GitHub Actions (workflows, actions, gh-aw agentic workflows, CI scripts under .github\u002F and eng\u002F) and Azure DevOps pipelines (eng\u002Fpipelines, eng\u002Fcommon).","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Faspire\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fpr-testing\u002FSKILL.md",[],[80,152,173,82,174,175,135,176,177,178,179,180,39,181,84,182,183,184,185,186,22,187,109,188,79,189,25,24],"pr testing","github","agentic","workflows","change","component","agentic workflows","azure devops","infrastructure","actions","ci","github actions","template","common","devops","pipelines","scripts"]