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 skills add sergei-aronsen/claude-code-toolkit --skill llm-patternsgit clone --depth 1 https://github.com/sergei-aronsen/claude-code-toolkitWrote 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/sergei-aronsen/claude-code-toolkit/llm-patterns)<a href="https://agentmods.dev/skills/sergei-aronsen/claude-code-toolkit/llm-patterns"><img src="https://agentmods.dev/badge/skills/sergei-aronsen/claude-code-toolkit/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.
<a href="https://agentmods.dev/skills/sergei-aronsen/claude-code-toolkit/llm-patterns"><img src="https://agentmods.dev/badge/skills/sergei-aronsen/claude-code-toolkit/llm-patterns.svg" alt="Reviewed on agentmods" width="80" 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.1 | $0.00034 | $0.02415 |
| Opus 5.5 | $0.00014 | $0.00966 |
| Sonnet 5.5 | $0.00007 | $0.00483 |
| Haiku 4.5 | $0.00003 | $0.00242 |
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.
How it starts
The opening of the file, as written. The whole thing — 406 lines — stays where its author put it; the contents beside it link to each section on GitHub.
LLM Patterns Skill
Load this skill when working with LLMs, RAG systems, embeddings, or AI integrations.
Rule
LLM INTEGRATIONS MUST BE ROBUST AND COST-EFFECTIVE!
- Always handle streaming and errors
- Optimize tokens for cost
- Use appropriate models for tasks
Model Selection Guide
| Task | Model | Why |
|---|---|---|
| Complex reasoning | Claude Opus 4.5 / GPT-4 | Best quality |
| General tasks | Claude Sonnet 4.5 / GPT-4o | Balance |
| Simple tasks | Claude Haiku 4.5 / GPT-4o-mini | Fast & cheap |
| Embeddings | text-embedding-3-small | Cost-effective |
| Classification | Fine-tuned small model | Fastest |
RAG Architecture
Basic RAG Flow
Query → Embed Query → Vector Search → Retrieve Chunks → Augment Prompt → LLM → Response
Implementation
async function ragQuery(query: string): Promise<string> {
// 1. Embed the query
const queryEmbedding = await embedText(query);
// 2. Vector search for relevant chunks
const chunks = await vectorStore.similaritySearch(queryEmbedding, {
topK: 5,
minScore: 0.7,
});
// 3. Build context from chunks
const context = chunks.map((c) => c.content).join('\n\n---\n\n');
// 4. Augment prompt
const prompt = `Answer based on the following context:
Context:
${context}
Question: ${query}
Answer:`;
// 5. Get LLM response
return await llm.complete(prompt);
}
Chunking Strategies
Size Guidelines
| Document Type | Chunk Size | Overlap |
|---|---|---|
| Dense text (legal, technical) | 256-512 tokens | 50 tokens |
| General content | 512-1024 tokens | 100 tokens |
| Conversational | 1024-2048 tokens | 200 tokens |
Chunking Methods
// 1. Fixed size chunking
function fixedChunks(text: string, size: number, overlap: number): string[] {
const chunks = [];
for (let i = 0; i < text.length; i += size - overlap) {
chunks.push(text.slice(i, i + size));
}
return chunks;
}
// 2. Semantic chunking (by paragraph/section)
function semanticChunks(text: string): string[] {
return text
.split(/\n\n+/)
.filter((chunk) => chunk.trim().length > 50);
}
// 3. Recursive character splitting (LangChain style)
const splitter = new RecursiveCharacterTextSplitter({
chunkSize: 1000,
chunkOverlap: 200,
separators: ['\n\n', '\n', '. ', ' ', ''],
});
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.
- 1mo ago First seen · 406 lines · 34 tokens per session scan A adb961619bd7
LLM Patterns is a skill published in the GitHub repository sergei-aronsen/claude-code-toolkit (5 stars, last pushed 2mo ago), licensed MIT. It adds 34 tokens to every session and 2,415 once invoked, about $0.0001 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.
Other skills, from other repositories
dspy
DSPy: declarative LM programs, auto-optimize prompts, RAG.
ai-engineering-toolkit
Overview of six AI engineering workflows: prompt evaluation (8-dimension scoring), context budget planning, RAG pipeline design, agent security audit (65-point checklist), eval harness building, and product sense coaching.
llm-app-patterns
Production-ready patterns for building LLM applications. Covers RAG pipelines, agent architectures, prompt IDEs, and LLMOps monitoring. Use when designing AI applications, implementing RAG, building agents, or setting up LLM observability.
ai-product
Design and evaluate LLM product features, retrieval, validated outputs, latency, and cost controls.
llm-ops
LLM Operations -- RAG, embeddings, vector databases, fine-tuning, prompt engineering avancado, custos de LLM, evals de qualidade e arquiteturas de IA para producao.
llm-security
Use for authorized security assessment of LLM applications and AI agents, including prompt injection, tool abuse, RAG exposure, memory poisoning, and model supply-chain risks.