Agent skill

Senior Prompt Engineer

by alirezarezvani in alirezarezvani/claude-skills

A skill your agent uses when the user asks to optimize prompts, design prompt templates, evaluate LLM outputs with an eval set, measure RAG retrieval quality, validate agent/tool configurations…

MITAuto-check passedAI & LLM Engineering

Install Senior Prompt Engineer

skills CLI
$ npx skills add alirezarezvani/claude-skills --skill senior-prompt-engineer -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install alirezarezvani/claude-skills senior-prompt-engineer --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/alirezarezvani/claude-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/engineering-team/skills/senior-prompt-engineer .claude/skills/senior-prompt-engineer && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
senior-prompt-engineer
GitHub stars
28k
Used in
1 other repo
Token cost
~2.5k tokens
SKILL.md length
932 words
Files
7 (incl. scripts, references)
Skills in repo
342
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when the user asks to optimize prompts, design prompt templates, evaluate LLM outputs with an eval set, measure RAG retrieval quality, validate agent/tool configurations…

  • Works in 3 steps: Prompt Optimizer —… → RAG Evaluator — scripts/rag_evaluator.py → Agent Orchestrator —…
  • The user asks to optimize prompts
  • SKILL.md covers Operating Rules, Tools (exact CLIs, all stdlib), Workflows and References, plus 1 more section
  • Runs Python scripts from its folder; calls python3

What it does

Senior Prompt Engineer is an agent skill from alirezarezvani/claude-skills. Use when the user asks to optimize prompts, design prompt templates, evaluate LLM outputs with an eval set, measure RAG retrieval quality, validate agent/tool configurations, analyze token usage, or design structured-output contracts. Covers eval-driven prompt iteration, RAG metrics (relevance, faithfulness, coverage), agent workflow validation, and token/cost budgeting — all model-agnostic, with three stdlib Python tools.

Its SKILL.md is about 2.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 8 other files, including scripts and reference files (for example `references/agentic_system_design.md`, `references/llm_evaluation_frameworks.md` and `references/prompt_engineering_patterns.md`).

It sits in AI & LLM Engineering, covering Prompt engineering, Structured output and tool calling and LLM cost and token optimization. It works with Python. The repository describes itself as: 380 Claude Code skills & agent skills & plugins (30+ Agents, 70+ custom commands, 380+ skills, customizable references, scripts)for Claude Code, Codex, Gemini CLI, Cursor, and 8… The licence is MIT.

When your agent uses it

  • The user asks to optimize prompts
  • Design prompt templates
  • Evaluate LLM outputs with an eval set
  • Measure RAG retrieval quality

Example prompts

  • “/senior-prompt-engineer”

Requirements

  • Python 3

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Prompt Optimizer — scripts/prompt_optimizer.py
  2. RAG Evaluator — scripts/rag_evaluator.py
  3. Agent Orchestrator — scripts/agent_orchestrator.py

What it can do on your machine

Read from SKILL.md and the folder at commit 19392f7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 3 files in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python3

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Senior Prompt Engineer loads about 2.5k tokens when it runs, and up to ~15k if it reads all its reference files. Until then it costs about 112 tokens; SKILL.md has 932 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~112
When it runs · the whole SKILL.md, loaded when a task matches
~2.5k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~15k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from alirezarezvani/claude-skills at commit 19392f7, republished under its MIT licence (© alirezarezvani). 932 words, ~2,474 tokens.

Download SKILL.mdSave it as .claude/skills/senior-prompt-engineer/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.
name
senior-prompt-engineer
description
Use when the user asks to optimize prompts, design prompt templates, evaluate LLM outputs with an eval set, measure RAG retrieval quality, validate agent/tool configurations, analyze token usage, or design structured-output contracts. Covers eval-driven prompt iteration, RAG metrics (relevance, faithfulness, coverage), agent workflow validation, and token/cost budgeting — all model-agnostic, with three stdlib Python tools.

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.

bash
# 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).

bash
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.

