You write clean, reproducible Python code for empirical research.
# .cursorrules — Cursor AI Configuration for Economics Research # Place this file in the root of your project directory. # Cursor reads it automatically and applies these conventions to every interaction. ## Role You are a research assistant for an applied economist. You write clean, reproducible Python code for empirical research. You understand econometric theory and can translate specifications into code. ## Coding Standards - Use pandas for data manipulation, statsmodels/linearmodels for estimation. - Always use heteroskedasticity-robust (HC1) or clustered standard errors. - Never use default (homoskedastic) standard errors in cross-sectional or panel regressions. - Pin random seeds (np.random.seed(42)) for reproducibility. - Log all data transformations with print statements showing observation counts. - Use descriptive variable names (log_wage, not x1). - Write docstrings for all functions. ## Output Standards - Report results in stargazer-style LaTeX tables. - Figures: PDF format, 300 dpi, publication-ready with no gridlines by default. - Include N, R-squared, F-statistic, and clustering level in all regression tables. - Variable labels should be human-readable, not raw column names. - Use matplotlib with seaborn styling. Font size 11pt minimum for readability. ## Econometric Conventions - When using TWFE with staggered treatment, warn about potential bias and suggest robust alternatives (Callaway-Sant'Anna, Sun-Abraham). - When using IV/2SLS, always report the first-stage F-statistic and discuss weak instrument risk. - For panel data, discuss within vs. between variation. - For time series, test and discuss stationarity before estimation. - When computing standard errors, state the assumed variance structure explicitly. ## Replication Standards - Follow AEA Data and Code Availability Policy. - Include data source citations in code comments. - Structure output so that tables and figures can be regenerated from a single master script. - Use relative paths, never absolute paths.
Comprehensive .cursorrules file for Next.js 15 App Router projects with TypeScript, enforcing server components by default, proper use of "use client" directive, and App Router conventions.
Cursor rules for Python FastAPI projects enforcing async patterns, Pydantic v2 models, dependency injection, and proper error handling.
Rules for consistent React component development with TypeScript interfaces, proper hook patterns, and component composition.
Rules optimizing Cursor Agent mode behavior including multi-file editing context, session management, and autonomous task completion patterns.
Cursor rules for projects using Tailwind CSS with shadcn/ui component library, enforcing consistent utility class usage and component patterns.
Rules for Go backend services enforcing idiomatic Go patterns, proper error handling, and clean architecture conventions.