Prompt Review
Conduct a structured review of every prompt in the codebase: system prompts,
summarization instructions, tool descriptions, dynamic injections, and any
string literal that will be sent to an LLM as instruction or context.
When NOT to Use This Skill
- The prompt is already producing correct, reliable output and no specific
issue has been reported.
- The prompt is small (<50 tokens) — micro-optimizations risk breaking
behavior.
- The prompt uses model-specific patterns (XML tags for Claude, markdown for
GPT-4) that don't match generic advice in the checklist.
- The user hasn't asked for a review — don't proactively optimize prompts
that work.
Discovery Phase
Locate ALL prompts before reviewing. Prompts appear in several forms:
- Dedicated prompt files —
.txt, .md, .jinja2, .hbs, .mustache,
or constants modules (e.g. prompts.py, prompts.ts, prompts.go,
system_prompt.txt).
- String-literal prompts — variables/constants named
*PROMPT*,
*INSTRUCTION*, SYSTEM_*, or strings passed to LLM calls
("role": "system" in any language).
- Dynamically constructed prompts — string interpolation (Python
f-strings, JS template literals, Go
fmt.Sprintf, Ruby #{}, etc.),
.format(), template rendering, or concatenation that assembles messages
at runtime.
- Tool/function descriptions —
description fields in OpenAI
function-calling schemas, tool definitions, or similar structured metadata.
- Inline context injections — ephemeral system messages injected per-call
(dates, user metadata, progress state).
Discovery strategy: First determine which languages and frameworks the
project uses, then apply appropriate search patterns. Examples:
# constants / variable names (all languages)
grep -rn "PROMPT\|INSTRUCTION\|SYSTEM_"
# LLM message construction
grep -rn '"role".*"system"\|role.*system'
# string interpolation (adapt to project language)
# Python: f"...", "...".format(
# JS/TS: `...${...}`
# Go: fmt.Sprintf(
# Ruby: "...#{...}"
# tool schemas
grep -rn '"description"' --include="*.json" --include="*.yaml" --include="*.yml"
Review Process
Pre-Evaluation Gate
For each discovered prompt, first ask:
- Is this prompt currently producing correct, reliable output?
- If yes, apply the "Don't Touch" gate from the checklist before evaluating.
- Only proceed to full evaluation if there's evidence of a problem OR the user
specifically requested optimization.
Evaluation
For prompts that pass the gate, evaluate against the checklist in
checklist.md. Produce findings in this format:
Per-Prompt Report
#### <Prompt Name / Location>
- **File:** path:line
- **Type:** system | summarization | tool-description | dynamic-injection | context
- **Token estimate:** ~N tokens
- **Issues found:**
1. [Issue category]: description + suggested fix
2. ...
- **Suggested revision:** (only if changes are non-trivial)
Summary Report
After all prompts are reviewed, produce:
## Prompt Review Summary
| # | Prompt | File:Line | Tokens | Issues | Severity |
|---|--------|-----------|--------|--------|----------|
| 1 | ... | ... | ~N | N | high/med/low |
### Top Recommendations (ranked by token savings x impact)
1. ...
### Estimated Total Savings
- Current total: ~N tokens
- After fixes: ~N tokens
- Savings: ~N tokens (~X%)
Severity Levels
- High — prompt actively harms output quality, causes misbehavior, or
wastes >30% of its tokens on redundancy.
- Medium — prompt works but has clear optimization opportunities (10-30%
token savings possible, or clarity improvements).
- Low — minor style or structure improvements; functional as-is.
Key Principles
When evaluating, prioritize output quality over token savings. The LLM is
very capable, but context activates its knowledge — don't strip reminders
that direct attention to the right domain. Every token competes for context
window space, but a wrong answer costs more than a few extra tokens. When in
doubt, preserve the prompt.
1---2name: prompts-review3description: Review all prompts in a codebase for optimality, balancing effectiveness and token efficiency. Covers explicit prompt files, string-literal prompts, and dynamically constructed prompts in code. Use when the user asks to review, audit, or optimize prompts, system messages, LLM instructions, or agent prompts.4---56# Prompt Review78Conduct a structured review of every prompt in the codebase: system prompts,9summarization instructions, tool descriptions, dynamic injections, and any10string literal that will be sent to an LLM as instruction or context.1112## When NOT to Use This Skill1314- The prompt is already producing correct, reliable output and no specific15 issue has been reported.16- The prompt is small (<50 tokens) — micro-optimizations risk breaking17 behavior.18- The prompt uses model-specific patterns (XML tags for Claude, markdown for19 GPT-4) that don't match generic advice in the checklist.20- The user hasn't asked for a review — don't proactively optimize prompts21 that work.2223## Discovery Phase2425Locate ALL prompts before reviewing. Prompts appear in several forms:26271. **Dedicated prompt files** — `.txt`, `.md`, `.jinja2`, `.hbs`, `.mustache`,28 or constants modules (e.g. `prompts.py`, `prompts.ts`, `prompts.go`,29 `system_prompt.txt`).302. **String-literal prompts** — variables/constants named `*PROMPT*`,31 `*INSTRUCTION*`, `SYSTEM_*`, or strings passed to LLM calls32 (`"role": "system"` in any language).333. **Dynamically constructed prompts** — string interpolation (Python34 f-strings, JS template literals, Go `fmt.Sprintf`, Ruby `#{}`, etc.),35 `.format()`, template rendering, or concatenation that assembles messages36 at runtime.374. **Tool/function descriptions** — `description` fields in OpenAI38 function-calling schemas, tool definitions, or similar structured metadata.395. **Inline context injections** — ephemeral system messages injected per-call40 (dates, user metadata, progress state).4142**Discovery strategy**: First determine which languages and frameworks the43project uses, then apply appropriate search patterns. Examples:4445```46# constants / variable names (all languages)47grep -rn "PROMPT\|INSTRUCTION\|SYSTEM_"48# LLM message construction49grep -rn '"role".*"system"\|role.*system'50# string interpolation (adapt to project language)51# Python: f"...", "...".format(52# JS/TS: `...${...}`53# Go: fmt.Sprintf(54# Ruby: "...#{...}"55# tool schemas56grep -rn '"description"' --include="*.json" --include="*.yaml" --include="*.yml"57```5859## Review Process6061### Pre-Evaluation Gate6263For each discovered prompt, first ask:64- Is this prompt currently producing correct, reliable output?65- If yes, apply the "Don't Touch" gate from the checklist before evaluating.66- Only proceed to full evaluation if there's evidence of a problem OR the user67 specifically requested optimization.6869### Evaluation7071For prompts that pass the gate, evaluate against the checklist in72[checklist.md](checklist.md). Produce findings in this format:7374### Per-Prompt Report7576```77#### <Prompt Name / Location>78- **File:** path:line79- **Type:** system | summarization | tool-description | dynamic-injection | context80- **Token estimate:** ~N tokens81- **Issues found:**82 1. [Issue category]: description + suggested fix83 2. ...84- **Suggested revision:** (only if changes are non-trivial)85```8687### Summary Report8889After all prompts are reviewed, produce:9091```92## Prompt Review Summary9394| # | Prompt | File:Line | Tokens | Issues | Severity |95|---|--------|-----------|--------|--------|----------|96| 1 | ... | ... | ~N | N | high/med/low |9798### Top Recommendations (ranked by token savings x impact)991. ...100101### Estimated Total Savings102- Current total: ~N tokens103- After fixes: ~N tokens104- Savings: ~N tokens (~X%)105```106107## Severity Levels108109- **High** — prompt actively harms output quality, causes misbehavior, or110 wastes >30% of its tokens on redundancy.111- **Medium** — prompt works but has clear optimization opportunities (10-30%112 token savings possible, or clarity improvements).113- **Low** — minor style or structure improvements; functional as-is.114115## Key Principles116117When evaluating, prioritize output quality over token savings. The LLM is118very capable, but context *activates* its knowledge — don't strip reminders119that direct attention to the right domain. Every token competes for context120window space, but a wrong answer costs more than a few extra tokens. When in121doubt, preserve the prompt.