ai-asset-pricing: Skill for Claude Code

.claude/skills/panel-data-rules/SKILL.md

panel-data-rules is a skill for Claude Code from Alexander-M-Dickerson/ai-asset-pricing. It costs 68 tokens per session (2,251 once invoked), scanned A, original, MIT.

A set of rules for working with CRSP, Compustat, OptionMetrics, and other financial panel data, where observations track companies over time.

In plain words
What is it for?
Use it when cleaning or transforming financial panel data, including time shifts, company links, book equity calculations, and missing values.
Why use it?
It helps prevent silent data errors such as pairing observations from the wrong dates, using future information, or linking companies incorrectly.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

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/panel-data-rules/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 panel-data-rules

README.md
[![agentmods](https://agentmods.dev/badge/skills/alexander-m-dickerson/ai-asset-pricing/panel-data-rules/github.svg)](https://agentmods.dev/skills/alexander-m-dickerson/ai-asset-pricing/panel-data-rules)
Your own site
<a href="https://agentmods.dev/skills/alexander-m-dickerson/ai-asset-pricing/panel-data-rules"><img src="https://agentmods.dev/badge/skills/alexander-m-dickerson/ai-asset-pricing/panel-data-rules/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 panel-data-rules

Your own site · 80×15
<a href="https://agentmods.dev/skills/alexander-m-dickerson/ai-asset-pricing/panel-data-rules"><img src="https://agentmods.dev/badge/skills/alexander-m-dickerson/ai-asset-pricing/panel-data-rules.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 68 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,251 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 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.00068 $0.02251
Opus 5 $0.00034 $0.01125
Sonnet 5 $0.00014 $0.00450
Haiku 4.5 $0.00007 $0.00225

Measured 11d ago against content hash 6488bb39eac1, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

panel-data-rules scanned grade A with 0 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 11d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/panel-data-rules/SKILL.md · 150 lines

How it starts

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

Financial Panel Data Rules

Apply these rules whenever writing code that manipulates CRSP, Compustat, OptionMetrics, or any financial panel data. These are hard-won lessons — violating them causes silent data errors.

Rule 1: Safe Lagging/Leading (MANDATORY)

Every groupby().shift() and .diff() MUST be followed by a date gap check. Data is rarely contiguous — missing quarters, fiscal year changes, and delistings create gaps. A bare shift(1) will silently pair non-adjacent observations.

After any shift(k), auto-insert this validation:

df["_date_shifted"] = df.groupby(id_col)[date_col].shift(k)
day_gap = (df[date_col] - df["_date_shifted"]).dt.days
df.loc[(day_gap > max_gap) | (day_gap < min_gap), shifted_col] = np.nan
df.drop(columns=["_date_shifted"], inplace=True)

Thresholds by data source (validated against real WRDS data):

Source shift(1) max gap shift(1) min gap Notes
CRSP msf/msf_v2 (month-end normalized) 31 days 28 days 2.26M obs: max gap = 31 days exactly (v2: mthcaldt)
CRSP msf/msf_v2 (raw trading dates) 33 days 28 days Raw dates vary by last trading day
Compustat fundq 100 days 80 days 99.89% in [90,92]; >100 = missing quarter
Compustat funda 380 days 350 days <350 = FYE change (correctly flagged)
CRSP dsf/dsf_v2 5 days 0 days Weekends/holidays (v2: dlycaldt)

For shift(k): max_gap = k * single_max, min_gap = k * single_min.

Infer frequency from data source (table name, column names). Columns ending in q (ibq, atq, seqq) → quarterly. If source unknown, ask the user.

CRSP month-end normalization (do this FIRST, before any gap checks or merges):

df["date"] = df["date"].dt.to_period("M").dt.to_timestamp("M")

This converts raw trading dates to calendar month-end. Required for: (1) gap checks to use the 31-day threshold, (2) matching CRSP to Compustat/JKP data, (3) consistent date joins across datasets.

Read the full file on GitHub · 150 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. 11d ago First seen · 150 lines · 68 tokens per session scan A 6488bb39eac1

Subscribe to this mod's changes

panel-data-rules is a skill published in the GitHub repository Alexander-M-Dickerson/ai-asset-pricing (59 stars, last pushed 4mo ago), licensed MIT. It adds 68 tokens to every session and 2,251 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. 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

sector-rotation

An analysis framework for comparing industries in the Chinese A-share stock market, using business conditions, price momentum, valuation, and money flows. It produces rankings and higher- or lower-allocation suggestions.

HKUDS/Vibe-Trading · 39 tokens

strategy-pivot-designer

Detect backtest iteration stagnation and generate structurally different strategy pivot proposals when parameter tuning reaches a local optimum.

tradermonty/claude-trading-skills · 28 tokens

twitter-reader

Read Twitter/X for financial research using opencli (read-only). Use this skill whenever the user wants to read their Twitter feed, search for financial tweets, view bookmarks, look up user profiles, or gather market sentiment from Twitter/X. Triggers include: "check my feed", "search Twitter for", "show my…

himself65/finance-skills · 161 tokens

chenhao-limit-up

A framework for judging Chinese A-share stocks that have reached the daily price-rise limit, using market mood, sector leadership, and trading momentum.

questflowai/investorskills · 44 tokens

trading-risk-gate

Unified pre-trade safety gate: Ruin check (Law #1), ergodicity audit, and win-rate dominance validation. Absorbs: ergodicity-check, law-of-ruin, win-rate-dominance.

winstonkoh87/Athena-Public · 53 tokens

furusato

A Japanese hometown-tax donation manager for furusato nozei, a system where donations to municipalities can qualify for an income-tax or local-tax deduction. It reads donation receipts, stores donation records, and calculates deduction limits.

kazukinagata/shinkoku · 102 tokens