/ 目錄 / 演練場 / Mastering LangGraph Agent Skill
● 社群 SpillwaveSolutions ⚡ 即開即用

Mastering LangGraph Agent Skill

作者 SpillwaveSolutions · SpillwaveSolutions/mastering-langgraph-agent-skill

LangGraph流暢的點擊—八種生產模式( ReAct、路由、檢查點、HITL、主管、SWARM、部署、調試) + 150多個文檔鏈接,作為Claude技能。

mastering-langgraph-agent-skill將Python中LangGraph的九個參考指南打包成與Claude相容的技能:使用代理、條件路由管道、檢查指標支援的記憶體、人機迴圈中斷、主管和羣組多代理模式、Docker/LangGraph平臺部署、時間旅行調試和LangSmith追蹤。透過skilz安裝;可與Claude Code和其他Agent Skill Standard用戶端搭配使用。

為什麼要用

核心特性

即時演示

實際使用效果

mastering-langgraph-skill.replay ▶ 就緒
0/0

安裝

選擇你的客戶端

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "mastering-langgraph-skill": {
      "command": "pip",
      "args": [
        "install",
        "skilz",
        "&&",
        "skilz",
        "install",
        "-g",
        "https://github.com/SpillwaveSolutions/mastering-langgraph-agent-skill"
      ],
      "_inferred": false
    }
  }
}

開啟 Claude Desktop → Settings → Developer → Edit Config。儲存後重啟應用。

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "mastering-langgraph-skill": {
      "command": "pip",
      "args": [
        "install",
        "skilz",
        "&&",
        "skilz",
        "install",
        "-g",
        "https://github.com/SpillwaveSolutions/mastering-langgraph-agent-skill"
      ],
      "_inferred": false
    }
  }
}

Cursor 使用與 Claude Desktop 相同的 mcpServers 格式。專案級設定優先於全域。

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "mastering-langgraph-skill": {
      "command": "pip",
      "args": [
        "install",
        "skilz",
        "&&",
        "skilz",
        "install",
        "-g",
        "https://github.com/SpillwaveSolutions/mastering-langgraph-agent-skill"
      ],
      "_inferred": false
    }
  }
}

點擊 Cline 側欄中的 MCP Servers 圖示,然後選 "Edit Configuration"。

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "mastering-langgraph-skill": {
      "command": "pip",
      "args": [
        "install",
        "skilz",
        "&&",
        "skilz",
        "install",
        "-g",
        "https://github.com/SpillwaveSolutions/mastering-langgraph-agent-skill"
      ],
      "_inferred": false
    }
  }
}

格式與 Claude Desktop 相同。重啟 Windsurf 生效。

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "mastering-langgraph-skill",
      "command": "pip",
      "args": [
        "install",
        "skilz",
        "&&",
        "skilz",
        "install",
        "-g",
        "https://github.com/SpillwaveSolutions/mastering-langgraph-agent-skill"
      ]
    }
  ]
}

Continue 使用伺服器物件陣列,而非映射。

~/.config/zed/settings.json
{
  "context_servers": {
    "mastering-langgraph-skill": {
      "command": {
        "path": "pip",
        "args": [
          "install",
          "skilz",
          "&&",
          "skilz",
          "install",
          "-g",
          "https://github.com/SpillwaveSolutions/mastering-langgraph-agent-skill"
        ]
      }
    }
  }
}

加入 context_servers。Zed 儲存後熱重載。

claude mcp add mastering-langgraph-skill -- pip install skilz && skilz install -g https://github.com/SpillwaveSolutions/mastering-langgraph-agent-skill

一行命令搞定。用 claude mcp list 驗證,claude mcp remove 移除。

使用場景

實戰用法: Mastering LangGraph Agent Skill

使用ReAct客服人員的工具搭建檢查指標的腳手架

👤 Python開發人員啟動新的LangGraph專案 ⏱ ~45 min intermediate

何時使用: 您需要一個可用的工具迴圈代理作為起點,而不是另一個空白筆記本。

前置條件
  • Python 3.10 +和pip — pyenv或system Python
  • LangGraph + LangChain核心 — pip install langgraph langchain-core
步驟
  1. 安裝技能
    pip install skilz & & skilz install -g https://github.com/SpillwaveSolutions/mastering-langgraph-agent-skill✓ 已複製
    → 技能出現在~/.claude/skills/
  2. 索取ReAct腳手架
    使用兩個工具(搜尋+計算器)和MemorySaver檢查指標將ReAct客服人員腳手架架起來。✓ 已複製
    → 具有圖形、工具和檢查指標的可執行程式碼有線
  3. 跑步並穿過
    Run it with thread_id='thread-1' and show me the state at each step.✓ 已複製
    → State snapshots per step confirm the loop is working

結果: 您可以延伸的運行代理,而不是從零開始。

注意事項
  • Using InMemorySaver in production — Swap to the Postgres checkpointer before shipping; the guide covers the swap
搭配使用: fastmcp

Build a multi-step pipeline with conditional routing

👤 Backend engineers replacing ad-hoc chains with typed graphs ⏱ ~60 min intermediate

何時使用: Your workflow has branches (classify → route → specialize → finalize) and you want explicit state.

