llm-prompt-optimizer
Fungsinya
Alat ini memperbaiki instruksi yang Anda berikan kepada kecerdasan buatan (AI). Alat ini mengubah permintaan yang samar menjadi permintaan yang jelas dan efisien, sehingga AI benar-benar memahami apa yang Anda inginkan dan menghasilkan jawaban yang lebih baik.
Kapan dipakai
- βKetika AI memberikan jawaban yang membingungkan atau keliru.
- βKetika Anda ingin AI memformat jawabannya dengan cara tertentu (misalnya dalam bentuk daftar atau tabel).
- βKetika Anda ingin AI lebih to the point dan tidak bertele-tele.
Link skill
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/llm-prompt-optimizer/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βPerbaiki prompt ini untuk AI: 'Bicarakan tentang anjing.'β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Alat ini menganalisis permintaan asli Anda lalu menerapkan teknik 'prompt engineering' yang sudah dikenal. Alat ini menambahkan detail seperti peran yang harus dimainkan AI, konteks, aturan, dan cara jawaban sebaiknya diformat.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
LLM Prompt Optimizer
Overview
This skill transforms weak, vague, or inconsistent prompts into precision-engineered instructions that reliably produce high-quality outputs from any LLM (Claude, Gemini, GPT-4, Llama, etc.). It applies systematic prompt engineering frameworks β from zero-shot to few-shot, chain-of-thought, and structured output patterns.
When to Use This Skill
- Use when a prompt returns inconsistent, vague, or hallucinated results
- Use when you need structured/JSON output from an LLM reliably
- Use when designing system prompts for AI agents or chatbots
- Use when you want to reduce token usage without sacrificing quality
- Use when implementing chain-of-thought reasoning for complex tasks
- Use when prompts work on one model but fail on another
Step-by-Step Guide
1. Diagnose the Weak Prompt
Before optimizing, identify which problem pattern applies:
| Problem | Symptom | Fix |
|---|---|---|
| Too vague | Generic, unhelpful answers | Add role + context + constraints |
| No structure | Unformatted, hard-to-parse output | Specify output format explicitly |
| Hallucination | Confident wrong answers | Add "say I don't know if unsure" |
| Inconsistent | Different answers each run | Add few-shot examples |
| Too long | Verbose, padded responses | Add length constraints |
2. Apply the RSCIT Framework
Every optimized prompt should have:
- R β Role: Who is the AI in this interaction?
- S β Situation: What context does it need?
- C β Constraints: What are the rules and limits?
- I β Instructions: What exactly should it do?
- T β Template: What should the output look like?
Before (weak prompt):
Explain machine learning.
After (optimized prompt):
You are a senior ML engineer explaining concepts to a junior developer.
Context: The developer has 1 year of Python experience but no ML background.
Task: Explain supervised machine learning in simple terms.
Constraints:
- Use an analogy from everyday life
- Maximum 200 words
- No mathematical formulas
- End with one actionable next step
Format: Plain prose, no bullet points.
3. Chain-of-Thought (CoT) Pattern
For reasoning tasks, instruct the model to think step-by-step:
Solve this problem step by step, showing your work at each stage.
Only provide the final answer after completing all reasoning steps.
Problem: [your problem here]
Thinking process:
Step 1: [identify what's given]
Step 2: [identify what's needed]
Step 3: [apply logic or formula]
Step 4: [verify the answer]
Final Answer:
4. Few-Shot Examples Pattern
Provide 2-3 examples to establish the pattern:
Classify the sentiment of customer reviews as POSITIVE, NEGATIVE, or NEUTRAL.
Examples:
Review: "This product exceeded my expectations!" -> POSITIVE
Review: "It arrived broken and support was useless." -> NEGATIVE
Review: "Product works as described, nothing special." -> NEUTRAL
Now classify:
Review: "[your review here]" ->
5. Structured JSON Output Pattern
Extract the following information from the text below and return it as valid JSON only.
Do not include any explanation or markdown β just the raw JSON object.
Schema:
{
"name": string,
"email": string | null,
"company": string | null,
"role": string | null
}
Text: [input text here]
6. Reduce Hallucination Pattern
Answer the following question based ONLY on the provided context.
If the answer is not contained in the context, respond with exactly: "I don't have enough information to answer this."
Do not make up or infer information not present in the context.
Context:
[your context here]
Question: [your question here]
7. Prompt Compression Techniques
Reduce token count without losing effectiveness:
# Verbose (expensive)
"Please carefully analyze the following code and provide a detailed explanation of
what it does, how it works, and any potential issues you might find."
# Compressed (efficient, same quality)
"Analyze this code: explain what it does, how it works, and flag any issues."
Best Practices
- β Do: Always specify the output format (JSON, markdown, plain text, bullet list)
- β Do: Use delimiters (```, ---) to separate instructions from content
- β Do: Test prompts with edge cases (empty input, unusual data)
- β Do: Version your system prompts in source control
β¦
Pertanyaan umum
Apa itu 'prompt engineering'?
Ini adalah seni menulis instruksi yang jelas dan efektif agar kecerdasan buatan memahami dan menjalankan tugas sebaik mungkin.
Mengapa AI kadang 'mengarang' jawaban (hallucination)?
Hal ini bisa terjadi ketika permintaan kurang jelas atau ketika AI tidak memiliki informasi yang benar. Prompt yang disusun dengan baik membantu mencegah hal ini.
Apa itu 'token'?
Token adalah satuan dasar yang digunakan AI untuk memproses teks. Prompt yang lebih singkat dan langsung menggunakan lebih sedikit token, sehingga biayanya bisa lebih murah.
Detail
Deskripsi asli dari pembuat
Use when improving prompts for any LLM. Applies proven prompt engineering techniques to boost output quality, reduce hallucinations, and cut token usage.
Popularitas
- Bintang GitHub
- 48k
- Peringkat
- #5089
- Lisensi
- MIT
- Diperbarui
- 15/10/2026
Komentar
- β¦
Skill lain dari repositori ini
00-andruia-consultant
48kMembantu agent Anda memulai atau meningkatkan proyek AI. Agent menganalisis kode, menyarankan tools, dan membuat rencana aksi dalam bahasa Spanyol.
007
48kMemungkinkan agent Anda melakukan audit keamanan dan threat modeling. Berguna untuk melindungi proyek dari serangan dan celah keamanan.
10-andruia-skill-smith
48kMembantu agent Anda membuat atau meningkatkan tools AI. Agent mendefinisikan cara kerja tools, menulis dokumentasi, dan memvalidasi strukturnya.
20-andruia-niche-intelligence
48kMemungkinkan agent Anda membuat ringkasan industri tertentu. Berguna untuk memahami konteks, aturan, pola penggunaan, dan risiko proyek dengan sumber terpercaya.
Skill serupa
writing-skills
311kMengajari agent Anda menulis skill baru dan menguji setiap skill lebih dulu, memastikan skill itu benar-benar mengubah perilaku agent.
writing-for-agents
310kMenjelaskan cara menulis instruksi yang jelas untuk agent AI, termasuk file skill, AGENTS.md, dan CLAUDE.md, agar perilaku agent dapat diprediksi.
bengali-nlp
280kMembuat agent Anda memproses teks Bahasa Bengali. Membantu memahami dan mengolah bahasa tersebut, termasuk normalisasi teks dan karakteristik uniknya.