PocketFlow framework for building LLM applications with graph-based abstractions, design patterns, and agentic coding workflows
View on GitHubnickth3man/claude_market
pocketflow
skills/pocketflow/SKILL.md
January 21, 2026
Select agents to install to:
npx add-skill https://github.com/nickth3man/claude_market/blob/main/skills/pocketflow/SKILL.md -a claude-code --skill pocketflowInstallation paths:
.claude/skills/pocketflow/# PocketFlow Skill
A comprehensive guide to building LLM applications using PocketFlow - a 100-line minimalist framework for Agents, Task Decomposition, RAG, and more.
## When to Use This Skill
Activate this skill when working with:
- **Graph-based LLM workflows** - Building complex AI systems with nodes and flows
- **Agentic applications** - Creating autonomous agents with dynamic action selection
- **Task decomposition** - Breaking down complex LLM tasks into manageable steps
- **RAG systems** - Implementing Retrieval Augmented Generation pipelines
- **Batch processing** - Handling large inputs or multiple files with LLMs
- **Multi-agent systems** - Coordinating multiple AI agents
- **Async workflows** - Building I/O-bound LLM applications with concurrency
## Core Concepts
### Architecture Overview
PocketFlow models LLM workflows as **Graph + Shared Store**:
```python
# Shared Store: Central data storage
shared = {
"data": {},
"summary": {},
"config": {...}
}
# Graph: Nodes connected by transitions
node_a >> node_b >> node_c
flow = Flow(start=node_a)
flow.run(shared)
```
### The Node: Building Block
Every Node has 3 steps: `prep()` → `exec()` → `post()`
```python
class SummarizeFile(Node):
def prep(self, shared):
# Get data from shared store
return shared["data"]
def exec(self, prep_res):
# Process with LLM (retries built-in)
prompt = f"Summarize this text in 10 words: {prep_res}"
summary = call_llm(prompt)
return summary
def post(self, shared, prep_res, exec_res):
# Write results back to shared store
shared["summary"] = exec_res
return "default" # Action for flow control
```
**Why 3 steps?** Separation of concerns - data storage and processing operate separately.
### The Flow: Orchestration
```python
# Simple sequence
load_data >> summarize >> save_result
flow = Flow(start=load_data)
flow.run(shared)
# Branching with actions
review - "approved" >> pay