agentleFS
LouLouLibsLouLouLibs/claude-skills/skills/wrds-download/SKILL.md

wrds-download

Skill1 starsChanged 2 months agoMITView on GitHub

Download data from the WRDS (Wharton Research Data Services) PostgreSQL database to local Parquet or CSV files. Use when the user asks to get data from WRDS, download financial data, or mentions WRDS schemas like crsp, comp, optionm, ibes, etc.

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 5 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If wrds-dl is not found, tell the user to install it:

    line 19
  2. Distinctive:

    Follow these steps for every download request:

    line 25
  3. Very specific:

    If unsure which table, ask the user or use wrds-dl info to explore.

    line 48
  4. Very specific:

    Always run wrds-dl info first to understand the table structure:

    line 52
  5. Distinctive:

    Use the output to:

    line 58
  6. Distinctive:

    Check the estimated row count to warn about large downloads

    line 61
  7. Distinctive:

    Format: Use Parquet unless the user asks for CSV.

    line 91
  8. Very specific:

    Limit: Use --limit for testing. Suggest --limit 1000 if the user is exploring.

    line 94
  9. Distinctive:

    After download completes, confirm the file was created and report its size:

    line 104
  10. Very specific:

    Table not found: Use wrds-dl info to check schema/table names.

    line 113

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

WRDS Data Download

You help users download data from the Wharton Research Data Services (WRDS) PostgreSQL database using the wrds-dl CLI tool.

Prerequisites

The wrds-dl CLI must be installed and on the PATH. Either the Go binary or the Python version works — they have the same commands and flags. The user must have WRDS credentials configured via one of:

  • Environment variables: PGUSER and PGPASSWORD
  • Saved credentials at ~/.config/wrds-dl/credentials
  • Standard ~/.pgpass file

If wrds-dl is not found, tell the user to install it:

Workflow

Follow these steps for every download request:

Step 1: Identify the table

Parse the user's request to determine the WRDS schema and table. Common mappings:

DatasetSchemaKey Tables
CRSP daily stockcrspdsf (daily), msf (monthly), dsi (index)
CRSP eventscrspdsedelist, stocknames
Compustat annualcompfunda
Compustat quarterlycompfundq
Compustat globalcomp_global_dailyg_funda, g_fundq
IBESibesstatsum_epsus, actu_epsus
OptionMetricsoptionmopprcd (prices), secprd (security)
TAQtaqmsecctm_YYYYMMDD
CRSP/Compustat mergedcrspccmxpf_linktable
BoardExboardexna_wrds_company_profile
Institutional (13F)tfns34
Audit Analyticsauditauditnonreli
Ravenpackravenpackrpa_djnw
Bank Regulatorybankcall_schedule_rc, bhck

If unsure which table, ask the user or use wrds-dl info to explore.

Step 2: Inspect the table

Always run wrds-dl info first to understand the table structure:

wrds-dl info --schema <schema> --table <table>

Use the output to:

  • Confirm the table exists and has the expected columns
  • Note column names for the user's requested variables
  • Check the estimated row count to warn about large downloads

For JSON output (useful for parsing): wrds-dl info --schema <schema> --table <table> --json

Step 3: Dry run

For tables with more than 1 million estimated rows, or when a WHERE clause is involved, always do a dry run first:

wrds-dl download --schema <schema> --table <table> \
  --columns "<cols>" --where "<filter>" --dry-run

Show the user the row count and sample rows. Ask for confirmation before proceeding if the row count is very large (>10M rows).

Step 4: Download

Build and run the download command:

wrds-dl download \
  --schema <schema> \
  --table <table> \
  --columns "<comma-separated columns>" \
  --where "<SQL filter>" \
  --out <output_file> \
  --format <parquet|csv>

Defaults and conventions

  • Format: Use Parquet unless the user asks for CSV. Parquet is smaller and faster.
  • Output path: Name the file descriptively, e.g., crsp_dsf_2020.parquet or comp_funda_2010_2023.parquet.
  • Columns: Select only the columns the user needs. Don't use * on wide tables — ask what variables they need.
  • Limit: Use --limit for testing. Suggest --limit 1000 if the user is exploring.

Common filters

  • Date ranges: --where "date >= '2020-01-01' AND date < '2021-01-01'"
  • Specific firms by permno: --where "permno IN (10107, 93436)"
  • Specific firms by gvkey: --where "gvkey IN ('001690', '012141')"
  • Fiscal year: --where "fyear >= 2010 AND fyear <= 2023"

Step 5: Verify

After download completes, confirm the file was created and report its size:

ls -lh <output_file>

Error handling

  • Authentication errors: Remind the user to set PGUSER/PGPASSWORD or run wrds-dl tui to save credentials.
  • Table not found: Use wrds-dl info to check schema/table names. WRDS schemas and table names are lowercase.
  • Timeout on large tables: Suggest adding a --where filter or --limit to reduce the result set.
  • Duo 2FA prompt: The connection triggers a Duo push. Tell the user to approve it on their phone.

Example interactions

User: "Download CRSP daily stock data for 2020" → wrds-dl info --schema crsp --table dsf → wrds-dl download --schema crsp --table dsf --where "date >= '2020-01-01' AND date < '2021-01-01'" --out crsp_dsf_2020.parquet

User: "Get Compustat annual fundamentals, just gvkey, datadate, and sales" → wrds-dl info --schema comp --table funda → wrds-dl download --schema comp --table funda --columns "gvkey,datadate,sale" --out comp_funda.parquet

User: "I need IBES analyst estimates" → wrds-dl info --schema ibes --table statsum_epsus → Ask what date range and variables they need, then download.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.