bash
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:
    SymptomFix
    Malformed/unparseable outputNative structured outputs / JSON schema if the API supports it; explicit schema-in-prompt otherwise
    Inconsistent answers across runsTighten instructions + add 2–3 contrastive examples (one near-miss showing what NOT to do)
    Misses edge casesEnumerate the edge cases explicitly; add a "when uncertain, do X" rule
    Token bloat on repeated callsMove stable prefix (system rules, examples) first so prompt caching applies; trim redundancy
    Wrong reasoning on hard casesAsk for stepwise reasoning in a scratch field the consumer ignores, or use the provider's extended-thinking mode
  4. Re-analyze and compare: python3 scripts/prompt_optimizer.py revised.txt --analyze --compare baseline.json
  5. Eval gate (must pass before shipping): run the revised prompt over the eval set, write per-case pass/fail to eval_results.json, then assert:
    bash
    python3 scripts/prompt_optimizer.py revised.txt --analyze --json --output revised.json \
      && python3 -c "
    import json, sys
    r = json.load(open('revised.json')); b = json.load(open('baseline.json'))
    ok = r['clarity_score'] >= b['clarity_score'] and r['token_count'] <= b['token_count'] * 1.10
    sys.exit(0 if ok else 1)"
    echo "gate exit=$?"   # 0 = ship; 1 = regression, iterate again
    Pair this structural gate with your task-level eval: the revision must not lose any previously-passing eval case (no-regression rule).
Show full SKILL.md (405 more words)Show less
Few-Shot Example Design
  1. Define the task contract first (input shape, output shape, edge-case policy).
  2. Start with zero examples and measure — current models often need none. Add examples only for failure clusters the eval reveals.
  3. When adding: 3–5 max, ordered simple → edge → negative (what NOT to extract), formatted identically to the real output contract.
  4. Validate consistency: python3 scripts/prompt_optimizer.py prompt_with_examples.txt --extract-examples --output examples.json and inspect that every extracted pair parses against your schema.
  5. Re-run the eval set; if a case passes only because it resembles an example, add a held-out variant to the eval set.
Structured Output Design
  1. Write the JSON Schema first (types, enums, required, maxLength).
  2. Prefer API-native enforcement: structured-outputs / response-schema / tool-call parameters guarantee shape; prompt text cannot.
  3. Fallback (API without schema support): include the schema rendered as field-by-field rules + one valid example, and instruct "output only the JSON object".
  4. Gate: pipe 10 eval outputs through a schema validator (python3 -c "import json,sys; [json.loads(l) for l in sys.stdin]" at minimum); 10/10 must parse, else return to step 2.
RAG Tuning Loop
  1. Build questions.json (id, question, reference answer) and capture current retrievals to contexts.json.
  2. python3 scripts/rag_evaluator.py --contexts contexts.json --questions questions.json --output rag_baseline.json
  3. Fix the lowest metric first: relevance → chunking/embeddings/metadata filters; faithfulness → grounding instructions + "answer only from context" + citation requirement; coverage → retrieval k / query expansion.
  4. Gate: python3 scripts/rag_evaluator.py --contexts new_contexts.json --questions questions.json --compare rag_baseline.json — every metric must be ≥ baseline; any regression blocks the change.
Agent Config Review
  1. python3 scripts/agent_orchestrator.py agent.yaml --validate — must exit with VALIDATION PASSED; fix every error and warning (missing tool config, unbounded iterations, loop risk).
  2. Check context discipline: each tool description ≤ 1–2 sentences, tool count minimal for the job, stable system prompt placed first (cache-friendly), iteration cap + early-exit condition present.
  3. Budget: --estimate-cost --runs N with your current prices; if cost/run exceeds budget, cut tools or context before downgrading the model.

References

FileContainsLoad when user asks about
references/prompt_engineering_patterns.md10 prompt patterns with input/output examples"which pattern?", few-shot design, decomposition, meta-prompting
references/llm_evaluation_frameworks.mdEval metrics, scoring methods, A/B testing"how to evaluate?", "measure quality", "compare prompts"
references/agentic_system_design.mdAgent architectures (ReAct, Plan-Execute, Tool Use)"build agent", "tool calling", "multi-agent"
  • engineering-team/skills/senior-ml-engineer — model deployment and serving (this skill stops at the prompt/eval layer)
  • engineering/rag-architect — RAG system architecture (this skill measures RAG quality; that one designs the pipeline)
  • engineering/agent-designer — full agent system design (this skill validates configs; that one designs the architecture)

