Skip to content

πŸš€ The fast, Pythonic way to build MCP servers and clients.

agents: consolidate PR review guidance (#5297)

nate nowack899837ba7cb9
diff --git a/.agents/skills/code-review/SKILL.md b/.agents/skills/code-review/SKILL.md
deleted file mode 100644
index a3eb54996..000000000
--- a/.agents/skills/code-review/SKILL.md
+++ /dev/null
@@ -1,28 +0,0 @@
----
-name: code-review
-description: Review a complete FastMCP change for correctness, supported behavior, compatibility, and maintainability. Use for self-review or reviewing a pull request.
----
-
-# Review FastMCP code
-
-Read AGENTS.md, the contribution policy in [the development guide](../../../docs/development/contributing.mdx), the entire diff against the merge base, and prior review threads and replies. Trace the changed code in context, including callers and shared abstractions. Collect independent consequential findings in one pass.
-
-Establish the intended contract from released docs, tests, history, and maintainer decisions. A reproducible behavior is not automatically a bug. Check whether the change fixes the cause where it occurs or adds compensation elsewhere.
-
-## Compatibility
-
-Assess behavior changes even for bug fixes. Compare omitted defaults, explicit overrides, errors, serialization, and supported configurations. Trace shared branches into adjacent behavior and all affected MCP component types; use the base component's canonical identity rather than inventing one.
-
-State the compatibility conclusion plainly: what existing input changes behavior, whether that is necessary to fix the issue, and what migration preserves the old behavior. Separate intended corrections from accidental regressions. Passing tests or a clean bot review does not make that product decision.
-
-For dependency changes, verify the declared minimum version supports every API now used. Test the old minimum when compatibility is claimed. Keep lockfile changes scoped to the dependency change.
-
-## Findings
-
-Report reachable defects with concrete triggers and consequences. Evaluate bot comments on their merits; do not repeat resolved or convincingly rebutted findings without new evidence. Avoid speculative cases, cosmetic blockers, and generic requests for more tests.
-
-When a change touches shared dispatch, a security boundary, or behavior other components rely on, also get an independent adversarial pass: give a fresh agent the PR and the paths to attack, have it run reproducers in a throwaway worktree, and keep only the findings it confirmed. Run it again after each substantive rework.
-
-Review regression tests for the actual failure and affected neighboring contracts. Record which checks were run and at what revision. Keep uncertainty explicit: an inspected diff, a passing focused test, and a complete validated review are different evidence.
-
-Use [review-pr](../review-pr/SKILL.md) to follow CI and automated feedback after publication. A merge still needs the user's authorization and the repository's current merge gates.
diff --git a/.agents/skills/fix-issue/SKILL.md b/.agents/skills/fix-issue/SKILL.md
index 1739433ab..a4350ad92 100644
--- a/.agents/skills/fix-issue/SKILL.md
+++ b/.agents/skills/fix-issue/SKILL.md
@@ -15,7 +15,7 @@ Trace the public request to the failing operation. Confirm supported behavior is
Use [python-tests](../python-tests/SKILL.md). Reproduce the failure on unchanged code, confirm it fails for the right reason, then make the smallest causal fix. Test explicit overrides and neighboring supported paths that share the changed branch. Avoid expanding the fix to unrelated standards gaps.
-Self-review the full change with [code-review](../code-review/SKILL.md), including docs and dependency bounds. Separate necessary compatibility changes from accidental regressions and say whether a breaking change remains. Do not infer compatibility from passing tests.
+Self-review the full change with [review-pr](../review-pr/SKILL.md), including docs and dependency bounds. Separate necessary compatibility changes from accidental regressions and say whether a breaking change remains. Do not infer compatibility from passing tests.
Run the repository's required dependency sync, full tests, and static checks before committing. Honor branch and attribution conventions. If a required check fails, investigate and report evidence rather than hiding the failure.
diff --git a/.agents/skills/review-issue/SKILL.md b/.agents/skills/review-issue/SKILL.md
index c98f42186..4e17be91b 100644
--- a/.agents/skills/review-issue/SKILL.md
+++ b/.agents/skills/review-issue/SKILL.md
@@ -1,6 +1,6 @@
---
name: review-issue
-description: Review an incoming external issue (and any gated-closed PR behind it) and decide whether to assign the contributor or decline. Use when the maintainer says "look at this issue", "review issue #N", "should we take this", or asks whether to assign someone. Assigning the author auto-reopens their PR for normal review. This is the entry point for incoming-issue triage β€” distinct from review-pr, which responds to bot reviews on your own open PR.
+description: Review an incoming external issue (and any gated-closed PR behind it) and decide whether to assign the contributor or decline. Use when the maintainer says "look at this issue", "review issue #N", "should we take this", or asks whether to assign someone. Assigning the author auto-reopens their PR for normal review. This is the entry point for incoming-issue triage β€” distinct from review-pr, which assesses the full change and follows CI and review feedback.
---
# Review an incoming issue
@@ -61,7 +61,7 @@ Assignment commits us to reviewing the PR, not to merging it. A gate closure is
gh issue edit N --repo PrefectHQ/fastmcp --add-assignee <login>
```
-Confirm the `require-issue-link` run passes and the PR reopens, then review it with [code-review](../code-review/SKILL.md) and follow it with [review-pr](../review-pr/SKILL.md). If the PR's head branch was deleted, assignment cannot reopen it; the workflow asks the author for a fresh PR.
+Confirm the `require-issue-link` run passes and the PR reopens, then review it and follow CI and feedback with [review-pr](../review-pr/SKILL.md). If the PR's head branch was deleted, assignment cannot reopen it; the workflow asks the author for a fresh PR.
**Decline:** with authorization, comment on the issue with the reason and the relevant contribution-policy section. Write the body to a file first:
diff --git a/.agents/skills/review-pr/SKILL.md b/.agents/skills/review-pr/SKILL.md
index 8f722021a..5a0588307 100644
--- a/.agents/skills/review-pr/SKILL.md
+++ b/.agents/skills/review-pr/SKILL.md
@@ -1,33 +1,55 @@
---
name: review-pr
-description: Follow an existing FastMCP PR through CI and automated review, evaluate feedback, and verify the current head before reporting readiness.
+description: Assess a FastMCP pull request for justified behavior, compatibility, and correctness, then follow CI and review feedback to a revision-specific verdict. Use for draft or ready PRs and self-review before publication.
---
-# Follow a PR
+# Review a FastMCP PR
-Read AGENTS.md for publication, review-thread, and merge rules. Track the PR's current head SHA. A push invalidates evidence tied only to an earlier head.
+Review whether the change should ship, with evidence for its intended behavior as well as its implementation. Use the same procedure for maintainer, contributor, and agent drafts. For an unpublished change, record the base and local diff and skip GitHub-only steps. For an external contributor's assignment decision, start with [review-issue](../review-issue/SKILL.md).
-## CI and review are separate
+For review-only tasks, assess and report; repair, push, and monitoring steps apply only when that follow-through is in scope. Automated reviewers use the same substantive checks and their required findings format. Do not wait for your own bot review or manage the PR lifecycle. If the review environment cannot run tests or delegate an adversarial pass, state that limit rather than claiming those checks passed.
-After opening or updating a PR, establish a monitor using the host's scheduling capability. Keep it quiet while pending without a meaningful change. Report failures, requested decisions, and completion; pause it after the terminal report. If persistent monitoring is unavailable, watch during the active task and state that limitation rather than promising a future notification.
+## Procedure
-Fetch checks and reviews together:
+1. **Establish the scope.** Read AGENTS.md, the contribution policy in [the development guide](../../../docs/development/contributing.mdx), the issue's full discussion, the entire diff against the merge base, and prior review threads and replies. Record the base and head revisions. Find related issues and PRs in all states, and inspect open PRs touching the same files for overlapping lines or behavior even when they do not link the issue. Distinguish released behavior, fixes already on main, and competing proposals.
+
+2. **Establish the contract before judging the fix.** Use the protocol, released docs, history, and maintainer decisions to explain what FastMCP promises for the reported inputs. Existing code and tests are evidence of behavior, not sufficient proof that it is intended. A reproducer can demonstrate surprising behavior without demonstrating a bug; a regression test can assert the wrong result. State whether this restores an established contract or proposes a behavior change. If the contract is unresolved, surface the precise maintainer decision and do not recommend readiness on the strength of passing tests.
+
+3. **Trace the cause and compatibility.** Read every changed file in context, its callers, producers and consumers, and shared abstractions. Check whether the fix changes the causal path or compensates elsewhere. Search for the same bug pattern and trace affected tools, resources, templates, and prompts; use canonical component identity. Compare omitted defaults, explicit overrides, errors, serialization, and supported configurations. State which existing inputs change behavior, why that is necessary, and any migration preserving the old behavior. Keep breaking changes out of a patch recommendation. Check API ergonomics, docs, and whether dependency minimums support newly used APIs; test the old minimum when compatibility is claimed and keep lockfile changes scoped.
+
+4. **Verify behavior independently.** For bug fixes, use [python-tests](../python-tests/SKILL.md) to run the regression on the unchanged base and proposed head yourself. Confirm it fails for the claimed reason and asserts the intended value and type, not merely that a result exists. For other changes, verify the promised behavior with appropriate checks. Exercise neighboring supported paths sharing the changed branch. For shared dispatch, security boundaries, or behavior other components rely on, get an independent adversarial pass: give a fresh agent the PR and paths to investigate, have it run reproducers in a throwaway worktree, and retain confirmed findings. Repeat that pass after substantive rework. Record revisions and checks actually run; unavailable validation remains pending evidence.
+
+5. **Evaluate feedback and resolve findings.** Fetch CI, review summaries, inline threads, and replies together using the commands below. Evaluate CodeRabbit, Copilot, Codex, and maintainer feedback on its merits. Collect all independent consequential findings in one pass, with reachable triggers and consequences; do not repeat resolved or convincingly rebutted findings without new evidence. Avoid cosmetic blockers and speculative scope expansion. Within authorization, fix real defects together, verify adjacent behavior, run required checks, and push. Resolve verified fixes; reply with a reason when declining a finding if posting is authorized. Do not iterate indefinitely on hypothetical follow-ups.
+
+6. **Follow the current revision to a verdict.** A push invalidates evidence tied only to the old head. After publication or an update within the task, establish quiet monitoring using the host's scheduling capability; notify only on meaningful changes, decisions, failures, or completion, and pause after the terminal report. For a one-time review, report pending checks without creating an ongoing monitor unless requested. If persistent monitoring is unavailable, watch during the active task and state the limitation. Inspect failed CI logs before diagnosing or retrying; distinguish assertions, worker crashes, dependency resolution, and infrastructure failures. Reproduce supposedly unrelated failures on the base. Report remaining decisions separately from CI and bot status.
+
+## GitHub evidence
```bash
gh pr view <number> --repo PrefectHQ/fastmcp \
- --json headRefOid,statusCheckRollup,reviews,comments,isDraft,labels
+ --json baseRefOid,headRefOid,title,body,statusCheckRollup,reviews,comments,isDraft,labels
gh api --paginate repos/PrefectHQ/fastmcp/pulls/<number>/comments
```
-Read relevant CodeRabbit, Copilot, Codex, and maintainer feedback, including inline threads and replies. Codex may update a summary issue comment instead of creating a formal review. Match its reported commit and completion status; zero formal reviews does not prove it has not run. Drafts may not trigger reviews. Do not mark ready or request reviews solely to satisfy a polling loop without authorization.
+Read review threads and author replies, not just summary verdicts. Codex can update a summary issue comment without creating a formal review; match its reported revision and completion status. Zero formal reviews does not prove it has not run. Drafts may not trigger reviews. Do not mark ready or request reviews solely to satisfy a polling loop. A generic request for human review is not a concrete defect, and green CI does not establish review completion or settle a compatibility decision.
+
+Preserve draft status unless the user authorizes changing it. Approval, publication, and merging remain subject to AGENTS.md and existing authorization. Immediately before an authorized merge, recheck the title, body, labels, head, checks, and branch protections; obey all draft and DNM stops.
-Green CI means checks passed, not that review finished. A generic request for human review is not a concrete defect; explain any actual unresolved compatibility decision. Distinguish substantive findings from status messages and stylistic notes.
+## Verdict template
-## Act on evidence
+Keep the report proportional to the change, with these facts explicit:
-Use [code-review](../code-review/SKILL.md) to assess findings. Fix real defects together, verify adjacent paths, run required checks, and push. Resolve a thread when its fix is verified. When declining a finding, reply with the reason if posting is authorized. Do not loop indefinitely on speculative follow-ups.
+> **Verdict:** ready for maintainer consideration / changes needed / maintainer decision needed / validation pending β€” at `<head>`, against `<base>`.
+>
+> **Contract:** promised behavior and supporting source; why this is a correction or a proposed change.
+>
+> **Compatibility:** inputs whose behavior changes, adjacent behavior preserved, and any migration or release constraint.
+>
+> **Evidence:** regression on base/head, neighboring checks, adversarial result or why it was not required, CI and bot status at this revision.
+>
+> **Outstanding:** consequential findings, decisions, and checks still pending.
-For CI failures, inspect the failed job's logs. Distinguish assertions, worker crashes, dependency resolution, and infrastructure failures. A test name or unrelated diff alone does not establish the cause. Retry when evidence supports a transient failure; recurring failures need diagnosis.
+## Check before finishing
-The final report names the head checked, CI outcome, outstanding review findings or decisions, and any pending work. Preserve draft status unless the user authorizes changing it. Merging is separate: recheck title, body, labels, head, and checks immediately before an authorized merge; obey all DNM markers and branch protections.
+Can another maintainer tell why this behavior is desirable, what existing behavior changes, and which claims were independently verified at the reported revision? If any answer is missing, qualify the verdict instead of calling the PR ready.
diff --git a/.claude/skills/code-review b/.claude/skills/code-review
deleted file mode 120000
index 2d88efdf9..000000000
--- a/.claude/skills/code-review
+++ /dev/null
@@ -1 +0,0 @@
-../../.agents/skills/code-review
\ No newline at end of file
diff --git a/AGENTS.md b/AGENTS.md
index 30a4239e1..3398adae7 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -48,8 +48,7 @@ Repository skills live in `.agents/skills/`, with symlinks in `.claude/skills/`
| Find worthwhile issues in a backlog or release window | `triage` |
| Decide whether to assign an external contributor | `review-issue` |
| Fix a chosen bug through to a PR | `fix-issue` |
-| Review a change, yours or a contributor's | `code-review` |
-| Follow a PR through CI and bot review | `review-pr` |
+| Review a PR or local change, including compatibility, tests, CI, and bot feedback | `review-pr` |
| Write regression tests | `python-tests` |
| Write or revise a docs page | `docs` |
| Evaluate a vulnerability report | `review-security-report` |
@@ -172,6 +171,12 @@ Load the `release` skill to cut one; it holds the procedure. The policy it imple
## Code Review Rules
+These rules apply to automated reviewers and agents working locally. The [review-pr skill](.agents/skills/review-pr/SKILL.md) supplies the review procedure and maintainer follow-through; a review-only bot should report findings in its required format without taking over PR management.
+
+### Intended behavior and compatibility
+
+Establish intended behavior from the protocol, docs, history, and maintainer decisions; code and tests alone do not define the contract. Identify affected users and weigh migration cost against the cost of retaining the behavior. Surface unresolved decisions and follow the [release policy](docs/development/releases.mdx#versioning-policy).
+
### Framework regressions and root causes
- Review changes carefully for regressions in supported framework behavior, including interactions beyond the immediate diff. Trace relevant callers, shared abstractions, protocol and public API contracts, and all affected MCP component types. Determine whether a change fixes the causal code path or merely compensates for the symptom; side channels and special cases that leave the root cause intact should be treated as suspect.