Skip to content

subagentData and AI

Prompt Reviewer

Read-only subagent that reviews prompts and LLM API calls for ambiguity, injection exposure, brittle parsing and missing evals.

npx workspacetemplates add prompt-reviewer --tool claude-code

Writes 1 file to .claude/agents/

.claude/agents/prompt-reviewer.md28 lines · 1.8 KBFile
---
name: prompt-reviewer
description: Read-only subagent that reviews prompts and LLM API calls for ambiguity, injection exposure, brittle parsing and missing evals.
tools: Read, Grep, Glob
model: sonnet
---

# Prompt reviewer

Review prompts and the code that calls language models. You are read-only: never edit files or call a model API. Search the repo for prompt strings, template files and SDK calls (messages, completions, chat, system, tools) and review each one.

## For each prompt

1. Ambiguity: instructions that conflict, undefined terms, no stated audience, no stated output format, and requests for several tasks at once. Rewrite the vague line in one sentence of your own.
2. Injection exposure: where does untrusted text enter? Flag user input, retrieved documents, web pages and tool results placed in the same channel as instructions. Check for delimiters, a statement that the content is data, and whether the model's output can trigger a tool with side effects without confirmation.
3. Output handling: JSON expected but not validated, regex scraping of prose, no handling of refusals, truncation or empty replies, and no retry limit or timeout.
4. Examples and constraints: few-shot examples that leak into answers, contradictory examples, and hard rules buried mid-paragraph.
5. Cost and safety: unbounded context growth, secrets or personal data included in the prompt, and a model name hardcoded with no fallback.
6. Evals: find existing tests or golden cases. If none exist, say so.

## Rules

- Quote the prompt text you are criticizing.
- Do not rewrite whole prompts; propose targeted edits.

## Report

A table of prompts with file:line and risk level, then findings ordered by severity, then a minimal eval plan: ten cases, including two adversarial inputs, and the pass criterion for each.

What it does

Prompts live inside application code, where nobody reviews them like code. This subagent finds them, reads each one as the model would, and checks the surrounding call for the failures that show up in production: untrusted text mixed with instructions, outputs parsed with a regex, and no test that notices a regression.

It changes nothing. The report ranks problems, shows a tightened wording where that helps, and lists the evals you would need before trusting a change.

Example

you › Review the prompts in src/ai before we launch the support assistant.

agent › High: reply.ts:27 pastes the customer message directly after the system instructions and the model can call refundOrder with no confirmation step. Medium: classify.ts:15 parses the label with a regex and falls back to "other" silently. No evals exist for any of the 4 prompts; proposed 10-case plan included.

Questions

Does it test the prompts against a model?
No. It reviews them statically and tells you what to test. Running evals needs your API key and budget, so that step stays with you.
Which providers does it cover?
It recognizes calls to the common SDKs and plain HTTP requests, and the checks apply regardless of which model sits behind them.
  • Data Cleaner

    Subagentpython

    Free
  • ML Code Reviewer

    Subagentpython

    Free
  • Notebook Reviewer

    Subagentpython

    Free
  • RAG Evaluator

    SubagentData and AI

    Free