llm-patternslisted
Install: claude install-skill kouroshez/coding-os
# LLM Patterns — Production-Grade AI Features
A practical playbook for shipping LLM-powered features that work reliably, cost-controllably, and don't hallucinate on critical paths. Provider-neutral; references Anthropic Claude Opus 4.7 / Sonnet 4.6 / Haiku 4.5 (2026 generation) and OpenAI as anchors.
## When to Use This Skill
- Designing a new LLM-powered feature (chat, summarization, classification, extraction, code-gen).
- Building a RAG (Retrieval-Augmented Generation) system.
- Writing an evaluation harness for an LLM feature.
- Adding guardrails / safety / hallucination mitigation.
- Choosing between provider / model tier / fine-tuning / prompt-only.
- Designing an agentic loop (tool use, multi-turn planning).
- Cost-optimizing a working LLM feature.
Skip when: implementing pure deterministic logic. Use this only when LLM truly outperforms rules-based code on the task.
## The Eight Layer Stack
```
Application ← UI, UX, error handling
─────────────────────────────
Orchestration ← Tool loop, multi-step, retries
─────────────────────────────
Guardrails ← Input validation, output filtering
─────────────────────────────
Retrieval (RAG) ← Context fetching from KB
─────────────────────────────
Prompt construction ← System + context + question
─────────────────────────────
Provider SDK ← anthropic, openai, etc.
──────────────────────