Agent skill
imsa
Query the IMSA DuckDB dataset (output/imsa.duckdb). Includes schema guidance for seasons and laps plus formatting macros. Use for analytics, session lookups, and lap-level queries.
Install this agent skill to your Project
npx add-skill https://github.com/tobi/imsa_data/tree/main/.pi/skills/imsa
SKILL.md
IMSA DuckDB Skill
Use this skill when working with the IMSA database in this repo.
Dataset
- Database:
output/imsa.duckdb - Primary entry points:
seasonsview (session-level summary)lapstable (lap-by-lap records)
Quick Start
SELECT *
FROM seasons
WHERE session = 'race'
ORDER BY date DESC
LIMIT 10;
Schema Cheatsheet
seasons view
date(DATE): event start datesession_id(BIGINT): join key tolapsseason(VARCHAR): 2021–2025event(VARCHAR): canonical venue namesession(VARCHAR): race/practice/qualifyingcars,drivers(BIGINT): countsclasses(VARCHAR): comma-separated classessession_start,session_end(TIMESTAMP)total_laps(INTEGER)rain_laps(BIGINT)flags(VARCHAR): non-green flags (NULL means all green)
laps table
- Session keys:
year,event,session,start_date,session_id - Timing:
session_time,clock_time,lap_time,lap_time_s1/s2/s3 - Car/driver:
car(string),class,driver_name,driver_id,team_name - Lap metadata:
lap,lap_time_driver_rank,pit_time,flags - Stints:
stint_start,stint_number,stint_lap - License:
license,license_rank,driver_country - Weather:
air_temp_f,track_temp_f,humidity_percent,pressure_inhg,wind_speed_mph,wind_direction_degrees,raining
Notes
session_idis a stable join key for session-level joins.caris stored as text (e.g., '01' vs '1').stint_lapis 0-based within each stint.- Weather columns are nullable; values reuse latest reading.
Time Formatting
Use these macros when presenting times:
format_time(t) -- MM:SS.mmm or HH:MM:SS.mmm when >= 1 hour
format_gap(t) -- always +/- with 3 decimals
Examples:
format_time(117.099)→01:57.099format_time(3661.234)→01:01:01.234format_gap(4.323)→+4.323
Example Queries
Fastest laps per driver in a race:
SELECT
driver_name,
MIN(lap_time) AS best_lap
FROM laps
WHERE session_id = ?
GROUP BY driver_name
ORDER BY best_lap;
Track rain sessions:
SELECT date, event, session, rain_laps
FROM seasons
WHERE rain_laps > 0
ORDER BY date DESC;
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
install-duckdb
query
Run SQL queries against the attached DuckDB database or ad-hoc against files. Accepts raw SQL or natural language questions. Uses DuckDB Friendly SQL idioms.
attach-db
Attach a DuckDB database file for use with /duckdb-skills:query. Explores the schema (tables, columns, row counts) and writes a SQL state file so subsequent queries can restore this session automatically via duckdb -init.
read-file
Read and explore any data file (CSV, JSON, Parquet, Avro, Excel, spatial, …) locally or remotely (S3, HTTPS). Resolves the path automatically. Uses DuckDB with extension-based format detection — no magic extension needed.
read-memories
Search past Claude Code session logs to recover your own context. Invoke this proactively when you need to recall past decisions, patterns, or unresolved work — either across all projects or scoped to the current one.
IMSA Analyst
use to query historical data on the IMSA Weathertech seasons
Didn't find tool you were looking for?