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.5 | $0.00031 | $0.02079 |
| Sonnet 5.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 2mo 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.
- 2mo 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 6mo ago), licensed MIT. It adds 78 tokens to every session and 5,198 once invoked, about $0.0003 per session on Opus 5.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.
wrds-psql compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| wrds-psqlAlexander-M-Dickerson/ai-asset-pricing | Skill | 59 | 6mo ago | MIT | C | 78 | Claude Code |
| sqlserver-babelfish-finance-demobinrogithub/1-3-Cloud-Adoption-Skills | Skill | 14 | 3d ago | none | A | 114 | Codex |
| financial-workflow-integritycjerochim/compound-workflow | Skill | 2 | 4mo ago | none | A | 33 | Claude Code, Codex |
| alloydb-basicsgoogle/skills | Skill | 22k | yesterday | Apache-2.0 | A | 72 | Claude Code, Codex |
| postgresql-table-designwshobson/agents | Skill | 42k | yesterday | MIT | A | 37 | Claude Code |
| db-repairgarrytan/gbrain | Skill | 32k | yesterday | MIT | A | 96 | Claude Code |
| volcengine-rds-postgresqlbytedance/agentkit-samples | Skill | 484 | today | Apache-2.0 | A | 63 | Claude Code, Codex |