Prompt Engineering
by @kongyo2
Comprehensive prompt engineering framework for designing, optimizing, and iterating LLM prompts. This skill should be used when users request prompt creation...
clawhub install prompt-engineering-2π About This Skill
name: prompt-engineering description: Comprehensive prompt engineering framework for designing, optimizing, and iterating LLM prompts. This skill should be used when users request prompt creation, optimization, or improvement for any LLM task, or when users need help translating vague requirements into effective prompts through collaborative dialogue and iterative refinement.
Prompt Engineering
Overview
This skill transforms vague user requests into precise, effective prompts through collaborative dialogue, systematic analysis, and iterative refinement. It combines proven prompt engineering techniques with a structured development process to create prompts that reliably achieve user objectives.
Workflow Decision Tree
When a user requests prompt assistance, follow this decision flow:
User Request
ββ "Create a prompt" / "Make a prompt" / Vague request
β ββ β Start with EXPLORATION PHASE
ββ "Optimize this prompt" / Has existing prompt
β ββ β Start with SIMPLE OPTIMIZATION
ββ "Fix this issue with my prompt" / Specific problem
ββ β Start with ANALYSIS PHASE (focused on problem)
Core Process
Phase 1: Exploration - Uncovering True Needs
Before creating any prompt, deeply understand the user's actual needs through strategic questioning. Start broad, then narrow down systematically.
Initial Context Gathering:
Deepening Understanding:
Technical Requirements:
Continue exploration until the core requirements are crystal clear. Never assumeβalways verify.
Phase 2: Analysis - Choosing the Right Strategy
Analyze the task to determine the optimal prompting approach.
Task Classification:
Classify the task along key dimensions:
Strategy Selection:
Based on classification, choose primary techniques:
Trade-off Analysis:
Present multiple approaches with clear trade-offs:
Always explain WHY each approach fits the specific context.
Phase 3: Implementation - Building Iteratively
Create the prompt through progressive refinement, starting simple and adding complexity as needed.
Version 1 - Minimal Viable Prompt:
Version 2 - Enhanced Clarity:
Version 3+ - Optimization:
Document each version's changes and rationale. Store prompts in markdown files with:
Phase 4: Validation - Critical Evaluation
Rigorously evaluate the prompt against quality criteria.
Essential Checks:
Testing Approach:
Be ruthlessly honest about weaknesses. If something isn't working, acknowledge it and iterate.
Simple Optimization
When optimizing an existing prompt, focus on minimal, targeted improvements:
1. Identify Specific Issues: What exactly isn't working? 2. Diagnose Root Causes: Why is the current prompt failing? 3. Apply Minimal Edits: Change only what's necessary 4. Preserve Working Elements: Keep what already works well 5. Test Improvements: Verify fixes don't break other aspects
Common optimization targets:
Prompt Creation from Scratch
When creating new prompts, structure them as instructions for an eager but inexperienced assistant who needs clear guidance.
Essential Components:
1. Role/Context (if beneficial): - Set perspective or expertise level - Establish tone and approach 2. Clear Objective: - State the primary goal explicitly - Define success criteria
3. Specific Instructions: - Break complex tasks into steps - Provide decision criteria - Specify constraints and boundaries
4. Output Format (when relevant): - Define structure explicitly - Provide format examples - Specify length or detail level
5. Examples (when clarifying): - Show desired patterns - Illustrate edge cases - Demonstrate style/tone
Key Techniques Reference
Foundation Techniques
Role Setting: Establish perspective when expertise or tone matters
Progressive Disclosure: Start general, add detail as needed
Explicit Constraints: Define boundaries clearly
Advanced Techniques
Chain-of-Thought: Request reasoning before conclusions
Few-Shot Learning: Provide input-output examples
Self-Consistency: Have model verify its own outputs
For detailed technique explanations and examples, consult:
references/techniques.md - Comprehensive technique catalogreferences/patterns.md - Common prompt patternsreferences/antipatterns.md - What to avoidCollaboration Principles
Be a Thought Partner, Not Just an Executor
Question Assumptions Constructively
Iterate Based on Feedback
Teach While Doing
References
This skill includes detailed reference documentation:
references/
techniques.md - Complete catalog of prompting techniques with examplespatterns.md - Reusable prompt patterns for common scenarios antipatterns.md - Common mistakes and how to avoid themevaluation.md - Comprehensive quality evaluation frameworkexamples.md - Library of before/after prompt improvementsConsult these references for in-depth technical details and extensive examples not included in this overview.