spoon-graph-development
Installation
SKILL.md
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
- Function nodes:
async def node(state) -> dict - Agent nodes:
SpoonReactMCPinstances - Subgraph nodes: Nested
StateGraph
Edge Types
- Direct:
graph.add_edge("a", "b") - Conditional:
graph.add_conditional_edges("a", router, {...})
Best Practices
- Use TypedDict for state schemas
- Return only changed fields from nodes
- Use checkpointing for long workflows
- Implement timeout for external calls
Related skills
More from xspoonai/spoon-awesome-skill
cross-chain-bridge
Cross-chain bridge skill for LayerZero, Wormhole, Stargate, and multi-chain asset transfers
6solana-ecosystem
Solana ecosystem skill for development, DeFi, NFTs, and on-chain analysis
3web3-dao-tooling
Build DAO governance agents with SpoonOS. Use when monitoring proposals, automating voting, managing delegations, or analyzing governance patterns.
3neo-ecosystem
Neo N3 blockchain interaction skill for wallet management, smart contracts, and NeoFS storage
3spoon-erc8004-standard
Implement ERC-8004 trustless agent identity. Use when registering agents on-chain, managing reputation, handling validation, or generating DID documents.
3spoon-tool-development
Develop tools for SpoonOS agents. Use when creating custom tools, MCP servers, toolkit extensions, or configuring tool managers.
3