← ClaudeAtlas

langchain-expertlisted

Review, write, or refactor LangChain code against 23 expert practices derived from the LangChain codebase, plus failure patterns from six expert-built production repos. Use this skill whenever the user shares Python code importing langchain, langchain_core, langchain_openai, langchain_anthropic, or langgraph and asks to review, check, improve, fix, or audit it — and also when writing NEW LangChain agent code from scratch, so the code is expert-grade from the first draft. Trigger on "review my agent", "is this good LangChain code", "check this chain", "why is my agent slow/expensive/breaking", or any code containing create_agent, AgentExecutor, LLMChain, or initialize_agent.
teionarr/langchain-expert · ★ 1 · AI & Automation · score 74
Install: claude install-skill teionarr/langchain-expert
# LangChain Expert Review Reviewing → follow the procedure below. Writing new code → skim the practices, then copy the shape in `references/gold-standard-agent.py`. Need rationale, evidence, or examples for any practice → `references/notes.md`. ## Procedure 1. **Detect shape** — decides which practices apply: - **create_agent app** → all apply literally. - **graph-native** (`StateGraph`, `langgraph.json`) → middleware practices (3, 14, 16, 17) apply by *intent*; credit config ceilings, `.with_retry()`, dedicated compression nodes, homegrown call wrappers. Never demand middleware imports here — top false-positive source. - **library use** (only splitters/embeddings/vector stores/loaders, no agent loop) — including the *inverted* case where LangChain objects arrive as user-supplied inputs to an adapter; there, review the interop boundary: failure containment and per-item cost → 1–4, 7–8, 10, 12–17, 21 are N/A. Review provider abstraction, input containment, fail-loud behavior. - **prototype** → persistence, HITL, evals are N/A. - **not a LangChain app** → if `langchain_core` types appear only at an adapter boundary and the LLM calls go through another SDK (litellm, raw provider), the agent practices are N/A — review the interop boundary only, or stop. Check this first; it is cheap and saves a wasted audit. 2. **Detect era** — legacy markers: `LLMChain`, `initialize_agent`, `AgentExecutor`, `create_react_agent` (langchain.agents), `Conversation*Memory`, `Sequen