Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/kouroshez/coding-os/llm-patternsnpx skills add kouroshez/coding-os --skill llm-patternsgit clone --depth 1 https://github.com/kouroshez/coding-osWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/kouroshez/coding-os/llm-patterns)<a href="https://agentmods.dev/skills/kouroshez/coding-os/llm-patterns"><img src="https://agentmods.dev/badge/skills/kouroshez/coding-os/llm-patterns.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00135 | $0.04160 |
| Opus 5 | $0.00068 | $0.02080 |
| Sonnet 5 | $0.00027 | $0.00832 |
| Haiku 4.5 | $0.00014 | $0.00416 |
Grade B, and why
llm-patterns scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Instruction-override phrasingmediumPrompt injection
Text telling the model to disregard its earlier instructions or safety rules is the shape of a prompt injection, whoever wrote it.
The model knows to treat `<article>` as the document and `<question>` as the instruction. Crucially this also defends against **prompt injection** (a malicious article saying "ignore previous instructions and …" is conta Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.
How it starts
The opening of the file, as written. The whole thing — 411 lines — stays where its author put it; the contents beside it link to each section on GitHub.
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.
─────────────────────────────
Eval + Telemetry ← Quality + cost + latency monitoring
─────────────────────────────
Model ← Opus / Sonnet / Haiku / GPT-4o / etc.
Skipping any layer creates a failure mode. Skipping eval is the most common skip — and the most expensive.
Provider + Model Selection (2026 baseline)
| Need | Default | Why |
|---|---|---|
| Complex reasoning, code architecture, long horizons | claude-opus-4-8 |
Best reasoning, 1M context, most expensive |
| Production default — chat, summaries, code edits | claude-sonnet-4-6 |
Strong reasoning, ~5× cheaper than Opus, 200K context |
| Cheap, fast classification / extraction / heuristics | claude-haiku-4-5-20251001 |
Fast, cheap; fine for narrow tasks |
| Multi-modal vision (charts, screenshots, OCR) | claude-sonnet-4-6 or gpt-4o |
Both vision-capable in 2026 |
| Embeddings | text-embedding-3-large (OpenAI) / voyage-3-large (Voyage) |
Anthropic doesn't ship embedding models — pair with one |
What ships with it
3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3d ago First seen · 411 lines · 135 tokens per session scan B 2882a5494987
llm-patterns is a skill published in the GitHub repository kouroshez/coding-os (6 stars, last pushed 3d ago), licensed Apache-2.0. It adds 135 tokens to every session and 4,160 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it B with 1 finding (instruction-override phrasing). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
graph-mutation-plan
Cookbook for composing an applygraphmutations plan — stable entitykey patterns, the canonical label/edge vocabulary, evidence/invalidation/confidence discipline, and a worked example. Load this when building a non-trivial mutation plan.
potpie-infra-architecture
Use for project infra and architecture context: environments, adapters, runtime configuration, deployments, service dependencies, datastores, API contracts, ownership, incidents, and dependency blast radius.
alfworld-receptacle-finder
Searches for a suitable empty or appropriately occupied receptacle (like a shelf or table) to place an object. Use when you are holding an object that needs to be stored or placed and must find a receptacle that meets the placement criteria. Examines candidate receptacles by navigating to and inspecting each one until…
alfworld-search-pattern-executor
Systematically searches a sequence of likely locations for a target object based on common sense. Use when you need to find a specific object and know which receptacles to check but not which one contains it. Takes a list of candidate receptacles, orchestrates navigation and inspection, and outputs when the target is…
ux-ui-analyze-single-page
Analyze exactly one captured UI page (from uxuimap screenshots + request JSON) and immediately write/update uxuimap/pages/{page}.md in neutral descriptive language. Use when asked to analyze screenshots, rewrite corresponding analysis immediately, or avoid memory/context saturation.
scienceworld-growth-focuser
Use when you have planted a seed or need to track a plant's growth stage (sprouting, flowering, reproduction). Applies the 'focus on' action to a specific plant or biological entity to signal intent and monitor its development. Trigger after planting or when you need to observe life cycle progression in the…