Skip to content
Skillpedia
Prompts & LLMs29k Β· #9515

senior-prompt-engineer

What it does

This skill makes the agent improve AI prompts with measured tests rather than guesswork. It is for people who write prompts for AI features, RAG systems or agents and want to know whether a change helps.

When to use it

  • βœ“When a prompt gives inconsistent answers and needs measured improvement.
  • βœ“When you want to measure how well your RAG retrieval finds the right information.
  • βœ“When you need to check that an agent's tool setup works as intended.

Skill link

https://github.com/alirezarezvani/claude-skills/blob/main/engineering-team/skills/senior-prompt-engineer/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/alirezarezvani/claude-skills/blob/main/engineering-team/skills/senior-prompt-engineer/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œMy support prompt gives inconsistent answers. Build a small test set and improve the prompt against it.”

5 new skills a week. 1 minute to read.

How it works

The agent captures a baseline before changing anything, builds an eval set with you if needed and compares each prompt change against the baseline. It also scores RAG retrieval and checks agent tool setups.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Senior Prompt Engineer

Eval-driven prompt engineering, RAG quality measurement, and agent workflow validation. Everything here is model-agnostic by design: techniques are framed by what they do, not by which model generation they were observed on, and the tools never hardcode model IDs or pricing β€” you supply your provider's current rates when you want dollar figures.

Operating Rules

  1. Never change a prompt without a baseline. Capture metrics first (--analyze --output baseline.json), then compare every iteration against it.
  2. Eval set before optimization. 10–20 representative cases with expected outputs minimum. If the user has no eval set, build one with them before touching the prompt β€” optimizing against vibes is the #1 failure mode.
  3. Prefer platform features over prompt hacks. If the provider offers native structured outputs / JSON schema enforcement, tool-use APIs, or prompt caching, use those instead of "respond ONLY with JSON" incantations. Prompt-level format enforcement is the fallback, not the default.
  4. Current-generation models need less scaffolding. Don't add chain-of-thought boilerplate, role framing, or few-shot examples reflexively β€” frontier models often do worse with redundant scaffolding. Add each element only when the eval set shows it helps.
  5. Cost numbers are always user-supplied. Look up the provider's current per-Mtok pricing and pass it via --price-per-mtok (never trust a cached price table β€” including any you remember).

Tools (exact CLIs, all stdlib)

1. Prompt Optimizer β€” scripts/prompt_optimizer.py

Static analysis: token estimate, clarity/structure scores (0–100), ambiguity + redundancy detection, few-shot example extraction.

# Full analysis (human-readable report)
python3 scripts/prompt_optimizer.py prompt.txt --analyze

# Save machine-readable baseline for later comparison
python3 scripts/prompt_optimizer.py prompt.txt --analyze --json --output baseline.json

# Token estimate; cost only if you supply your provider's current rate
python3 scripts/prompt_optimizer.py prompt.txt --tokens --model claude --price-per-mtok 3.00

# Whitespace/redundancy-trimmed version
python3 scripts/prompt_optimizer.py prompt.txt --optimize --output optimized.txt

# Extract Input/Output few-shot pairs to JSON
python3 scripts/prompt_optimizer.py prompt.txt --extract-examples --output examples.json

# Compare a revision against the saved baseline
python3 scripts/prompt_optimizer.py optimized.txt --analyze --compare baseline.json

--model accepts any string; only the tokenizer family is inferred (names containing "claude" β†’ 3.5 chars/token, otherwise 4.0). Exit 0 on success, 1 on missing file.

2. RAG Evaluator β€” scripts/rag_evaluator.py

Measures retrieval and grounding quality from two JSON files (formats printed in --help).

python3 scripts/rag_evaluator.py --contexts retrieved.json --questions eval_set.json
python3 scripts/rag_evaluator.py --contexts ctx.json --questions q.json --k 10 --json
python3 scripts/rag_evaluator.py --contexts ctx.json --questions q.json --output report.json --verbose
python3 scripts/rag_evaluator.py --contexts ctx.json --questions q.json --compare baseline_report.json

Reports context relevance, precision@k, coverage, answer faithfulness, groundedness. Treat relevance < 0.80 as a retrieval problem (chunking/embedding/filtering), not a prompt problem β€” fix retrieval before rewriting the generation prompt.

3. Agent Orchestrator β€” scripts/agent_orchestrator.py

Validates agent configs (YAML/JSON): tool wiring, missing required config, loop risk, token estimates.

python3 scripts/agent_orchestrator.py agent.yaml --validate
python3 scripts/agent_orchestrator.py agent.yaml --visualize --format mermaid
python3 scripts/agent_orchestrator.py agent.yaml --estimate-cost --runs 100 \
    --input-price-per-mtok 3.00 --output-price-per-mtok 15.00

Without the two price flags, --estimate-cost reports token estimates only. The model: field in the config is informational β€” any model name is accepted.

Workflows

Prompt Optimization (eval-gated)

  1. Baseline: python3 scripts/prompt_optimizer.py current_prompt.txt --analyze --json --output baseline.json
  2. Diagnose from the report: ambiguous verbs ("analyze", "handle"), redundant blocks, missing output contract, token waste.
  3. Apply one change at a time, in this order of leverage:
    Symptom Fix
FAQ

Why does it need an eval set first?

Changing a prompt without test cases is guesswork. The skill recommends at least 10 to 20 representative cases before you start.

Does it prefer built-in features over prompt tricks?

Yes. It recommends native structured outputs or tool use when a provider offers them.

Will it give dollar cost estimates?

Only with rates you supply. The tools do not contain model prices.

Details

Original description by the author

Use when optimizing a prompt, building an eval set, measuring RAG retrieval quality or validating an agent's tool config. Iterates with prompt_optimizer.py, scores RAG with rag_evaluator.py and checks agents with agent_orchestrator.py.

repo: alirezarezvani/claude-skills

Popularity

GitHub stars
29k
Ranking position
#9515
License
MIT
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills