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/noobgaminghard/cursor-rules/rulegit clone --depth 1 https://github.com/noobgaminghard/cursor-rulesWhat 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 | $0.00000 | $0.02173 |
| Opus 5 | $0.00000 | $0.01086 |
| Sonnet 5 | $0.00000 | $0.00435 |
| Haiku 4.5 | $0.00000 | $0.00217 |
Grade A, and why
rule 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.
This is a copy
91% identical to cursorrules — 6 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 250 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AI/ML Python Projects — Cursor Rules
Production ML: PyTorch, data pipelines, experiment tracking, and deployment
Project Context
You are building an AI/ML project with Python. The project uses PyTorch for model training, handles data pipelines with proper validation, tracks experiments systematically, and follows production ML engineering practices. Code is type-hinted, tested, and reproducible.
Project Structure
project/
src/
data/
datasets.py # PyTorch Dataset classes
transforms.py # Data augmentation and preprocessing
loaders.py # DataLoader configurations
validation.py # Data quality checks
models/
architectures/ # Model definitions
resnet.py
transformer.py
losses.py # Custom loss functions
metrics.py # Evaluation metrics
training/
trainer.py # Training loop
callbacks.py # Training callbacks (early stopping, checkpointing)
optimizers.py # Optimizer configurations
inference/
predictor.py # Inference pipeline
postprocess.py # Output postprocessing
utils/
config.py # Configuration management
logging.py # Experiment logging
reproducibility.py # Seed setting, deterministic mode
configs/
train_config.yaml # Training hyperparameters
model_config.yaml # Model architecture config
scripts/
train.py # Training entry point
evaluate.py # Evaluation script
export.py # Model export (ONNX, TorchScript)
notebooks/
exploration.ipynb # Data exploration (not production code)
tests/
test_data.py
test_models.py
test_training.py
PyTorch Model Patterns
- Inherit from
nn.Module. Always callsuper().__init__(). - Type hint all method signatures:
class ClassificationHead(nn.Module): def __init__(self, in_features: int, num_classes: int, dropout: float = 0.1) -> None: super().__init__() self.dropout = nn.Dropout(dropout) self.fc = nn.Linear(in_features, num_classes) def forward(self, x: torch.Tensor) -> torch.Tensor: x = self.dropout(x) return self.fc(x) - Use
nn.Sequentialornn.ModuleListfor dynamic layer construction — never regular Python lists. - Register buffers for non-parameter tensors:
self.register_buffer('mean', torch.zeros(3)). - Use
@torch.no_grad()for inference methods. - DON'T: Use numpy operations inside
forward()— they break autograd. - DON'T: Create tensors in
forward()without sending to the correct device.
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 · 250 lines · 0 tokens per session scan A c14e0f692310
rule is a cursor rule published in the GitHub repository noobgaminghard/cursor-rules (1 stars, last pushed 2d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,173 tokens. A static security scan graded it A with 0 findings. It is 91% identical to cursorrules, differing in 6 lines, and is treated as a copy.
Other cursor rules, from other repositories
agent-development
Python agents are typically in folders named agent-py/ or agent/ and use the sdk-python/ package.
swift-argument-parser
Documentation and usage patterns for Swift Argument Parser for command-line tools.
update-docs
You will generate LLM-optimized documentation with concrete file references and flexible formatting.
safari-automation
Patterns and best practices for automating Safari browser interactions for web UI automation and testing.
commit
Create well-formatted commits with conventional commit messages and emojis.
clean
Fix all code formatting and quality issues in the entire codebase.