بنقرة واحدة
pr-review
// End-to-end PR reviewer for dotnet/maui. Orchestrates 3 phases — Pre-Flight, Try-Fix, Report. Gate runs separately before this skill. Use when asked to 'review PR #XXXXX', 'work on PR #XXXXX', or 'fix issue #XXXXX'.
// End-to-end PR reviewer for dotnet/maui. Orchestrates 3 phases — Pre-Flight, Try-Fix, Report. Gate runs separately before this skill. Use when asked to 'review PR #XXXXX', 'work on PR #XXXXX', or 'fix issue #XXXXX'.
Labels issues and pull requests in the dotnet/maui repository with `area-*` and `platform/*` labels ONLY, based on technical content and platform-file conventions. Used by the gh-aw agentic-labeler workflow and available for batch evaluation and interactive Copilot CLI usage.
MAUI-specific dependency flow rules, channel conventions, and feed lookup workflows. Use when asked about darc, BAR, Maestro, feeds for .NET MAUI, build promotion, asset lookup, channel mappings, or dependency flow for dotnet/maui. Wraps the maestro-cli skill and maestro MCP tools with MAUI-specific guardrails.
Deep code review of PR changes for correctness, safety, and MAUI conventions. Uses independence-first assessment (code before narrative) and delegates to the maui-expert-reviewer agent for per-dimension sub-agent evaluation. Triggers on: "review code for PR", "code review PR", "analyze code changes", "check PR code quality". Do NOT use for: summarizing PRs, describing what changed, general PR questions, running tests, or fixing code.
Attempts ONE alternative fix for a bug, tests it empirically, and reports results. ALWAYS explores a DIFFERENT approach from existing PR fixes. Use when CI or an agent needs to try independent fix alternatives. Invoke with problem description, test command, target files, and optional hints.
Verifies tests catch the bug. Auto-detects test type (UI tests, device tests, unit tests) and dispatches to the appropriate runner. Supports two modes - verify failure only (test creation) or full verification (test + fix validation).
Investigate CI failures for dotnet/maui PRs — build errors, Helix test logs, and binlog analysis. Use when asked about failing checks, CI status, test failures, 'why is CI red', 'build failed', 'what's failing on PR', Helix failures, or device test failures.
| name | pr-review |
| description | End-to-end PR reviewer for dotnet/maui. Orchestrates 3 phases — Pre-Flight, Try-Fix, Report. Gate runs separately before this skill. Use when asked to 'review PR #XXXXX', 'work on PR #XXXXX', or 'fix issue #XXXXX'. |
End-to-end PR review workflow that orchestrates phases to explore independent fix alternatives and produce a recommendation.
Trigger phrases: "review PR #XXXXX", "work on PR #XXXXX", "fix issue #XXXXX"
🚨 NEVER use
gh pr review --approveor--request-changes. AI agents must NEVER post review comments. 🚨 DO NOT post any comments to the PR. This skill only produces output files inCustomAgentLogsTmp/PRState/.
Gate (pre-run) → Already completed by Review-PR.ps1 before this skill runs
Phase 1: Pre-Flight → Gather context, classify files, code review → .github/pr-review/pr-preflight.md
Phase 2: Try-Fix → ⚠️ MANDATORY multi-model exploration → invoke try-fix skill (×4 models)
Phase 3: Report → Write review recommendation → .github/pr-review/pr-report.md
Gate and Branch setup are handled by
Review-PR.ps1before this skill is invoked. The gate result is passed in the prompt. Do NOT re-run gate verification.
All phases write output to: CustomAgentLogsTmp/PRState/{PRNumber}/PRAgent/{phase}/content.md
Pre-Flight also writes: CustomAgentLogsTmp/PRState/{PRNumber}/PRAgent/pre-flight/code-review.md
git checkout or git switch to change branches — stay on the review branch set up by the callercontent.md. Do NOT copy gate results into try-fix or report content files.CustomAgentLogsTmp/ output files for every phaseCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> in any commitscontent.md must use the exact template from the phase instruction doc — no extra prosePhase 2 uses these 4 AI models (run SEQUENTIALLY — they modify the same files):
| Order | Model |
|---|---|
| 1 | claude-opus-4.6 |
| 2 | claude-opus-4.7 |
| 3 | gpt-5.3-codex |
| 4 | gpt-5.5 |
🚨 MANDATORY: Use mode: "sync" for ALL try-fix task invocations. Never use mode: "background". Background mode causes the orchestrator to move on before the attempt finishes, which means try-fix/content.md is never written and try-fix results are lost from the PR comment. Each try-fix task MUST complete and return its result before you proceed to the next attempt or to the Phase 3 completion checklist.
| Blocker Type | Max Retries | Then Do |
|---|---|---|
| Missing tool/driver | 1 install attempt | Skip phase, continue |
| Server errors (500, timeout) | 1 retry | Skip phase, continue |
| Port conflicts | 1 (kill process) | Skip phase, continue |
| Build failures in try-fix | 2 attempts | Skip remaining models, proceed to Report |
| Configuration issues | 1 fix attempt | Skip phase, continue |
Read and follow
.github/pr-review/pr-preflight.md
Gather context from the issue, PR, comments, classify changed files, and perform a deep code review using the code-review skill.
Pre-Flight now has two parts:
.github/skills/code-review/SKILL.md and .github/skills/code-review/references/review-rules.mdOutputs:
pre-flight/content.md — Context + code review summarypre-flight/code-review.md — Full code-review output (findings, blast radius, failure-mode probes, verdict)Gate: None — always runs.
Why code review runs here: The code-review findings (❌ Errors, ⚠️ Warnings, failure-mode probes, blast radius) become structured hints for Phase 2 (Try-Fix). Instead of each model starting from scratch, they receive concrete code concerns to address, leading to higher-quality fix exploration.
try-fix Skill (×4 Models)Read and follow
.github/skills/try-fix/SKILL.md
⚠️ THIS PHASE IS MANDATORY. YOU MUST NEVER SKIP IT. NO EXCEPTIONS.
Even if the PR's fix looks correct and Gate passed, you MUST still run all 4 models to explore alternative approaches. The purpose is to find the BEST fix, not just validate one.
"Independent" means each model explores a different fix approach from the PR's fix — not that models are isolated from code-review context. Code-review findings are provided as advisory background to improve fix quality.
The purpose is NOT to re-test the PR's fix, but to:
try-fix/content.md updated with attempt 1 resulttry-fix/content.md updated with attempt 2 resulttry-fix/content.md updated with attempt 3 resulttry-fix/content.md updated with attempt 4 resultFor each model, invoke try-fix skill via a general-purpose task agent with that model:
prompt: |
Invoke the try-fix skill for PR #XXXXX:
- problem: {bug description from Pre-Flight}
- platform: {platform from Platform Selection}
- test_command: {test command from detected test type — use BuildAndRunHostApp.ps1 for UITest, Run-DeviceTests.ps1 for DeviceTest, dotnet test for UnitTest}
- target_files:
- src/{area}/{file1}.cs
- src/{area}/{file2}.cs
- hints: |
Code review found the following concerns (advisory — use to inform your approach, not as a checklist):
Errors:
- {❌ Error finding 1 with file:line reference}
# Include warnings ONLY if relevant to the root cause:
# Warnings:
# - {⚠️ Warning — omit if unrelated to root cause}
Failure modes:
- {Failure mode 1}: {What happens in this scenario}
Blast radius: {Summary — e.g., "Runs for ALL toolbar items at startup, not just badged ones"}
Code review verdict: {LGTM / NEEDS_CHANGES / NEEDS_DISCUSSION} (confidence: {high/medium/low})
Generate ONE independent fix idea. Review the PR's fix first to ensure your approach is DIFFERENT.
"Independent" means exploring a different fix approach — the code review context above is background
information to help you make better decisions, not a constraint on your exploration.
Include code review context in the hints field (try-fix's documented optional input). If Pre-Flight code review found no issues, use hints: "Code review found no issues (verdict: LGTM)". If code review was SKIPPED, omit the hints field entirely.
Selectivity: Only include ❌ Error findings and failure-mode probes that are relevant to the bug being fixed. Omit 💡 Suggestions. Include ⚠️ Warnings only if directly related to the root cause.
Wait for each to complete before starting the next.
🧹 MANDATORY: Clean up between attempts:
# Restore baseline from previous attempt — this is the ONLY way to restore.
# Do NOT use manual git checkout/restore/reset commands.
pwsh .github/scripts/EstablishBrokenBaseline.ps1 -Restore
📝 MANDATORY: Update try-fix/content.md after EVERY attempt. Do not wait until all attempts are done. After each try-fix attempt completes (pass or fail), immediately write/update CustomAgentLogsTmp/PRState/{PRNumber}/PRAgent/try-fix/content.md with all results so far. This ensures the PR comment always reflects the latest try-fix state, even if a later attempt times out or the agent is interrupted.
After Round 1, invoke EACH model via task agent:
"Review PR #XXXXX fix attempts:
- Attempt 1: {approach} - ✅/❌
- Attempt 2: {approach} - ✅/❌
...
Do you have any NEW fix ideas? Reply: 'NEW IDEA: {desc}' or 'NO NEW IDEAS'"
Run any new ideas as additional try-fix attempts. Repeat until all say "NO NEW IDEAS" (max 3 rounds).
Compare all passing candidates on:
mkdir -p CustomAgentLogsTmp/PRState/{PRNumber}/PRAgent/try-fix
Write content.md:
### Fix Candidates
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|--------|----------|-------------|---------------|-------|
| 1 | try-fix | {approach} | ✅/❌ | 1 file | {insight} |
| ... | ... | ... | ... | ... | ... |
| PR | PR #XXXXX | {approach} | ✅ PASSED (Gate) | 2 files | Original PR |
### Cross-Pollination
| Model | Round | New Ideas? | Details |
|-------|-------|------------|---------|
| ... | 2 | Yes/No | {idea or "NO NEW IDEAS"} |
**Exhausted:** {Yes/No}
**Selected Fix:** {PR's fix / Candidate #N} — {Reason}
mode: "sync"mode: "background" for try-fix tasks — results will be lostRead and follow
.github/pr-review/pr-report.md
Deliver the final review recommendation.
🚨 DO NOT post any comments. All output goes to
CustomAgentLogsTmp/PRState/.
Gate: Phases 1-2 must be complete.
CustomAgentLogsTmp/PRState/{PRNumber}/PRAgent/
├── pre-flight/
│ ├── content.md # Phase 1 output (context + code review summary)
│ └── code-review.md # Full code-review skill output (findings, blast radius, verdict)
├── gate/
│ └── content.md # Gate output (pr-gate, run separately)
├── try-fix/
│ ├── content.md # Phase 2 summary
│ └── attempt-{N}/ # Per-model attempt
│ ├── baseline.log # Baseline establishment proof
│ ├── approach.md # What was tried
│ ├── result.txt # Pass / Fail / Blocked
│ ├── fix.diff # git diff of changes
│ ├── test-output.log # Full test command output
│ ├── reviewer-findings.json # Inline expert self-review (`[]` if clean) — reflects the FINAL diff (refreshed by Step 7.5 if test loop modified code)
│ ├── reviewer-findings.diff # Snapshot of the diff that the self-review evaluated (used by Step 7.5 to detect drift)
│ └── analysis.md # Why it worked/failed + self-review summary
└── report/
└── content.md # Phase 3 output (pr-report)
| Phase | Instructions | Key Action | If Blocked |
|---|---|---|---|
| Gate (pre-run) | pr-gate.md | Verify tests (run by Review-PR.ps1) | Result passed in prompt — if missing, document and continue |
| 1. Pre-Flight | pr-preflight.md | Read issue + PR context + code review | Skip missing info; if code review fails, set verdict to SKIPPED |
| 2. Try-Fix | try-fix skill (×4) | 4-model exploration with code-review hints (MANDATORY) | Skip failing models, continue |
| 3. Report | pr-report.md | Write review recommendation | Never skip |
| Error | Cause | Fix |
|---|---|---|
ENOENT: no such file on skill | Dirty working tree from prior attempt | Run cleanup: -Restore + git checkout HEAD -- . + git clean -fd --exclude=CustomAgentLogsTmp/ |
| Dirty working tree before attempt | Prior attempt didn't restore | Same cleanup as above |
| Build errors in unmodified files | Stale state | Cleanup + retry; if still fails, treat as environment blocker |