© alirezarezvani, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 6 other files (scripts, references) in engineering-team/skills/senior-prompt-engineer of alirezarezvani/claude-skills.

  • SKILL.md
  • references/agentic_system_design.md
  • references/llm_evaluation_frameworks.md
  • references/prompt_engineering_patterns.md
  • scripts/agent_orchestrator.py
  • scripts/prompt_optimizer.py
  • scripts/rag_evaluator.py

Open the folder on GitHubat commit 19392f7

Used in 1 other repository

We found 3 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in alirezarezvani/claude-skills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Senior Prompt Engineer next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Senior Prompt Engineer compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Senior Prompt Engineer this skillalirezarezvani/claude-skills28k1 repos~2.5kAutomated safety check: PassMIT
Prompt Engineering Patternswshobson/agents40k—~1.3kAutomated safety check: PassMIT
Kayba Stage 2 Domain Contextkayba-ai/agentic-context-engine2.6k—~1.9kAutomated safety check: PassApache-2.0
Lintlanghermes-labs-ai/lintlang140—~719Automated safety check: PassApache-2.0
Lintlang Audithermes-labs-ai/lintlang140—~1.9kAutomated safety check: PassApache-2.0
Context Engineering Reviewmohitagw15856/pm-claude-skills1.4k—~1.4kAutomated safety check: PassMIT

Similar skills

  • Reference for designing and tuning production LLM prompts: few-shot examples, chain-of-thought, structured outputs, templates and system prompts.

    40k GitHub stars~1.3k tokensUpdated 5 days ago
    AI & LLM EngineeringAuto-check passed
  • Kayba Stage 2 Domain Context

    kayba-ai/agentic-context-engine

    Gather domain context about the repository and agent — system prompt, tool definitions, domain docs, and behavior patterns from traces.

    2.6k GitHub stars~1.9k tokensUpdated 16 days ago
    AI & LLM EngineeringAuto-check passed
  • Lintlang

    hermes-labs-ai/lintlang

    A skill your agent uses when writing or reviewing AI agent configs, system prompts, or tool definitions (JSON/YAML/Python) and you need to catch ambiguous tool descriptions, missing stop conditions…

    140 GitHub stars~719 tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Lintlang Audit

    hermes-labs-ai/lintlang

    Audit a named AI agent config, system prompt, tool definition, or instruction file (YAML, JSON, Markdown, text, or Python) with the released LintLang CLI in GitHub Copilot CLI.

    140 GitHub stars~1.9k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Context Engineering Review

    mohitagw15856/pm-claude-skills

    Review what an LLM feature or agent actually puts in its context window — and find what's bloating, missing, or fighting itself.

    1.4k GitHub stars~1.4k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed
  • SDK Core

    VectorSpaceLab/AREX-Skill

    A skill your agent uses for direct LiteLLM Python SDK work: chat/text completions, async calls, streaming, embeddings, structured outputs, tools, token/cost checks, caching, callbacks, import/smoke…

    331 GitHub stars~1.1k tokensUpdated 1 mo ago
    AI & LLM EngineeringAuto-check passed

More from alirezarezvani/claude-skills

