langgraph-typescript-rules

langgraph-typescript-rules is a cursor rule for Cursor from yu-iskw/llmops-demo-ts. It costs 4,662 tokens per session, scanned A, original, Apache-2.0.

A reference guide for building stateful applications with LangGraph in TypeScript. LangGraph represents work as connected steps that can share and update application state.

In plain words
What is it for?
Use it when designing LangGraph nodes, edges, shared state, workflows, and cyclic application flows in TypeScript.
Why use it?
It gives developers consistent patterns for workflows and multi-actor applications instead of requiring them to work out the library's structure alone.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/yu-iskw/llmops-demo-ts/langgraph-typescript-rules
Clone the repo
git clone --depth 1 https://github.com/yu-iskw/llmops-demo-ts

Made for: Cursor.

Wrote 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.

agentmods badge for langgraph-typescript-rules

README.md
[![agentmods](https://agentmods.dev/badge/rules/yu-iskw/llmops-demo-ts/langgraph-typescript-rules.svg)](https://agentmods.dev/rules/yu-iskw/llmops-demo-ts/langgraph-typescript-rules)
Your own site
<a href="https://agentmods.dev/rules/yu-iskw/llmops-demo-ts/langgraph-typescript-rules"><img src="https://agentmods.dev/badge/rules/yu-iskw/llmops-demo-ts/langgraph-typescript-rules.svg" alt="Measured on agentmods" height="20"></a>
Per session 4,662 This file is loaded in full into every session.
When invoked 4,662 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.04662 $0.04662
Opus 5 $0.02331 $0.02331
Sonnet 5 $0.00932 $0.00932
Haiku 4.5 $0.00466 $0.00466

Measured yesterday against content hash 4dcb134d68a2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

langgraph-typescript-rules 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 yesterday.

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.

.cursor/rules/langgraph-typescript-rules.mdc · 502 lines

How it starts

The opening of the file, as written. The whole thing — 502 lines — stays where its author put it; the contents beside it link to each section on GitHub.

LangGraph in TypeScript: Comprehensive Guide

This rule provides comprehensive guidelines and best practices for developing with LangGraph in TypeScript, covering basic knowledge, common patterns, and best practices for robust and maintainable applications.

1. Basic Concepts and Setup

1.1 What is LangGraph?

LangGraph is a library that allows you to build stateful, multi-actor applications with LLMs. It extends LangChain to enable cycles and more complex orchestration by representing your application as a graph of nodes and edges.

  • State: The shared context or data that flows through the graph. It's updated by nodes.
  • Nodes: Functions or runnable units that perform operations and update the graph state.
  • Edges: Transitions between nodes. They can be direct or conditional based on the state.
  • Graph: The complete workflow defined by nodes and edges.

LangGraph can be used to build two main types of systems:

1.2 Installation

Ensure you have langchain and langgraph installed:

pnpm add langchain @langchain/langgraph
pnpm add -D @types/node # if not already installed

1.3 Defining Your Graph State with TypeScript

Always define a clear TypeScript annotation for your graph state using Annotation.Root. This provides strong typing and improves code readability and maintainability. Each field in Annotation.Root represents a channel in the graph, and its type is defined using Annotation<Type>.

Read the full file on GitHub · 502 lines

Changes

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.

  1. yesterday First seen · 502 lines · 4,662 tokens per session scan A 4dcb134d68a2

Subscribe to this mod's changes

langgraph-typescript-rules is a cursor rule published in the GitHub repository yu-iskw/llmops-demo-ts (6 stars, last pushed 4d ago), licensed Apache-2.0. It adds 4,662 tokens to every session, about $0.0233 per session on Opus 5. 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-09-04.