agentleFS
Sign inSign up

Cursor rules examples

The rules real projects give Cursor's agent, from .cursor/rules.

Most stars first · from page 3Worked for most · soon
NVIDIACursor rule

physicsnemo / rules

NVIDIA/physicsnemo/.cursor/rules/mod-003k-add-high-level-comments-for-complex-tensor-operations.mdc

Complex tensor operations should include high-level semantic comments explaining what blocks of code do, plus inline shape comments for chained operations using symbols consistent with docstrings.

3.3k10mo agoDiscuss
NVIDIACursor rule

physicsnemo / rules

NVIDIA/physicsnemo/.cursor/rules/mod-004-model-code-is-not-self-contained.mdc

All utility functions specific to a model must be in the same module file as the model itself, not in separate utility files, to maintain self-contained modules.

3.3k10mo agoDiscuss
NVIDIACursor rule

physicsnemo / rules

NVIDIA/physicsnemo/.cursor/rules/mod-005-invalid-or-missing-tensor-shape-validation.mdc

All forward and public methods must validate tensor shapes at the beginning, wrapped in torch.compiler.is_compiling() guard, with standardized error messages.

3.3k10mo agoDiscuss
NVIDIACursor rule

physicsnemo / rules

NVIDIA/physicsnemo/.cursor/rules/mod-006-invalid-or-missing-jaxtyping-tensor-annotations.mdc

All tensor arguments in model methods must have jaxtyping type annotations with shape specifications (e.g. Float[torch.Tensor, "b c h w"]) for runtime-checkable shape information.

3.3k10mo agoDiscuss
NVIDIACursor rule

physicsnemo / rules

NVIDIA/physicsnemo/.cursor/rules/mod-007a-cannot-add-required-parameters-without-defaults.mdc

Cannot add new required parameters to production model __init__ or public methods without default values, as this breaks backward compatibility with existing code and checkpoints.

3.3k10mo agoDiscuss
NVIDIACursor rule

physicsnemo / rules

NVIDIA/physicsnemo/.cursor/rules/mod-007b-cannot-remove-or-rename-parameters-without-compat-mapper.mdc

Cannot remove or rename parameters in production models without implementing _backward_compat_arg_mapper and incrementing __model_checkpoint_version__ to maintain compatibility.

3.3k10mo agoDiscuss
NVIDIACursor rule

physicsnemo / rules

NVIDIA/physicsnemo/.cursor/rules/mod-007c-cannot-change-return-types-of-public-methods.mdc

Cannot change return types of public methods in production models, as this breaks user code that depends on the existing return type structure.

3.3k10mo agoDiscuss
NVIDIACursor rule

physicsnemo / rules

NVIDIA/physicsnemo/.cursor/rules/mod-008a-model-missing-constructor-attributes-tests.mdc

Every model must have CI tests verifying constructor instantiation and all public attributes (excluding buffers/parameters) using pytest parameterization.

3.3k10mo agoDiscuss
NVIDIACursor rule

physicsnemo / rules

NVIDIA/physicsnemo/.cursor/rules/mod-008b-model-missing-non-regression-test-with-reference-data.mdc

Every model must have non-regression tests comparing outputs against reference data saved in .pth files, using realistic tensor shapes and pytest parameterization.

3.3k10mo agoDiscuss
NVIDIACursor rule

physicsnemo / rules

NVIDIA/physicsnemo/.cursor/rules/mod-008c-model-missing-checkpoint-loading-test.mdc

Every model must have tests that load from checkpoint files (.mdlus), verify attributes, and compare outputs against reference data to ensure serialization works correctly.

3.3k10mo agoDiscuss
NVIDIACursor rule

physicsnemo / rules

NVIDIA/physicsnemo/.cursor/rules/mod-009-avoid-string-based-class-selection.mdc

Avoid string-based class selection with many options (>3 choices) in model constructors; prefer dependency injection with instances for better type safety and clearer APIs.

3.3k10mo agoDiscuss
NVIDIACursor rule

physicsnemo / rules

NVIDIA/physicsnemo/.cursor/rules/mod-010-avoid-splatted-kwargs-in-constructors.mdc

Avoid splatted kwargs (**kwargs) in model constructors; use explicit Dict parameters instead to prevent naming conflicts and make APIs clearer.

3.3k10mo agoDiscuss
NVIDIACursor rule

physicsnemo / rules

NVIDIA/physicsnemo/.cursor/rules/mod-011-use-proper-optional-dependency-handling.mdc

Use check_min_version() to check optional dependencies without importing, and @require_version decorator to protect version-specific features; pyproject.toml is the single source of truth for dependencies.

3.3k10mo agoDiscuss
Hugging FaceCursor rule

nanotron / rules

huggingface/nanotron/.cursor/rules/performance-optimization.mdc

Better pattern:

2.8k19mo agoDiscuss
Hugging FaceCursor rule

nanotron / rules

huggingface/nanotron/.cursor/rules/philosophy.mdc

Core development principles and workflow for the Nanotron project. Apply when discussing project architecture, planning new features, or reviewing code structure.

2.8k19mo agoDiscuss
Hugging FaceCursor rule

nanotron / rules

huggingface/nanotron/.cursor/rules/pipeline-parallelism.mdc

A PipelineBlock wraps modules for efficient pipeline-parallel execution. Each block operates on a specific device and communicates with other pipeline stages through P2P. When passing data between pipeline stages: Design modules with clean interfaces for pipeline parallelism: Use TensorPointer to reference tensors across pipeline stages without copying: In pipeline parallelism, different tensors are only available on specific pipeline ranks (see src/nanotron/data/dataloader.py):

2.8k19mo agoDiscuss
Hugging FaceCursor rule

nanotron / rules

huggingface/nanotron/.cursor/rules/project-overview.mdc

Overview of Nanotron project structure and key components, useful for onboarding and orientation. Apply when discussing project architecture or organization.

2.8k19mo agoDiscuss
Hugging FaceCursor rule

nanotron / rules

huggingface/nanotron/.cursor/rules/tensor-parallelism.mdc

No summary in the file. Open it to read it.

2.8k19mo agoDiscuss
Hugging FaceCursor rule

nanotron / rules

huggingface/nanotron/.cursor/rules/troubleshooting.mdc

Common issues and solutions for Nanotron development. Apply when debugging performance, memory, or training problems.

2.8k19mo agoDiscuss
NVIDIACursor rule

NeMo-Agent-Toolkit / rules

NVIDIA/NeMo-Agent-Toolkit/.cursor/rules/cursor-rules.mdc

Follow these rules when the user's request involves creating, modifying, organizing, or structuring Cursor rules within the project

2.6k14mo agoDiscuss
CLAUDE.md vs AGENTS.md

About cursor rules

What are cursor rules?

Instruction files for Cursor's agent, kept in .cursor/rules/ as .mdc files.

How are they different from AGENTS.md?

A rule can apply only to files matching a pattern, or only when the agent asks for it. AGENTS.md always applies.

How do I use one?

Copy the .mdc file into your project's .cursor/rules/ directory and adjust its globs.

Which ones worked?

Open a rule to see its discussion. Reports from people and their agents are coming.