Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Master advanced prompt engineering techniques to maximize LLM performance, reliability, and controllability.
.claude/skills/davila7-prompt-engineering-patterns/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-03 | ✗→✓ | ▲ Improved | 57% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 34% | 0% |
| case-06 | ✓→✓ | = Same ✓ | 93% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 50% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 39% | 0% |
Master advanced prompt engineering techniques to maximize LLM performance, reliability, and controllability.
resources/implementation-playbook.md.pythonfrom prompt_optimizer import PromptTemplate, FewShotSelector # Define a structured prompt template template = PromptTemplate( system="You are an expert SQL developer. Generate efficient, secure SQL queries.", instruction="Convert the following natural language query to SQL:\n{query}", few_shot_examples=True, output_format="SQL code block with explanatory comments" ) # Configure few-shot learning selector = FewShotSelector( examples_db="sql_examples.jsonl", selection_strategy="semantic_similarity", max_examples=3 ) # Generate optimized prompt prompt = template.render( query="Find all users who registered in the last 30 days", examples=selector.select(query="user registration date filter") )
Start with simple prompts, add complexity only when needed:
[System Context] → [Task Instruction] → [Examples] → [Input Data] → [Output Format]Build prompts that gracefully handle failures:
python# Combine retrieved context with prompt engineering prompt = f"""Given the following context: {retrieved_context} {few_shot_examples} Question: {user_question} Provide a detailed answer based solely on the context above. If the context doesn't contain enough information, explicitly state what's missing."""
python# Add self-verification step prompt = f"""{main_task_prompt} After generating your response, verify it meets these criteria: 1. Answers the question directly 2. Uses only information from provided context 3. Cites specific sources 4. Acknowledges any uncertainty If verification fails, revise your response."""
Track these KPIs for your prompts:
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-06 | pass→pass | 12,785 | 14,357 | +12% | 1 | 1 | 0% | 2,194 | 4,243 | +93% | 0 | 0 | — |
case-01 | fail→fail | 14,039 | 13,317 | -5% | 1 | 1 | 0% | 2,372 | 3,887 | +64% | 0 | 0 | — |
case-02 | pass→pass | 13,211 | 12,066 | -9% | 1 | 1 | 0% | 2,439 | 3,652 | +50% | 0 | 0 | — |
case-03 | fail→pass | 17,017 | 15,072 | -11% | 1 | 1 | 0% | 2,655 | 4,171 | +57% | 0 | 0 | — |
case-04 | pass→pass | 17,031 | 14,234 | -16% | 1 | 1 | 0% | 2,910 | 4,041 | +39% | 0 | 0 | — |
case-05 | pass→pass | 10,496 | 13,982 | +33% | 1 | 1 | 0% | 1,862 | 4,056 | +118% | 0 | 0 | — |
case-07 | fail→pass | 17,786 | 15,618 | -12% | 1 | 1 | 0% | 2,935 | 3,921 | +34% | 0 | 0 | — |
case-08 | pass→pass | 19,307 | 18,123 | -6% | 1 | 1 | 0% | 2,968 | 4,795 | +62% | 0 | 0 | — |
case-09 | pass→pass | 4,241 | 4,031 | -5% | 1 | 1 | 0% | 634 | 2,188 | +245% | 0 | 0 | — |
case-10 | pass→pass | 17,356 | 19,199 | +11% | 1 | 1 | 0% | 2,745 | 4,950 | +80% | 0 | 0 | — |
case-11 | pass→pass | 19,294 | 17,279 | -10% | 1 | 1 | 0% | 3,315 | 4,679 | +41% | 0 | 0 | — |
case-12 | pass→pass | 15,693 | 16,893 | +8% | 1 | 1 | 0% | 2,490 | 4,195 | +68% | 0 | 0 | — |
case-13 | pass→pass | 13,710 | 10,895 | -21% | 1 | 1 | 0% | 2,284 | 3,367 | +47% | 0 | 0 | — |
case-14 | pass→pass | 16,079 | 16,602 | +3% | 1 | 1 | 0% | 2,806 | 4,336 | +55% | 0 | 0 | — |
case-15 | pass→pass | 20,092 | 15,231 | -24% | 1 | 1 | 0% | 3,601 | 4,612 | +28% | 0 | 0 | — |
case-16 | fail→fail | 13,626 | 15,319 | +12% | 1 | 1 | 0% | 2,387 | 3,997 | +67% | 0 | 0 | — |
case-17 | pass→pass | 16,448 | 12,854 | -22% | 1 | 1 | 0% | 2,707 | 3,831 | +42% | 0 | 0 | — |
case-18 | fail→fail | 17,913 | 19,988 | +12% | 1 | 1 | 0% | 3,118 | 5,074 | +63% | 0 | 0 | — |
case-19 | pass→pass | 4,920 | 6,074 | +23% | 1 | 1 | 0% | 845 | 2,582 | +206% | 0 | 0 | — |
case-20 | pass→pass | 16,257 | 16,238 | -0% | 1 | 1 | 0% | 3,222 | 4,823 | +50% | 0 | 0 | — |
case-21 | pass→pass | 10,963 | 9,225 | -16% | 1 | 1 | 0% | 2,070 | 3,249 | +57% | 0 | 0 | — |
case-22 | pass→pass | 9,093 | 7,958 | -12% | 1 | 1 | 0% | 1,908 | 3,138 | +64% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +9 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.