Pull request review team: Multi-Step Agent Workflow for Claude Code, Codex or ChatGPT

Three reviewers check security, performance and tests in parallel; a lead merges, de-duplicates and posts one comment.

Prompt

Installs to .agents/skills/pull-request-review-team-multi-step-agent-workflow-for-claude-co/

mkdir -p .agents/skills/pull-request-review-team-multi-step-agent-workflow-for-claude-co && curl -sL "https://prompts-gpt.com/prompts/pull-request-review-team-multi-step-agent-workflow-for-claude-code-codex-or-chatgpt/raw" -o .agents/skills/pull-request-review-team-multi-step-agent-workflow-for-claude-co/SKILL.md
SKILL.md
Preview
---
name: pull-request-review-team-multi-step-agent-workflow-for-claude-co
description: "Three reviewers check security, performance and tests in parallel; a lead merges, de-duplicates and posts one comment."
---

# Pull request review team: Multi-Step Agent Workflow for Claude Code, Codex or ChatGPT

Three reviewers check security, performance and tests in parallel; a lead merges, de-duplicates and posts one comment.

## Prompt

```
---
name: pull-request-review-team
description: Three reviewers check security, performance and tests in parallel; a lead merges, de-duplicates and posts one comment. Use when asked to run the "Pull request review team" workflow.
---

# Pull request review team

Three reviewers check security, performance and tests in parallel; a lead merges, de-duplicates and posts one comment.

## Inputs

Ask for any of these that the user hasn't given:

- `diff` (e.g. "Paste the output of `git diff main...HEAD` (or the PR's .diff)")

## Steps

Run the steps in order. Refer to saved results by name. Don't skip a step that says STOP.

1. **Pull request opened** — Start: Runs on a pull request's diff (`diff`). Paste one to try it.
2. **Review in parallel** — Launch these as parallel subagents in one message, then wait for all of them. Give each reviewer `diff`. Each returns findings as file:line, severity, why, fix. Save the result as `findings`.
   - **Security**: Injection, auth checks on new routes, secrets, unsafe deserialization.
   - **Performance**: N+1 queries, unbounded loops, missing pagination, large payloads.
   - **Tests**: Untested branches, missing edge cases, flaky patterns.
3. **Lead reviewer merges** — Merge `findings`, drop duplicates and anything you can't point to in `diff`. Order by severity. If there are no real findings, say so. Save the result as `review`.
4. **Comment on the PR** — Finish: Post `review` as one review comment with inline notes.

## Done when

Every step has run, each approval was given, and you've reported what was produced and where it was saved.
```

## Usage Notes

Run it in Claude Code or Codex: save as .claude/skills/pull-request-review-team/SKILL.md (or .agents/skills/ for Codex) and say "run the Pull request review team workflow"; parallel steps run as subagents. Or paste it into ChatGPT or Claude and answer its questions. It asks for: diff. Build or run it step by step at prompts-gpt.com/workflows/pull-request-review-team.

Example output

At a glancePR #482 findings by severity after merge9 raw findings from three reviewers, 6 remain after de-duplication
  • High: 2
  • Medium: 2
  • Low: 2

Example for: a pasted git diff main...HEAD from PR #482, "Add order export endpoint", in a Node/Express + Prisma service.

PR Review: #482 Add order export endpoint

Workflow run: Security, Performance and Tests reviewers ran in parallel and returned 9 raw findings. After merging and de-duplicating, 6 remain. 2 were dropped because they could not be traced to the diff, and 1 was a duplicate.

Summary

The export feature works, but it is not ready to merge yet. It has one high-severity auth gap and one query pattern that will degrade quickly with real data volumes. Test coverage is missing the failure paths.

SeverityCount
🔴 High2
🟠 Medium2
🟡 Low2
🔴 High

1. src/routes/exports.ts:14: Missing authorization check (Security)
GET /orders/export uses requireAuth but never checks that req.query.accountId belongs to the caller. Any logged-in user could export another account's orders.
Fix: Add requireAccountMember(req.query.accountId), or derive accountId from req.user.

2. src/services/exportService.ts:38-45: N+1 query on line items (Performance)
prisma.lineItem.findMany runs once per order inside the for loop. An export of 5,000 orders issues 5,001 queries.
Fix: Use prisma.order.findMany({ include: { lineItems: true } }) or batch with where: { orderId: { in: ids } }.

🟠 Medium

3. src/services/exportService.ts:22: No limit or pagination (Performance)
findMany has no take, so the full result set is buffered in memory before the CSV is written.
Fix: Stream with cursor pagination (take: 500, cursor) and pipe the rows to the response.

4. src/utils/csv.ts:9: CSV formula injection (Security)
Customer names starting with =, +, - or @ are written unescaped, which lets them execute as formulas in spreadsheet apps.
Fix: Prefix those values with ' in escapeCell().

🟡 Low

5. test/exports.test.ts:31: Untested error branch (Tests)
The catch block at exportService.ts:52 (returns 502) has no test.
Fix: Mock prisma.order.findMany to reject, then assert a 502 response with no partial body.

6. test/exports.test.ts:48: Time-dependent assertion (Tests)
The test compares the filename to new Date().toISOString().slice(0,10). It will be flaky when run near midnight UTC.
Fix: Use jest.useFakeTimers().setSystemTime(...).

Dropped during merge
  • "Hardcoded API key" (Security) dropped because the string at config.ts:3 is not part of this diff.
  • "Missing index on orders.createdAt" (Performance) dropped because no schema change appears in the diff.
  • Performance's duplicate of #3 was merged into the existing finding.

Posted: One review comment on PR #482 with status Request changes and 6 inline notes attached to the lines cited above. The merged review is saved as review.

Written by AI from this prompt. Your results will vary.

Run it in Claude Code or Codex: save as .claude/skills/pull-request-review-team/SKILL.md (or .agents/skills/ for Codex) and say "run the Pull request review team workflow"; parallel steps run as subagents. Or paste it into ChatGPT or Claude and answer its questions. It asks for: diff. Build or run it step by step at prompts-gpt.com/workflows/pull-request-review-team.

Make it repeatable

Keep using this prompt without pasting it in every time.

Prompt details

By
Prompts-GPT editors
Published
How prompts are written and checked

Did this prompt work?

Keep exploring

More in Multi-Agent Pipelines