- AGENT.md: role-based issue-driven workflow (PO → Dev → Reviewer) - CLAUDE.md: points to AGENT.md - .codex/skills/: validate-issue, do-task, review-pr with phase gates Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
3.2 KiB
3.2 KiB
name, description
| name | description |
|---|---|
| review-pr | Phase 2 skill. Use when a PR is created or updated. Review PR against locked issue requirements and post verdict as Reviewer. Do NOT edit code on the PR. |
Review PR
Phase: 2 — Requirement Implementation Role: Reviewer
When to invoke
- User says: "review PR #X", "check PR #X", "/review-pr #X"
- A PR is created or updated and needs review.
Prerequisite
- PR exists on Gitea.
- The referenced issue has a Final Requirements comment from PO (Phase 1 done).
Workflow
-
Load PR and issue
- Read PR:
mcp__gitea__.pull_request_read(method: "get"). - Identify the linked issue from PR body (
Fixes #<id>orCloses #<id>). - Read issue comments, find the Final Requirements comment:
mcp__gitea__.issue_read(method: "get_comments"). - Read existing reviews:
mcp__gitea__.pull_request_read(method: "get_reviews"). - If PR is already merged or closed, say so and stop.
- Read PR:
-
Read review history (for re-reviews)
- Get review comments:
mcp__gitea__.pull_request_read(method: "get_review_comments"). - If author addressed feedback in a follow-up commit, focus on new commits but still sanity-check the full diff.
- Get review comments:
-
Get the diff
- Use
mcp__gitea__.pull_request_read(method: "get_diff"). - Use
mcp__gitea__.get_file_contentsfor surrounding context when needed.
- Use
-
Validate locally (when needed)
- Create worktree:
git worktree add .worktrees/pr-<number> origin/<head-branch> - Run checks:
gofmt -l . go vet ./... go test ./... - Remove worktree when done:
git worktree remove .worktrees/pr-<number>
- Create worktree:
-
Evaluate
- Does PR address all Final Requirements from the issue?
- Does PR contain unrelated changes or refactoring? → FAIL immediately.
- Code correctness, style, test coverage.
-
Write verdict
- Start with PASS or FAIL.
- Include file:line references for findings.
- Explain concrete impact, not style preferences.
-
Post review
- Post proactively if verdict is clear.
- Use
mcp__gitea__.pull_request_review_write(method: "create"):PASS→state: "APPROVED"FAIL→state: "REQUEST_CHANGES"- Non-blocking note →
state: "COMMENT"
- For plain discussion (not changing review state):
mcp__gitea__.issue_write(method: "add_comment").
Review Format
PASS
PASS
No blocking issues found.
Validation:
- gofmt -l .: OK
- go vet ./...: OK
- go test ./...: OK
Non-blocking:
- <optional note>
FAIL
FAIL
1. [High] <issue with path:line and impact>
2. [Medium] <issue with path:line and impact>
Validation:
- go test ./...: FAIL (<details>)
Rules
- Use Gitea MCP tools for all PR/review operations.
- Do NOT edit code on the PR.
- FAIL if PR contains unrelated changes or scope creep.
- Post review proactively if verdict is clear.
- Mention validation commands you actually ran.
- No bracketed author/tool tags.
What happens next
- PASS (APPROVED): Developer merges the PR.
- FAIL (REQUEST_CHANGES): Developer fixes feedback, then user re-invokes
/review-pron this PR.