Agent skill · software engineering · jeremylongshore

langchain-upgrade-migration

Migrate a LangChain 0.3.x Python codebase to LangChain 1.0 / LangGraph\

Why this skill is useful

Adds a detailed migration playbook with executable scripts and codemod patterns for upgrading LangChain from 0.3.x to 1.0, which the AI wouldn't generate on its own.

What it needs

Requires python installed locally. About 6k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.

What this skill does

LangChain 1.0 Upgrade Migration (Python) Overview The first deploy after pip install -U langchain crashes on import with: Fix the import, restart, and the next error lands: LangChain 1.0 removed four entire public-API surfaces in one release: Provider imports under langchain.chatmodels / langchain.llms (pain code P38). The LLMChain family under langchain.chains (P39). ConversationBufferMemory and siblings under langchain.memory (P40). initializeagent under langchain.agents (P41). Anything that inspected intermediatesteps also breaks because the tuple shape changed from (AgentAction, observation) to (ToolCall, observation) (P42). This skill walks a reversible, phased migration: 1. A pre-flight grep audit. 2. A pinned package upgrade (including the langchain-anthropic 1.0 peer-pin against anthropic >= 0.40, P66). 3. Codemod patterns for the seven removed APIs. 4. A rollout playbook with shadow traffic and a sub-five-minute rollback. It covers 7 named breaking changes and typically touches 10–100 files in a mid-sized service. The fix for the error above: See codemod-patterns.md for the other six patterns. Prerequisites Python 3.10+ (LangChain 1.0 dropped 3.8/3.9). A working test suite for the service being migrated (the playbook runs pytest -W error::DeprecationWarning at every phase). Git on a clean working tree — the migration uses per-module commits so rollback is per-commit. Access to staging traffic or a request-mirror. Phase 4 of the playbook needs real-shape traffic. If conversations are persisted (Redis / Postgres / DynamoDB), a snapshot of the chat-history store before Phase 2. The LangGraph checkpointer uses a new schema and a naive rollback is data-lossy. Instructions Step 1 — Pre-flight grep audit Inventory every 0.3 usage before touching a requirements.txt. Each grep below maps to one pain code and one codemod pattern. Pipe the full set into langchain-0.3-hits.txt — that file is the migration work list. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills jeremylongshore/langchain-upgrade-migration--9cedbd

View the source on GitHub

Browse the @skills marketplace