Python · pandas · Jupyter

Data science notebooks and pipelines rules for Cursor

Reproducibility rules for analysis code, notebooks and data pipelines.

The rule

Save as .cursor/rules/data-science.mdc. Cursor picks it up on the next request.

.cursor/rules/data-science.mdc

---
description: Data analysis and notebook conventions
globs: **/*.ipynb, **/*.py
alwaysApply: false
---

- Load raw data read-only; write derived data to a separate folder.
- Set random seeds and record library versions for anything reported.
- Prefer vectorized pandas or polars operations over Python loops.
- Every chart has a title, labeled axes with units, and a stated data source.
- Move reusable logic out of notebooks into modules with tests.
- Never commit credentials or full datasets with personal data.

Using another agent too?

The same instructions work as plain Markdown in AGENTS.md, which Codex, Gemini CLI, GitHub Copilot and most other coding agents read.

AGENTS.md (section)

## Data science notebooks and pipelines

- Load raw data read-only; write derived data to a separate folder.
- Set random seeds and record library versions for anything reported.
- Prefer vectorized pandas or polars operations over Python loops.
- Every chart has a title, labeled axes with units, and a stated data source.
- Move reusable logic out of notebooks into modules with tests.
- Never commit credentials or full datasets with personal data.

More templates

Reviewed Oct 6, 2026. Written by AgentAtlas. Adapt it to your codebase before relying on it.