Graph development

From XSpoonAi/spoon-awesome-skill · View interactive version

Graph development is an AI agent skill from the GitHub repository XSpoonAi/spoon-awesome-skill. Build StateGraph workflows with SpoonOS. Use when creating multi-step workflows, conditional routing, parallel execution, checkpointing, or multi-agent orchestration.

How to use this skill

Skill file

Graph Development

Build workflow graphs using SpoonOS StateGraph.

Quick Start

from spoon_ai.graph import StateGraph, END
from typing import TypedDict

class MyState(TypedDict):
    counter: int
    result: str

async def process(state: MyState) -> dict:
    return {"counter": state["counter"] + 1}

graph = StateGraph(MyState)
graph.add_node("process", process)
graph.set_entry_point("process")
graph.add_edge("process", END)

app = graph.compile()
result = await app.invoke({"counter": 0, "result": ""})

Scripts

| Script | Purpose |

|--------|---------|

| basic_graph.py | Simple linear workflow |

| conditional_graph.py | Conditional routing |

| parallel_graph.py | Parallel node execution |

| checkpoint_graph.py | State persistence |

References

| Reference | Content |

|-----------|---------|

| patterns.md | Common graph patterns |

| parallel.md | Parallel execution modes |

Node Types

Edge Types

Best Practices

  1. Use TypedDict for state schemas
  2. Return only changed fields from nodes
  3. Use checkpointing for long workflows
  4. Implement timeout for external calls
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.