Install any skill in seconds. Free to start, no credit card required.
Get Started Free →This skill should be used when the user asks to "optimize a prompt", "improve prompt performance", "design a prompt template", "write better prompts", "debug prompt issues", "use chain-of-thought", "structured prompting", "few-shot prompting", or wants to apply advanced prompt engineering patterns for production LLM applications.
.claude/skills/wshobson-prompt-engineering-patterns/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 70% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 65% | 0% |
| case-19 | ✗→✓ | ▲ Improved | 21% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 52% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 230% | 0% |
Master advanced prompt engineering techniques to maximize LLM performance, reliability, and controllability.
pythonfrom langchain_anthropic import ChatAnthropic from langchain_core.prompts import ChatPromptTemplate from pydantic import BaseModel, Field # Define structured output schema class SQLQuery(BaseModel): query: str = Field(description="The SQL query") explanation: str = Field(description="Brief explanation of what the query does") tables_used: list[str] = Field(description="List of tables referenced") # Initialize model with structured output llm = ChatAnthropic(model="claude-sonnet-5") structured_llm = llm.with_structured_output(SQLQuery) # Create prompt template prompt = ChatPromptTemplate.from_messages([ ("system", """You are an expert SQL developer. Generate efficient, secure SQL queries. Always use parameterized queries to prevent SQL injection. Explain your reasoning briefly."""), ("user", "Convert this to SQL: {query}") ]) # Create chain chain = prompt | structured_llm # Use result = await chain.ainvoke({ "query": "Find all users who registered in the last 30 days" }) print(result.query) print(result.explanation)
Detailed pattern documentation lives in references/details.md. Read that file when the navigation tier above is insufficient.
Track these KPIs for your prompts:
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 5,920 | 5,111 | -14% | 1 | 1 | 0% | 1,101 | 1,874 | +70% | 0 | 0 | — |
case-02 | pass→pass | 11,951 | 11,475 | -4% | 1 | 1 | 0% | 2,270 | 3,453 | +52% | 0 | 0 | — |
case-03 | pass→pass | 4,236 | 7,104 | +68% | 1 | 1 | 0% | 758 | 2,498 | +230% | 0 | 0 | — |
case-04 | pass→pass | 13,457 | 16,839 | +25% | 1 | 1 | 0% | 2,399 | 4,357 | +82% | 0 | 0 | — |
case-05 | pass→pass | 14,179 | 12,638 | -11% | 1 | 1 | 0% | 2,493 | 3,355 | +35% | 0 | 0 | — |
case-06 | pass→pass | 11,378 | 7,619 | -33% | 1 | 1 | 0% | 2,046 | 2,390 | +17% | 0 | 0 | — |
case-07 | pass→pass | 8,562 | 7,095 | -17% | 1 | 1 | 0% | 1,586 | 2,405 | +52% | 0 | 0 | — |
case-08 | fail→pass | 6,444 | 3,810 | -41% | 1 | 1 | 0% | 1,031 | 1,696 | +65% | 0 | 0 | — |
case-09 | pass→pass | 13,393 | 13,767 | +3% | 1 | 1 | 0% | 2,523 | 3,859 | +53% | 0 | 0 | — |
case-10 | pass→pass | 4,860 | 4,483 | -8% | 1 | 1 | 0% | 923 | 1,860 | +102% | 0 | 0 | — |
case-11 | pass→pass | 14,734 | 16,421 | +11% | 1 | 1 | 0% | 2,808 | 4,124 | +47% | 0 | 0 | — |
case-12 | pass→pass | 11,825 | 16,941 | +43% | 1 | 1 | 0% | 2,079 | 3,496 | +68% | 0 | 0 | — |
case-13 | pass→pass | 13,755 | 13,218 | -4% | 1 | 1 | 0% | 2,766 | 3,594 | +30% | 0 | 0 | — |
case-14 | pass→pass | 13,373 | 13,472 | +1% | 1 | 1 | 0% | 2,336 | 3,595 | +54% | 0 | 0 | — |
case-15 | pass→pass | 5,685 | 3,617 | -36% | 1 | 1 | 0% | 1,084 | 1,682 | +55% | 0 | 0 | — |
case-16 | pass→pass | 6,917 | 6,573 | -5% | 1 | 1 | 0% | 1,293 | 2,295 | +77% | 0 | 0 | — |
case-17 | pass→pass | 13,843 | 12,354 | -11% | 1 | 1 | 0% | 2,430 | 3,501 | +44% | 0 | 0 | — |
case-18 | pass→pass | 64,601 | 6,474 | -90% | 1 | 1 | 0% | 841 | 2,183 | +160% | 0 | 0 | — |
case-19 | fail→pass | 8,715 | 6,013 | -31% | 1 | 1 | 0% | 1,929 | 2,326 | +21% | 0 | 0 | — |
case-20 | fail→fail | 12,992 | 11,755 | -10% | 1 | 1 | 0% | 2,697 | 3,565 | +32% | 0 | 0 | — |
case-21 | fail→fail | 11,409 | 10,350 | -9% | 1 | 1 | 0% | 2,321 | 3,064 | +32% | 0 | 0 | — |
case-22 | fail→fail | 15,656 | 18,185 | +16% | 1 | 1 | 0% | 3,237 | 4,885 | +51% | 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 +14 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.