---
name: "langchain-expression-language-lcel"
description: "Compose declarative, streaming, and production-grade LLM chains with LCEL syntax."
metadata:
  author: "LangChain"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "write lcel pipeline langchain"
  - "compose runnable sequence"
  - "stream lcel output"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# LangChain Expression Language (LCEL) Pipelines

Builds streaming RAG and transformation pipelines using LangChain LCEL: prompt | model | parser piping, RunnablePassthrough, RunnableParallel, and automated async batching.

## When to Invoke
Invoke this skill whenever you need to:
- write lcel pipeline langchain
- compose runnable sequence
- stream lcel output

## Execution SOP & Rules
1. Pipe components using the unix-style | operator: chain = prompt | model | StrOutputParser().
2. Pass contextual variables through the pipeline using RunnablePassthrough.assign().
3. Use .stream() or .astream() to enable progressive token delivery to frontends.
4. Attach error handlers using .with_retry() to recover from transient API rate limits.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
