本文へスキップ
Skillpedia
プロンプトとLLM29k · #9515

senior-prompt-engineer

できること

このスキルにより、エージェントは推測ではなく測定可能なテストでAIのプロンプトを改善します。AI機能、RAGシステム、エージェントのためにプロンプトを書き、変更が役立つかを知りたい人を対象としています。

使う場面

  • ✓プロンプトの回答が一定せず、測定に基づいて改善する必要があるとき。
  • ✓RAGの検索が正しい情報をどれだけ見つけるかを測定したいとき。
  • ✓エージェントのツール設定が意図どおり動くかを確認する必要があるとき。

スキルのリンク

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

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/alirezarezvani/claude-skills/blob/main/engineering-team/skills/senior-prompt-engineer/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“サポート用のプロンプトの回答が一定しません。小さなテストセットを作り、それに対してプロンプトを改善してください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントは、変更の前に基準を記録し、必要に応じてあなたと一緒に評価用のデータセットを作ります。その後、プロンプトの各変更を基準と比較します。RAG検索の採点やエージェントのツール設定の確認も行います。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)を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
よくある質問

なぜ最初に評価用のデータセットが必要なのですか?

テストケースなしにプロンプトを変えるのは推測に過ぎないためです。スキルは、始める前に少なくとも10から20の代表的なケースを用意することを勧めています。

プロンプトの工夫より、組み込みの機能を優先しますか?

はい。プロバイダーが提供している場合は、ネイティブの構造化出力やツール利用を勧めます。

コストの見積もりも出せますか?

あなたが提供する料金を使う場合のみです。ツールには、モデルの価格は含まれていません。

詳細

作者による元の説明

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

人気

GitHubのスター
29k
ランキング
#9515
ライセンス
MIT
更新日
2026/11/2

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル