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.
curl -O https://raw.githubusercontent.com/Alexander-M-Dickerson/ai-asset-pricing/main/.claude/skills/wrds-psql/SKILL.mdgit clone --depth 1 https://github.com/Alexander-M-Dickerson/ai-asset-pricingWrote 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.
[](https://agentmods.dev/skills/alexander-m-dickerson/ai-asset-pricing/wrds-psql)<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.
<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>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.
| Model | Per session | Once 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 |
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={...})`: 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) — NOTcrsp.dsfcrsp.msf_v2/crsp.wrds_msfv2_query(monthly) — NOTcrsp.msf
v1 is frozen at 2024-12-31. v2 is updated through 2025-12-31+.
v2 eliminates three common v1 error patterns:
- No
abs(prc)— prices are always positive (dlyprcflgflags bid/ask midpoint) - No
msenamesjoin — ticker, issuer name, exchange are columns in the v2 views - No delisting merge —
dlyret/mthretalready 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,
)
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.
- 12d ago First seen · 271 lines · 78 tokens per session scan C 8b482ed8460f
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.
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…
financial-workflow-integrity
Enforce correct financial workflows using durable state, idempotency, immutability, and concurrency guards (Drizzle + Postgres).
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.
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.
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 …
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.