chain-llm-pattern

chain-llm-pattern is a skill for Claude Code, Codex from masteranime/n8n-claude-skills. It costs 153 tokens per session (1,380 once invoked), scanned A, original, MIT.

A pattern for building n8n workflows that send data through several language-model steps, such as extracting information, classifying it, and making a decision. n8n is a tool for connecting automated workflow steps.

In plain words
What is it for?
Use it to extract structured data, categorize or score records, detect language, translate content, assess spam, and route results in stages.
Why use it?
Breaking a task into separate steps makes intermediate data explicit and easier to validate when one prompt would need to do several kinds of reasoning.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to extract structured data, categorize or score records, detect language, translate content, assess spam, and route results in stages.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/masteranime/n8n-claude-skills/chain-llm-pattern
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 masteranime/n8n-claude-skills --skill chain-llm-pattern
Clone the repo
git clone --depth 1 https://github.com/masteranime/n8n-claude-skills

Made for: Claude Code, Codex.

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 chain-llm-pattern

README.md
[![agentmods](https://agentmods.dev/badge/skills/masteranime/n8n-claude-skills/chain-llm-pattern/github.svg)](https://agentmods.dev/skills/masteranime/n8n-claude-skills/chain-llm-pattern)
Your own site
<a href="https://agentmods.dev/skills/masteranime/n8n-claude-skills/chain-llm-pattern"><img src="https://agentmods.dev/badge/skills/masteranime/n8n-claude-skills/chain-llm-pattern/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 chain-llm-pattern

Your own site · 80×15
<a href="https://agentmods.dev/skills/masteranime/n8n-claude-skills/chain-llm-pattern"><img src="https://agentmods.dev/badge/skills/masteranime/n8n-claude-skills/chain-llm-pattern.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 153 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,380 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.00153 $0.01380
Opus 5 $0.00077 $0.00690
Sonnet 5 $0.00031 $0.00276
Haiku 4.5 $0.00015 $0.00138

Measured 11d ago against content hash 64eea0a03a3a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

chain-llm-pattern 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 11d 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.

skills/chain-llm-pattern/SKILL.md · 110 lines

How it starts

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

Chain LLM Pattern for n8n

Multi-step LLM chains outperform single-shot prompts on any task that combines extraction + reasoning. This skill encodes the production pattern.

When to use a chain vs a single prompt

Single prompt works Chain is better
"Summarize this email" "Extract entities, then categorize by urgency, then decide routing"
"Translate this to English" "Detect language, translate, then extract structured fields"
"Is this spam? yes/no" "Score spam probability from email, phone, IP, content separately, then combine"

Rule of thumb: if the task has ≥2 distinct reasoning steps OR the final decision depends on intermediate structured data, use a chain.

The pattern (3-stage default)

Input → [Extract] → [Analyze/Classify] → [Score/Decide] → Output

Each stage is its own LLM node with its own prompt. Between stages, use Set or Code nodes to transform and validate.

Stage 1: Extract (schema-bound)

Use Information Extractor node (LangChain). NOT a generic AI Agent or raw HTTP call.

Why: Information Extractor binds output to a JSON schema. It parses, retries on invalid JSON, and fails loudly — instead of silently returning prose you then regex.

Define schema explicitly:

{
  "type": "object",
  "properties": {
    "customer_name": { "type": "string" },
    "product_mentioned": { "type": "string" },
    "sentiment": { "enum": ["positive", "neutral", "negative"] },
    "urgency_score": { "type": "number", "minimum": 0, "maximum": 10 }
  },
  "required": ["customer_name", "sentiment"]
}

System prompt for this stage: short, one job. "Extract the fields defined in the schema from the transcript. If a field is absent, omit it. Do not infer or guess."

Stage 2: Analyze (reason over extracted data)

Use Basic LLM Chain with the extracted JSON from Stage 1 as input.

This stage reasons: categorize, cluster, identify patterns, detect issues. The input is structured (from Stage 1) so the model isn't juggling parsing + reasoning simultaneously.

Read the full file on GitHub · 110 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. 11d ago First seen · 110 lines · 153 tokens per session scan A 64eea0a03a3a

Subscribe to this mod's changes

chain-llm-pattern is a skill published in the GitHub repository masteranime/n8n-claude-skills (32 stars, last pushed 4mo ago), licensed MIT. It adds 153 tokens to every session and 1,380 once invoked, about $0.0008 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-30.

Related

Other skills, from other repositories

model-recommendation

Analyse chatmode or prompt files and recommend optimal AI models based on task complexity, required capabilities, and cost-efficiency.

MarieLynneBlock/arcanum-artifex · 28 tokens

eval-driven-dev

Build an automated evaluation pipeline that tests a Python LLM application end-to-end with pixie test — real code paths, real LLM calls, instrumented external data — and scores outputs with evaluators instead of assertions. Use when adding evals to a Python AI app.

MarieLynneBlock/arcanum-artifex · 59 tokens

pymc

Bayesian modelling with PyMC. Build hierarchical models, MCMC (NUTS), variational inference, LOO/WAIC comparison, posterior checks, for probabilistic programming and inference.

MarieLynneBlock/arcanum-artifex · 43 tokens

scikit-learn

Machine learning in Python with scikit-learn. Use when working with supervised learning (classification, regression), unsupervised learning (clustering, dimensionality reduction), model evaluation, hyperparameter tuning, preprocessing, or building ML pipelines. Provides comprehensive reference documentation for…

MarieLynneBlock/arcanum-artifex · 68 tokens

shap

Model interpretability and explainability using SHAP (SHapley Additive exPlanations). Use this skill when explaining machine learning model predictions, computing feature importance, generating SHAP plots (waterfall, beeswarm, bar, scatter, force, heatmap), debugging models, analysing model bias or fairness, comparing…

MarieLynneBlock/arcanum-artifex · 109 tokens

umap-learn

UMAP dimensionality reduction. Fast nonlinear manifold learning for 2D/3D visualisation, clustering preprocessing (HDBSCAN), supervised/parametric UMAP, for high-dimensional data.

MarieLynneBlock/arcanum-artifex · 44 tokens