skills/deepagents-planning-todos/SKILL.md
Use the write_todos tool effectively for task planning and decomposition in Deep Agents. Use when users want to (1) implement task planning with write_todos, (2) break down complex tasks into subtasks, (3) track agent progress through todos, (4) debug why todos aren't completing, (5) design todo structures for different task types (research, coding, analysis), (6) understand todo status lifecycle and best practices, or (7) visualize todo progression from LangSmith traces.
npx skillsauth add lubu-labs/langchain-agent-skills deepagents-planning-todosInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Master the write_todos tool for effective task planning and decomposition in Deep Agents.
| Use write_todos | Execute Directly | |-----------------|------------------| | ✅ Complex multi-step tasks (3-6 steps) | ✅ Simple 1-2 step queries | | ✅ Tasks requiring user approval first | ✅ Single tool calls | | ✅ Long-running workflows needing progress tracking | ✅ Quick information lookups | | ✅ Tasks where planning adds clarity | ✅ Straightforward API calls |
Decision rule: If you'd benefit from showing the user "Here's my plan..." before starting, use write_todos.
from deepagents import create_deep_agent
# TodoListMiddleware is included by default in create_deep_agent
agent = create_deep_agent(
model="anthropic:claude-sonnet-4-5-20250929",
tools=[search_tool, summarize_tool],
system_prompt="You are a research assistant. Use write_todos for multi-step tasks."
)
# Agent workflow:
# 1. Call write_todos with initial plan
# 2. Ask user: "Does this plan look good?"
# 3. User approves → start executing
# 4. Update the todo list as work progresses
# 5. Keep todos aligned with the current plan and execution state
Example todo creation:
# Agent calls write_todos internally:
{
"name": "write_todos",
"arguments": {
"todos": [
{"content": "Search for papers on LLM agents", "status": "pending"},
{"content": "Read and extract findings from top 5 papers", "status": "pending"},
{"content": "Identify common themes", "status": "pending"},
{"content": "Write summary report", "status": "pending"}
]
}
}
{
"content": "Task description (clear, actionable)",
"status": "pending" | "in_progress" | "completed"
}
Full-list updates: Treat each write_todos call as a full state update and include all active todos.
Per-turn discipline: Prefer one write_todos update per model turn to avoid conflicting plan changes.
Best granularity: Keep lists to 3-6 items maximum (avoid over-fragmentation).
Deep Agents documentation describes write_todos as the built-in interface for todo planning/tracking.
Keep todo state accurate by rewriting the list with updated statuses as execution progresses.
pending → in_progress → completed
Best practices:
"status": "pending" for newly planned work."in_progress" when starting work on a todo."completed" when finished (don't delete - keeps context).Typical workflow:
# Step 1: Create initial plan (all pending)
write_todos([
{"content": "Research topic", "status": "pending"},
{"content": "Write summary", "status": "pending"}
])
# Step 2: Ask user approval
# User: "Yes, proceed"
# Step 3: Start first task
write_todos([
{"content": "Research topic", "status": "in_progress"},
{"content": "Write summary", "status": "pending"}
])
# Step 4: Complete first task, start second
write_todos([
{"content": "Research topic", "status": "completed"},
{"content": "Write summary", "status": "in_progress"}
])
# Step 5: Finish all tasks
write_todos([
{"content": "Research topic", "status": "completed"},
{"content": "Write summary", "status": "completed"}
])
| Task Type | Pattern | Example Todos | |-----------|---------|---------------| | Research | gather → synthesize → report | Search docs, Read examples, Analyze patterns, Synthesize findings | | Coding | design → implement → test | Design API, Implement endpoints, Write tests, Test end-to-end | | Analysis | collect → process → analyze | Collect data, Process traces, Analyze patterns, Visualize results | | Document Processing | read → extract → transform | Read files, Extract key info, Transform format, Output result |
For detailed patterns with code examples, see references/todo-patterns.md.
Symptom: Todo stuck in in_progress, agent loops or gets confused.
Causes & fixes:
Symptom: Agent creates todos but doesn't follow them.
Causes & fixes:
Symptom: 10+ todos, hard to track, agent overwhelmed.
Causes & fixes:
references/todo-patterns.md).Symptom: Agent loses track of what's been done.
Causes & fixes:
FilesystemBackend or StoreBackend for long sessions.write_todos whenever status changes or scope shifts.MemoryMiddleware for long-term context.Use the included script to parse LangSmith traces and visualize todo progression:
# Export trace from LangSmith (download JSON)
# Then run:
uv run skills/deepagents-planning-todos/scripts/visualize_todos.py trace.json
# Show Mermaid diagram:
uv run skills/deepagents-planning-todos/scripts/visualize_todos.py trace.json --format mermaid
# Show full timeline:
uv run skills/deepagents-planning-todos/scripts/visualize_todos.py trace.json --show-timeline
Output example:
Todo Timeline for trace abc123:
Initial Plan (Step 1):
⏳ [pending] Search for papers on LLM agents
⏳ [pending] Read and extract findings
⏳ [pending] Identify common themes
⏳ [pending] Write summary report
Final State:
✅ [completed] Search for papers on LLM agents
✅ [completed] Read and extract findings
✅ [completed] Identify common themes
✅ [completed] Write summary report
References (detailed patterns):
references/todo-patterns.md: Task-specific patterns with code examplesExamples (working code):
assets/examples/todo-driven-agent/: Research agent demonstrating full workflowExample structures (templates):
assets/todo-structures/research-todos.json: Research task breakdownassets/todo-structures/coding-todos.json: Coding task breakdownExternal docs:
tools
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
tools
Fetch, organize, and analyze LangSmith traces for debugging and evaluation. Use when you need to: query traces/runs by project, metadata, status, or time window; download traces to JSON; organize outcomes into passed/failed/error buckets; analyze token/message/tool-call patterns; compare passed vs failed behavior; or investigate benchmark and production failures.
tools
Use this skill when you need to test or evaluate LangGraph/LangChain agents: writing unit or integration tests, generating test scaffolds, mocking LLM/tool behavior, running trajectory evaluation (match or LLM-as-judge), running LangSmith dataset evaluations, and comparing two agent versions with A/B-style offline analysis. Use it for Python and JavaScript/TypeScript workflows, evaluator design, experiment setup, regression gates, and debugging flaky/incorrect evaluation results.
development
Design state schemas, implement reducers, configure persistence, and debug state issues for LangGraph applications. Use when users want to (1) design or define state schemas for LangGraph graphs, (2) implement reducer functions for state accumulation, (3) configure persistence with checkpointers (InMemorySaver/MemorySaver, SqliteSaver, PostgresSaver), (4) debug state update issues or unexpected state behavior, (5) migrate state schemas between versions, (6) validate state schema structure, (7) choose between TypedDict and MessagesState patterns, (8) implement custom reducers for lists, dicts, or sets, (9) use the Overwrite type to bypass reducers, (10) set up thread-based persistence for multi-turn conversations, or (11) inspect checkpoints for debugging.