sraldon24/claudecodeconfigs/langgraph-patterns

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

LangChain & LangGraph core patterns and best practices.

Install

npx vskill@latest install sraldon24/claudecodeconfigs/langgraph-patterns

SKILL.md

LangGraph Core Patterns

  • Architecture: Use StateGraph for orchestration. Define explicit typed State classes using TypedDict or Pydantic.
  • Chains: NEVER use legacy Chain classes. ALWAYS use LCEL (LangChain Expression Language) with the | pipe operator.
  • Tools: Bind tools to LLMs using .bind_tools(). Use ToolNode to execute them.
  • Structured Output: Use .with_structured_output(PydanticModel) to enforce clean data extraction.
  • Debugging: Require LANGCHAIN_TRACING_V2=true and LANGCHAIN_API_KEY in .env for LangSmith.
  • Docs: If hitting API errors, defuddle official docs (python.langchain.com or langchain-ai.github.io/langgraph) before proceeding. LangChain changes rapidly.

Vibe Coding Boilerplate

Always start LangGraph agents with this robust StateGraph structure:

python
from typing import Annotated, TypedDict
from langchain_core.messages import BaseMessage
from langgraph.graph import StateGraph, START, END
from langgraph.graph.message import add_messages
from langchain_anthropic import ChatAnthropic
# 1. State Definition (Message reducer is critical)
class AgentState(TypedDict):
messages: Annotated[list[BaseMessage], add_messages]
# Add custom state variables here (e.g., extracted_data: str)
# 2. Node Definitions
def agent_node(state: AgentState):
llm = ChatAnthropic(model="claude-3-5-sonnet-latest")
# Bind tools here if needed: llm = llm.bind_tools(tools)
response = llm.invoke(state["messages"])
# Return MUST be a dict updating the state
return {"messages": [response]}
# 3. Conditional Edges (Routing)
def should_continue(state: AgentState) -> str:
last_msg = state["messages"][-1]
if last_msg.tool_calls:
return "tools"
return END
# 4. Graph Construction
builder = StateGraph(AgentState)
builder.add_node("agent", agent_node)
# builder.add_node("tools", ToolNode(tools)) # If using tools
builder.add_edge(START, "agent")
# builder.add_conditional_edges("agent", should_continue, ["tools", END])
# builder.add_edge("tools", "agent")
# 5. Compilation
graph = builder.compile()
# Usage: graph.invoke({"messages": [("user", "Hello!")]})

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/sraldon24/claudecodeconfigs/langgraph-patterns/badge)](https://verified-skill.com/skills/sraldon24/claudecodeconfigs/langgraph-patterns)

Something wrong with this skill or its page? Tell us.