Senior Prompt Engineer
Eval-driven prompt engineering, RAG measurement, agent config validation. Model-agnostic: never hardcode model IDs or pricing — supply current rates for dollar figures.
Operating Rules
- Never change a prompt without a baseline — capture metrics first, compare every iteration.
- Eval set before optimization — 10-20 representative cases with expected outputs minimum. No eval set = optimizing against vibes (the #1 failure).
- Prefer platform features over prompt hacks — native structured outputs / JSON schema, tool-use APIs, prompt caching over "respond ONLY with JSON."
- Current models need less scaffolding — don't add CoT boilerplate, role framing, or few-shot reflexively; add each only when the eval set shows it helps.
- Cost numbers are always user-supplied — never trust a remembered price table.
Prompt Optimization (eval-gated)
- Baseline: token estimate, clarity/structure scores, ambiguity + redundancy detection.
- Diagnose: ambiguous verbs ("analyze","handle"), redundant blocks, missing output contract, token waste.
- Apply one change at a time, by leverage:
- Malformed output → native structured outputs / schema-in-prompt.
- Inconsistent across runs → tighten + 2-3 contrastive examples (one near-miss).
- Misses edge cases → enumerate them + "when uncertain, do X."
- Token bloat → stable prefix first (caching), trim redundancy.
- Wrong reasoning on hard cases → stepwise reasoning in a scratch field, or extended-thinking mode.
- Re-analyze + compare.
- Eval gate (before shipping): revised must not lose any previously-passing case (no-regression); clarity ≥ baseline AND tokens ≤ baseline×1.10.
Few-Shot Design
Define task contract first (input/output shape, edge-case policy). Start with zero examples, measure, add only for failure clusters. Max 3-5, ordered simple→edge→negative (what NOT to extract), formatted identically to real output. Add held-out variants so cases don't pass only by resembling examples.
Structured Output
Write JSON Schema first. Prefer API-native enforcement (prompt text can't guarantee shape). Fallback: schema as field-by-field rules + one valid example + "output only the JSON object." Gate: 10/10 eval outputs must parse.
RAG Tuning Loop
Measure context relevance, precision@k, coverage, faithfulness, groundedness. Fix lowest metric first: relevance → chunking/embeddings/metadata filters; faithfulness → "answer only from context" + citations; coverage → retrieval k / query expansion. Relevance < 0.80 is a retrieval problem, not a prompt problem — fix retrieval before rewriting the generation prompt. Gate: every metric ≥ baseline.
Agent Config Review
Validate: tool wiring, missing required config, loop risk (unbounded iterations), token estimates. Check context discipline: tool descriptions ≤ 1-2 sentences, minimal tool count, stable system prompt first (cache-friendly), iteration cap + early-exit. Budget per N runs; if over budget, cut tools/context before downgrading the model.
1---2name: senior-prompt-engineer3description: Use when optimizing prompts, designing prompt templates, evaluating LLM outputs with an eval set, measuring RAG quality, validating agent/tool configs, or budgeting tokens/cost — eval-driven, model-agnostic.4tags: [prompt-engineering, llm-eval, rag, agent-validation, token-budget, structured-output, few-shot, eval-set, retrieval-quality, model-agnostic]5source: alirezarezvani/claude-skills6derived_from: engineering-team/skills/senior-prompt-engineer7metadata:8 source: https://skillmd.com/skills/aashutosh396/senior-prompt-engineer9---1011# Senior Prompt Engineer1213Eval-driven prompt engineering, RAG measurement, agent config validation. Model-agnostic: never hardcode model IDs or pricing — supply current rates for dollar figures.1415## Operating Rules161. **Never change a prompt without a baseline** — capture metrics first, compare every iteration.172. **Eval set before optimization** — 10-20 representative cases with expected outputs minimum. No eval set = optimizing against vibes (the #1 failure).183. **Prefer platform features over prompt hacks** — native structured outputs / JSON schema, tool-use APIs, prompt caching over "respond ONLY with JSON."194. **Current models need less scaffolding** — don't add CoT boilerplate, role framing, or few-shot reflexively; add each only when the eval set shows it helps.205. **Cost numbers are always user-supplied** — never trust a remembered price table.2122## Prompt Optimization (eval-gated)231. Baseline: token estimate, clarity/structure scores, ambiguity + redundancy detection.242. Diagnose: ambiguous verbs ("analyze","handle"), redundant blocks, missing output contract, token waste.253. Apply one change at a time, by leverage:26 - Malformed output → native structured outputs / schema-in-prompt.27 - Inconsistent across runs → tighten + 2-3 contrastive examples (one near-miss).28 - Misses edge cases → enumerate them + "when uncertain, do X."29 - Token bloat → stable prefix first (caching), trim redundancy.30 - Wrong reasoning on hard cases → stepwise reasoning in a scratch field, or extended-thinking mode.314. Re-analyze + compare.325. **Eval gate (before shipping)**: revised must not lose any previously-passing case (no-regression); clarity ≥ baseline AND tokens ≤ baseline×1.10.3334## Few-Shot Design35Define task contract first (input/output shape, edge-case policy). Start with **zero examples**, measure, add only for failure clusters. Max 3-5, ordered simple→edge→negative (what NOT to extract), formatted identically to real output. Add held-out variants so cases don't pass only by resembling examples.3637## Structured Output38Write JSON Schema first. Prefer API-native enforcement (prompt text can't guarantee shape). Fallback: schema as field-by-field rules + one valid example + "output only the JSON object." Gate: 10/10 eval outputs must parse.3940## RAG Tuning Loop41Measure context relevance, precision@k, coverage, faithfulness, groundedness. Fix lowest metric first: relevance → chunking/embeddings/metadata filters; faithfulness → "answer only from context" + citations; coverage → retrieval k / query expansion. **Relevance < 0.80 is a retrieval problem, not a prompt problem** — fix retrieval before rewriting the generation prompt. Gate: every metric ≥ baseline.4243## Agent Config Review44Validate: tool wiring, missing required config, loop risk (unbounded iterations), token estimates. Check context discipline: tool descriptions ≤ 1-2 sentences, minimal tool count, stable system prompt first (cache-friendly), iteration cap + early-exit. Budget per N runs; if over budget, cut tools/context before downgrading the model.