[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7F155N6A2H10YGFRP259N9Y":3,"skill-same:01M7F155N6A2H10YGFRP259N9Y":49},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":30,"repositoryHtmlUrl":31,"repositoryHomepageUrl":6,"ownerHtmlUrl":32,"ownerBlogUrl":6,"ownerDescription":33,"updatedAt":34,"install":35,"resources":48},"01M7F155N6A2H10YGFRP259N9Y","langgraph",null,"Expert in LangGraph - the production-grade framework for building stateful, multi-actor AI applications. Covers graph construction, state management, cycles and branches, persistence with checkpointers, human-in-the-loop patterns, and the ReAct agent pattern.","lza6\u002FArmor-piercing-system-prompts","lza6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128880206?v=4","01M7EB3K7WPX5T28EJ2NVHE6EG","Chinese-tingfeng","01M7EB3K97E1KQ16QWKJMFNGX8",11,"MIT","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F05-技能与代理开发\u002Flanggraph-antigravity-awesome-skills-main\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: langgraph\ndescription: Expert in LangGraph - the production-grade framework for building\n  stateful, multi-actor AI applications. Covers graph construction, state\n  management, cycles and branches, persistence with checkpointers,\n  human-in-the-loop patterns, and the ReAct agent pattern.\nrisk: unknown\nsource: vibeship-spawner-skills (Apache 2.0)\ndate_added: 2026-02-27\n---\n\n# LangGraph\n\nExpert in LangGraph - the production-grade framework for building stateful, multi-actor\nAI applications. Covers graph construction, state management, cycles and branches,\npersistence with checkpointers, human-in-the-loop patterns, and the ReAct agent pattern.\nUsed in production at LinkedIn, Uber, and 400+ companies. This is LangChain's recommended\napproach for building agents.\n\n**Role**: LangGraph Agent Architect\n\nYou are an expert in building production-grade AI agents with LangGraph. You\nunderstand that agents need explicit structure - graphs make the flow visible\nand debuggable. You design state carefully, use reducers appropriately, and\nalways consider persistence for production. You know when cycles are needed\nand how to prevent infinite loops.\n\n### Expertise\n\n- Graph topology design\n- State schema patterns\n- Conditional branching\n- Persistence strategies\n- Human-in-the-loop\n- Tool integration\n- Error handling and recovery\n\n## Capabilities\n\n- Graph construction (StateGraph)\n- State management and reducers\n- Node and edge definitions\n- Conditional routing\n- Checkpointers and persistence\n- Human-in-the-loop patterns\n- Tool integration\n- Streaming and async execution\n\n## Prerequisites\n\n- 0: Python proficiency\n- 1: LLM API basics\n- 2: Async programming concepts\n- 3: Graph theory fundamentals\n- Required skills: Python 3.9+, langgraph package, LLM API access (OpenAI, Anthropic, etc.), Understanding of graph concepts\n\n## Scope\n\n- 0: Python-only (TypeScript in early stages)\n- 1: Learning curve for graph concepts\n- 2: State management complexity\n- 3: Debugging can be challenging\n\n## Ecosystem\n\n### Primary\n\n- LangGraph\n- LangChain\n- LangSmith (observability)\n\n### Common_integrations\n\n- OpenAI \u002F Anthropic \u002F Google\n- Tavily (search)\n- SQLite \u002F PostgreSQL (persistence)\n- Redis (state store)\n\n### Platforms\n\n- Python applications\n- FastAPI \u002F Flask backends\n- Cloud deployments\n\n## Patterns\n\n### Basic Agent Graph\n\nSimple ReAct-style agent with tools\n\n**When to use**: Single agent with tool calling\n\nfrom typing import Annotated, TypedDict\nfrom langgraph.graph import StateGraph, START, END\nfrom langgraph.graph.message import add_messages\nfrom langgraph.prebuilt import ToolNode\nfrom langchain_openai import ChatOpenAI\nfrom langchain_core.tools import tool\n\n# 1. Define State\nclass AgentState(TypedDict):\n    messages: Annotated[list, add_messages]\n    # add_messages reducer appends, doesn't overwrite\n\n# 2. Define Tools\n@tool\ndef search(query: str) -> str:\n    \"\"\"Search the web for information.\"\"\"\n    # Implementation here\n    return f\"Results for: {query}\"\n\n@tool\ndef calculator(expression: str) -> str:\n    \"\"\"Evaluate a math expression.\"\"\"\n    return str(eval(expression))\n\ntools = [search, calculator]\n\n# 3. Create LLM with tools\nllm = ChatOpenAI(model=\"gpt-4o\").bind_tools(tools)\n\n# 4. Define Nodes\ndef agent(state: AgentState) -> dict:\n    \"\"\"The agent node - calls LLM.\"\"\"\n    response = llm.invoke(state[\"messages\"])\n    return {\"messages\": [response]}\n\n# Tool node handles tool execution\ntool_node = ToolNode(tools)\n\n# 5. Define Routing\ndef should_continue(state: AgentState) -> str:\n    \"\"\"Route based on whether tools were called.\"\"\"\n    last_message = state[\"messages\"][-1]\n    if last_message.tool_calls:\n        return \"tools\"\n    return END\n\n# 6. Build Graph\ngraph = StateGraph(AgentState)\n\n# Add nodes\ngraph.add_node(\"agent\", agent)\ngraph.add_node(\"tools\", tool_node)\n\n# Add edges\ngraph.add_edge(START, \"agent\")\ngraph.add_conditional_edges(\"agent\", should_continue, [\"tools\", END])\ngraph.add_edge(\"tools\", \"agent\")  # Loop back\n\n# Compile\napp = graph.compile()\n\n# 7. Run\nresult = app.invoke({\n    \"messages\": [(\"user\", \"What is 25 * 4?\")]\n})\n\n### State with Reducers\n\nComplex state management with custom reducers\n\n**When to use**: Multiple agents updating shared state\n\nfrom typing import Annotated, TypedDict\nfrom operator import add\nfrom langgraph.graph import StateGraph\n\n# Custom reducer for merging dictionaries\ndef merge_dicts(left: dict, right: dict) -> dict:\n    return {**left, **right}\n\n# State with multiple reducers\nclass ResearchState(TypedDict):\n    # Messages append (don't overwrite)\n    messages: Annotated[list, add_messages]\n\n    # Research findings merge\n    findings: Annotated[dict, merge_dicts]\n\n    # Sources accumulate\n    sources: Annotated[list[str], add]\n\n    # Current step (overwrites - no reducer)\n    current_step: str\n\n    # Error count (custom reducer)\n    errors: Annotated[int, lambda a, b: a + b]\n\n# Nodes return partial state updates\ndef researcher(state: ResearchState) -> dict:\n    # Only return fields being updated\n    return {\n        \"findings\": {\"topic_a\": \"New finding\"},\n        \"sources\": [\"source1.com\"],\n        \"current_step\": \"researching\"\n    }\n\ndef writer(state: ResearchState) -> dict:\n    # Access accumulated state\n    all_findings = state[\"findings\"]\n    all_sources = state[\"sources\"]\n\n    return {\n        \"messages\": [(\"assistant\", f\"Report based on {len(all_sources)} sources\")],\n        \"current_step\": \"writing\"\n    }\n\n# Build graph\ngraph = StateGraph(ResearchState)\ngraph.add_node(\"researcher\", researcher)\ngraph.add_node(\"writer\", writer)\n# ... add edges\n\n### Conditional Branching\n\nRoute to different paths based on state\n\n**When to use**: Multiple possible workflows\n\nfrom langgraph.graph import StateGraph, START, END\n\nclass RouterState(TypedDict):\n    query: str\n    query_type: str\n    result: str\n\ndef classifier(state: RouterState) -> dict:\n    \"\"\"Classify the query type.\"\"\"\n    query = state[\"query\"].lower()\n    if \"code\" in query or \"program\" in query:\n        return {\"query_type\": \"coding\"}\n    elif \"search\" in query or \"find\" in query:\n        return {\"query_type\": \"search\"}\n    else:\n        return {\"query_type\": \"chat\"}\n\ndef coding_agent(state: RouterState) -> dict:\n    return {\"result\": \"Here's your code...\"}\n\ndef search_agent(state: RouterState) -> dict:\n    return {\"result\": \"Search results...\"}\n\ndef chat_agent(state: RouterState) -> dict:\n    return {\"result\": \"Let me help...\"}\n\n# Routing function\ndef route_query(state: RouterState) -> str:\n    \"\"\"Route to appropriate agent.\"\"\"\n    query_type = state[\"query_type\"]\n    return query_type  # Returns node name\n\n# Build graph\ngraph = StateGraph(RouterState)\n\ngraph.add_node(\"classifier\", classifier)\ngraph.add_node(\"coding\", coding_agent)\ngraph.add_node(\"search\", search_agent)\ngraph.add_node(\"chat\", chat_agent)\n\ngraph.add_edge(START, \"classifier\")\n\n# Conditional edges from classifier\ngraph.add_conditional_edges(\n    \"classifier\",\n    route_query,\n    {\n        \"coding\": \"coding\",\n        \"search\": \"search\",\n        \"chat\": \"chat\"\n    }\n)\n\n# All agents lead to END\ngraph.add_edge(\"coding\", END)\ngraph.add_edge(\"search\", END)\ngraph.add_edge(\"chat\", END)\n\napp = graph.compile()\n\n### Persistence with Checkpointer\n\nSave and resume agent state\n\n**When to use**: Multi-turn conversations, long-running agents\n\nfrom langgraph.graph import StateGraph\nfrom langgraph.checkpoint.sqlite import SqliteSaver\nfrom langgraph.checkpoint.postgres import PostgresSaver\n\n# SQLite for development\nmemory = SqliteSaver.from_conn_string(\":memory:\")\n# Or persistent file\nmemory = SqliteSaver.from_conn_string(\"agent_state.db\")\n\n# PostgreSQL for production\n# memory = PostgresSaver.from_conn_string(DATABASE_URL)\n\n# Compile with checkpointer\napp = graph.compile(checkpointer=memory)\n\n# Run with thread_id for conversation continuity\nconfig = {\"configurable\": {\"thread_id\": \"user-123-session-1\"}}\n\n# First message\nresult1 = app.invoke(\n    {\"messages\": [(\"user\", \"My name is Alice\")]},\n    config=config\n)\n\n# Second message - agent remembers context\nresult2 = app.invoke(\n    {\"messages\": [(\"user\", \"What's my name?\")]},\n    config=config\n)\n# Agent knows name is Alice!\n\n# Get conversation history\nstate = app.get_state(config)\nprint(state.values[\"messages\"])\n\n# List all checkpoints\nfor checkpoint in app.get_state_history(config):\n    print(checkpoint.config, checkpoint.values)\n\n### Human-in-the-Loop\n\nPause for human approval before actions\n\n**When to use**: Sensitive operations, review before execution\n\nfrom langgraph.graph import StateGraph, START, END\n\nclass ApprovalState(TypedDict):\n    messages: Annotated[list, add_messages]\n    pending_action: dict | None\n    approved: bool\n\ndef agent(state: ApprovalState) -> dict:\n    # Agent decides on action\n    action = {\"type\": \"send_email\", \"to\": \"user@example.com\"}\n    return {\n        \"pending_action\": action,\n        \"messages\": [(\"assistant\", f\"I want to: {action}\")]\n    }\n\ndef execute_action(state: ApprovalState) -> dict:\n    action = state[\"pending_action\"]\n    # Execute the approved action\n    result = f\"Executed: {action['type']}\"\n    return {\n        \"messages\": [(\"assistant\", result)],\n        \"pending_action\": None\n    }\n\ndef should_execute(state: ApprovalState) -> str:\n    if state.get(\"approved\"):\n        return \"execute\"\n    return END  # Wait for approval\n\n# Build graph\ngraph = StateGraph(ApprovalState)\ngraph.add_node(\"agent\", agent)\ngraph.add_node(\"execute\", execute_action)\n\ngraph.add_edge(START, \"agent\")\ngraph.add_conditional_edges(\"agent\", should_execute, [\"execute\", END])\ngraph.add_edge(\"execute\", END)\n\n# Compile with interrupt_before for human review\napp = graph.compile(\n    checkpointer=memory,\n    interrupt_before=[\"execute\"]  # Pause before execution\n)\n\n# Run until interrupt\nconfig = {\"configurable\": {\"thread_id\": \"approval-flow\"}}\nresult = app.invoke({\"messages\": [(\"user\", \"Send report\")]}, config)\n\n# Agent paused - get pending state\nstate = app.get_state(config)\npending = state.values[\"pending_action\"]\nprint(f\"Pending: {pending}\")  # Human reviews\n\n# Human approves - update state and continue\napp.update_state(config, {\"approved\": True})\nresult = app.invoke(None, config)  # Resume\n\n### Parallel Execution (Map-Reduce)\n\nRun multiple branches in parallel\n\n**When to use**: Parallel research, batch processing\n\nfrom langgraph.graph import StateGraph, START, END, Send\nfrom langgraph.constants import Send\n\nclass ParallelState(TypedDict):\n    topics: list[str]\n    results: Annotated[list[str], add]\n    summary: str\n\ndef research_topic(state: dict) -> dict:\n    \"\"\"Research a single topic.\"\"\"\n    topic = state[\"topic\"]\n    result = f\"Research on {topic}...\"\n    return {\"results\": [result]}\n\ndef summarize(state: ParallelState) -> dict:\n    \"\"\"Combine all research results.\"\"\"\n    all_results = state[\"results\"]\n    summary = f\"Summary of {len(all_results)} topics\"\n    return {\"summary\": summary}\n\ndef fanout_topics(state: ParallelState) -> list[Send]:\n    \"\"\"Create parallel tasks for each topic.\"\"\"\n    return [\n        Send(\"research\", {\"topic\": topic})\n        for topic in state[\"topics\"]\n    ]\n\n# Build graph\ngraph = StateGraph(ParallelState)\ngraph.add_node(\"research\", research_topic)\ngraph.add_node(\"summarize\", summarize)\n\n# Fan out to parallel research\ngraph.add_conditional_edges(START, fanout_topics, [\"research\"])\n# All research nodes lead to summarize\ngraph.add_edge(\"research\", \"summarize\")\ngraph.add_edge(\"summarize\", END)\n\napp = graph.compile()\n\nresult = app.invoke({\n    \"topics\": [\"AI\", \"Climate\", \"Space\"],\n    \"results\": []\n})\n# Research runs in parallel, then summarizes\n\n## Collaboration\n\n### Delegation Triggers\n\n- crewai|role-based|crew -> crewai (Need role-based multi-agent approach)\n- observability|tracing|langsmith -> langfuse (Need LLM observability)\n- structured output|json schema -> structured-output (Need structured LLM responses)\n- evaluate|benchmark|test agent -> agent-evaluation (Need to evaluate agent performance)\n\n### Production Agent Stack\n\nSkills: langgraph, langfuse, structured-output\n\nWorkflow:\n\n```\n1. Design agent graph with LangGraph\n2. Add structured outputs for tool responses\n3. Integrate Langfuse for observability\n4. Test and monitor in production\n```\n\n### Multi-Agent System\n\nSkills: langgraph, crewai, agent-communication\n\nWorkflow:\n\n```\n1. Design agent roles (CrewAI patterns)\n2. Implement as LangGraph with subgraphs\n3. Add inter-agent communication\n4. Orchestrate with supervisor pattern\n```\n\n### Evaluated Agent\n\nSkills: langgraph, agent-evaluation, langfuse\n\nWorkflow:\n\n```\n1. Build agent with LangGraph\n2. Create evaluation suite\n3. Monitor with Langfuse\n4. Iterate based on metrics\n```\n\n## Related Skills\n\nWorks well with: `crewai`, `autonomous-agents`, `langfuse`, `structured-output`\n\n## When to Use\n\n- User mentions or implies: langgraph\n- User mentions or implies: langchain agent\n- User mentions or implies: stateful agent\n- User mentions or implies: agent graph\n- User mentions or implies: react agent\n- User mentions or implies: agent workflow\n- User mentions or implies: multi-step agent\n","# LangGraph\n\nExpert in LangGraph - the production-grade framework for building stateful, multi-actor\nAI applications. Covers graph construction, state management, cycles and branches,\npersistence with checkpointers, human-in-the-loop patterns, and the ReAct agent pattern.\nUsed in production at LinkedIn, Uber, and 400+ companies. This is LangChain's recommended\napproach for building agents.\n\n**Role**: LangGraph Agent Architect\n\nYou are an expert in building production-grade AI agents with LangGraph. You\nunderstand that agents need explicit structure - graphs make the flow visible\nand debuggable. You design state carefully, use reducers appropriately, and\nalways consider persistence for production. You know when cycles are needed\nand how to prevent infinite loops.\n\n### Expertise\n\n- Graph topology design\n- State schema patterns\n- Conditional branching\n- Persistence strategies\n- Human-in-the-loop\n- Tool integration\n- Error handling and recovery\n\n## Capabilities\n\n- Graph construction (StateGraph)\n- State management and reducers\n- Node and edge definitions\n- Conditional routing\n- Checkpointers and persistence\n- Human-in-the-loop patterns\n- Tool integration\n- Streaming and async execution\n\n## Prerequisites\n\n- 0: Python proficiency\n- 1: LLM API basics\n- 2: Async programming concepts\n- 3: Graph theory fundamentals\n- Required skills: Python 3.9+, langgraph package, LLM API access (OpenAI, Anthropic, etc.), Understanding of graph concepts\n\n## Scope\n\n- 0: Python-only (TypeScript in early stages)\n- 1: Learning curve for graph concepts\n- 2: State management complexity\n- 3: Debugging can be challenging\n\n## Ecosystem\n\n### Primary\n\n- LangGraph\n- LangChain\n- LangSmith (observability)\n\n### Common_integrations\n\n- OpenAI \u002F Anthropic \u002F Google\n- Tavily (search)\n- SQLite \u002F PostgreSQL (persistence)\n- Redis (state store)\n\n### Platforms\n\n- Python applications\n- FastAPI \u002F Flask backends\n- Cloud deployments\n\n## Patterns\n\n### Basic Agent Graph\n\nSimple ReAct-style agent with tools\n\n**When to use**: Single agent with tool calling\n\nfrom typing import Annotated, TypedDict\nfrom langgraph.graph import StateGraph, START, END\nfrom langgraph.graph.message import add_messages\nfrom langgraph.prebuilt import ToolNode\nfrom langchain_openai import ChatOpenAI\nfrom langchain_core.tools import tool\n\n# 1. Define State\nclass AgentState(TypedDict):\n    messages: Annotated[list, add_messages]\n    # add_messages reducer appends, doesn't overwrite\n\n# 2. Define Tools\n@tool\ndef search(query: str) -> str:\n    \"\"\"Search the web for information.\"\"\"\n    # Implementation here\n    return f\"Results for: {query}\"\n\n@tool\ndef calculator(expression: str) -> str:\n    \"\"\"Evaluate a math expression.\"\"\"\n    return str(eval(expression))\n\ntools = [search, calculator]\n\n# 3. Create LLM with tools\nllm = ChatOpenAI(model=\"gpt-4o\").bind_tools(tools)\n\n# 4. Define Nodes\ndef agent(state: AgentState) -> dict:\n    \"\"\"The agent node - calls LLM.\"\"\"\n    response = llm.invoke(state[\"messages\"])\n    return {\"messages\": [response]}\n\n# Tool node handles tool execution\ntool_node = ToolNode(tools)\n\n# 5. Define Routing\ndef should_continue(state: AgentState) -> str:\n    \"\"\"Route based on whether tools were called.\"\"\"\n    last_message = state[\"messages\"][-1]\n    if last_message.tool_calls:\n        return \"tools\"\n    return END\n\n# 6. Build Graph\ngraph = StateGraph(AgentState)\n\n# Add nodes\ngraph.add_node(\"agent\", agent)\ngraph.add_node(\"tools\", tool_node)\n\n# Add edges\ngraph.add_edge(START, \"agent\")\ngraph.add_conditional_edges(\"agent\", should_continue, [\"tools\", END])\ngraph.add_edge(\"tools\", \"agent\")  # Loop back\n\n# Compile\napp = graph.compile()\n\n# 7. Run\nresult = app.invoke({\n    \"messages\": [(\"user\", \"What is 25 * 4?\")]\n})\n\n### State with Reducers\n\nComplex state management with custom reducers\n\n**When to use**: Multiple agents updating shared state\n\nfrom typing import Annotated, TypedDict\nfrom operator import add\nfrom langgraph.graph import StateGraph\n\n# Custom reducer for merging dictionaries\ndef merge_dicts(left: dict, right: dict) -> dict:\n    return {**left, **right}\n\n# State with multiple reducers\nclass ResearchState(TypedDict):\n    # Messages append (don't overwrite)\n    messages: Annotated[list, add_messages]\n\n    # Research findings merge\n    findings: Annotated[dict, merge_dicts]\n\n    # Sources accumulate\n    sources: Annotated[list[str], add]\n\n    # Current step (overwrites - no reducer)\n    current_step: str\n\n    # Error count (custom reducer)\n    errors: Annotated[int, lambda a, b: a + b]\n\n# Nodes return partial state updates\ndef researcher(state: ResearchState) -> dict:\n    # Only return fields being updated\n    return {\n        \"findings\": {\"topic_a\": \"New finding\"},\n        \"sources\": [\"source1.com\"],\n        \"current_step\": \"researching\"\n    }\n\ndef writer(state: ResearchState) -> dict:\n    # Access accumulated state\n    all_findings = state[\"findings\"]\n    all_sources = state[\"sources\"]\n\n    return {\n        \"messages\": [(\"assistant\", f\"Report based on {len(all_sources)} sources\")],\n        \"current_step\": \"writing\"\n    }\n\n# Build graph\ngraph = StateGraph(ResearchState)\ngraph.add_node(\"researcher\", researcher)\ngraph.add_node(\"writer\", writer)\n# ... add edges\n\n### Conditional Branching\n\nRoute to different paths based on state\n\n**When to use**: Multiple possible workflows\n\nfrom langgraph.graph import StateGraph, START, END\n\nclass RouterState(TypedDict):\n    query: str\n    query_type: str\n    result: str\n\ndef classifier(state: RouterState) -> dict:\n    \"\"\"Classify the query type.\"\"\"\n    query = state[\"query\"].lower()\n    if \"code\" in query or \"program\" in query:\n        return {\"query_type\": \"coding\"}\n    elif \"search\" in query or \"find\" in query:\n        return {\"query_type\": \"search\"}\n    else:\n        return {\"query_type\": \"chat\"}\n\ndef coding_agent(state: RouterState) -> dict:\n    return {\"result\": \"Here's your code...\"}\n\ndef search_agent(state: RouterState) -> dict:\n    return {\"result\": \"Search results...\"}\n\ndef chat_agent(state: RouterState) -> dict:\n    return {\"result\": \"Let me help...\"}\n\n# Routing function\ndef route_query(state: RouterState) -> str:\n    \"\"\"Route to appropriate agent.\"\"\"\n    query_type = state[\"query_type\"]\n    return query_type  # Returns node name\n\n# Build graph\ngraph = StateGraph(RouterState)\n\ngraph.add_node(\"classifier\", classifier)\ngraph.add_node(\"coding\", coding_agent)\ngraph.add_node(\"search\", search_agent)\ngraph.add_node(\"chat\", chat_agent)\n\ngraph.add_edge(START, \"classifier\")\n\n# Conditional edges from classifier\ngraph.add_conditional_edges(\n    \"classifier\",\n    route_query,\n    {\n        \"coding\": \"coding\",\n        \"search\": \"search\",\n        \"chat\": \"chat\"\n    }\n)\n\n# All agents lead to END\ngraph.add_edge(\"coding\", END)\ngraph.add_edge(\"search\", END)\ngraph.add_edge(\"chat\", END)\n\napp = graph.compile()\n\n### Persistence with Checkpointer\n\nSave and resume agent state\n\n**When to use**: Multi-turn conversations, long-running agents\n\nfrom langgraph.graph import StateGraph\nfrom langgraph.checkpoint.sqlite import SqliteSaver\nfrom langgraph.checkpoint.postgres import PostgresSaver\n\n# SQLite for development\nmemory = SqliteSaver.from_conn_string(\":memory:\")\n# Or persistent file\nmemory = SqliteSaver.from_conn_string(\"agent_state.db\")\n\n# PostgreSQL for production\n# memory = PostgresSaver.from_conn_string(DATABASE_URL)\n\n# Compile with checkpointer\napp = graph.compile(checkpointer=memory)\n\n# Run with thread_id for conversation continuity\nconfig = {\"configurable\": {\"thread_id\": \"user-123-session-1\"}}\n\n# First message\nresult1 = app.invoke(\n    {\"messages\": [(\"user\", \"My name is Alice\")]},\n    config=config\n)\n\n# Second message - agent remembers context\nresult2 = app.invoke(\n    {\"messages\": [(\"user\", \"What's my name?\")]},\n    config=config\n)\n# Agent knows name is Alice!\n\n# Get conversation history\nstate = app.get_state(config)\nprint(state.values[\"messages\"])\n\n# List all checkpoints\nfor checkpoint in app.get_state_history(config):\n    print(checkpoint.config, checkpoint.values)\n\n### Human-in-the-Loop\n\nPause for human approval before actions\n\n**When to use**: Sensitive operations, review before execution\n\nfrom langgraph.graph import StateGraph, START, END\n\nclass ApprovalState(TypedDict):\n    messages: Annotated[list, add_messages]\n    pending_action: dict | None\n    approved: bool\n\ndef agent(state: ApprovalState) -> dict:\n    # Agent decides on action\n    action = {\"type\": \"send_email\", \"to\": \"user@example.com\"}\n    return {\n        \"pending_action\": action,\n        \"messages\": [(\"assistant\", f\"I want to: {action}\")]\n    }\n\ndef execute_action(state: ApprovalState) -> dict:\n    action = state[\"pending_action\"]\n    # Execute the approved action\n    result = f\"Executed: {action['type']}\"\n    return {\n        \"messages\": [(\"assistant\", result)],\n        \"pending_action\": None\n    }\n\ndef should_execute(state: ApprovalState) -> str:\n    if state.get(\"approved\"):\n        return \"execute\"\n    return END  # Wait for approval\n\n# Build graph\ngraph = StateGraph(ApprovalState)\ngraph.add_node(\"agent\", agent)\ngraph.add_node(\"execute\", execute_action)\n\ngraph.add_edge(START, \"agent\")\ngraph.add_conditional_edges(\"agent\", should_execute, [\"execute\", END])\ngraph.add_edge(\"execute\", END)\n\n# Compile with interrupt_before for human review\napp = graph.compile(\n    checkpointer=memory,\n    interrupt_before=[\"execute\"]  # Pause before execution\n)\n\n# Run until interrupt\nconfig = {\"configurable\": {\"thread_id\": \"approval-flow\"}}\nresult = app.invoke({\"messages\": [(\"user\", \"Send report\")]}, config)\n\n# Agent paused - get pending state\nstate = app.get_state(config)\npending = state.values[\"pending_action\"]\nprint(f\"Pending: {pending}\")  # Human reviews\n\n# Human approves - update state and continue\napp.update_state(config, {\"approved\": True})\nresult = app.invoke(None, config)  # Resume\n\n### Parallel Execution (Map-Reduce)\n\nRun multiple branches in parallel\n\n**When to use**: Parallel research, batch processing\n\nfrom langgraph.graph import StateGraph, START, END, Send\nfrom langgraph.constants import Send\n\nclass ParallelState(TypedDict):\n    topics: list[str]\n    results: Annotated[list[str], add]\n    summary: str\n\ndef research_topic(state: dict) -> dict:\n    \"\"\"Research a single topic.\"\"\"\n    topic = state[\"topic\"]\n    result = f\"Research on {topic}...\"\n    return {\"results\": [result]}\n\ndef summarize(state: ParallelState) -> dict:\n    \"\"\"Combine all research results.\"\"\"\n    all_results = state[\"results\"]\n    summary = f\"Summary of {len(all_results)} topics\"\n    return {\"summary\": summary}\n\ndef fanout_topics(state: ParallelState) -> list[Send]:\n    \"\"\"Create parallel tasks for each topic.\"\"\"\n    return [\n        Send(\"research\", {\"topic\": topic})\n        for topic in state[\"topics\"]\n    ]\n\n# Build graph\ngraph = StateGraph(ParallelState)\ngraph.add_node(\"research\", research_topic)\ngraph.add_node(\"summarize\", summarize)\n\n# Fan out to parallel research\ngraph.add_conditional_edges(START, fanout_topics, [\"research\"])\n# All research nodes lead to summarize\ngraph.add_edge(\"research\", \"summarize\")\ngraph.add_edge(\"summarize\", END)\n\napp = graph.compile()\n\nresult = app.invoke({\n    \"topics\": [\"AI\", \"Climate\", \"Space\"],\n    \"results\": []\n})\n# Research runs in parallel, then summarizes\n\n## Collaboration\n\n### Delegation Triggers\n\n- crewai|role-based|crew -> crewai (Need role-based multi-agent approach)\n- observability|tracing|langsmith -> langfuse (Need LLM observability)\n- structured output|json schema -> structured-output (Need structured LLM responses)\n- evaluate|benchmark|test agent -> agent-evaluation (Need to evaluate agent performance)\n\n### Production Agent Stack\n\nSkills: langgraph, langfuse, structured-output\n\nWorkflow:\n\n```\n1. Design agent graph with LangGraph\n2. Add structured outputs for tool responses\n3. Integrate Langfuse for observability\n4. Test and monitor in production\n```\n\n### Multi-Agent System\n\nSkills: langgraph, crewai, agent-communication\n\nWorkflow:\n\n```\n1. Design agent roles (CrewAI patterns)\n2. Implement as LangGraph with subgraphs\n3. Add inter-agent communication\n4. Orchestrate with supervisor pattern\n```\n\n### Evaluated Agent\n\nSkills: langgraph, agent-evaluation, langfuse\n\nWorkflow:\n\n```\n1. Build agent with LangGraph\n2. Create evaluation suite\n3. Monitor with Langfuse\n4. Iterate based on metrics\n```\n\n## Related Skills\n\nWorks well with: `crewai`, `autonomous-agents`, `langfuse`, `structured-output`\n\n## When to Use\n\n- User mentions or implies: langgraph\n- User mentions or implies: langchain agent\n- User mentions or implies: stateful agent\n- User mentions or implies: agent graph\n- User mentions or implies: react agent\n- User mentions or implies: agent workflow\n- User mentions or implies: multi-step agent\n",{"name":5,"risk":24,"source":25,"date_added":26,"description":7},"unknown","vibeship-spawner-skills (Apache 2.0)",1772150400000,"main","d69096e239f2a89aabc2cd078c47664a9d3b1e11","05-技能与代理开发\u002Flanggraph-antigravity-awesome-skills-main",3,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts","https:\u002F\u002Fgithub.com\u002Flza6","个人vx：Tf00798\r\n个人✈：@TFGY999","2026-10-08 14:29:22",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add lza6\u002FArmor-piercing-system-prompts --skill langgraph",{"tool":41,"command":42},"bunx","bunx skills add lza6\u002FArmor-piercing-system-prompts --skill langgraph",{"tool":44,"command":45},"pnpm","pnpm dlx skills add lza6\u002FArmor-piercing-system-prompts --skill langgraph","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F05-技能与代理开发\u002Flanggraph-antigravity-awesome-skills-main\u002FSKILL.md",true,[],[50,57,62,69,76,83],{"skillNo":51,"name":52,"nameZh":6,"description":53,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":19},"01M7FFG485KY83TD6HSC4YPCMC","obsidian-clipper-template-creator","Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator\u002FSKILL.md",[],[],{"skillNo":58,"name":52,"nameZh":6,"description":53,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":19},"01M7FFG0T6AZ0STEJPSB3CX84K","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator-antigravity-awesome-skills-main\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M7FFFY0QEM14SKWPDYGMXM2P","python-api","Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP\u002FmAP semantics, and source-style import diagnostics.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Fpython-api\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M7FFFVZQZ2GJ0C0TGP7JHD20","file-evaluation","Folder-based PASCAL VOC AP\u002FmAP evaluation from ground-truth and detection text files.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Ffile-evaluation\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M7FFFSFNYSE77SJ6PE1CK2DA","object-detection-metrics","Guides legacy Object-Detection-Metrics PASCAL VOC AP\u002FmAP evaluation from detection text folders and direct Python API classes.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M7FFFP0GCK1RVXBCPQ8APBMT","nx-workspace-patterns","Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fnx-workspace-patterns\u002FSKILL.md",[],[]]