assimilate-popular-wor…
This skill should be used when the user asks to "find skills in the wild", "assimilate popular workflows", "discover SKILL.md files in repos", "research…
LangGraph StateGraph builder with state schema design. Create stateful agent workflows with cycles, conditionals, and persistence.
$ npx -y skills add a5c-ai/babysitter --skill langgraph-state-graph --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/langgraph-state-graphContext preview
The summary Claude sees to decide when to auto-load this skill.
LangGraph StateGraph builder with state schema design. Create stateful agent workflows with cycles, conditionals, and persistence.
name: langgraph-state-graph description: LangGraph StateGraph builder with state schema design. Create stateful agent workflows with cycles, conditionals, and persistence. allowed-tools: Read, Grep, Write, Edit, Bash, Glob, WebFetch graph: domains: [domain:software-engineering] specializations: [specialization:ai-agents-conversational] skillAreas: [skill-area:agentic-loops, skill-area:agent-planning-reasoning] roles: [role:ml-engineer, role:backend-engineer] workflows: [workflow:feature-development, workflow:ml-model-lifecycle] topics: [topic:design-patterns, topic:event-driven-architecture]
Build stateful agent workflows using LangGraph's StateGraph pattern. Design state schemas, create nodes, define edges with conditional routing, and enable persistence.
LangGraph is a library for building stateful, multi-actor applications with LLMs. The StateGraph is the core abstraction that enables:
from typing import TypedDict, Annotated
from langgraph.graph import StateGraph, END
from langgraph.graph.message import add_messages
# Define state schema
class AgentState(TypedDict):
messages: Annotated[list, add_messages]
current_step: str
iteration: int
# Create nodes
def agent_node(state: AgentState) -> AgentState:
# Process state and return updates
return {"current_step": "processed", "iteration": state["iteration"] + 1}
def tool_node(state: AgentState) -> AgentState:
# Execute tools based on agent decisions
return {"current_step": "tools_executed"}
# Build graph
graph = StateGraph(AgentState)
graph.add_node("agent", agent_node)
graph.add_node("tools", tool_node)
# Define edges
graph.set_entry_point("agent")
graph.add_edge("agent", "tools")
graph.add_conditional_edges(
"tools",
lambda state: "end" if state["iteration"] >= 3 else "continue",
{"end": END, "continue": "agent"}
)
# Compile
app = graph.compile()def router(state: AgentState) -> str:
"""Route based on state conditions."""
last_message = state["messages"][-1]
if hasattr(last_message, "tool_calls") and last_message.tool_calls:
return "tools"
elif state["iteration"] >= state.get("max_iterations", 10):
return "end"
else:
return "agent"
graph.add_conditional_edges(
"agent",
router,
{
"tools": "tool_executor",
"agent": "agent",
"end": END
}
)from langgraph.checkpoint.sqlite import SqliteSaver
# Configure checkpointer
memory = SqliteSaver.from_conn_string(":memory:")
# Compile with persistence
app = graph.compile(checkpointer=memory)
# Run with thread_id for persistence
config = {"configurable": {"thread_id": "conversation-1"}}
result = app.invoke(initial_state, config=config)
# Resume from checkpoint
result = app.invoke(None, config=config) # Continues from last statefrom langgraph.graph import StateGraph
graph = StateGraph(AgentState)
# ... add nodes ...
# Compile with interrupt points
app = graph.compile(
checkpointer=memory,
interrupt_before=["tool_executor"] # Pause before tool execution
)
# First invocation - pauses at interrupt
result = app.invoke(initial_state, config)
# After human approval, resume
result = app.invoke(None, config) # Continues past interruptconst langgraphStateGraphTask = defineTask({
name: 'langgraph-state-graph-design',
description: 'Design and implement a LangGraph StateGraph workflow',
inputs: {
workflowName: { type: 'string', required: true },
stateSchema: { type: 'object', required: true },
nodes: { type: 'array', required: true },
edges: { type: 'array', required: true },
enablePersistence: { type: 'boolean', default: true },
interruptPoints: { type: 'array', default: [] }
},
outputs: {
graphCode: { type: 'string' },
stateSchemaCode: { type: 'string' },
compiledGraph: { type: 'boolean' },
artifacts: { type: 'array' }
},
async run(inputs, taskCtx) {
return {
kind: 'skill',
title: `Design StateGraph: ${inputs.workflowName}`,
skill: {
name: 'langgraph-state-graph',
context: {
workflowName: inputs.workflowName,
stateSchema: inputs.stateSchema,
nodes: inputs.nodes,
edges: inputs.edges,
enablePersistence: inputs.enablePersistence,
interruptPoints: inputs.interruptPoints,
instructions: [
'Analyze workflow requirements and state needs',
'Design state schema with proper typing',
'Create node functions with state transformations',
'Define edges and conditional routing logic',
'Configure persistence if enabled',
'Add interrupt points for human-in-tEnforce obedience on agentic workforces. Manage extremely complex workflows through deterministic, hallucination-free self-orchestration.
Repo: a5c-ai/babysitter
This skill should be used when the user asks to "find skills in the wild", "assimilate popular workflows", "discover SKILL.md files in repos", "research…
This skill should be used when the user asks to "babysit issues", "work on assigned issues", "check a5c-agent issues", "process babysitter issues", or wants to…
Discover public GitHub repositories that import defineTask from @a5c-ai/babysitter-sdk and maintain a deduplicated catalog of those repositories in…
This skill should be used when the user asks to "fix pipelines", "fix CI", "check staging pipelines", "fix failing workflows", "fix failing actions", or wants…
Scaffold new babysitter process definitions following SDK patterns, proper structure, and best practices. Guides the 3-phase workflow from research to…
For a repository in the babysitter-users catalog, locate its babysitter processes and any committed runs (.a5c/runs/<runId>/) and perform a retrospective on a…