senior-prompt-engineer
Skill này làm gì
Skill này khiến agent cải thiện prompt AI bằng kiểm thử có đo lường thay vì phỏng đoán. Skill dành cho người viết prompt cho tính năng AI, hệ thống RAG hoặc agent và muốn biết một thay đổi có thực sự giúp ích không.
Khi nào nên dùng
- ✓Khi một prompt cho câu trả lời không nhất quán và cần được cải thiện có đo lường.
- ✓Khi bạn muốn đo xem RAG tìm đúng thông tin tốt đến đâu.
- ✓Khi bạn cần kiểm tra thiết lập công cụ của agent có hoạt động như dự định không.
Liên kết skill
https://github.com/alirezarezvani/claude-skills/blob/main/engineering-team/skills/senior-prompt-engineer/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Prompt hỗ trợ khách hàng của tôi cho câu trả lời không nhất quán. Hãy xây một bộ kiểm thử nhỏ và cải thiện prompt dựa trên nó.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent ghi lại kết quả nền trước khi thay đổi bất cứ thứ gì, xây dựng bộ đánh giá cùng bạn nếu cần, và so sánh từng thay đổi prompt với kết quả nền. Nó cũng chấm điểm truy xuất RAG và kiểm tra thiết lập công cụ của agent.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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
- Never change a prompt without a baseline. Capture metrics first (
--analyze --output baseline.json), then compare every iteration against it. - 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.
- 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.
- 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.
- 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)
- Baseline:
python3 scripts/prompt_optimizer.py current_prompt.txt --analyze --json --output baseline.json - Diagnose from the report: ambiguous verbs ("analyze", "handle"), redundant blocks, missing output contract, token waste.
- Apply one change at a time, in this order of leverage:
Symptom Fix
Câu hỏi thường gặp
Vì sao cần bộ đánh giá trước?
Thay đổi prompt mà không có trường hợp kiểm thử là phỏng đoán. Skill khuyên có ít nhất 10 đến 20 trường hợp đại diện trước khi bắt đầu.
Skill có ưu tiên tính năng sẵn có hơn mẹo prompt không?
Có. Skill khuyên dùng đầu ra có cấu trúc gốc hoặc sử dụng công cụ khi nhà cung cấp có hỗ trợ.
Skill có đưa ra ước tính chi phí bằng đô la không?
Chỉ khi bạn cung cấp mức giá. Các công cụ không chứa giá của mô hình.
Chi tiết
Mô tả gốc của tác giả
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.
Độ phổ biến
- Sao GitHub
- 29k
- Vị trí xếp hạng
- #9515
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
agent-launcher-orchestrator
29kGiúp agent của bạn lên kế hoạch, xây dựng, kiểm thử và lên lịch một Claude managed agent trong tài khoản riêng, từng bước một, bắt đầu từ một mục tiêu rõ ràng.
grade-iterate
29kCho phép agent của bạn chấm kết quả một managed AI agent theo bảng tiêu chí và cải thiện qua số vòng cố định, nên không bao giờ lặp vô tận.
interview
29kCho phép agent của bạn phỏng vấn bạn về ý tưởng agent AI và biến câu trả lời thành một kế hoạch xây dựng đơn giản trước khi khởi chạy bất cứ điều gì.
run-without-you
29kGiúp agent của bạn thiết lập một managed AI agent chạy theo lịch hoặc khi có sự kiện xảy ra, với thời gian cron được kiểm tra trước khi khởi chạy.
Skill tương tự
writing-skills
311kDạy agent của bạn viết skill mới và kiểm thử từng skill trước, kiểm tra xem skill có thực sự thay đổi cách agent hành xử hay không.
writing-for-agents
310kGiải thích cách viết hướng dẫn rõ ràng cho agent AI, gồm skill, tệp AGENTS.md và CLAUDE.md, để agent cư xử nhất quán.
bengali-nlp
280kGiúp agent của bạn xử lý văn bản tiếng Bengali, hỗ trợ hiểu ngôn ngữ này, chuẩn hóa văn bản và xử lý các đặc điểm riêng của nó.