Agent skill
install-duckdb
Install this agent skill to your Project
npx add-skill https://github.com/tobi/imsa_data/tree/main/.pi/skills/install-duckdb
SKILL.md
Arguments: $@
Each extension argument has the form name or name@repo.
name→INSTALL name;name@repo→INSTALL name FROM repo;
Step 1 — Locate DuckDB
DUCKDB=$(command -v duckdb)
If not found, tell the user:
DuckDB is not installed. Install it first with one of:
- macOS:
brew install duckdb- Linux:
curl -fsSL https://install.duckdb.org | sh- Windows:
winget install DuckDB.cliThen re-run
/duckdb-skills:install-duckdb.
Stop if DuckDB is not found.
Step 2 — Check for --update flag
If --update is present in $@, remove it from the argument list and set mode to update.
Otherwise mode is install.
Step 3 — Build and run statements
Install mode:
Parse each remaining argument:
- If it contains
@, split on@→INSTALL <name> FROM <repo>; - Otherwise →
INSTALL <name>;
Run all in a single DuckDB call:
"$DUCKDB" :memory: -c "INSTALL <ext1>; INSTALL <ext2> FROM <repo2>; ..."
Update mode:
First, check if the DuckDB CLI itself is up to date:
CURRENT=$(duckdb --version | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
LATEST=$(curl -fsSL https://duckdb.org/data/latest_stable_version.txt)
-
If
CURRENT==LATEST→ report DuckDB CLI is up to date. -
If
CURRENT!=LATEST→ ask the user:DuckDB CLI is outdated (installed:
CURRENT, latest:LATEST). Upgrade now?If the user agrees, detect the platform and run the appropriate upgrade command:
- macOS (
brewavailable):brew upgrade duckdb - Linux:
curl -fsSL https://install.duckdb.org | sh - Windows:
winget upgrade DuckDB.cli
- macOS (
Then update extensions:
- No extension names → update all:
UPDATE EXTENSIONS; - With extension names → update in a single call (ignore
@repo):UPDATE EXTENSIONS (<name1>, <name2>, ...);
"$DUCKDB" :memory: -c "UPDATE EXTENSIONS;"
# or
"$DUCKDB" :memory: -c "UPDATE EXTENSIONS (<ext1>, <ext2>, ...);"
Report success or failure after the call completes.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
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.
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?