coding-guidelines
Standardized Python & Stata coding practices for empirical research projects
npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill coding-guidelines --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
Guides a coding agent to apply standardized Python and Stata practices for empirical research projects, including project structure, script templates, path management, data loading/saving, progress reporting, function documentation, data validation, merging patterns, visualization standards, variable naming, and Stata workflow conventions.
How it works
- Defines a Python script template with a standard header, imports, a get_project_root() function, and a main() entry point.
- Enforces a CRITICAL path management pattern that uses get_project_root() and relative paths for loading and saving data, with explicit directory variables (e.g., Data/Raw, Data/Clean, Data/Intermediate, Results/Tables, Results/Figures).
- Provides concrete code blocks for data loading, saving, progress reporting, function documentation, and data validation, including examples for reading CSVs, error handling, and reporting counts.
- Outlines a merging pattern with standardized keys and reporting steps.
- Specifies visualization standards for publication-quality figures via a configured matplotlib/seaborn setup.
- Supplies naming conventions for DataFrames, paths, functions, variables, and constants.
- Includes a separate Stata section with script templates, global path setup, common regression patterns (reghdfe, outreg2, esttab), output conventions, fixed effects patterns, subsample analyses, variable generation, descriptive statistics, and section headers.
When to use it
Use when starting a new empirical research project or when enforcing consistency across Python and Stata scripts within a project. Follow the templates and path patterns when creating scripts, data pipelines, and analysis workflows.
What it can touch
- Python scripts and modules using the provided template and path management.
- Data files located under Data/Raw, Data/Intermediate, Data/Clean, and Results subdirectories.
- Stata scripts leveraging reghdfe, outreg2, and esttab workflows, with defined global paths for project directories.
Caveats
- License: NOASSERTION
- Tools declared: claude-code
- The guidance is descriptive and prescriptive about structure and templates; it does not guarantee successful results outside the stated conventions.
# Research Project Coding Guidelines **Version:** 1.0 **Last Updated:** January 2026 **Purpose:** Standardized coding practices for empirical research projects --- ## Table of Contents 1. [Project Structure](#project-structure) 2. [Python Guidelines](#python-guidelines) 3. [Stata Guidelines](#stata-guidelines) 4. [General Best Practices](#general-best-practices) 5. [Quick Reference Templates](#quick-reference-templates) --- ## Project Structure ### Directory Organization ``` ProjectName/ ├── Code/ # All analysis scripts │ ├── [Number]_[Name].py # Data processing (Python) │ ├── AN_[Number]_[Name].do # Analysis scripts (Stata) │ ├── AN_[Number]_[Name].py # Analysis scripts (Python) │ ├── LogFiles/ # Stata log files │ └── README.md # Project documentation ├── Data/ │ ├── Raw/ # Original data (never modify) │ ├── Intermediate/ # Partial processing │ └── Clean/ # Analysis-ready data └── Results/ ├── Tables/ # Regression tables └── Figures/ # Visualizations ``` ### Script Numbering Convention - **0:** Initial data extraction - **1a, 1b, 1c:** Data cleaning and preparation - **2a, 2b:** Data merging and linking - **3a, 3b:** Feature extraction and engineering - **4a, 4b:** Final data prep
- Table of Contents
- Project Structure
- Directory Organization
- Script Numbering Convention
- Tool Preferences by Task
- Python Guidelines
- 1. Script Template
- 2. Path Management (CRITICAL)
- 3. Data Loading & Saving
- 4. Progress Reporting
- 5. Function Documentation
- 6. Data Validation
- 7. Merging Pattern
- 8. Visualization Standards
What does the coding-guidelines skill do?
Standardized Python & Stata coding practices for empirical research projects
How do I install it?
Run `npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill coding-guidelines --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From brycewang-stanford/Auto-Empirical-Research-Skills, a repository with 3,244 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.