Convert File
538Convierte cualquier archivo de datos a otro formato: CSV, Parquet, JSON, Excel, GeoJSON y más, usando DuckDB.
- Costo de contexto al activarse
- 725 tok
- Tamaño del paquete
- 1 archivo
- Última actualización
- hace 5 meses
- Permisos
Adjunta un archivo de base de datos DuckDB para usarlo con /duckdb-skills:query. Explora el esquema (tablas, columnas, conteos) y escribe un state file SQL para restaurar la sesión con duckdb -init.
bashen todo el repo
0–100, la ruta de este skill
último commit aquí
últimos 90 días
55 tok en reposo
5 KB
Funciona con cualquier agente que lea SKILL.md
npx -y skills add duckdb/duckdb-skills --skill attach-db --agent claude-codeSe instala solo en este repositorio.
Este skill runs shell commands, reads environment config.
Di cualquiera de estas frases y el agente debería cargar este skill.
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>".
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:
test -f "$RESOLVED_PATH"
command -v duckdb
If not found, delegate to /duckdb-skills:install-duckdb and then continue.
duckdb "$RESOLVED_PATH" -c "PRAGMA version;"
First, list all tables:
duckdb "$RESOLVED_PATH" -csv -c "
SELECT table_name, estimated_size
FROM duckdb_tables()
ORDER BY table_name;
"
If the database has no tables, note that it is empty and skip to Step 5.
For each table discovered (up to 20), run:
duckdb "$RESOLVED_PATH" -csv -c "
DESCRIBE <table_name>;
SELECT count() AS row_count FROM <table_name>;
"
Collect the column definitions and row counts for the summary.
Check if a state file already exists in either location:
# Option 1: in the project directory
test -f .duckdb-skills/state.sql && STATE_DIR=".duckdb-skills"
# Option 2: in the home directory, scoped by project root path
PROJECT_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || echo "$PWD")"
PROJECT_ID="$(echo "$PROJECT_ROOT" | tr '/' '-')"
test -f "$HOME/.duckdb-skills/$PROJECT_ID/state.sql" && STATE_DIR="$HOME/.duckdb-skills/$PROJECT_ID"
If neither exists, ask the user:
Where would you like to store the DuckDB session state for this project?
- In the project directory (
.duckdb-skills/state.sql) — colocated with the project, easy to find. You can choose to gitignore it.- In your home directory (
~/.duckdb-skills/<project-id>/state.sql) — keeps the project directory clean.
Based on their choice:
Option 1:
STATE_DIR=".duckdb-skills"
mkdir -p "$STATE_DIR"
Then ask: "Would you like to gitignore .duckdb-skills/?" If yes:
echo '.duckdb-skills/' >> .gitignore
Option 2:
PROJECT_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || echo "$PWD")"
PROJECT_ID="$(echo "$PROJECT_ROOT" | tr '/' '-')"
STATE_DIR="$HOME/.duckdb-skills/$PROJECT_ID"
mkdir -p "$STATE_DIR"
state.sql is a shared, accumulative init file used by all duckdb-skills. It may already contain macros, LOAD statements, secrets, or other ATTACH statements written by other skills. Never overwrite it — always check for duplicates and append.
Derive the database alias from the filename without extension (e.g. my_data.duckdb → my_data). Check if this ATTACH already exists:
grep -q "ATTACH.*RESOLVED_PATH" "$STATE_DIR/state.sql" 2>/dev/null
If not already present, append:
cat >> "$STATE_DIR/state.sql" <<'STATESQL'
ATTACH IF NOT EXISTS 'RESOLVED_PATH' AS my_data;
USE my_data;
STATESQL
Replace RESOLVED_PATH and my_data with the actual values. If the alias would conflict with an existing one in the file, ask the user for a name.
duckdb -init "$STATE_DIR/state.sql" -c "SHOW TABLES;"
If this fails, fix the state file and retry.
Summarize for the user:
STATE_DIR/state.sql path/duckdb-skills:queryIf the database is empty, suggest creating tables or importing data.
Reproducido de duckdb/duckdb-skills bajo licencia MIT. Leer esta página en markdown.
1 archivo en el paquete. Solo se lee SKILL.md al activarse — las referencias se cargan si el skill decide que las necesita.
Requiere el binario duckdb instalado; si falta, delega a /duckdb-skills:install-duckdb.
Necesita en el PATH:git
Variables de entorno:PROJECT_IDPROJECT_ROOTRESOLVED_PATHSTATE_DIR
Este repo incluye 9 skills. Si instalas uno, normalmente ya tienes los demás. Ver el pack duckdb-skills entero y su comando de instalación
Convierte cualquier archivo de datos a otro formato: CSV, Parquet, JSON, Excel, GeoJSON y más, usando DuckDB.
Explora y consulta datos en S3, Cloudflare R2, GCS, MinIO o cualquier almacenamiento compatible con S3, sin necesidad de descargarlos.
Responde preguntas sobre datos espaciales con DuckDB: ubicaciones, coordenadas, distancias, mapas, direcciones, formatos como GeoJSON, Shapefile, GeoPackage, GPX o GeoParquet, usando también Overture Maps.
Busca en la documentación de DuckDB y DuckLake y en posts del blog, devolviendo fragmentos relevantes mediante búsqueda de texto completo contra un índice local cacheado.
Lee cualquier archivo de datos (CSV, JSON, Parquet, Avro, Excel, spatial, SQLite) o URL remota (S3, HTTPS) usando DuckDB. No sirve para código fuente.
Busca en los logs de sesiones pasadas de Claude Code para recordar decisiones, patrones o trabajo pendiente. Úsalo cuando el usuario mencione conversaciones anteriores o necesites contexto previo.
Busca en la documentación de DuckDB y DuckLake y en posts del blog, devolviendo fragmentos relevantes mediante búsqueda de texto completo contra un índice local cacheado.
Instala o actualiza extensiones de DuckDB. Cada argumento es un nombre simple (core) o name@repo (p. ej. magic@community). Usa --update para actualizar en vez de instalar.
Ejecuta consultas SQL contra la base DuckDB adjunta o directamente sobre archivos, aceptando SQL crudo o preguntas en lenguaje natural con los modismos de DuckDB Friendly SQL.