langgraph-state
LangGraph state management patterns. Use when designing workflow state schemas, using TypedDict vs Pydantic, implementing accumulating state with Annotated operators, or managing shared state across nodes.
npx skills add majiayu000/claude-skill-registry --skill langgraph-state --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# LangGraph State Management Design and manage state schemas for LangGraph workflows. ## When to Use - Designing workflow state schemas - Choosing TypedDict vs Pydantic - Multi-agent state accumulation - State validation and typing ## TypedDict Approach (Simple) ```python from typing import TypedDict, Annotated from operator import add class WorkflowState(TypedDict): input: str output: str agent_responses: Annotated[list[dict], add] # Accumulates metadata: dict ``` ## MessagesState Pattern (2026 Best Practice) ```python from langgraph.graph import MessagesState from langgraph.graph.message import add_messages from typing import Annotated # Option 1: Use built-in MessagesState (recommended) class AgentState(MessagesState): """Extends MessagesState with custom fields.""" user_id: str context: dict # Option 2: Define messages manually with add_messages reducer class CustomState(TypedDict): messages: Annotated[list, add_messages] # Smart append/update by ID metadata: dict ``` **Why `add_messages` matters:** - Appends new messages (doesn't overwrite) - Updates existing messages by ID - Handles message deduplication automatically > **Note**: `MessageGraph` is deprecated in LangGraph v1.0
- When to Use
- TypedDict Approach (Simple)
- MessagesState Pattern (2026 Best Practice)
- Pydantic Approach (Validation)
- Accumulating State Pattern
- Custom Reducers
- State Immutability
- Key Decisions
- Common Mistakes
- Related Skills
- Capability Details
- state-definition
- state-channels
- state-reducers
What does the langgraph-state skill do?
LangGraph state management patterns. Use when designing workflow state schemas, using TypedDict vs Pydantic, implementing accumulating state with Annotated operators, or managing shared state across nodes.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill langgraph-state --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
