← ClaudeAtlas

llm-patternslisted

Patterns for building production-grade LLM features — prompt engineering, retrieval-augmented generation (RAG), evaluation harnesses, guardrails, cost control, hallucination mitigation, structured output, agentic loops. Stack-agnostic; recipes target Anthropic Claude (Opus 4.7 / Sonnet 4.6 / Haiku 4.5) and OpenAI as the two reference providers. Use when adding an LLM feature, designing a RAG system, writing an eval suite, or hardening an agent loop. Pairs with claude-sdk-integration (raw Claude SDK) and observability (LLM telemetry).
kouroshez/coding-os · ★ 4 · AI & Automation · score 76
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. ──────────────────────