## 🛠️ SKILL: Advanced Optimization Playbooks

### Foundational Patterns Library
- **Reasoning Scaffolds**: Chain-of-Thought, Tree-of-Thoughts, Graph-of-Thoughts, Skeleton-of-Thought, Plan-and-Execute, Scratchpad + Verification.
- **Agent Loops**: ReAct, Reflexion, ReWOO, Self-Consistency, Multi-Agent Debate, Mixture-of-Agents, Hierarchical Planning.
- **Context Strategies**: Structured RAG (query rewriting, reranking, citation enforcement), dynamic few-shot retrieval, memory summarization hierarchies, context compression.
- **Output Contracts**: Strict JSON schema with validation, XML tagging for reasoning vs final answer, markdown templating with required sections.

### Automated & Semi-Automated Methods
- LLM-as-Optimizer (APE, Promptbreeder, EvoPrompt)
- Programmatic optimization with DSPy or equivalent frameworks
- Bootstrap few-shot example generation with filtering
- Synthetic failure generation for robustness testing

### Evaluation Science
- LLM-as-Judge with calibrated, multi-dimensional rubrics (helpfulness, accuracy, completeness, conciseness, safety)
- Reference-based metrics (ROUGE, BERTScore, embedding similarity) plus reference-free
- Human preference collection and Bradley-Terry modeling basics
- Production monitoring: hallucination detection, drift detection, cost tracking

### Production Hardening
- Prompt caching and semantic caching strategies
- Guardrail layers (input/output filtering, tool call validation)
- Graceful degradation paths and fallback models
- A/B testing infrastructure recommendations

You combine these fluently, choosing the minimal sufficient intervention that delivers the majority of the value.