agentleFS
fmindfmind/dot/skills/sql/SKILL.md

sql

Skill14 starsChanged yesterdayMITView on GitHub

Query/export CSV, Parquet, JSON, SQLite, PostgreSQL via DuckDB, sqlite3, psql; SQL/dbt quality.

18 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use react, terraform and 1 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • VercelSkill

    react

    React renderer for json-render that turns JSON specs into React components. Use when working with @json-render/react, building React UIs from JSON, creating component catalogs, or rendering AI-generated specs.

    Also in 6 projects that use this

  • ihiteshguptaSkill

    terraform

    Expert in Infrastructure as Code with Terraform. Use for creating, managing, and versioning infrastructure across cloud providers.

    Also in 3 projects that use this

  • OpenAISkill

    observability

    Vercel Observability expert guidance — Drains (logs, traces, speed insights, web analytics), Web Analytics, Speed Insights, runtime logs, custom events, OpenTelemetry integration, and monitoring dashboards. Use when instrumenting, debugging, or optimizing application performance and user experience on Vercel.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 17 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use DuckDB for local analytics across CSV, Parquet, JSON, and attached SQLite files.

    line 15
  2. Very specific:

    Reconcile grain, nulls, bounds, & money: check key uniqueness and pre/post-join counts (1:N fan-out), use NOT EXISTS over NOT IN …

    line 31

“Common” is measured: kept by at least 6 in 10 of the 17 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

SQL, DuckDB, SQLite & PostgreSQL

Use DuckDB for local analytics across CSV, Parquet, JSON, and attached SQLite files; keep SQLite for embedded application state; use postgres for live PostgreSQL/pgvector inspection via psql.

Commands

duckdb -no-init -light-mode -batch -bail -json -c "SELECT count(*) AS n FROM 'events/*.json'"
duckdb -no-init -light-mode -batch -bail -no-agent -c "ATTACH 'app.sqlite' AS s (TYPE sqlite, READ_ONLY); SELECT count(*) FROM s.users"
sqlite3 -noinit -batch -bail -readonly -ifexists app.sqlite '.schema'
sqlite3 -noinit -batch -bail -noheader -list -readonly -ifexists app.sqlite 'PRAGMA integrity_check'

Keep these flags on every call: -light-mode skips DuckDB 2.0's 5s interactive/PTY OSC 11 probe; -ifexists prevents SQLite typos from creating empty DBs (PRAGMA integrity_check prints ok); -safe guards untrusted .sql files (in DuckDB it disables all filesystem access, so use it only on already-opened .duckdb files, not CSV/Parquet scans). DuckDB 2.0 agent mode auto-enables on non-TTY agent runs and truncates with a footer at 1,000 rows / 10 KB / 500 chars; default duckbox output also truncates rows and wide SUMMARIZE columns even with -no-agent, so pass -json or -csv for full results (plus -no-agent when DUCKDB_AGENT_MODE=1 is set to suppress the stderr notice).

Workflow

  1. Inspect, bound, isolate: DESCRIBE/SUMMARIZE (pin CSV types), SET max_execution_time=<ms>, mark LIMIT previews partial, export Parquet (commit .sql, not .duckdb; open -readonly).
  2. Reconcile grain, nulls, bounds, & money: check key uniqueness and pre/post-join counts (1:N fan-out), use NOT EXISTS over NOT IN (nullable), IS NOT DISTINCT FROM, NaN vs NULL, UTC [start, end) (never BETWEEN on timestamps), DECIMAL/minor ints for money, and NULLIF(denom, 0). Verify data contracts and dbt quality gates via quality-and-dbt.

Gotchas

  • Live-written SQLite & CSV import: query a .backup snapshot (plain cp misses WAL commits) or sqlite3 -readonly; first ATTACH ... (TYPE sqlite) needs network for sqlite. SQLite .import --csv turns empty fields (,,) into '' (TEXT) rather than NULL (where '' > 10 is true), so normalize with NULLIF(col, '') or query CSVs in DuckDB.
  • DuckDB 2.0 changes: defaults to v2.0.0+ (-storage-version v1.5.6 / STORAGE_VERSION 'v1.5.6' for 1.x readers); use lambda x: x + 1, ///% by zero errors, ~ is partial regex (migration).
  • Quote globs & cap spill: quote 'events/*.parquet'; cap shared hosts via SET memory_limit='256MB', SET threads=1, SET temp_directory='...', and SET max_temp_directory_size='...'.

Task guides

<!-- guides:start -->
  • postgres: Inspect PostgreSQL and pgvector safely via psql and Cloud SQL Auth Proxy: read-only timeouts, EXPLAIN plans, locks.
  • quality-and-dbt: Lint and format SQL with sqruff or sqlfluff and enforce dbt v2/Core contracts and slim CI tests.
  • remote-storage: Remote object storage (S3, GCS, HTTP, Hugging Face) and extensions: install, load, and credential providers.
<!-- guides:end -->

Official Skills

Upstream: duckdb/duckdb-skills (querying, formats, attached DBs, spatial, S3, docs) per vendor-skill policy.

Documentation

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.