llm-application-dev-prompt-optimize
運用進階工程技巧優化 LLM 提示
將基本指令轉化為生產級提示,提升 40% 準確率並降低 50-80% 成本。本技能提供思維鏈推理、憲法 AI 模式,以及針對 Claude、GPT 和 Gemini 的模型專屬優化專業指導。
下載技能 ZIP
在 Claude 中上傳
前往 設定 → 功能 → 技能 → 上傳技能
開啟並開始使用
測試它
正在使用「llm-application-dev-prompt-optimize」。 Optimize this prompt: 'Answer customer questions about refunds'
預期結果:
優化後的提示包含角色定義、診斷框架、解決方案傳遞結構、驗證步驟、約束條件和 JSON 輸出格式。包含思維鏈推理區段和自我審查清單以確保品質。
正在使用「llm-application-dev-prompt-optimize」。 Make this prompt better for data analysis: 'Analyze the sales data'
預期結果:
包含五個階段的綜合分析框架:資料驗證、具統計顯著性測試的趨勢分析、多維度區段分析、具信心評分的見解範本,以及 YAML 格式的優先建議事項。
安全審計
安全Static analysis detected 62 potential security issues in code examples within documentation files. All findings are false positives - the detected patterns (Ruby backticks, MD5 references, reconnaissance commands) appear exclusively within markdown code blocks that demonstrate prompt engineering techniques. The skill contains no executable code, performs no file operations, network requests, or command execution. It is a documentation-only skill providing guidance on prompt optimization best practices.
品質評分
你能建構什麼
客戶服務提示優化
將基本客戶服務提示轉化為結構化、具同理心的回應系統,包含診斷推理框架、升級路徑和品質約束,確保一致且專業的服務互動。
資料分析提示增強
將簡單的資料分析請求升級為綜合分析框架,包含分階段驗證、統計顯著性測試、多維度區段分析,以及結構化 YAML 格式的高階主管報告。
程式碼生成安全改進
透過安全優先設計思維、輸入驗證要求、SOLID 原則和自我審查清單增強程式碼生成提示,防止注入漏洞並確保生產級程式碼。
試試這些提示
Analyze this step by step:
1. Identify the core problem
2. Break down into smaller components
3. Reason through each component carefully
4. Synthesize findings
5. Provide final answer with confidence level
Input: {your_input}Example 1:
Input: {simple_case}
Output: {correct_output}
Example 2:
Input: {edge_case}
Output: {correct_output}
Example 3:
Input: {error_case}
Wrong: {incorrect_output}
Correct: {correct_output}
Now apply to: {actual_input}{task_instructions}
Review your response against these principles:
1. ACCURACY: Verify all claims, flag uncertainties
2. SAFETY: Check for harm, bias, ethical issues
3. QUALITY: Ensure clarity, consistency, completeness
Initial Response: [Generate]
Self-Review: [Evaluate against principles]
Final Response: [Refined based on review]<context>
{background_information}
</context>
<task>
{clear_objective_with_constraints}
</task>
<thinking>
1. Understanding requirements...
2. Identifying components...
3. Planning approach...
</thinking>
<output_format>
{xml_structured_response_specification}
</output_format>最佳實務
- 務必在提示中定義明確的角色、上下文、任務和輸出格式
- 對於複雜的多步驟問題使用思維鏈推理以提升準確性
- 在少樣本學習中包含 3-5 個涵蓋典型、邊界和錯誤案例的多樣化範例
- 針對安全關鍵應用實作具備憲法原則的自我批判迴圈
避免
- 避免模糊指令如「分析這個」而未指定框架、輸出格式或成功標準
- 不要使用未涵蓋邊界案例的單一範例,這會導致提示行為脆弱
- 切勿在未經對抗性輸入、超出範圍查詢和邊界案例測試下部署提示
- 避免模型無關的提示,應針對特定 LLM 優化結構(Claude 偏好 XML 標籤,GPT 偏好 ## 標頭)