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.
npx agentmods add rules/yu-iskw/llmops-demo-ts/langgraph-typescript-rulesgit clone --depth 1 https://github.com/yu-iskw/llmops-demo-tsWrote 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/rules/yu-iskw/llmops-demo-ts/langgraph-typescript-rules)<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>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.04662 | $0.04662 |
| Opus 5 | $0.02331 | $0.02331 |
| Sonnet 5 | $0.00932 | $0.00932 |
| Haiku 4.5 | $0.00466 | $0.00466 |
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.
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:
- Workflows: Systems where LLMs and tools are orchestrated through predefined code paths. These are ideal for tasks that can be easily and cleanly decomposed into fixed subtasks. [https://langchain-ai.github.io/langgraphjs/tutorials/workflows/#prompt-chaining]
- Agents: Systems where LLMs dynamically direct their own processes and tool usage, maintaining control over how they accomplish tasks. Agents are suitable for open-ended problems where the number of steps is unpredictable. [https://langchain-ai.github.io/langgraphjs/tutorials/workflows/#prompt-chaining]
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>.
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.
- yesterday First seen · 502 lines · 4,662 tokens per session scan A 4dcb134d68a2
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.
Other cursor rules, from other repositories
typescript-javascript-rules
description: Defines specific coding style and structure for TypeScript and JavaScript files, including function usage, type preferences, and file organization. globs: /.{ts,tsx,js,jsx}.
page_layer_rules
Page layer rules for Next.js App Router pages and layouts.
type_layer_rules
Type layer rules for TypeScript type definitions and interfaces.
update-ai-sdk
Update ai-sdk(ai, @ai/) to latest.
design
All tasks related to updating frontend components, CSS, and general styling.
valid
TypeScript coding standards for the project.