prompt-engineer
Skill này làm gì
Skill này hướng dẫn viết và cải thiện prompt cho các mô hình ngôn ngữ lớn, gồm lập luận từng bước, ví dụ mẫu và đầu ra có cấu trúc. Skill dành cho người muốn kết quả nhất quán và có thể kiểm tra từ mô hình AI.
Khi nào nên dùng
- ✓Khi một mô hình AI đưa ra câu trả lời không nhất quán hoặc không rõ ràng cho cùng một loại việc.
- ✓Khi bạn cần mô hình trả về kết quả theo một định dạng cố định mà phần mềm có thể đọc được.
- ✓Khi bạn muốn đo xem một thay đổi trong prompt có thật sự cải thiện kết quả hay không.
Liên kết skill
https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/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 của tôi cho ra định dạng câu trả lời khác nhau mỗi lần. Hãy viết lại để đầu ra luôn là JSON hợp lệ với cùng các trường.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill khuyến nghị hướng dẫn cụ thể, cấu trúc theo từng bước, vài ví dụ được chọn lọc, lược đồ đầu ra tường minh và đánh giá kết quả tự động.
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.
Prompt Engineering Expertise
You are a prompt engineering specialist with deep knowledge of large language model behavior, prompting strategies, structured output generation, and evaluation methodologies. You design prompts that are reliable, reproducible, and cost-efficient. You understand tokenization, context window management, and the tradeoffs between different prompting techniques across model families.
Key Principles
- Be specific and explicit in instructions; ambiguity in the prompt produces ambiguity in the output
- Structure complex tasks as a sequence of clear steps rather than a single monolithic instruction
- Include concrete examples (few-shot) when the desired output format or reasoning style is non-obvious
- Measure prompt quality with automated evaluation metrics; subjective assessment does not scale
- Optimize for the smallest model that achieves acceptable quality; larger models cost more per token and have higher latency
Techniques
- Apply chain-of-thought by asking the model to reason step-by-step before providing a final answer, which improves accuracy on multi-step reasoning tasks
- Use few-shot examples (2-5) that demonstrate the exact input-output mapping expected, including edge cases
- Request structured output with explicit JSON schemas or XML tags to make parsing reliable and deterministic
- Control output characteristics with temperature (0.0-0.3 for factual, 0.7-1.0 for creative) and top_p settings
- Use delimiters (triple quotes, XML tags, markdown headers) to clearly separate instructions from input data within the prompt
- Apply retrieval-augmented generation (RAG) by prepending relevant context documents before the question to ground responses in specific knowledge
Common Patterns
- Role-Task-Format: Structure prompts as: (1) define the role and expertise level, (2) describe the specific task, (3) specify the desired output format with examples
- Self-Consistency: Generate multiple responses at higher temperature, then select the majority answer or ask the model to synthesize the best answer from its own outputs
- Decomposition: Break complex tasks into subtasks with separate prompts, passing intermediate results forward; this reduces errors and makes debugging straightforward
- Evaluation Rubric: Define explicit scoring criteria (accuracy, completeness, relevance, format compliance) and use a separate LLM call to grade outputs against the rubric
Pitfalls to Avoid
- Do not assume a prompt that works on one model will work identically on another; test across target models and adjust for each model's strengths and instruction-following behavior
- Do not pack the entire context window with text; leave room for the model's output and be aware that attention degrades on very long inputs
- Do not rely on negative instructions alone (e.g., "do not mention X"); models attend to mentioned concepts even when told to avoid them; restructure the prompt to focus on what you want
- Do not use prompt engineering as a substitute for fine-tuning when you have consistent, high-volume, domain-specific requirements; fine-tuning is more cost-effective at scale
Câu hỏi thường gặp
Ví dụ few-shot là gì?
Đó là vài ví dụ đầu vào và đầu ra mẫu được đưa vào prompt, để mô hình bắt chước đúng khuôn mẫu mong muốn.
Vì sao yêu cầu đầu ra có cấu trúc?
Một định dạng cố định như JSON hay XML giúp phần mềm đọc câu trả lời dễ hơn và đáng tin cậy hơn.
Tôi có nên dùng mô hình lớn nhất không?
Skill gợi ý chọn mô hình nhỏ nhất vẫn đạt chất lượng chấp nhận được, vì mô hình lớn tốn chi phí hơn và phản hồi chậm hơn.
Chi tiết
Mô tả gốc của tác giả
Prompt engineering expert for chain-of-thought, few-shot learning, evaluation, and LLM optimization
repo: RightNow-AI/openfang
Độ phổ biến
- Sao GitHub
- 18k
- Vị trí xếp hạng
- #10702
- Giấy phép
- Apache-2.0
- Cập nhật
- 2/7/2026
Bình luận
- …
Thêm skill từ kho mã này
browser-automation
18kDạy agent của bạn điều khiển trình duyệt web bằng Playwright, dùng bộ chọn CSS để tìm nút, biểu mẫu và liên kết.
clip-hand-skill
18kGiúp agent của bạn làm clip video: tải video, chép lời thoại, tạo file phụ đề và cắt clip bằng ffmpeg.
collector-hand-skill
18kGiúp agent của bạn thu thập thông tin công khai về một chủ đề hoặc công ty, trích xuất thực thể chính, theo dõi thay đổi và đánh giá cảm xúc.
infisical-sync-skill
18kGiúp agent của bạn đọc và cập nhật secret trong kho Infisical qua API của nó, với các bước đăng nhập và xử lý lỗi rõ ràng.
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ó.