步驟
  1. Describe the branches
    Draft a LangGraph for: classify intent → route to summarizer or Q&A → finalize with citations.✓ 已複製
    → Graph diagram and code; explicit conditional edges
  2. Add checkpointing
    Add a checkpointer so resumes work mid-flow.✓ 已複製
    → State persisted between invocations

結果: A typed pipeline that's testable and resumable.

注意事項
  • Treating every node as an LLM call — Non-LLM pure Python nodes are often clearer and cheaper
搭配使用: langsmith-fetch-skill

Pause for human approval before a risky action

👤 Teams running agents against production systems ⏱ ~30 min intermediate

何時使用: The agent is about to spend money, email someone, or mutate state — you want a human checkpoint.

步驟
  1. Add an interrupt node
    Insert a human approval interrupt before the 'send_email' node; show how to resume.✓ 已複製
    → interrupt_before wiring + clear resume API
  2. Test approve + reject paths
    Write a script that tests both approval and rejection flows.✓ 已複製
    → Two paths exercised cleanly

結果: Humans gate the risky step; approved actions run to completion.

注意事項
  • Forgetting to persist state across the interrupt — Interrupts need a checkpointer; without it, the pause is useless
搭配使用: linear

Design a supervisor-or-swarm multi-agent setup

👤 Architects evaluating multi-agent patterns ⏱ ~90 min advanced

何時使用: A single agent is getting confused or too big; you're considering orchestration patterns.

步驟
  1. Walk through the tradeoffs
    Compare supervisor vs swarm for a researcher + coder + reviewer team.✓ 已複製
    → Clear pros/cons; when to pick each
  2. Pick and scaffold
    Scaffold the chosen pattern with the three agents.✓ 已複製
    → Runnable code with routing/handoff logic

結果: A principled choice of multi-agent pattern with running code.

注意事項
  • Adopting multi-agent before a single agent has been debugged — Start single-agent; split only when you hit concrete limits

Take a LangGraph from laptop to production

👤 Engineers shipping agent features ⏱ ~60 min advanced

何時使用: You have a working graph and need a real deploy plan.

步驟
  1. Pick the deploy target
    Compare Docker + LangGraph Platform vs self-hosted; recommend for small team.✓ 已複製
    → Concrete recommendation with cost/ops tradeoffs
  2. Wire tracing
    Add LangSmith tracing with project scoping.✓ 已複製
    → Traces visible in LangSmith with proper project name

結果: A deploy path you can show a platform team.

搭配使用: cloud-run

組合

與其他 MCP 搭配,撬動十倍槓桿

mastering-langgraph-skill + fastmcp

Wrap your LangGraph as an MCP server for other agents to consume

Expose the current graph as an MCP tool via fastmcp.✓ 已複製
mastering-langgraph-skill + langsmith-fetch-skill

Fetch traces for debugging and feed them back into the conversation

Get the last 10 traces for project 'prod-agent' and surface failure patterns.✓ 已複製
mastering-langgraph-skill + server-mas-sequential-thinking

Combine multi-agent sequential thinking patterns with LangGraph orchestration

Map your supervisor graph onto a sequential-thinking MAS pattern.✓ 已複製

工具

此 MCP 暴露的能力

工具輸入參數何時呼叫成本
skill: mastering-langgraph natural-language LangGraph questions and tasks Whenever you're building or debugging a LangGraph 0

成本與限制

運行它的成本

API 配額
None for the skill; your LLM provider charges for underlying calls
每次呼叫 Token 數
Depends on the sections the skill loads — narrow questions keep it small
費用
Free skill; provider costs (OpenAI/Anthropic/etc.) apply
提示
Ask targeted 'how do I <X> in LangGraph' questions. Broad 'teach me LangGraph' pulls in huge reference sections.

安全

權限、密鑰、影響範圍

憑證儲存: None in the skill; your own LLM and tool credentials stay in your env/secret manager
資料出站: Skill content is local. Any egress comes from the code you run (tool calls, LangSmith).

故障排查

常見錯誤與修復

skilz install fails with 'repo not found'

Use the -g flag with the full GitHub URL, not the SkillzWave short path, if the marketplace isn't configured.

驗證: pip show skilz && skilz list -g
Graph code runs locally but breaks on deploy

Usually checkpointer choice — InMemorySaver won't survive a restart. Switch to Postgres or Redis per the deploy section.

驗證: Inspect the checkpointer type in your code
LangSmith traces missing

Set LANGSMITH_API_KEY and LANGCHAIN_PROJECT before invoking the graph.

驗證: echo $LANGSMITH_API_KEY | head -c 5

替代方案

Mastering LangGraph Agent Skill 對比其他方案

替代方案何時用它替代權衡
mcp-agentYou want MCP-native agent patterns rather than LangGraphDifferent framework, different ecosystem
server-mas-sequential-thinkingYou want a ready multi-agent sequential thinking serverLess flexible than building in LangGraph
agent-langchainjsYou're on JS/TS, not PythonDifferent language target

更多

資源

📖 閱讀 GitHub 上的官方 README

🐙 查看未解決的 issue

🔍 瀏覽全部 400+ MCP 伺服器和 Skills