Borrowing it
Nothing to install: this file belongs to pyramidheadshark/claude-scaffold. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/pyramidheadshark/claude-scaffold/main/.claude/skills/langgraph-patterns/SKILL.mdgit clone --depth 1 https://github.com/pyramidheadshark/claude-scaffoldWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/pyramidheadshark/claude-scaffold/langgraph-patterns)<a href="https://agentmods.dev/skills/pyramidheadshark/claude-scaffold/langgraph-patterns"><img src="https://agentmods.dev/badge/skills/pyramidheadshark/claude-scaffold/langgraph-patterns.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.01406 |
| Opus 5 | $0.00000 | $0.00703 |
| Sonnet 5 | $0.00000 | $0.00281 |
| Haiku 4.5 | $0.00000 | $0.00141 |
Grade A, and why
langgraph-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 240 lines — stays where its author put it; the contents beside it link to each section on GitHub.
LangGraph Patterns
When to Load This Skill
Load when working with: LangGraph state machines, agent nodes, tool definitions, checkpointers, human-in-the-loop interrupts, multi-agent coordination.
Current Version
LangGraph >=0.2.0 (langgraph-checkpoint for persistence).
Always pin exact version in pyproject.toml.
Core Concepts
LangGraph models agent workflows as directed graphs:
- State: typed dict passed between nodes (the single source of truth)
- Nodes: Python async functions that receive and return state updates
- Edges: routing logic — conditional or unconditional
- Checkpointer: persistence layer for long-running agents (SQLite locally, PostgreSQL in production)
Standard Project Structure
src/{project_name}/
├── agents/
│ ├── __init__.py
│ ├── graph.py # graph assembly
│ ├── state.py # TypedDict state definition
│ ├── nodes/
│ │ ├── __init__.py
│ │ ├── analyst.py
│ │ └── writer.py
│ └── tools/
│ ├── __init__.py
│ └── search.py
State Definition Pattern
from typing import Annotated
from typing_extensions import TypedDict
import operator
class AgentState(TypedDict):
messages: Annotated[list[dict], operator.add]
user_input: str
retrieved_context: list[str]
final_answer: str | None
error: str | None
iteration_count: int
Use Annotated[list, operator.add] for lists that nodes append to.
Use plain types for values that nodes replace entirely.
Node Pattern
from langchain_core.messages import AIMessage
from src.project_name.agents.state import AgentState
from src.project_name.adapters.llm.claude_adapter import ClaudeAdapter
async def analyst_node(state: AgentState) -> dict:
adapter = ClaudeAdapter()
response = await adapter.invoke(
system="You are a precise analyst. Answer based only on retrieved context.",
messages=state["messages"],
context=state["retrieved_context"],
)
return {
"messages": [AIMessage(content=response)],
"final_answer": response,
}
What ships with it
4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 7d ago First seen · 240 lines · 0 tokens per session scan A d979d4416cfb
langgraph-patterns is a skill published in the GitHub repository pyramidheadshark/claude-scaffold (4 stars, last pushed 4mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,406 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
mle-workflow
Production ML engineering workflow — data contracts, reproducible training, evaluation gates, deployment, and monitoring. Use when building, reviewing, or hardening ML systems beyond notebooks.
data-scientist
!cat Claude-Production-Grade-Suite/.protocols/ux-protocol.md 2>/dev/null || true !cat Claude-Production-Grade-Suite/.protocols/input-validation.md 2>/dev/null || true !cat Claude-Production-Grade-Suite/.protocols/tool-efficiency.md 2>/dev/null || true !cat Claude-Production-Grade-Suite/.protocols/visual-identity.md…
ai-engineer
Builds production AI/ML systems — model training, fine-tuning, MLOps pipelines, model serving, evaluation frameworks, RAG optimization, and agent orchestration at scale. Use when the user asks to build, train, or deploy ML models, set up MLOps pipelines, optimize RAG systems, create inference endpoints, or design…
data-scientist
!cat skills/shared/protocols/ux-protocol.md 2>/dev/null || true !cat skills/shared/protocols/input-validation.md 2>/dev/null || true !cat skills/shared/protocols/tool-efficiency.md 2>/dev/null || true !cat .production-grade.yaml 2>/dev/null || echo "No config — using defaults".
ai-ml-engineering
AI/ML Engineering Review: Reviews AI/ML systems for production readiness — model serving, MLOps pipelines, LLM integration patterns, prompt engineering, evaluation frameworks, and responsible AI. Covers model deployment, feature stores, experiment tracking, monitoring/drift detection, and AI safety. Use when the user…
git-hooks-manager
Setup and manage git hooks for pre-commit, pre-push automation (lint, test, format).