awesome-cursor-rules-mdc is a generator that creates Cursor MDC rule files from structured library information, using semantic search and language models to gather and organize guidance. Developers use it to produce reusable rules for libraries in Cursor, and the catalogue includes 200 of those rules.
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.
git clone --depth 1 https://github.com/sanjeed5/awesome-cursor-rules-mdcWrote 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/sanjeed5/awesome-cursor-rules-mdc/modal)<a href="https://agentmods.dev/rules/sanjeed5/awesome-cursor-rules-mdc/modal"><img src="https://agentmods.dev/badge/rules/sanjeed5/awesome-cursor-rules-mdc/modal.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.04054 | $0.04054 |
| Opus 5 | $0.02027 | $0.02027 |
| Sonnet 5 | $0.00811 | $0.00811 |
| Haiku 4.5 | $0.00405 | $0.00405 |
Grade A, and why
modal scanned grade A with 1 finding 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 3d 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.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
response = requests.get(f"{app_url}/hello") How it starts
The opening of the file, as written. The whole thing — 470 lines — stays where its author put it; the contents beside it link to each section on GitHub.
modal Best Practices
Modal is the definitive platform for deploying AI/ML workloads. To leverage its full potential – sub-second cold starts, instant autoscaling, and GPU acceleration – you must adhere to these best practices. This guide cuts through the noise, providing the exact patterns your team will use daily.
Code Organization and Structure
A well-structured Modal application is modular, explicit, and easy to debug.
1. Centralize Your modal.Stub
Always define a single, well-named modal.Stub at the top level of your main application file. This Stub is the entry point for all your Modal functions, images, and volumes.
❌ BAD: Multiple Stub definitions or generic names
# my_module_a.py
import modal
stub_a = modal.Stub("my-app-part-a") # Don't do this
# my_module_b.py
import modal
stub_b = modal.Stub("my-app-part-b") # Or this
✅ GOOD: Single, descriptive Stub
# src/my_ml_app/app.py
import modal
# Define the stub for your entire application
# Use a clear, unique name for your project/service
stub = modal.Stub("my-inference-service")
# All modal.Functions, Images, and Volumes will be attached to this stub
2. Modularize Your Application
For larger applications, separate your core logic (e.g., model loading, inference pipeline) into distinct Python modules. Import these modules into your main app.py where your modal.Functions are defined. This keeps your Modal definitions clean and your business logic testable.
# src/my_ml_app/model_loader.py
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
class ModelLoader:
def __init__(self, model_id: str):
self.model_id = model_id
self.model = None
self.tokenizer = None
def load(self):
if self.model is None:
print(f"Loading model {self.model_id}...")
self.tokenizer = AutoTokenizer.from_pretrained(self.model_id)
self.model = AutoModelForCausalLM.from_pretrained(self.model_id, torch_dtype=torch.bfloat16)
print("Model loaded.")
return self.model, self.tokenizer
# src/my_ml_app/app.py
import modal
from .model_loader import ModelLoader # Relative import for modularity
stub = modal.Stub("my-inference-service")
# Define your image and volumes here (see sections below)
inference_image = modal.Image.from_registry("nvcr.io/nvidia/pytorch:23.09-py3") \
.pip_install("torch", "transformers")
model_volume = modal.Volume.from_name("my-llm-weights", create_if_missing=True)
@stub.function(image=inference_image, volumes={"/models": model_volume})
def generate_text(prompt: str):
model_id = "mistralai/Mistral-7B-Instruct-v0.2"
# Lazy load the model inside the function
model_loader = ModelLoader(model_id)
model, tokenizer = model_loader.load()
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=100)
return tokenizer.decode(outputs[0], skip_special_tokens=True)
@stub.local_entrypoint()
def main():
print(generate_text.remote("Hello, my name is"))
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.
- 3d ago First seen · 470 lines · 4,054 tokens per session scan A c6de2e3ba33c
modal is a cursor rule published in the GitHub repository sanjeed5/awesome-cursor-rules-mdc (3,571 stars, last pushed 3mo ago), licensed CC0-1.0. It adds 4,054 tokens to every session, about $0.0203 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other cursor rules, from other repositories
073_DSPy_Local_Model_Deployment
Local Model Deployment - Local model deployment patterns with SGLang, Ollama, and vLLM for DSPy production systems.
ponytail
Ponytail, lazy senior dev mode. Always pick the simplest solution that works.
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.
cli-error-handling
CLI command error handling patterns.
prefer-direct-imports-over-module-mocks
Prefer extracting a testable core over vi.mock / vi.resetModules when unit tests need to reach production logic entangled with config, env, or singletons.