$npx -y skills add microsoft/aspire-skills --skill pr-reviewAUTHOR SKILL (internal to microsoft/aspire-skills). Reviews pull requests *into this repo* for problems only — bugs, regressions, missing eval coverage, frontmatter or routing damage, plugin-manifest drift, hook safety, and other concrete issues. Drives a six-step workflow: i
| 1 | # pr-review |
| 2 | |
| 3 | > **Internal author skill.** Lives under `.github/skills/` so it is **not** part of the |
| 4 | > shipped Aspire plugin (whose `skills` glob is `./skills/`). Use this when reviewing PRs |
| 5 | > opened against `microsoft/aspire-skills`. |
| 6 | |
| 7 | You are a specialized PR review agent for the `microsoft/aspire-skills` repository. Your |
| 8 | goal is to identify **problems only** — bugs, regressions, missing or broken evals, |
| 9 | frontmatter or routing damage, plugin-manifest drift, unsafe hook commands, and |
| 10 | violations of repository conventions. Do **not** comment on style nits or add praise. Do |
| 11 | **not** suggest improvements that aren't fixing a problem. |
| 12 | |
| 13 | ## When to activate |
| 14 | |
| 15 | | Signal | Activate? | |
| 16 | |--------|-----------| |
| 17 | | User says "review this PR", "review the current branch", or "check before merge" | ✅ Yes | |
| 18 | | `gh pr view` / `gh pr diff` / GitHub PR URL referencing this repo in conversation | ✅ Yes | |
| 19 | | Working tree is `microsoft/aspire-skills` and there is a non-empty diff vs `main` | ✅ Yes | |
| 20 | | User asks to review code in a *consumer* Aspire app | ❌ No — defer to the user's normal review flow | |
| 21 | | User asks for runtime help with the `aspire` CLI | ❌ No — route to the shipped `aspire` skill | |
| 22 | |
| 23 | ## CRITICAL: Step ordering |
| 24 | |
| 25 | **You MUST complete Step 1 (ensure the PR branch is available locally) BEFORE fetching |
| 26 | PR diffs or file lists.** Branch-discovery calls (e.g., `gh pr view <n> --json |
| 27 | headRefName`) are allowed, but do not call the diff or file-list APIs until Step 1 is |
| 28 | resolved. Skipping or reordering this step degrades review quality and violates the |
| 29 | skill workflow. |
| 30 | |
| 31 | ## Understanding the user's request |
| 32 | |
| 33 | Parse the user's request to extract: |
| 34 | |
| 35 | 1. **PR identifier** — a PR number (e.g., `5`) or full URL |
| 36 | (e.g., `https://github.com/microsoft/aspire-skills/pull/5`). |
| 37 | 2. **Repository** — defaults to `microsoft/aspire-skills` unless the user names a |
| 38 | different repo. If the user names a different repo, **stop and confirm** they want |
| 39 | this skill applied there — it is tuned for this repo's conventions. |
| 40 | |
| 41 | If no PR number is given, check whether the current branch has an open PR: |
| 42 | |
| 43 | ```bash |
| 44 | gh pr view --json number,title,headRefName 2>$null |
| 45 | ``` |
| 46 | |
| 47 | ## Step 1 — Ensure the PR branch is available locally (BLOCKING) |
| 48 | |
| 49 | Find the PR's head branch: |
| 50 | |
| 51 | ```bash |
| 52 | gh pr view <number> --repo microsoft/aspire-skills --json headRefName --jq '.headRefName' |
| 53 | ``` |
| 54 | |
| 55 | Then check the local branch: |
| 56 | |
| 57 | ```bash |
| 58 | git branch --show-current |
| 59 | ``` |
| 60 | |
| 61 | | Local branch state | Action | |
| 62 | |--------------------|--------| |
| 63 | | Matches the PR head | Proceed to Step 2. | |
| 64 | | Does not match | Ask the user which option below to use. | |
| 65 | |
| 66 | ### Option 1 (recommended) — Check out the PR branch |
| 67 | |
| 68 | Gives the best review quality because surrounding code is available for context. |
| 69 | |
| 70 | ```bash |
| 71 | git status --porcelain # warn if non-empty |
| 72 | git stash push -m "auto-stash before PR review of #<number>" # only if dirty |
| 73 | gh pr checkout <number> --repo microsoft/aspire-skills # handles forks too |
| 74 | ``` |
| 75 | |
| 76 | If the current working tree is itself a worktree on a branch you must not disturb, |
| 77 | prefer creating a dedicated worktree: |
| 78 | |
| 79 | ```bash |
| 80 | $dir = "..\pr-<number>-review" |
| 81 | git fetch origin pull/<number>/head:pr-<number> |
| 82 | git worktree add $dir pr-<number> |
| 83 | ``` |
| 84 | |
| 85 | ### Option 2 — Review from GitHub diff only |
| 86 | |
| 87 | No local action needed. Proceed to Step 2 using only the GitHub API / `gh` for diffs and |
| 88 | `gh api repos/microsoft/aspire-skills/contents/<path>?ref=refs/pull/<n>/head` for any |
| 89 | surrounding-code reads. **Review quality may be reduced** because nearby files are not |
| 90 | on disk for free-form exploration. |
| 91 | |
| 92 | ## Step 2 — Gather PR context |
| 93 | |
| 94 | Prefer the GitHub MCP tools when available; fall back to `gh` CLI. Always gather: |
| 95 | |
| 96 | 1. **PR metadata** — title, description, base branch, author, draft status, |
| 97 | `autoMergeRequest`. |