llm-patterns

llm-patterns is a skill for Claude Code from ArieGoldkin/claude-forge. It costs 119 tokens per session (877 once invoked), scanned A, original, MIT.

A set of patterns for building, evaluating, streaming, and testing applications that use language models. It covers output scoring, real-time responses, tool calls, and test techniques.

In plain words
What is it for?
Use it to score answers with a separate judge model, detect hallucinations, track evaluations in Langfuse, stream responses through FastAPI and TypeScript, handle backpressure, mock model replies, record them with VCR.py, and validate structured output.
Why use it?
It provides practical ways to check whether model answers are useful and to handle responses as they arrive. It also helps test model-based code without depending on live model results every time.

Skill for Claude Code

Written for Claude Code: paths in frontmatter.

Part of the atk plugin — 16 skills, 25 commands, 1 agent, 1 hook shipped together

Good fit Use it to score answers with a separate judge model, detect hallucinations, track evaluations in Langfuse, stream responses through FastAPI and TypeScript, handle backpressure, mock model replies, record them with VCR.py, and validate structured output.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ariegoldkin/claude-forge/llm-patterns
Install

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.

Any agent
npx skills add ArieGoldkin/claude-forge --skill llm-patterns
Clone the repo
git clone --depth 1 https://github.com/ArieGoldkin/claude-forge

Made for: Claude Code.

Or install atk, the plugin that ships this one along with the rest of its 16 skills, 25 commands, 1 agent, 1 hook.

Wrote 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.

agentmods badge for llm-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/ariegoldkin/claude-forge/llm-patterns/github.svg)](https://agentmods.dev/skills/ariegoldkin/claude-forge/llm-patterns)
Your own site
<a href="https://agentmods.dev/skills/ariegoldkin/claude-forge/llm-patterns"><img src="https://agentmods.dev/badge/skills/ariegoldkin/claude-forge/llm-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for llm-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/ariegoldkin/claude-forge/llm-patterns"><img src="https://agentmods.dev/badge/skills/ariegoldkin/claude-forge/llm-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 119 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 877 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00119 $0.00877
Opus 5.5 $0.00048 $0.00351
Sonnet 5.5 $0.00024 $0.00175
Haiku 4.5 $0.00012 $0.00088

Measured 1mo ago against content hash 8b04c1739cec, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

llm-patterns scanned grade A with 0 findings 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 1mo 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/ai-toolkit/skills/llm-patterns/SKILL.md · 81 lines

How it starts

The opening of the file, as written. The whole thing — 81 lines — stays where its author put it; the contents beside it link to each section on GitHub.

LLM Patterns

Patterns for building, evaluating, streaming, and testing LLM-powered applications.

Evaluation

Quality assessment and validation of LLM outputs using LLM-as-judge, multi-dimension scoring, pairwise comparison, hallucination detection, and batch evaluation. Integrates with Langfuse for score tracking.

  • Use a separate judge model (e.g., GPT-4o-mini, Claude Haiku) to avoid self-evaluation bias
  • Score across 3-5 dimensions: relevance, accuracy, completeness, coherence
  • Quality threshold: 0.7 for production, 0.6 for drafts

Full patterns and code: See references/evaluation.md

Autonomous Evaluation Loop

Use /experiment to autonomously iterate on evaluator quality (judge prompts, scoring rubrics) against golden datasets, tracking agreement via Langfuse Experiments API. See references/autonomous-evaluation.md for the full pattern and a worked example.


Streaming

Real-time token delivery via Server-Sent Events (SSE) for better UX. Covers OpenAI sync/async streaming, FastAPI SSE endpoints, TypeScript frontend consumers, streaming with tool calls, and backpressure handling.

  • Use SSE for web, WebSocket for bidirectional communication
  • Buffer 50-200 tokens; set 30-60s timeouts for long responses
  • Always close connections properly and handle stream errors

Full patterns and code: See references/streaming.md


Testing

Deterministic testing patterns for non-deterministic LLM outputs. Covers quality gate tests, template rendering, edge cases (empty/long inputs, partial responses), and VCR.py for recording API responses in CI.

  • Use VCR for integration tests, mocks for unit tests
  • Always test with < 1s timeout; validate both valid and invalid schemas
  • Record mode "none" in CI to avoid live API calls

Full patterns and code: See references/testing.md

Read the full file on GitHub · 81 lines

Files

What ships with it

4 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.

Changes

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.

  1. 1mo ago First seen · 81 lines · 119 tokens per session scan A 8b04c1739cec

Subscribe to this mod's changes

llm-patterns is a skill published in the GitHub repository ArieGoldkin/claude-forge (7 stars, last pushed 2mo ago), licensed MIT. It adds 119 tokens to every session and 877 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

dataset-evaluation

Validates dataset formatting and quality for SageMaker model fine-tuning (SFT, DPO, or RLVR). Use when the user says "is my dataset okay", "evaluate my data", "check my training data", "I have my own data", or before starting any fine-tuning job. Detects file format, checks schema compliance against the selected model…

awslabs/agent-plugins · 93 tokens

llm-evaluation

LLM evaluation and testing patterns including prompt testing, hallucination detection, benchmark creation, and quality metrics. Use when testing LLM applications, validating prompt quality, implementing systematic evaluation, or measuring LLM performance.

stefan-jansen/claude-code-toolkit · 47 tokens

llm-evaluation

Implement comprehensive evaluation strategies for LLM applications using automated metrics, human feedback, and benchmarking. Use when testing LLM performance, measuring AI application quality, or establishing evaluation frameworks.

FluxonLab/Skillry · 40 tokens

llm-eval

LLM evaluation: build evaluation datasets, choose metrics (RAGAS, G-Eval, LLM-as-judge), run automated evals, monitor production quality, and detect regressions.

UitbreidenOS/UitKit · 43 tokens

scikit-learn-train-test-splittings

Guidelines and instructions for Scikit-learn train test splittings.

UitbreidenOS/UitKit · 24 tokens

cli-eval

Create and run evaluation suites, watch live benchmark progress, view scorecards, compare model performance, and integrate eval runs with CI workflows from the CLI.

diegosouzapw/OmniRoute · 34 tokens