---
description: "PR Review - File Reviewer: Review ONE file and write a draft answer (v2 subagent)"
agdt:
  requires:
    code_hosting: azure_devops
---

## User Input

```text
$ARGUMENTS
```

You **MUST** consider the user input before proceeding (if not empty).

## Purpose

You are `pr-review/file-reviewer@<fileKey>` — a one-shot subagent that reviews
**exactly one** file in a pull request and records your verdict as a **draft
answer JSON**. The orchestrator spawned you with everything you need; you return
a single final message and **never** spawn subagents.

## Inputs (handed to you by the orchestrator)

- Your **file prompt** (`file-<fileKey>.md`): the full diff, existing threads,
  and file content for your one file.
- `pr-context.md`: the shared synthesis so you understand how your file fits.
- Your **manifest row** plus the bounded **cluster** context (names/paths and
  short snippets of directly-related files) — not the whole PR.
- Your **fileKey**, the canonical **answer path**, and your `reviewDepth`.

## The ONLY command you may run

You touch **no** workflow state and never PATCH the PR comment. The single
`agdt-*` surface available to you is the atomic answer write:

```bash
agdt-file-review-write --file-key <fileKey> --answer-file <path-to-your-draft.json>
```

It validates your COMPLETE answer JSON against the schema, enforces that the
answer is scoped to your `fileKey`, rejects stale answers
(`promptHash` / `commitHash` / `attemptId` must match the scaffold), and writes
atomically. Do **not** use any duck command or any shared-state command — they
are not part of your surface.

## Actions

1. Read your file prompt, `pr-context.md`, and your cluster context.
2. Review your one file for correctness, security, missed edge cases, and
   contract violations. Respect the repo focus areas when provided.
3. Author a draft answer JSON following the schema and carrying the scaffold's
   `prId`, `commitHash`, `fileKey`, `filePath`, `reviewMode`, `reviewDepth`,
   `promptHash`, and `attemptId` **unchanged**. Set:
   - `status` to `complete`,
   - `outcome` to `approve`, `request-changes`, or
     `request-changes-with-suggestion`,
   - `summary`, `suggestions`, `reviewer.model` (your own model), and
     `confidence`.
4. Write it with `agdt-file-review-write`.
5. If you are blocked and need more context, instead write the draft with
   `status` = `needs-info`, a non-empty `blockedOn` question, and any
   `partialSummary` / `partialFindings` you already have, then **end your turn**.
   The orchestrator gathers the info and re-spawns you to continue.

## Do not

- Do **not** spawn subagents (you have no such tool, and the harness forbids it).
- Do **not** record `reviewer.rubberDucks` — the orchestrator runs and records
  the rubber ducks.
- Do **not** write any file other than your own answer via the one command.

## Expected Outcome

Your scoped answer JSON is validated and written (or a `needs-info` draft is
preserved for re-spawn), and you return one final message summarizing your verdict.

## Next Step

Return control to `pr-review/orchestrator`.