All 342 skills in this repo
  • Agile Product Owner

    alirezarezvani/claude-skills

    Writes INVEST-checked user stories with acceptance criteria, splits epics, plans sprints from velocity and ranks the backlog with a weighted score.

    28k GitHub starsUsed in 3 repos~3.2k tokens
    Auto-check passed
  • Product Strategist

    alirezarezvani/claude-skills

    OKR cascade toolkit for product leaders: generates aligned company-to-team OKRs from five strategy types and scores how well they line up.

    28k GitHub starsUsed in 2 repos~1.8k tokens
    Auto-check passed
  • App Store Optimization

    alirezarezvani/claude-skills

    App Store Optimization (ASO) toolkit for researching keywords, analyzing competitor rankings, generating metadata suggestions, and improving app visibility on Apple App Store and Google Play Store.

    28k GitHub starsUsed in 1 repo~4.2k tokens
    Auto-check passed
  • AWS Solution Architect

    alirezarezvani/claude-skills

    Design AWS architectures for startups using serverless patterns and IaC templates.

    28k GitHub starsUsed in 1 repo~2.5k tokens
    Auto-check passed
  • Campaign Analytics

    alirezarezvani/claude-skills

    Calculates attribution, funnel and ROI figures for marketing campaigns with three Python scripts that need only the standard library.

    28k GitHub starsUsed in 1 repo~2.1k tokens
    Auto-check passed
  • Code to PRD

    alirezarezvani/claude-skills

    Reverse-engineers a frontend, backend or fullstack codebase into a product requirements document with per-page docs, an enum dictionary and an API inventory.

    28k GitHub starsUsed in 1 repo~4.9k tokens
    Auto-check passed

Works with

Questions about Senior Prompt Engineer

What does Senior Prompt Engineer do?

A skill your agent uses when the user asks to optimize prompts, design prompt templates, evaluate LLM outputs with an eval set, measure RAG retrieval quality, validate agent/tool configurations…. Senior Prompt Engineer is an agent skill from alirezarezvani/claude-skills. Use when the user asks to optimize prompts, design prompt templates, evaluate LLM outputs with an eval set, measure RAG retrieval quality, validate agent/tool configurations, analyze token usage, or design structured-output contracts.

When should I use Senior Prompt Engineer?

Senior Prompt Engineer fits situations like: the user asks to optimize prompts; design prompt templates; evaluate LLM outputs with an eval set; measure RAG retrieval quality.

How do I install Senior Prompt Engineer in Claude Code?

Run `npx skills add alirezarezvani/claude-skills --skill senior-prompt-engineer -a claude-code`. Or copy the skill folder (engineering-team/skills/senior-prompt-engineer in alirezarezvani/claude-skills) into .claude/skills/senior-prompt-engineer in your project. Claude Code loads it when a task matches its description.

How do I install Senior Prompt Engineer in Codex?

Run `npx skills add alirezarezvani/claude-skills --skill senior-prompt-engineer -a codex`. Or copy the skill folder (engineering-team/skills/senior-prompt-engineer in alirezarezvani/claude-skills) into .agents/skills/senior-prompt-engineer in your project. Codex loads it when a task matches its description.

Can I use Senior Prompt Engineer in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add alirezarezvani/claude-skills --skill senior-prompt-engineer -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/senior-prompt-engineer, .gemini/skills/senior-prompt-engineer, .github/skills/senior-prompt-engineer and .opencode/skills/senior-prompt-engineer in your project.

What does Senior Prompt Engineer need to run?

Going by SKILL.md and its folder, Senior Prompt Engineer needs Python for the scripts in its folder and the command-line tools its instructions call (python3). Our summary lists: Python 3.

Does Senior Prompt Engineer access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Senior Prompt Engineer safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Senior Prompt Engineer use?

Senior Prompt Engineer is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Senior Prompt Engineer use?

About 2.5k tokens (SKILL.md is roughly 9.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 12k tokens, read only when the agent opens those files.

What are the alternatives to Senior Prompt Engineer?

Skills that share tags, products or a category with Senior Prompt Engineer: Prompt Engineering Patterns (wshobson/agents, 40k stars), Kayba Stage 2 Domain Context (kayba-ai/agentic-context-engine, 2.6k stars), Lintlang (hermes-labs-ai/lintlang, 140 stars) and Lintlang Audit (hermes-labs-ai/lintlang, 140 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Senior Prompt Engineer?

alirezarezvani (a GitHub user) maintains it in alirezarezvani/claude-skills, which has 27,938 GitHub stars. The repository holds 342 skills in this directory. The repository was last updated on August 30, 2026.

Source: alirezarezvani/claude-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.