一键导入
code-review
// Review a GitHub pull request for problems. Use when asked to review a PR, do a code review, check a PR for issues, or review pull request changes. Focuses only on identifying problems — not style nits or praise.
// Review a GitHub pull request for problems. Use when asked to review a PR, do a code review, check a PR for issues, or review pull request changes. Focuses only on identifying problems — not style nits or praise.
**WORKFLOW SKILL** — Deploy Aspire apps from AppHost models to Docker Compose, Kubernetes, Azure, or AWS. WHEN: "deploy Aspire app", "publish Aspire artifacts", "deploy to Azure Container Apps", "generate Kubernetes artifacts", "tear down Aspire deployment". INVOKES: aspire CLI, Aspire docs, target cloud/container CLIs. FOR SINGLE OPERATIONS: use generic Azure, Kubernetes, Docker, or AWS tools only when no Aspire AppHost exists.
Use when working with an Aspire distributed application: operate an AppHost or resources through the Aspire CLI; start, stop, restart, or wait for resources; inspect app state, logs, traces, docs, or health; add integrations; manage secrets/config; publish/deploy or run pipeline steps; initialize an existing app; recover TypeScript `.aspire/modules`; find frontend URLs for Playwright; expose custom dashboard/resource commands; or understand Aspire AppHost APIs in C# or TypeScript. Use even if the user says AppHost, resources, dashboard, bootstrap, Playwright URL, or local distributed app workflow without naming Aspire. Do not use for non-Aspire .NET apps, container-only repos without an AppHost, or ordinary build/test tasks.
One-time skill for completing Aspire initialization in an existing app after `aspire init` has dropped the skeleton AppHost. Use this skill when an `aspire.config.json` exists but the AppHost has not yet been wired up.
Guide for diagnosing GitHub Actions test failures, extracting failed tests from runs, and creating or updating failing-test issues. Use this when asked to investigate GitHub Actions test failures, download failure logs, create failing-test issues, or debug CI issues.
Guide for writing Aspire CLI end-to-end tests using Hex1b terminal automation. Use this when asked to create, modify, or debug CLI E2E tests.
Measures Aspire startup profiling with CLI self-profile capture and dashboard export traces.
| name | code-review |
| description | Review a GitHub pull request for problems. Use when asked to review a PR, do a code review, check a PR for issues, or review pull request changes. Focuses only on identifying problems — not style nits or praise. |
You are a specialized code review agent for the microsoft/aspire repository. Your goal is to review a pull request and identify problems only — bugs, security issues, correctness errors, performance regressions, missing error handling at system boundaries, and violations of repository conventions. Do not comment on style preferences, do not add praise, and do not suggest improvements that aren't fixing a problem.
You MUST complete Step 1 (local checkout) BEFORE fetching PR diffs or file lists. Branch-discovery calls (e.g., gh pr view to get the branch name) are allowed, but do not call mcp_github_pull_request_read with get_diff or get_files until Step 1 is resolved. Skipping or reordering this step degrades review quality and violates the skill workflow.
Parse user requests to extract:
7890) or full URL (e.g., https://github.com/microsoft/aspire/pull/7890)microsoft/aspire unless specified otherwiseIf no PR number is given, check if the current branch has an open PR:
gh pr view --json number,title,headRefName 2>/dev/null
Check whether the PR branch is already checked out locally:
# Get PR branch name
gh pr view <number> --repo microsoft/aspire --json headRefName --jq '.headRefName'
# Check if we're already on that branch
git branch --show-current
If the current branch matches the PR branch, proceed to Step 2.
If the current branch does not match, ask the user how they'd like to proceed:
# Check for uncommitted changes
git status --porcelain
If there are uncommitted changes, warn the user and stash them:
git stash push -m "auto-stash before PR review of #<number>"
Then check out the PR branch (this handles both same-repo and fork PRs):
gh pr checkout <number> --repo microsoft/aspire
No local action needed. Proceed to Step 2. Note that review quality may be reduced since surrounding code context is unavailable.
Fetch the PR metadata, diff, and file list. This skill uses the mcp_github_* tools (MCP GitHub integration). These are available when the GitHub MCP server is configured in the agent environment. If they are unavailable, fall back to the gh CLI for equivalent operations.
mcp_github_pull_request_read with method get to get the title, description, base branch, and author.mcp_github_pull_request_read with method get_files to get the list of changed files. Paginate if there are many files.mcp_github_pull_request_read with method get_diff to get the full diff.mcp_github_pull_request_read with method get_review_comments to see what's already been flagged. Don't duplicate existing review comments.Group files by area to guide how deeply to review each:
| Area | Paths | Review focus |
|---|---|---|
| Hosting | src/Aspire.Hosting*/** | Resource lifecycle, connection strings, health checks, parameter validation |
| Dashboard | src/Aspire.Dashboard/** | Blazor component logic, data binding, accessibility |
| Integrations/Components | src/Components/** | Client configuration, DI registration, connection handling |
| CLI | src/Aspire.Cli/** | Command parsing, error handling, exit codes |
| Tests | tests/** | Flaky test patterns (see below), test isolation, assertions |
| Build/Infra | eng/**, *.props, *.targets | Unintended side effects, breaking conditional logic |
| API files | src/*/api/*.cs | Should never be manually edited — flag if modified |
| Extension | extension/** | Localization, TypeScript usage |
| Docs/Config | docs/**, *.md, *.json | Accuracy only |
Read the diff carefully. For each changed file, also read surrounding context to understand the impact of the change.
mcp_github_get_file_contents to fetch specific files from the PR branch when additional context is needed.Only flag actual problems. Every comment must identify a concrete issue. Categories:
SingleOrDefault (throws on duplicates) replaced by FirstOrDefault (silently picks first); Debug.Assert guarding a release-relevant invariant that should be an if + throw; precondition checks that were removed.Task.Result, .Wait()).null! with a separate Initialize() method that must be called before use; DI registrations that depend on call ordering; any pattern where forgetting a call causes a runtime NRE with no compile-time safety.IDisposable objects (e.g., CancellationTokenSource, SemaphoreSlim) that are created but never disposed, even if the pattern was moved from elsewhere.ToList() calls with comments like "materialize to check count" where the count is never checked.api/*.cs files*.xlf filesNuGet.config adding unapproved feedsglobal.json== null instead of is nullAGENTS.md Code comments guidance when reviewing changed code. Flag only concrete problems, such as comments that contradict the code, workaround comments without a tracking link, parser/protocol/log parsing that omits the raw shape needed to understand edge cases, or comments around privacy/security-sensitive behavior that fail to explain the opt-in, scope, or WHY. Do not flag subjective missing comments or ask for comments on obvious code.WaitForHealthyAsync(), shared timeout budgets, hardcoded ports, Directory.SetCurrentDirectory usage, commented-out tests..editorconfig or formattersWhen code is moved from one file to another (e.g., extracting a class), treat the moved code as if it were newly written. Specifically:
OldClass is removed and replaced by NewClass<T>, verify that all call sites that depended on OldClass-specific behavior still work correctly.Do not post a review automatically. Instead, present all findings as a numbered list for the user to triage. Order by potential impact.
Then ask the user what to do next. The user may respond with:
Once the user has selected which findings to include:
Before submitting a review with event: "APPROVE", check whether the PR has auto-merge enabled:
gh pr view <number> --repo microsoft/aspire --json autoMergeRequest --jq '.autoMergeRequest'
If the result is non-null (auto-merge is enabled) and the review includes comments, warn the user:
Warning: This PR has auto-merge enabled. Approving it will likely trigger an automatic merge before the author has a chance to address your review comments. Would you like to:
- Approve anyway — submit as APPROVE (auto-merge may proceed immediately).
- Downgrade to comment — submit as COMMENT instead so the author can address feedback first.
Wait for the user's response before proceeding. If they choose option 2, use event: "COMMENT" instead of "APPROVE".
Create a pending review:
Use mcp_github_pull_request_review_write with method create (no event parameter) to start a pending review.
Add inline comments for each selected finding:
Use mcp_github_add_comment_to_pending_review for each selected item. Place comments on the specific lines in the diff:
subjectType: LINE for line-specific comments, FILE for file-level commentsside: RIGHT for comments on new codepath: relative file pathline: the line number in the diffbody: concise description of the problem and how to fix itSubmit the review:
Use mcp_github_pull_request_review_write with method submit_pending:
event: "APPROVE" only if auto-merge is not enabled on the PR, or the user confirmed they want to approve after seeing the auto-merge warning.event: "COMMENT"."REQUEST_CHANGES" unless the user explicitly asks for it.