llm-patterns

llm-patterns is a skill for Claude Code, Codex 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 CodeCodex

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

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.

agentmods
npx agentmods add skills/ariegoldkin/claude-forge/llm-patterns
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, Codex.

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.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.svg" alt="Measured on agentmods" 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. Scan, not verified.
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 $0.00119 $0.00877
Opus 5 $0.00060 $0.00439
Sonnet 5 $0.00024 $0.00175
Haiku 4.5 $0.00012 $0.00088

Measured 4d ago against content hash 8b04c1739cec, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 4d 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. 4d 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 (6 stars, last pushed 26d ago), licensed MIT. It adds 119 tokens to every session and 877 once invoked, about $0.0006 per session on Opus 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

prowler-ui

Prowler UI-specific patterns. For generic patterns, see: typescript, react-19, nextjs-16, tailwind-4. Trigger: When working inside ui/ on Prowler-specific conventions (shadcn, folder placement, actions/adapters, shared types/hooks/lib).

prowler-cloud/prowler · 64 tokens

prowler-pr

Creates Pull Requests for Prowler following the project template and conventions. Trigger: When working on pull request requirements or creation (PR template sections, PR title Conventional Commits check, changelog gate/no-changelog label), or when inspecting PR-related GitHub workflows like conventional-commit.yml…

prowler-cloud/prowler · 84 tokens

prowler-test-api

Testing patterns for Prowler API: JSON:API, Celery tasks, RLS isolation, RBAC. Trigger: When writing tests for api/ (JSON:API requests/assertions, cross-tenant isolation, RBAC, Celery tasks, viewsets/serializers).

prowler-cloud/prowler · 62 tokens

prowler-commit

Creates professional git commits following conventional-commits format. Trigger: When creating commits, after completing code changes, when user asks to commit.

prowler-cloud/prowler · 33 tokens

prowler

Main entry point for Prowler development - quick reference for all components. Trigger: General Prowler development questions, project overview, component navigation (NOT PR CI gates or GitHub Actions workflows).

prowler-cloud/prowler · 43 tokens

prowler-mcp

Creates MCP tools for Prowler MCP Server. Covers BaseTool pattern, model design, and API client usage. Trigger: When working in mcpserver/ on tools (BaseTool), models (MinimalSerializerMixin/fromapiresponse), or API client patterns.

prowler-cloud/prowler · 57 tokens