ClaudeSuperPower

attach-db

Skill

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.

Install

git clone https://github.com/duckdb/duckdb-skills.git ~/.claude/skills/attach-db

What is 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.

What this can do

Capabilities declared in this component's own frontmatter — not inferred.

Run shell commands

Declares Bash

~55 tokens of context used while enabled, before you invoke anything

All declared tools (1)
Bash

Documentation

README · ~3 min read

You are helping the user attach a DuckDB database file for interactive querying.

Database path given: $0

Follow these steps in order, stopping and reporting clearly if any step fails.

State file convention: see the "Resolve state directory" section below. All skills share a single state.sql file per project. Once resolved, any skill can use it with duckdb -init "$STATE_DIR/state.sql" -c "<QUERY>".

Step 1 — Resolve the database path

If $0 is a relative path, resolve it against $PWD to get an absolute path (RESOLVED_PATH).

RESOLVED_PATH="$(cd "$(dirname "$0")" 2>/dev/null && pwd)/$(basename "$0")"

Check the file exists:

Reviews

Log in to leave a review.

No reviews yet — be the first.

Explore related

Other things in this space — across every part of the ecosystem, not just skills.

Skillssimilar to this one

All skills