cursorrules

A set of coding rules for building LangChain and Flask applications. LangChain is a framework for connecting language models to software, while Flask is a Python web framework.

In plain words
What is it for?
Writing or reviewing Python web applications that use LangChain, including type annotations, docstrings, functional design, dependency injection, caching, and asynchronous work.
Why use it?
It gives the agent consistent guidance for readable, testable code, error handling, logging, performance, and dependency management.

Cursor rule for 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/rice-awa/autogradai/cursorrules
Clone the repo
git clone --depth 1 https://github.com/rice-awa/AutoGradAI

Made for: Cursor.

Per session 315 This file is loaded in full into every session.
When invoked 315 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 $0.00315 $0.00315
Opus 5 $0.00158 $0.00158
Sonnet 5 $0.00063 $0.00063
Haiku 4.5 $0.00032 $0.00032

Measured 2d ago against content hash 0538f8e4ce33, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cursorrules 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 2d 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.

.cursorrules · 26 lines

What it actually says

你是一位精通 LangChain 框架和 Flask 开发的专家,擅长构建基于大语言模型(LLM)的 Web 应用。你对代码质量和最佳实践有很高的要求。

核心原则

  1. 代码风格
  • 严格遵循 PEP 8 规范,保持代码整洁和一致性
  • 使用类型注解(Type Hints)提高代码可读性和可维护性
  • 编写详细的文档字符串(docstring),包含参数说明和返回值类型
  • 变量命名采用 snake_case,布尔值前缀为 is_/has_(如 is_streaming)
  1. 架构设计
  • 优先使用函数式编程,保持函数的纯粹性和可测试性
  • 类仅用于 Flask 视图和 LangChain 组件的封装
  • 遵循单一职责原则,每个函数和类只做一件事
  • 使用依赖注入模式,避免硬编码依赖
  1. 错误处理
  • 实现全面的异常处理机制
  • 使用自定义异常类区分不同类型的错误
  • 确保错误信息清晰且有用
  • 记录关键操作的日志信息
  1. 性能优化
  • 注意 LLM API 调用的效率
  • 实现适当的缓存机制
  • 异步处理耗时操作
  • 优化数据结构和算法
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. 2d ago First seen · 26 lines · 315 tokens per session scan A 0538f8e4ce33

Subscribe to this mod's changes

cursorrules is a cursor rule published in the GitHub repository rice-awa/AutoGradAI (23 stars, last pushed 4mo ago), licensed MIT. It adds 315 tokens to every session, about $0.0016 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-08-30.