ai-asset-pricing: Skill for Claude Code

.claude/skills/wrds-psql/SKILL.md

wrds-psql is a skill for Claude Code from Alexander-M-Dickerson/ai-asset-pricing. It costs 78 tokens per session (5,198 once invoked), scanned C, original, MIT.

A guide for querying WRDS financial datasets through PostgreSQL from a local machine.

In plain words
What is it for?
Use it to build or run WRDS queries, retrieve data such as stock returns, and export results to CSV or Parquet.
Why use it?
It explains the required connection setup, current CRSP table versions, safe query patterns, and export methods, helping avoid outdated tables and common extraction errors.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: reads .claude/ paths; mentions Claude Code.

This is Alexander-M-Dickerson/ai-asset-pricing's own configuration. It tells Claude Code how to work on ai-asset-pricing itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything ai-asset-pricing configures →

Reuse

Borrowing it

Nothing to install: this file belongs to Alexander-M-Dickerson/ai-asset-pricing. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/Alexander-M-Dickerson/ai-asset-pricing/main/.claude/skills/wrds-psql/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/Alexander-M-Dickerson/ai-asset-pricing

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for wrds-psql

README.md
[![agentmods](https://agentmods.dev/badge/skills/alexander-m-dickerson/ai-asset-pricing/wrds-psql/github.svg)](https://agentmods.dev/skills/alexander-m-dickerson/ai-asset-pricing/wrds-psql)
Your own site
<a href="https://agentmods.dev/skills/alexander-m-dickerson/ai-asset-pricing/wrds-psql"><img src="https://agentmods.dev/badge/skills/alexander-m-dickerson/ai-asset-pricing/wrds-psql/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for wrds-psql

Your own site · 80×15
<a href="https://agentmods.dev/skills/alexander-m-dickerson/ai-asset-pricing/wrds-psql"><img src="https://agentmods.dev/badge/skills/alexander-m-dickerson/ai-asset-pricing/wrds-psql.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 78 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,198 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00078 $0.05198
Opus 5 $0.00039 $0.02599
Sonnet 5 $0.00016 $0.01040
Haiku 4.5 $0.00008 $0.00520

Measured 12d ago against content hash 8b482ed8460f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade C, and why

wrds-psql scanned grade C with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Harvests environment variableshighData exfiltration

Enumerating or grepping the environment for keys collects credentials unrelated to what the mod says it does.

env = os.environ.copy()

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

On Windows, `PGSERVICEFILE=... psql` shell syntax does not work. In Python, pass environment variables via `subprocess.run(..., env={...})`:
.claude/skills/wrds-psql/SKILL.md · 271 lines

How it starts

The opening of the file, as written. The whole thing — 271 lines — stays where its author put it; the contents beside it link to each section on GitHub.

WRDS PostgreSQL Query Skill (Local psql via .pgpass)

Execute WRDS queries directly from the local machine using psql with service file authentication. No SSH required.

CRSP Version Policy

All CRSP queries MUST use v2 tables:

  • crsp.dsf_v2 / crsp.wrds_dsfv2_query (daily) — NOT crsp.dsf
  • crsp.msf_v2 / crsp.wrds_msfv2_query (monthly) — NOT crsp.msf

v1 is frozen at 2024-12-31. v2 is updated through 2025-12-31+.

v2 eliminates three common v1 error patterns:

  1. No abs(prc) — prices are always positive (dlyprcflg flags bid/ask midpoint)
  2. No msenames join — ticker, issuer name, exchange are columns in the v2 views
  3. No delisting merge — dlyret/mthret already include delisting returns

For the full column mapping see .claude/agents/crsp-wrds-expert.md.

Examples

  • /wrds-psql -- interactive guidance for building a query
  • /wrds-psql "daily returns for AAPL in 2024" -- natural language query description
  • /wrds-psql "SELECT permno, dlycaldt, dlyret FROM crsp.dsf_v2 WHERE permno=14593" -- direct SQL

Critical Rule: Single-Line Commands Only

Always write psql commands as a single line. Never use \ line continuation or heredocs. This avoids shell expansion approval prompts.

# GOOD — single line
psql service=wrds -c "SELECT permno, dlycaldt, dlyret FROM crsp.dsf_v2 WHERE permno = 84398 LIMIT 10;"

# BAD — multi-line
psql service=wrds \
    -c "SELECT permno, dlycaldt, dlyret
        FROM crsp.dsf_v2
        WHERE permno = 84398 LIMIT 10;"

For complex queries, write SQL to a file and use -f:

psql service=wrds -f query.sql

Connection

Connection details are in ~/.pg_service.conf (host, port, database, user); password in ~/.pgpass.

Windows

On Windows, PGSERVICEFILE=... psql shell syntax does not work. In Python, pass environment variables via subprocess.run(..., env={...}):

import os, subprocess
env = os.environ.copy()
env['PGSERVICEFILE'] = os.path.expandvars(r'$APPDATA\postgresql\pg_service.conf')
result = subprocess.run(
    ['psql', '-X', '-w', 'service=wrds', '-c', sql],
    capture_output=True, text=True, timeout=300, env=env,
)

Read the full file on GitHub · 271 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 271 lines · 78 tokens per session scan C 8b482ed8460f

Subscribe to this mod's changes

wrds-psql is a skill published in the GitHub repository Alexander-M-Dickerson/ai-asset-pricing (59 stars, last pushed 4mo ago), licensed MIT. It adds 78 tokens to every session and 5,198 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it C with 2 findings (harvests environment variables, runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

sqlserver-babelfish-finance-demo

Build, adapt, or explain a local finance migration demo from SQL Server to PostgreSQL through Babelfish. Use when Codex needs to create a small host-local SQL Server source database, initialize Babelfish/PostgreSQL, migrate a banking FinanceDemo workload through the TDS port, validate SQL Server/Babelfish/PostgreSQL…

binrogithub/1-3-Cloud-Adoption-Skills · 114 tokens

financial-workflow-integrity

Enforce correct financial workflows using durable state, idempotency, immutability, and concurrency guards (Drizzle + Postgres).

cjerochim/compound-workflow · 33 tokens

alloydb-basics

Manages clusters, instances, and backups for AlloyDB for PostgreSQL, and integrates with AlloyDB Model Context Protocol (MCP) tools for automated database operations. Use when creating, configuring, or administering AlloyDB databases. Do NOT use for general PostgreSQL instances (e.g. Cloud SQL) or other GCP databases.

google/skills · 72 tokens

postgresql-table-design

Use this skill when designing or reviewing a PostgreSQL-specific schema. Covers best-practices, data types, indexing, constraints, performance patterns, and advanced features.

wshobson/agents · 37 tokens

db-repair

Auto-fix gbrain's Postgres access so the brain stays available. When any gbrain command or MCP tool result carries a GBRAINDBACCESS marker (or an operator reports the brain database is down), run the hardcoded gbrain db-repair ladder: diagnose, apply the safe tier, verify. The action is ALWAYS the hardcoded command …

garrytan/gbrain · 96 tokens

volcengine-rds-postgresql

A tool for operating PostgreSQL databases hosted by Volcano Engine's managed database service. PostgreSQL is a relational database used to store structured application data.

bytedance/agentkit-samples · 63 tokens