llm-app-patterns

llm-app-patterns is a skill for Claude Code from tranhieutt/software_development_department. It costs 50 tokens per session (1,000 once invoked), scanned A, original, MIT.

A set of architecture patterns for AI applications and assistants, including prompt design, retrieval-augmented generation, agent loops, conversation handling, and evaluation.

In plain words
What is it for?
Use it when building chatbots, document question-answering systems, tool-using assistants, or other LLM-based features.
Why use it?
It helps choose an appropriate structure for AI features based on the type of task, such as answering questions, using tools, or completing multi-step work.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: positional $N argument.

Good fit Use it when building chatbots, document question-answering systems, tool-using assistants, or other LLM-based features.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tranhieutt/software_development_department/llm-app-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 tranhieutt/software_development_department --skill llm-app-patterns
Clone the repo
git clone --depth 1 https://github.com/tranhieutt/software_development_department

Made for: Claude Code.

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-app-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/tranhieutt/software_development_department/llm-app-patterns/github.svg)](https://agentmods.dev/skills/tranhieutt/software_development_department/llm-app-patterns)
Your own site
<a href="https://agentmods.dev/skills/tranhieutt/software_development_department/llm-app-patterns"><img src="https://agentmods.dev/badge/skills/tranhieutt/software_development_department/llm-app-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-app-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/tranhieutt/software_development_department/llm-app-patterns"><img src="https://agentmods.dev/badge/skills/tranhieutt/software_development_department/llm-app-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 50 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,000 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.00050 $0.01000
Opus 5 $0.00025 $0.00500
Sonnet 5 $0.00010 $0.00200
Haiku 4.5 $0.00005 $0.00100

Measured 5d ago against content hash 1495215ee760, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

llm-app-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 5d 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.

.claude/skills/llm-app-patterns/SKILL.md · 122 lines

How it starts

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

LLM Application & AI Assistant Patterns

Resources

Architecture decision matrix

Pattern Use when Cost
Simple RAG FAQ, docs Q&A Low
Hybrid RAG (semantic + BM25) Mixed query types Medium
Function calling Structured tool use Low
ReAct agent Multi-step reasoning Medium
Plan-and-execute Complex decomposable tasks High
Multi-agent Research, critique-refine Very High

RAG: critical config numbers

CHUNK_CONFIG = {
    "chunk_size": 512,       # tokens — sweet spot for most docs
    "chunk_overlap": 50,     # prevents context loss at boundaries
    "separators": ["\n\n", "\n", ". ", " "],
}
# Hybrid search alpha: 1.0=semantic only, 0.0=BM25 only, 0.5=balanced

RAG: retrieval strategies

# Basic: semantic search
results = vector_db.similarity_search(embed(query), top_k=5)

# Better: hybrid (semantic + keyword via RRF)
def hybrid_search(query, alpha=0.5):
    return rrf_merge(vector_db.search(query), bm25_search(query), alpha)

# Best for recall: multi-query (3 variations, deduplicate)
queries = llm.generate_variations(query, n=3)
results = deduplicate([semantic_search(q) for q in queries])

RAG: generation prompt template

RAG_PROMPT = """Answer based ONLY on the context below.
If insufficient, say "I don't have enough information."

Context: {context}
Question: {question}
Answer:"""

Agent: function calling loop

messages = [{"role": "user", "content": question}]
while True:
    response = llm.chat(messages=messages, tools=TOOLS, tool_choice="auto")
    if not response.tool_calls:
        return response.content
    for call in response.tool_calls:
        result = execute_tool(call.name, call.arguments)
        messages.append({"role": "tool", "tool_call_id": call.id, "content": str(result)})

Production: caching (only temperature=0 responses)

def get_or_generate(prompt, model, **kwargs):
    deterministic = kwargs.get("temperature", 1.0) == 0
    if deterministic:
        key = sha256(f"{model}:{prompt}:{json.dumps(kwargs, sort_keys=True)}")
        if cached := redis.get(key): return cached
    response = llm.generate(prompt, model=model, **kwargs)
    if deterministic: redis.setex(key, 3600, response)
    return response

Read the full file on GitHub · 122 lines

Files

What ships with it

1 file 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. 5d ago First seen · 122 lines · 50 tokens per session scan A 1495215ee760

Subscribe to this mod's changes

llm-app-patterns is a skill published in the GitHub repository tranhieutt/software_development_department (72 stars, last pushed 3mo ago), licensed MIT. It adds 50 tokens to every session and 1,000 once invoked, about $0.0003 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-09-03.

Related

Other skills, from other repositories

reviewing-ai-papers

Analyzes an AI/ML publication — paper, preprint, article, technical blog post — and extracts what an enterprise AI engineer should do about it. Use when someone supplies a URL or document on RAG, embeddings, fine-tuning, prompt engineering, agents, or LLM deployment and asks "review this paper", "what do you make of…

oaustegard/claude-skills · 105 tokens

laravel-ai-sdk

Use when integrating AI agents, tool calling, embeddings, structured output, or streaming in Laravel 13 via the laravel/ai package.

fusengine/agents · 35 tokens

dspy-haystack-integration

Use for integrating DSPy with Haystack, optimizing Haystack prompts, improving retrieval pipelines, and extracting DSPy prompts.

OmidZamani/dspy-skills · 32 tokens

audit-langfuse-llm

Run a PDCA quality audit on LLM/AI features: traces, prompts, costs, evals, grounding, hallucination. Use for "audit LLM quality", "check Langfuse", "audit prompts", "check AI quality", "audit AI costs", "check traces". Jailbreak/OWASP LLM → audit-llm-security. Token caps → plan-llm-cost-guardrails.

kensaurus/cursor-kenji · 93 tokens

audit-llm-security

Read-only OWASP LLM Top 10 audit of app-facing AI: prompt injection, data leakage, unsafe output/agency, RAG risks, misinformation, and unbounded spend. Use when "audit LLM security", "prompt injection", "jailbreak my chatbot", or "is my AI safe?". General app security → audit-security.

kensaurus/cursor-kenji · 76 tokens

cm-deep-search

Optional power-up — detects oversized codebases/docs and suggests tobi/qmd for local semantic search. Bridges cm-continuity (working memory) with long-term document retrieval. Zero-config detection, non-intrusive suggestion.

tody-agent/codymaster · 50 tokens