skills/30-zirui-song-claude-skills/project-structure/SKILL.md
Project directory organization and script naming conventions for research
npx skillsauth add brycewang-stanford/Awesome-Agent-Skills-for-Empirical-Research project-structureInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This document outlines the standardized structure for research project code organization. Use this as a template for organizing future research projects.
Project Root/
├── Code/ # All analysis scripts
│ ├── [Numbered]_[Descriptive].py # Data processing scripts (Python)
│ ├── AN_[Number]_[Descriptive].py # Analysis scripts (Python)
│ ├── AN_[Number]_[Descriptive].do # Analysis scripts (Stata)
│ ├── LogFiles/ # Stata log files
│ └── README.md # Project documentation
├── Data/ # All data files
│ ├── Raw/ # Original, unprocessed data
│ ├── Intermediate/ # Partially processed data
│ └── Clean/ # Final, analysis-ready datasets
└── Results/ # Analysis outputs
├── Tables/ # Regression tables, summary stats
└── Figures/ # Plots, charts, visualizations
Format: [Number]_[DescriptiveName].py
Examples:
0_ExtractCreditAgreements.py1a_CleanCompAnnualCRSP.py1b_ProcessDealscanCompustat.py2_MergeAgreementsCompCRSP.py3a_ExtractLoanOfficerNames.py4a1_ExtractLoanTerms.py4b_CleanLoanOfficerPanel.pyNumbering Logic:
Python Analysis Scripts:
AN_[Number]_[DescriptiveName].pyAN_1a_DescribeSample.pyAN_1b_DescribeSample_NoLinkedin.pyAN_1c_DescribeSample_Dealscan_Aggregated.pyStata Analysis Scripts:
AN_[Number]_[DescriptiveName].doAN_2a_MainRegressions_ChatGPT.doAN_2b_MainRegressions_ChatGPT_NoLinkedin.doAN_2c_MainRegressions_Dealscan_NoLinkedin.doAN_2d_MainRegressions_Dealscan_NoLinkedin_Aggregated.doAN_2e_MainRegressions_Dealscan_Secured.doAN_2f_MainRegressions_Dealscan_Covenants.doAnalysis Numbering Logic:
Standard Structure:
"""
[Script Name]
[Brief Description]
[Detailed description of what the script does]
"""
import pandas as pd
import numpy as np
from pathlib import Path
# Other imports as needed
def get_project_root():
"""Automatically detect the project root directory."""
return Path(__file__).parent.absolute()
def [main_function]():
"""Main processing function."""
# Script logic here
pass
if __name__ == "__main__":
[main_function]()
Key Features:
get_project_root() function for path managementStandard Structure:
/***********
Globals for Paths
***********/
*** Change repodir and overleafdir paths for different users
global repodir "/path/to/project/root"
global datadir "$repodir/Data"
global rawdir "$datadir/Raw"
global cleandir "$datadir/Clean"
global tabdir "$repodir/Results/Tables"
global figdir "$repodir/Results/Figures"
global logdir "$repodir/Code/LogFiles"
* Start logging
log using "$logdir/[ScriptName].log", replace
/***********
[Analysis Section]
***********/
* Analysis code here
* Close log file
log close
Key Features:
Standard Structure:
"""
[Script Name]
[Brief Description]
This script [detailed description] based on the analysis
in [corresponding Stata do file]
"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from pathlib import Path
def get_project_root():
"""Automatically detect the project root directory."""
return Path(__file__).parent.absolute()
def load_data():
"""Load the cleaned data."""
# Data loading logic
pass
def [analysis_function]():
"""Perform specific analysis."""
# Analysis logic
pass
def main():
"""Main analysis function."""
# Orchestrate all analyses
pass
if __name__ == "__main__":
main()
loan_officer_final_panel_chatgpt_cleaned.csvdealscan_merged_tranche_level.csvcomp_crspa_merged.csvRaw Data → Intermediate Processing → Clean Data → Analysis
(Scripts 0-4) (Scripts AN_1-AN_4)
Use descriptive suffixes for different versions:
_ChatGPT.py (uses ChatGPT-extracted data)_NoLinkedin.py (excludes LinkedIn variables)_Dealscan.py (uses Dealscan data)_Aggregated.py (uses aggregated data)get_project_root() for Python scriptsFor a new research project, create this structure:
NewProject/
├── Code/
│ ├── 0_ExtractRawData.py
│ ├── 1a_CleanDatasetA.py
│ ├── 1b_CleanDatasetB.py
│ ├── 2_MergeDatasets.py
│ ├── 3_ExtractFeatures.py
│ ├── 4_PrepareAnalysisData.py
│ ├── AN_1a_DescribeSample.py
│ ├── AN_2a_MainRegressions.do
│ ├── AN_2b_RobustnessTests.do
│ ├── LogFiles/
│ └── README.md
├── Data/
│ ├── Raw/
│ ├── Intermediate/
│ └── Clean/
└── Results/
├── Tables/
└── Figures/
This structure ensures:
tools
Recommend AND run open-source AI tools, agents, Claude Code / Codex skills, and MCP servers for any stage of a literature review — searching, reading, extracting, synthesizing, screening, citation-checking, and paper writing. Use when the user asks "what tool should I use to..." OR "install/run/use <tool> to ..." for research/lit-review work: automating a survey or related-work section, PDF→Markdown extraction for LLMs (MinerU/marker/docling), PRISMA / systematic review (ASReview), citation-backed Q&A over PDFs (PaperQA2), wiring papers into Claude/Cursor via MCP (arxiv/paper-search/zotero servers), or chatting with a Zotero library. Ships a launcher (scripts/litrun.py) that installs each tool in an isolated venv and runs it. Curated catalog of 70+ vetted projects. 支持中英文(用于「文献综述工具选型」与「一键安装/运行」)。
development
Route empirical-research requests through the Auto-Empirical Research Skills catalog when this whole repository is installed as one skill in Codex, CodeBuddy, Claude Code, or another IDE. Use to choose and load the right vendored AERS skill for causal inference, econometrics, replication, data acquisition, manuscript writing, peer review and referee responses, citation checking, de-AIGC editing, or full empirical-paper workflows without reading the entire repository at once.
documentation
Use when the project collects primary data or runs a field, lab, or survey experiment, before the intervention begins — write the pre-analysis plan, size the sample from a power calculation, and register with the AEA RCT Registry. Apply after the design is chosen in aer-identification and before any outcome data are seen.
tools
Guide economists to authoritative data sources with explicit, confirmed data specifications before retrieval; interfaces with Playwright MCP to navigate portals and extract real data, not articles about data.