Install
$ agentstack add skill-mfrostbutter-claude-skills-langgraph-agent ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ● Dynamic code execution Used
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
Building production LangGraph agents
LangGraph is a state machine over an LLM: nodes mutate a shared state, edges route, and the graph streams its progress. The expensive lessons are not the API, they are the discipline that keeps a graph importable from Studio, boot-safe inside an app, resumable across a human pause, and visible in a live UI. This skill is that discipline.
The five non-negotiables
- Graph modules are pure factories. A graph file exports
build_X_graph(llm, ..., checkpointer=None)and imports only its own siblings (.prompts,.sources) plus langchain/langgraph. No imports of your app package, ever. That is what letslanggraph dev/ Studio import the graph without dragging in your web app. - Heavy imports are lazy.
import langgraph,langchain_anthropic,psycopg2, etc. go inside functions, never at module scope, so the package imports cleanly at app boot even when an optional extra is absent. - IO is injected, not imported. A graph never reaches out to a DB, an API, or an external service directly. Side effects arrive as an
effectsdict of callables the builder passes to its nodes. This keeps the graph pure AND lets Studio/tests run it with dry-run or no-op effects. Effects fail open or dry-run when their credentials are absent. - Progress is messages. Nodes emit
AIMessages on themessageschannel. A message withname="ingest"becomes a labeled timeline + graph step; the final unnamedAIMessageis the run result. This is the whole contract a streaming UI renders against. - The human pause is
interrupt()+ a checkpointer. HITL agents callinterrupt({...})to HALT and only resume when re-entered withCommand(resume=decision)on the samethread_id. No checkpointer, no resume.
Break one and the symptom is usually: Studio import fails (1/2), the app won't boot (2), the graph can't run headless (3), the timeline/graph stays blank (4), or the run can't pause/resume (5).
The 1.x API you actually use
from langgraph.graph import START, END, StateGraph, MessagesState
from langgraph.types import interrupt, Command
from langgraph.checkpoint.memory import MemorySaver
from langgraph.prebuilt import ToolNode, tools_condition # for ReAct loops
# llm.with_structured_output(PydanticModel) -> validated object, no parsing
# graph.astream(state, config, stream_mode="updates") -> async node updates
Pins that work together: langgraph==1.2.4, langchain-core==1.4.6, langchain-anthropic==1.4.5, langsmith==0.8.14, langchain-openai>=1.0,/graph.py as a pure factory: build__graph(llm, effects, checkpointer=None). Define a state class S(MessagesState): ..., the nodes, the edges, return g.compile(checkpointer=checkpointer).
- Put IO in sibling modules under the agent package (
sources.py,dedup.py), pure and self-contained, lazy heavy imports, fail-open. - Wire it into your app with a small builder
build(llm, checkpointer)that constructs the effects (+ any second model) and calls your factory. Keep a registry/catalog of these builders if you run more than one agent. Seereference/03-wiring-into-an-app.md. - Register for Studio: build the graph at module scope without a checkpointer in a
studio.py, and pointlanggraph.jsonat it.
Copy-paste skeleton: assets/new_agent_template.py.
Human-in-the-loop
interrupt(payload) HALTS the graph and surfaces payload to the human; resume with Command(resume=decision) and the graph continues from exactly that node. A useful decision contract is {"action": "approve"|"edit"|"reject", "edited": str, "mode": "dry_run"|"live"}. Your driver parks the live compiled graph, emits an "awaiting approval" event, and re-enters it on resume. Write-path agents default to dry_run and require an explicit live. A run can pause MORE than once: re-park on each interrupt, so a multi-gate agent (pick, then approve) is just two interrupt() nodes — each interrupt value needs a proposal key. Full pattern: reference/04-hitl.md.
Streaming + a live graph view
Drive graph.astream(..., stream_mode="updates") and map each node update to your UI. Emit a named AIMessage per node so it shows as a labeled step; a message with no name and no tool calls is the result-so-far (the last one is the final). The graph topology for a live SVG comes from compiled.get_graph() (build with a throwaway, never-invoked model to read the shape without an API key). Details + a workable event contract + LangSmith tracing: reference/05-streaming-and-observability.md.
Patterns to reach for
- ReAct tool-loop:
investigate ⇄ toolsviatools_condition, ends when the model stops calling tools. Read-only diagnosis. - Parallel fan-out / reduce: a plan node dispatches N lenses that run in one superstep, a synthesize node reduces. Use an additive state channel (e.g.
findings: list). - Routing pipeline: triage → assess → conditional route → propose → approve → apply. One graph, branches.
- Two-model: a cheap model ranks/routes, a quality model writes. Build the second model from the first's key so you reuse one credential.
- Multi-gate content + live publish: TWO interrupts in one run (pick an idea, then approve the draft) ending in a consequential, gated action (dry-run by default).
- Cross-provider reviewer: a different vendor's model judges the primary's output before it acts.
- Grounding fact-check: ground concrete claims against the source text (not the model's memory) before the human sees the draft; bound the auto-revision loop.
- Structured output:
llm.with_structured_output(PydanticModel)for selection/assessment/verdict nodes. Validation + retry happen for you.
More: reference/06-patterns.md.
Test before you wire the UI
Stand up a matched venv (the pins above), then drive the graph headless with stub models + real (or no-op) effects through the interrupt and a resume. You do not need an API key to prove topology, streaming, the pause, and staging. Then py_compile, then run it in the app. Harness + venv recipe: reference/07-testing.md.
Prompt hygiene in agents
- Untrusted data: any retrieved content (web, tools, tickets, scraped) is data, never instructions. Say so in the system prompt.
- Consistent punctuation: pick a style and scrub the rest; models mimic what they see, so stray characters leak into output.
Reference
reference/01-api-1x.md— the 1.x imports and idioms.reference/02-pure-factories-and-effects.md— why pure factories + injected effects, and how.reference/03-wiring-into-an-app.md— turning a graph into a runnable, catalogued agent + Studio.reference/04-hitl.md— interrupt/resume, multi-gate, the driver's park/resume job.reference/05-streaming-and-observability.md— streaming to a UI, topology, LangSmith.reference/06-patterns.md— the graph shapes with when-to-use.reference/07-testing.md— stub models, drive-to-interrupt, the async gotcha.assets/new_agent_template.py— a HITL two-model pure-factory skeleton.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: Mfrostbutter
- Source: Mfrostbutter/claude-skills
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.