[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-duckdb-attach-db":3,"mdc-oqixbv-key":32,"related-repo-duckdb-attach-db":1596,"related-org-duckdb-attach-db":1686},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":22,"repoUrl":23,"updatedAt":24,"license":25,"forks":26,"topics":27,"repo":28,"sourceUrl":30,"mdContent":31},"attach-db","attach DuckDB database files for querying","Attach a DuckDB database file for use with \u002Fduckdb-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.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"duckdb","DuckDB","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fduckdb.jpg",[12,16,19],{"name":13,"slug":14,"type":15},"Data Analysis","data-analysis","tag",{"name":17,"slug":18,"type":15},"Database","database",{"name":20,"slug":21,"type":15},"SQL","sql",510,"https:\u002F\u002Fgithub.com\u002Fduckdb\u002Fduckdb-skills","2026-07-12T07:54:35.248848",null,25,[],{"repoUrl":23,"stars":22,"forks":26,"topics":29,"description":25},[],"https:\u002F\u002Fgithub.com\u002Fduckdb\u002Fduckdb-skills\u002Ftree\u002FHEAD\u002Fskills\u002Fattach-db","---\nname: attach-db\ndescription: >\n  Attach a DuckDB database file for use with \u002Fduckdb-skills:query.\n  Explores the schema (tables, columns, row counts) and writes a SQL state file\n  so subsequent queries can restore this session automatically via duckdb -init.\nargument-hint: \u003Cpath-to-database.duckdb>\nallowed-tools: Bash\n---\n\nYou are helping the user attach a DuckDB database file for interactive querying.\n\nDatabase path given: `$0`\n\nFollow these steps in order, stopping and reporting clearly if any step fails.\n\n**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\u002Fstate.sql\" -c \"\u003CQUERY>\"`.\n\n## Step 1 — Resolve the database path\n\nIf `$0` is a relative path, resolve it against `$PWD` to get an absolute path (`RESOLVED_PATH`).\n\n```bash\nRESOLVED_PATH=\"$(cd \"$(dirname \"$0\")\" 2>\u002Fdev\u002Fnull && pwd)\u002F$(basename \"$0\")\"\n```\n\nCheck the file exists:\n\n```bash\ntest -f \"$RESOLVED_PATH\"\n```\n\n- **File exists** -> continue to Step 2.\n- **File not found** -> ask the user if they want to create a new empty database (DuckDB creates the file on first write). If yes, continue. If no, stop.\n\n## Step 2 — Check DuckDB is installed\n\n```bash\ncommand -v duckdb\n```\n\nIf not found, delegate to `\u002Fduckdb-skills:install-duckdb` and then continue.\n\n## Step 3 — Validate the database\n\n```bash\nduckdb \"$RESOLVED_PATH\" -c \"PRAGMA version;\"\n```\n\n- **Success** -> continue.\n- **Failure** -> report the error clearly (e.g. corrupt file, not a DuckDB database) and stop.\n\n## Step 4 — Explore the schema\n\nFirst, list all tables:\n\n```bash\nduckdb \"$RESOLVED_PATH\" -csv -c \"\nSELECT table_name, estimated_size\nFROM duckdb_tables()\nORDER BY table_name;\n\"\n```\n\nIf the database has **no tables**, note that it is empty and skip to Step 5.\n\nFor each table discovered (up to 20), run:\n\n```bash\nduckdb \"$RESOLVED_PATH\" -csv -c \"\nDESCRIBE \u003Ctable_name>;\nSELECT count() AS row_count FROM \u003Ctable_name>;\n\"\n```\n\nCollect the column definitions and row counts for the summary.\n\n## Step 5 — Resolve the state directory\n\nCheck if a state file already exists in either location:\n\n```bash\n# Option 1: in the project directory\ntest -f .duckdb-skills\u002Fstate.sql && STATE_DIR=\".duckdb-skills\"\n\n# Option 2: in the home directory, scoped by project root path\nPROJECT_ROOT=\"$(git rev-parse --show-toplevel 2>\u002Fdev\u002Fnull || echo \"$PWD\")\"\nPROJECT_ID=\"$(echo \"$PROJECT_ROOT\" | tr '\u002F' '-')\"\ntest -f \"$HOME\u002F.duckdb-skills\u002F$PROJECT_ID\u002Fstate.sql\" && STATE_DIR=\"$HOME\u002F.duckdb-skills\u002F$PROJECT_ID\"\n```\n\nIf **neither exists**, ask the user:\n\n> Where would you like to store the DuckDB session state for this project?\n>\n> 1. **In the project directory** (`.duckdb-skills\u002Fstate.sql`) — colocated with the project, easy to find. You can choose to gitignore it.\n> 2. **In your home directory** (`~\u002F.duckdb-skills\u002F\u003Cproject-id>\u002Fstate.sql`) — keeps the project directory clean.\n\nBased on their choice:\n\n**Option 1:**\n```bash\nSTATE_DIR=\".duckdb-skills\"\nmkdir -p \"$STATE_DIR\"\n```\nThen ask: *\"Would you like to gitignore `.duckdb-skills\u002F`?\"* If yes:\n```bash\necho '.duckdb-skills\u002F' >> .gitignore\n```\n\n**Option 2:**\n```bash\nPROJECT_ROOT=\"$(git rev-parse --show-toplevel 2>\u002Fdev\u002Fnull || echo \"$PWD\")\"\nPROJECT_ID=\"$(echo \"$PROJECT_ROOT\" | tr '\u002F' '-')\"\nSTATE_DIR=\"$HOME\u002F.duckdb-skills\u002F$PROJECT_ID\"\nmkdir -p \"$STATE_DIR\"\n```\n\n## Step 6 — Append to the state file\n\n`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.\n\nDerive the database alias from the filename without extension (e.g. `my_data.duckdb` → `my_data`). Check if this ATTACH already exists:\n\n```bash\ngrep -q \"ATTACH.*RESOLVED_PATH\" \"$STATE_DIR\u002Fstate.sql\" 2>\u002Fdev\u002Fnull\n```\n\nIf not already present, append:\n\n```bash\ncat >> \"$STATE_DIR\u002Fstate.sql\" \u003C\u003C'STATESQL'\nATTACH IF NOT EXISTS 'RESOLVED_PATH' AS my_data;\nUSE my_data;\nSTATESQL\n```\n\nReplace `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.\n\n## Step 7 — Verify the state file works\n\n```bash\nduckdb -init \"$STATE_DIR\u002Fstate.sql\" -c \"SHOW TABLES;\"\n```\n\nIf this fails, fix the state file and retry.\n\n## Step 8 — Report\n\nSummarize for the user:\n\n- **Database path**: the resolved absolute path\n- **Alias**: the database alias used in the state file\n- **State file**: the resolved `STATE_DIR\u002Fstate.sql` path\n- **Tables**: name, column count, row count for each table (or note the DB is empty)\n- Confirm the database is now active for `\u002Fduckdb-skills:query`\n\nIf the database is empty, suggest creating tables or importing data.\n",{"data":33,"body":36},{"name":4,"description":6,"argument-hint":34,"allowed-tools":35},"\u003Cpath-to-database.duckdb>","Bash",{"type":37,"children":38},"root",[39,47,59,64,91,98,126,245,250,284,309,315,340,353,359,404,427,433,438,513,525,530,591,596,602,607,885,896,944,949,957,1014,1035,1071,1079,1254,1260,1277,1298,1356,1361,1430,1449,1455,1507,1512,1518,1523,1585,1590],{"type":40,"tag":41,"props":42,"children":43},"element","p",{},[44],{"type":45,"value":46},"text","You are helping the user attach a DuckDB database file for interactive querying.",{"type":40,"tag":41,"props":48,"children":49},{},[50,52],{"type":45,"value":51},"Database path given: ",{"type":40,"tag":53,"props":54,"children":56},"code",{"className":55},[],[57],{"type":45,"value":58},"$0",{"type":40,"tag":41,"props":60,"children":61},{},[62],{"type":45,"value":63},"Follow these steps in order, stopping and reporting clearly if any step fails.",{"type":40,"tag":41,"props":65,"children":66},{},[67,73,75,81,83,89],{"type":40,"tag":68,"props":69,"children":70},"strong",{},[71],{"type":45,"value":72},"State file convention",{"type":45,"value":74},": see the \"Resolve state directory\" section below. All skills share a single ",{"type":40,"tag":53,"props":76,"children":78},{"className":77},[],[79],{"type":45,"value":80},"state.sql",{"type":45,"value":82}," file per project. Once resolved, any skill can use it with ",{"type":40,"tag":53,"props":84,"children":86},{"className":85},[],[87],{"type":45,"value":88},"duckdb -init \"$STATE_DIR\u002Fstate.sql\" -c \"\u003CQUERY>\"",{"type":45,"value":90},".",{"type":40,"tag":92,"props":93,"children":95},"h2",{"id":94},"step-1-resolve-the-database-path",[96],{"type":45,"value":97},"Step 1 — Resolve the database path",{"type":40,"tag":41,"props":99,"children":100},{},[101,103,108,110,116,118,124],{"type":45,"value":102},"If ",{"type":40,"tag":53,"props":104,"children":106},{"className":105},[],[107],{"type":45,"value":58},{"type":45,"value":109}," is a relative path, resolve it against ",{"type":40,"tag":53,"props":111,"children":113},{"className":112},[],[114],{"type":45,"value":115},"$PWD",{"type":45,"value":117}," to get an absolute path (",{"type":40,"tag":53,"props":119,"children":121},{"className":120},[],[122],{"type":45,"value":123},"RESOLVED_PATH",{"type":45,"value":125},").",{"type":40,"tag":127,"props":128,"children":133},"pre",{"className":129,"code":130,"language":131,"meta":132,"style":132},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","RESOLVED_PATH=\"$(cd \"$(dirname \"$0\")\" 2>\u002Fdev\u002Fnull && pwd)\u002F$(basename \"$0\")\"\n","bash","",[134],{"type":40,"tag":53,"props":135,"children":136},{"__ignoreMap":132},[137],{"type":40,"tag":138,"props":139,"children":142},"span",{"class":140,"line":141},"line",1,[143,148,154,159,165,170,176,181,186,191,196,202,207,212,217,222,227,232,236,240],{"type":40,"tag":138,"props":144,"children":146},{"style":145},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[147],{"type":45,"value":123},{"type":40,"tag":138,"props":149,"children":151},{"style":150},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[152],{"type":45,"value":153},"=",{"type":40,"tag":138,"props":155,"children":156},{"style":150},[157],{"type":45,"value":158},"\"$(",{"type":40,"tag":138,"props":160,"children":162},{"style":161},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[163],{"type":45,"value":164},"cd",{"type":40,"tag":138,"props":166,"children":167},{"style":150},[168],{"type":45,"value":169}," \"$(",{"type":40,"tag":138,"props":171,"children":173},{"style":172},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[174],{"type":45,"value":175},"dirname",{"type":40,"tag":138,"props":177,"children":178},{"style":150},[179],{"type":45,"value":180}," \"",{"type":40,"tag":138,"props":182,"children":184},{"style":183},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic",[185],{"type":45,"value":58},{"type":40,"tag":138,"props":187,"children":188},{"style":150},[189],{"type":45,"value":190},"\")\"",{"type":40,"tag":138,"props":192,"children":193},{"style":150},[194],{"type":45,"value":195}," 2>",{"type":40,"tag":138,"props":197,"children":199},{"style":198},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[200],{"type":45,"value":201},"\u002Fdev\u002Fnull ",{"type":40,"tag":138,"props":203,"children":204},{"style":150},[205],{"type":45,"value":206},"&&",{"type":40,"tag":138,"props":208,"children":209},{"style":161},[210],{"type":45,"value":211}," pwd",{"type":40,"tag":138,"props":213,"children":214},{"style":150},[215],{"type":45,"value":216},")",{"type":40,"tag":138,"props":218,"children":219},{"style":198},[220],{"type":45,"value":221},"\u002F",{"type":40,"tag":138,"props":223,"children":224},{"style":150},[225],{"type":45,"value":226},"$(",{"type":40,"tag":138,"props":228,"children":229},{"style":172},[230],{"type":45,"value":231},"basename",{"type":40,"tag":138,"props":233,"children":234},{"style":150},[235],{"type":45,"value":180},{"type":40,"tag":138,"props":237,"children":238},{"style":183},[239],{"type":45,"value":58},{"type":40,"tag":138,"props":241,"children":242},{"style":150},[243],{"type":45,"value":244},"\")\"\n",{"type":40,"tag":41,"props":246,"children":247},{},[248],{"type":45,"value":249},"Check the file exists:",{"type":40,"tag":127,"props":251,"children":253},{"className":129,"code":252,"language":131,"meta":132,"style":132},"test -f \"$RESOLVED_PATH\"\n",[254],{"type":40,"tag":53,"props":255,"children":256},{"__ignoreMap":132},[257],{"type":40,"tag":138,"props":258,"children":259},{"class":140,"line":141},[260,265,270,274,279],{"type":40,"tag":138,"props":261,"children":262},{"style":161},[263],{"type":45,"value":264},"test",{"type":40,"tag":138,"props":266,"children":267},{"style":198},[268],{"type":45,"value":269}," -f",{"type":40,"tag":138,"props":271,"children":272},{"style":150},[273],{"type":45,"value":180},{"type":40,"tag":138,"props":275,"children":276},{"style":145},[277],{"type":45,"value":278},"$RESOLVED_PATH",{"type":40,"tag":138,"props":280,"children":281},{"style":150},[282],{"type":45,"value":283},"\"\n",{"type":40,"tag":285,"props":286,"children":287},"ul",{},[288,299],{"type":40,"tag":289,"props":290,"children":291},"li",{},[292,297],{"type":40,"tag":68,"props":293,"children":294},{},[295],{"type":45,"value":296},"File exists",{"type":45,"value":298}," -> continue to Step 2.",{"type":40,"tag":289,"props":300,"children":301},{},[302,307],{"type":40,"tag":68,"props":303,"children":304},{},[305],{"type":45,"value":306},"File not found",{"type":45,"value":308}," -> ask the user if they want to create a new empty database (DuckDB creates the file on first write). If yes, continue. If no, stop.",{"type":40,"tag":92,"props":310,"children":312},{"id":311},"step-2-check-duckdb-is-installed",[313],{"type":45,"value":314},"Step 2 — Check DuckDB is installed",{"type":40,"tag":127,"props":316,"children":318},{"className":129,"code":317,"language":131,"meta":132,"style":132},"command -v duckdb\n",[319],{"type":40,"tag":53,"props":320,"children":321},{"__ignoreMap":132},[322],{"type":40,"tag":138,"props":323,"children":324},{"class":140,"line":141},[325,330,335],{"type":40,"tag":138,"props":326,"children":327},{"style":161},[328],{"type":45,"value":329},"command",{"type":40,"tag":138,"props":331,"children":332},{"style":198},[333],{"type":45,"value":334}," -v",{"type":40,"tag":138,"props":336,"children":337},{"style":198},[338],{"type":45,"value":339}," duckdb\n",{"type":40,"tag":41,"props":341,"children":342},{},[343,345,351],{"type":45,"value":344},"If not found, delegate to ",{"type":40,"tag":53,"props":346,"children":348},{"className":347},[],[349],{"type":45,"value":350},"\u002Fduckdb-skills:install-duckdb",{"type":45,"value":352}," and then continue.",{"type":40,"tag":92,"props":354,"children":356},{"id":355},"step-3-validate-the-database",[357],{"type":45,"value":358},"Step 3 — Validate the database",{"type":40,"tag":127,"props":360,"children":362},{"className":129,"code":361,"language":131,"meta":132,"style":132},"duckdb \"$RESOLVED_PATH\" -c \"PRAGMA version;\"\n",[363],{"type":40,"tag":53,"props":364,"children":365},{"__ignoreMap":132},[366],{"type":40,"tag":138,"props":367,"children":368},{"class":140,"line":141},[369,373,377,381,386,391,395,400],{"type":40,"tag":138,"props":370,"children":371},{"style":172},[372],{"type":45,"value":8},{"type":40,"tag":138,"props":374,"children":375},{"style":150},[376],{"type":45,"value":180},{"type":40,"tag":138,"props":378,"children":379},{"style":145},[380],{"type":45,"value":278},{"type":40,"tag":138,"props":382,"children":383},{"style":150},[384],{"type":45,"value":385},"\"",{"type":40,"tag":138,"props":387,"children":388},{"style":198},[389],{"type":45,"value":390}," -c",{"type":40,"tag":138,"props":392,"children":393},{"style":150},[394],{"type":45,"value":180},{"type":40,"tag":138,"props":396,"children":397},{"style":198},[398],{"type":45,"value":399},"PRAGMA version;",{"type":40,"tag":138,"props":401,"children":402},{"style":150},[403],{"type":45,"value":283},{"type":40,"tag":285,"props":405,"children":406},{},[407,417],{"type":40,"tag":289,"props":408,"children":409},{},[410,415],{"type":40,"tag":68,"props":411,"children":412},{},[413],{"type":45,"value":414},"Success",{"type":45,"value":416}," -> continue.",{"type":40,"tag":289,"props":418,"children":419},{},[420,425],{"type":40,"tag":68,"props":421,"children":422},{},[423],{"type":45,"value":424},"Failure",{"type":45,"value":426}," -> report the error clearly (e.g. corrupt file, not a DuckDB database) and stop.",{"type":40,"tag":92,"props":428,"children":430},{"id":429},"step-4-explore-the-schema",[431],{"type":45,"value":432},"Step 4 — Explore the schema",{"type":40,"tag":41,"props":434,"children":435},{},[436],{"type":45,"value":437},"First, list all tables:",{"type":40,"tag":127,"props":439,"children":441},{"className":129,"code":440,"language":131,"meta":132,"style":132},"duckdb \"$RESOLVED_PATH\" -csv -c \"\nSELECT table_name, estimated_size\nFROM duckdb_tables()\nORDER BY table_name;\n\"\n",[442],{"type":40,"tag":53,"props":443,"children":444},{"__ignoreMap":132},[445,478,487,496,505],{"type":40,"tag":138,"props":446,"children":447},{"class":140,"line":141},[448,452,456,460,464,469,473],{"type":40,"tag":138,"props":449,"children":450},{"style":172},[451],{"type":45,"value":8},{"type":40,"tag":138,"props":453,"children":454},{"style":150},[455],{"type":45,"value":180},{"type":40,"tag":138,"props":457,"children":458},{"style":145},[459],{"type":45,"value":278},{"type":40,"tag":138,"props":461,"children":462},{"style":150},[463],{"type":45,"value":385},{"type":40,"tag":138,"props":465,"children":466},{"style":198},[467],{"type":45,"value":468}," -csv",{"type":40,"tag":138,"props":470,"children":471},{"style":198},[472],{"type":45,"value":390},{"type":40,"tag":138,"props":474,"children":475},{"style":150},[476],{"type":45,"value":477}," \"\n",{"type":40,"tag":138,"props":479,"children":481},{"class":140,"line":480},2,[482],{"type":40,"tag":138,"props":483,"children":484},{"style":198},[485],{"type":45,"value":486},"SELECT table_name, estimated_size\n",{"type":40,"tag":138,"props":488,"children":490},{"class":140,"line":489},3,[491],{"type":40,"tag":138,"props":492,"children":493},{"style":198},[494],{"type":45,"value":495},"FROM duckdb_tables()\n",{"type":40,"tag":138,"props":497,"children":499},{"class":140,"line":498},4,[500],{"type":40,"tag":138,"props":501,"children":502},{"style":198},[503],{"type":45,"value":504},"ORDER BY table_name;\n",{"type":40,"tag":138,"props":506,"children":508},{"class":140,"line":507},5,[509],{"type":40,"tag":138,"props":510,"children":511},{"style":150},[512],{"type":45,"value":283},{"type":40,"tag":41,"props":514,"children":515},{},[516,518,523],{"type":45,"value":517},"If the database has ",{"type":40,"tag":68,"props":519,"children":520},{},[521],{"type":45,"value":522},"no tables",{"type":45,"value":524},", note that it is empty and skip to Step 5.",{"type":40,"tag":41,"props":526,"children":527},{},[528],{"type":45,"value":529},"For each table discovered (up to 20), run:",{"type":40,"tag":127,"props":531,"children":533},{"className":129,"code":532,"language":131,"meta":132,"style":132},"duckdb \"$RESOLVED_PATH\" -csv -c \"\nDESCRIBE \u003Ctable_name>;\nSELECT count() AS row_count FROM \u003Ctable_name>;\n\"\n",[534],{"type":40,"tag":53,"props":535,"children":536},{"__ignoreMap":132},[537,568,576,584],{"type":40,"tag":138,"props":538,"children":539},{"class":140,"line":141},[540,544,548,552,556,560,564],{"type":40,"tag":138,"props":541,"children":542},{"style":172},[543],{"type":45,"value":8},{"type":40,"tag":138,"props":545,"children":546},{"style":150},[547],{"type":45,"value":180},{"type":40,"tag":138,"props":549,"children":550},{"style":145},[551],{"type":45,"value":278},{"type":40,"tag":138,"props":553,"children":554},{"style":150},[555],{"type":45,"value":385},{"type":40,"tag":138,"props":557,"children":558},{"style":198},[559],{"type":45,"value":468},{"type":40,"tag":138,"props":561,"children":562},{"style":198},[563],{"type":45,"value":390},{"type":40,"tag":138,"props":565,"children":566},{"style":150},[567],{"type":45,"value":477},{"type":40,"tag":138,"props":569,"children":570},{"class":140,"line":480},[571],{"type":40,"tag":138,"props":572,"children":573},{"style":198},[574],{"type":45,"value":575},"DESCRIBE \u003Ctable_name>;\n",{"type":40,"tag":138,"props":577,"children":578},{"class":140,"line":489},[579],{"type":40,"tag":138,"props":580,"children":581},{"style":198},[582],{"type":45,"value":583},"SELECT count() AS row_count FROM \u003Ctable_name>;\n",{"type":40,"tag":138,"props":585,"children":586},{"class":140,"line":498},[587],{"type":40,"tag":138,"props":588,"children":589},{"style":150},[590],{"type":45,"value":283},{"type":40,"tag":41,"props":592,"children":593},{},[594],{"type":45,"value":595},"Collect the column definitions and row counts for the summary.",{"type":40,"tag":92,"props":597,"children":599},{"id":598},"step-5-resolve-the-state-directory",[600],{"type":45,"value":601},"Step 5 — Resolve the state directory",{"type":40,"tag":41,"props":603,"children":604},{},[605],{"type":45,"value":606},"Check if a state file already exists in either location:",{"type":40,"tag":127,"props":608,"children":610},{"className":129,"code":609,"language":131,"meta":132,"style":132},"# Option 1: in the project directory\ntest -f .duckdb-skills\u002Fstate.sql && STATE_DIR=\".duckdb-skills\"\n\n# Option 2: in the home directory, scoped by project root path\nPROJECT_ROOT=\"$(git rev-parse --show-toplevel 2>\u002Fdev\u002Fnull || echo \"$PWD\")\"\nPROJECT_ID=\"$(echo \"$PROJECT_ROOT\" | tr '\u002F' '-')\"\ntest -f \"$HOME\u002F.duckdb-skills\u002F$PROJECT_ID\u002Fstate.sql\" && STATE_DIR=\"$HOME\u002F.duckdb-skills\u002F$PROJECT_ID\"\n",[611],{"type":40,"tag":53,"props":612,"children":613},{"__ignoreMap":132},[614,623,666,675,683,740,813],{"type":40,"tag":138,"props":615,"children":616},{"class":140,"line":141},[617],{"type":40,"tag":138,"props":618,"children":620},{"style":619},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[621],{"type":45,"value":622},"# Option 1: in the project directory\n",{"type":40,"tag":138,"props":624,"children":625},{"class":140,"line":480},[626,630,634,639,644,649,653,657,662],{"type":40,"tag":138,"props":627,"children":628},{"style":161},[629],{"type":45,"value":264},{"type":40,"tag":138,"props":631,"children":632},{"style":198},[633],{"type":45,"value":269},{"type":40,"tag":138,"props":635,"children":636},{"style":198},[637],{"type":45,"value":638}," .duckdb-skills\u002Fstate.sql",{"type":40,"tag":138,"props":640,"children":641},{"style":150},[642],{"type":45,"value":643}," &&",{"type":40,"tag":138,"props":645,"children":646},{"style":145},[647],{"type":45,"value":648}," STATE_DIR",{"type":40,"tag":138,"props":650,"children":651},{"style":150},[652],{"type":45,"value":153},{"type":40,"tag":138,"props":654,"children":655},{"style":150},[656],{"type":45,"value":385},{"type":40,"tag":138,"props":658,"children":659},{"style":198},[660],{"type":45,"value":661},".duckdb-skills",{"type":40,"tag":138,"props":663,"children":664},{"style":150},[665],{"type":45,"value":283},{"type":40,"tag":138,"props":667,"children":668},{"class":140,"line":489},[669],{"type":40,"tag":138,"props":670,"children":672},{"emptyLinePlaceholder":671},true,[673],{"type":45,"value":674},"\n",{"type":40,"tag":138,"props":676,"children":677},{"class":140,"line":498},[678],{"type":40,"tag":138,"props":679,"children":680},{"style":619},[681],{"type":45,"value":682},"# Option 2: in the home directory, scoped by project root path\n",{"type":40,"tag":138,"props":684,"children":685},{"class":140,"line":507},[686,691,695,699,704,709,714,718,723,728,732,736],{"type":40,"tag":138,"props":687,"children":688},{"style":145},[689],{"type":45,"value":690},"PROJECT_ROOT",{"type":40,"tag":138,"props":692,"children":693},{"style":150},[694],{"type":45,"value":153},{"type":40,"tag":138,"props":696,"children":697},{"style":150},[698],{"type":45,"value":158},{"type":40,"tag":138,"props":700,"children":701},{"style":172},[702],{"type":45,"value":703},"git",{"type":40,"tag":138,"props":705,"children":706},{"style":198},[707],{"type":45,"value":708}," rev-parse --show-toplevel ",{"type":40,"tag":138,"props":710,"children":711},{"style":150},[712],{"type":45,"value":713},"2>",{"type":40,"tag":138,"props":715,"children":716},{"style":198},[717],{"type":45,"value":201},{"type":40,"tag":138,"props":719,"children":720},{"style":150},[721],{"type":45,"value":722},"||",{"type":40,"tag":138,"props":724,"children":725},{"style":161},[726],{"type":45,"value":727}," echo",{"type":40,"tag":138,"props":729,"children":730},{"style":150},[731],{"type":45,"value":180},{"type":40,"tag":138,"props":733,"children":734},{"style":145},[735],{"type":45,"value":115},{"type":40,"tag":138,"props":737,"children":738},{"style":150},[739],{"type":45,"value":244},{"type":40,"tag":138,"props":741,"children":743},{"class":140,"line":742},6,[744,749,753,757,762,766,771,775,780,785,790,794,799,803,808],{"type":40,"tag":138,"props":745,"children":746},{"style":145},[747],{"type":45,"value":748},"PROJECT_ID",{"type":40,"tag":138,"props":750,"children":751},{"style":150},[752],{"type":45,"value":153},{"type":40,"tag":138,"props":754,"children":755},{"style":150},[756],{"type":45,"value":158},{"type":40,"tag":138,"props":758,"children":759},{"style":161},[760],{"type":45,"value":761},"echo",{"type":40,"tag":138,"props":763,"children":764},{"style":150},[765],{"type":45,"value":180},{"type":40,"tag":138,"props":767,"children":768},{"style":145},[769],{"type":45,"value":770},"$PROJECT_ROOT",{"type":40,"tag":138,"props":772,"children":773},{"style":150},[774],{"type":45,"value":385},{"type":40,"tag":138,"props":776,"children":777},{"style":150},[778],{"type":45,"value":779}," |",{"type":40,"tag":138,"props":781,"children":782},{"style":172},[783],{"type":45,"value":784}," tr",{"type":40,"tag":138,"props":786,"children":787},{"style":150},[788],{"type":45,"value":789}," '",{"type":40,"tag":138,"props":791,"children":792},{"style":198},[793],{"type":45,"value":221},{"type":40,"tag":138,"props":795,"children":796},{"style":150},[797],{"type":45,"value":798},"'",{"type":40,"tag":138,"props":800,"children":801},{"style":150},[802],{"type":45,"value":789},{"type":40,"tag":138,"props":804,"children":805},{"style":198},[806],{"type":45,"value":807},"-",{"type":40,"tag":138,"props":809,"children":810},{"style":150},[811],{"type":45,"value":812},"')\"\n",{"type":40,"tag":138,"props":814,"children":816},{"class":140,"line":815},7,[817,821,825,829,834,839,844,849,853,857,861,865,869,873,877,881],{"type":40,"tag":138,"props":818,"children":819},{"style":161},[820],{"type":45,"value":264},{"type":40,"tag":138,"props":822,"children":823},{"style":198},[824],{"type":45,"value":269},{"type":40,"tag":138,"props":826,"children":827},{"style":150},[828],{"type":45,"value":180},{"type":40,"tag":138,"props":830,"children":831},{"style":145},[832],{"type":45,"value":833},"$HOME",{"type":40,"tag":138,"props":835,"children":836},{"style":198},[837],{"type":45,"value":838},"\u002F.duckdb-skills\u002F",{"type":40,"tag":138,"props":840,"children":841},{"style":145},[842],{"type":45,"value":843},"$PROJECT_ID",{"type":40,"tag":138,"props":845,"children":846},{"style":198},[847],{"type":45,"value":848},"\u002Fstate.sql",{"type":40,"tag":138,"props":850,"children":851},{"style":150},[852],{"type":45,"value":385},{"type":40,"tag":138,"props":854,"children":855},{"style":150},[856],{"type":45,"value":643},{"type":40,"tag":138,"props":858,"children":859},{"style":145},[860],{"type":45,"value":648},{"type":40,"tag":138,"props":862,"children":863},{"style":150},[864],{"type":45,"value":153},{"type":40,"tag":138,"props":866,"children":867},{"style":150},[868],{"type":45,"value":385},{"type":40,"tag":138,"props":870,"children":871},{"style":145},[872],{"type":45,"value":833},{"type":40,"tag":138,"props":874,"children":875},{"style":198},[876],{"type":45,"value":838},{"type":40,"tag":138,"props":878,"children":879},{"style":145},[880],{"type":45,"value":843},{"type":40,"tag":138,"props":882,"children":883},{"style":150},[884],{"type":45,"value":283},{"type":40,"tag":41,"props":886,"children":887},{},[888,889,894],{"type":45,"value":102},{"type":40,"tag":68,"props":890,"children":891},{},[892],{"type":45,"value":893},"neither exists",{"type":45,"value":895},", ask the user:",{"type":40,"tag":897,"props":898,"children":899},"blockquote",{},[900,905],{"type":40,"tag":41,"props":901,"children":902},{},[903],{"type":45,"value":904},"Where would you like to store the DuckDB session state for this project?",{"type":40,"tag":906,"props":907,"children":908},"ol",{},[909,927],{"type":40,"tag":289,"props":910,"children":911},{},[912,917,919,925],{"type":40,"tag":68,"props":913,"children":914},{},[915],{"type":45,"value":916},"In the project directory",{"type":45,"value":918}," (",{"type":40,"tag":53,"props":920,"children":922},{"className":921},[],[923],{"type":45,"value":924},".duckdb-skills\u002Fstate.sql",{"type":45,"value":926},") — colocated with the project, easy to find. You can choose to gitignore it.",{"type":40,"tag":289,"props":928,"children":929},{},[930,935,936,942],{"type":40,"tag":68,"props":931,"children":932},{},[933],{"type":45,"value":934},"In your home directory",{"type":45,"value":918},{"type":40,"tag":53,"props":937,"children":939},{"className":938},[],[940],{"type":45,"value":941},"~\u002F.duckdb-skills\u002F\u003Cproject-id>\u002Fstate.sql",{"type":45,"value":943},") — keeps the project directory clean.",{"type":40,"tag":41,"props":945,"children":946},{},[947],{"type":45,"value":948},"Based on their choice:",{"type":40,"tag":41,"props":950,"children":951},{},[952],{"type":40,"tag":68,"props":953,"children":954},{},[955],{"type":45,"value":956},"Option 1:",{"type":40,"tag":127,"props":958,"children":960},{"className":129,"code":959,"language":131,"meta":132,"style":132},"STATE_DIR=\".duckdb-skills\"\nmkdir -p \"$STATE_DIR\"\n",[961],{"type":40,"tag":53,"props":962,"children":963},{"__ignoreMap":132},[964,988],{"type":40,"tag":138,"props":965,"children":966},{"class":140,"line":141},[967,972,976,980,984],{"type":40,"tag":138,"props":968,"children":969},{"style":145},[970],{"type":45,"value":971},"STATE_DIR",{"type":40,"tag":138,"props":973,"children":974},{"style":150},[975],{"type":45,"value":153},{"type":40,"tag":138,"props":977,"children":978},{"style":150},[979],{"type":45,"value":385},{"type":40,"tag":138,"props":981,"children":982},{"style":198},[983],{"type":45,"value":661},{"type":40,"tag":138,"props":985,"children":986},{"style":150},[987],{"type":45,"value":283},{"type":40,"tag":138,"props":989,"children":990},{"class":140,"line":480},[991,996,1001,1005,1010],{"type":40,"tag":138,"props":992,"children":993},{"style":172},[994],{"type":45,"value":995},"mkdir",{"type":40,"tag":138,"props":997,"children":998},{"style":198},[999],{"type":45,"value":1000}," -p",{"type":40,"tag":138,"props":1002,"children":1003},{"style":150},[1004],{"type":45,"value":180},{"type":40,"tag":138,"props":1006,"children":1007},{"style":145},[1008],{"type":45,"value":1009},"$STATE_DIR",{"type":40,"tag":138,"props":1011,"children":1012},{"style":150},[1013],{"type":45,"value":283},{"type":40,"tag":41,"props":1015,"children":1016},{},[1017,1019,1033],{"type":45,"value":1018},"Then ask: ",{"type":40,"tag":1020,"props":1021,"children":1022},"em",{},[1023,1025,1031],{"type":45,"value":1024},"\"Would you like to gitignore ",{"type":40,"tag":53,"props":1026,"children":1028},{"className":1027},[],[1029],{"type":45,"value":1030},".duckdb-skills\u002F",{"type":45,"value":1032},"?\"",{"type":45,"value":1034}," If yes:",{"type":40,"tag":127,"props":1036,"children":1038},{"className":129,"code":1037,"language":131,"meta":132,"style":132},"echo '.duckdb-skills\u002F' >> .gitignore\n",[1039],{"type":40,"tag":53,"props":1040,"children":1041},{"__ignoreMap":132},[1042],{"type":40,"tag":138,"props":1043,"children":1044},{"class":140,"line":141},[1045,1049,1053,1057,1061,1066],{"type":40,"tag":138,"props":1046,"children":1047},{"style":161},[1048],{"type":45,"value":761},{"type":40,"tag":138,"props":1050,"children":1051},{"style":150},[1052],{"type":45,"value":789},{"type":40,"tag":138,"props":1054,"children":1055},{"style":198},[1056],{"type":45,"value":1030},{"type":40,"tag":138,"props":1058,"children":1059},{"style":150},[1060],{"type":45,"value":798},{"type":40,"tag":138,"props":1062,"children":1063},{"style":150},[1064],{"type":45,"value":1065}," >>",{"type":40,"tag":138,"props":1067,"children":1068},{"style":198},[1069],{"type":45,"value":1070}," .gitignore\n",{"type":40,"tag":41,"props":1072,"children":1073},{},[1074],{"type":40,"tag":68,"props":1075,"children":1076},{},[1077],{"type":45,"value":1078},"Option 2:",{"type":40,"tag":127,"props":1080,"children":1082},{"className":129,"code":1081,"language":131,"meta":132,"style":132},"PROJECT_ROOT=\"$(git rev-parse --show-toplevel 2>\u002Fdev\u002Fnull || echo \"$PWD\")\"\nPROJECT_ID=\"$(echo \"$PROJECT_ROOT\" | tr '\u002F' '-')\"\nSTATE_DIR=\"$HOME\u002F.duckdb-skills\u002F$PROJECT_ID\"\nmkdir -p \"$STATE_DIR\"\n",[1083],{"type":40,"tag":53,"props":1084,"children":1085},{"__ignoreMap":132},[1086,1137,1200,1231],{"type":40,"tag":138,"props":1087,"children":1088},{"class":140,"line":141},[1089,1093,1097,1101,1105,1109,1113,1117,1121,1125,1129,1133],{"type":40,"tag":138,"props":1090,"children":1091},{"style":145},[1092],{"type":45,"value":690},{"type":40,"tag":138,"props":1094,"children":1095},{"style":150},[1096],{"type":45,"value":153},{"type":40,"tag":138,"props":1098,"children":1099},{"style":150},[1100],{"type":45,"value":158},{"type":40,"tag":138,"props":1102,"children":1103},{"style":172},[1104],{"type":45,"value":703},{"type":40,"tag":138,"props":1106,"children":1107},{"style":198},[1108],{"type":45,"value":708},{"type":40,"tag":138,"props":1110,"children":1111},{"style":150},[1112],{"type":45,"value":713},{"type":40,"tag":138,"props":1114,"children":1115},{"style":198},[1116],{"type":45,"value":201},{"type":40,"tag":138,"props":1118,"children":1119},{"style":150},[1120],{"type":45,"value":722},{"type":40,"tag":138,"props":1122,"children":1123},{"style":161},[1124],{"type":45,"value":727},{"type":40,"tag":138,"props":1126,"children":1127},{"style":150},[1128],{"type":45,"value":180},{"type":40,"tag":138,"props":1130,"children":1131},{"style":145},[1132],{"type":45,"value":115},{"type":40,"tag":138,"props":1134,"children":1135},{"style":150},[1136],{"type":45,"value":244},{"type":40,"tag":138,"props":1138,"children":1139},{"class":140,"line":480},[1140,1144,1148,1152,1156,1160,1164,1168,1172,1176,1180,1184,1188,1192,1196],{"type":40,"tag":138,"props":1141,"children":1142},{"style":145},[1143],{"type":45,"value":748},{"type":40,"tag":138,"props":1145,"children":1146},{"style":150},[1147],{"type":45,"value":153},{"type":40,"tag":138,"props":1149,"children":1150},{"style":150},[1151],{"type":45,"value":158},{"type":40,"tag":138,"props":1153,"children":1154},{"style":161},[1155],{"type":45,"value":761},{"type":40,"tag":138,"props":1157,"children":1158},{"style":150},[1159],{"type":45,"value":180},{"type":40,"tag":138,"props":1161,"children":1162},{"style":145},[1163],{"type":45,"value":770},{"type":40,"tag":138,"props":1165,"children":1166},{"style":150},[1167],{"type":45,"value":385},{"type":40,"tag":138,"props":1169,"children":1170},{"style":150},[1171],{"type":45,"value":779},{"type":40,"tag":138,"props":1173,"children":1174},{"style":172},[1175],{"type":45,"value":784},{"type":40,"tag":138,"props":1177,"children":1178},{"style":150},[1179],{"type":45,"value":789},{"type":40,"tag":138,"props":1181,"children":1182},{"style":198},[1183],{"type":45,"value":221},{"type":40,"tag":138,"props":1185,"children":1186},{"style":150},[1187],{"type":45,"value":798},{"type":40,"tag":138,"props":1189,"children":1190},{"style":150},[1191],{"type":45,"value":789},{"type":40,"tag":138,"props":1193,"children":1194},{"style":198},[1195],{"type":45,"value":807},{"type":40,"tag":138,"props":1197,"children":1198},{"style":150},[1199],{"type":45,"value":812},{"type":40,"tag":138,"props":1201,"children":1202},{"class":140,"line":489},[1203,1207,1211,1215,1219,1223,1227],{"type":40,"tag":138,"props":1204,"children":1205},{"style":145},[1206],{"type":45,"value":971},{"type":40,"tag":138,"props":1208,"children":1209},{"style":150},[1210],{"type":45,"value":153},{"type":40,"tag":138,"props":1212,"children":1213},{"style":150},[1214],{"type":45,"value":385},{"type":40,"tag":138,"props":1216,"children":1217},{"style":145},[1218],{"type":45,"value":833},{"type":40,"tag":138,"props":1220,"children":1221},{"style":198},[1222],{"type":45,"value":838},{"type":40,"tag":138,"props":1224,"children":1225},{"style":145},[1226],{"type":45,"value":843},{"type":40,"tag":138,"props":1228,"children":1229},{"style":150},[1230],{"type":45,"value":283},{"type":40,"tag":138,"props":1232,"children":1233},{"class":140,"line":498},[1234,1238,1242,1246,1250],{"type":40,"tag":138,"props":1235,"children":1236},{"style":172},[1237],{"type":45,"value":995},{"type":40,"tag":138,"props":1239,"children":1240},{"style":198},[1241],{"type":45,"value":1000},{"type":40,"tag":138,"props":1243,"children":1244},{"style":150},[1245],{"type":45,"value":180},{"type":40,"tag":138,"props":1247,"children":1248},{"style":145},[1249],{"type":45,"value":1009},{"type":40,"tag":138,"props":1251,"children":1252},{"style":150},[1253],{"type":45,"value":283},{"type":40,"tag":92,"props":1255,"children":1257},{"id":1256},"step-6-append-to-the-state-file",[1258],{"type":45,"value":1259},"Step 6 — Append to the state file",{"type":40,"tag":41,"props":1261,"children":1262},{},[1263,1268,1270,1275],{"type":40,"tag":53,"props":1264,"children":1266},{"className":1265},[],[1267],{"type":45,"value":80},{"type":45,"value":1269}," 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. ",{"type":40,"tag":68,"props":1271,"children":1272},{},[1273],{"type":45,"value":1274},"Never overwrite it",{"type":45,"value":1276}," — always check for duplicates and append.",{"type":40,"tag":41,"props":1278,"children":1279},{},[1280,1282,1288,1290,1296],{"type":45,"value":1281},"Derive the database alias from the filename without extension (e.g. ",{"type":40,"tag":53,"props":1283,"children":1285},{"className":1284},[],[1286],{"type":45,"value":1287},"my_data.duckdb",{"type":45,"value":1289}," → ",{"type":40,"tag":53,"props":1291,"children":1293},{"className":1292},[],[1294],{"type":45,"value":1295},"my_data",{"type":45,"value":1297},"). Check if this ATTACH already exists:",{"type":40,"tag":127,"props":1299,"children":1301},{"className":129,"code":1300,"language":131,"meta":132,"style":132},"grep -q \"ATTACH.*RESOLVED_PATH\" \"$STATE_DIR\u002Fstate.sql\" 2>\u002Fdev\u002Fnull\n",[1302],{"type":40,"tag":53,"props":1303,"children":1304},{"__ignoreMap":132},[1305],{"type":40,"tag":138,"props":1306,"children":1307},{"class":140,"line":141},[1308,1313,1318,1322,1327,1331,1335,1339,1343,1347,1351],{"type":40,"tag":138,"props":1309,"children":1310},{"style":172},[1311],{"type":45,"value":1312},"grep",{"type":40,"tag":138,"props":1314,"children":1315},{"style":198},[1316],{"type":45,"value":1317}," -q",{"type":40,"tag":138,"props":1319,"children":1320},{"style":150},[1321],{"type":45,"value":180},{"type":40,"tag":138,"props":1323,"children":1324},{"style":198},[1325],{"type":45,"value":1326},"ATTACH.*RESOLVED_PATH",{"type":40,"tag":138,"props":1328,"children":1329},{"style":150},[1330],{"type":45,"value":385},{"type":40,"tag":138,"props":1332,"children":1333},{"style":150},[1334],{"type":45,"value":180},{"type":40,"tag":138,"props":1336,"children":1337},{"style":145},[1338],{"type":45,"value":1009},{"type":40,"tag":138,"props":1340,"children":1341},{"style":198},[1342],{"type":45,"value":848},{"type":40,"tag":138,"props":1344,"children":1345},{"style":150},[1346],{"type":45,"value":385},{"type":40,"tag":138,"props":1348,"children":1349},{"style":150},[1350],{"type":45,"value":195},{"type":40,"tag":138,"props":1352,"children":1353},{"style":198},[1354],{"type":45,"value":1355},"\u002Fdev\u002Fnull\n",{"type":40,"tag":41,"props":1357,"children":1358},{},[1359],{"type":45,"value":1360},"If not already present, append:",{"type":40,"tag":127,"props":1362,"children":1364},{"className":129,"code":1363,"language":131,"meta":132,"style":132},"cat >> \"$STATE_DIR\u002Fstate.sql\" \u003C\u003C'STATESQL'\nATTACH IF NOT EXISTS 'RESOLVED_PATH' AS my_data;\nUSE my_data;\nSTATESQL\n",[1365],{"type":40,"tag":53,"props":1366,"children":1367},{"__ignoreMap":132},[1368,1406,1414,1422],{"type":40,"tag":138,"props":1369,"children":1370},{"class":140,"line":141},[1371,1376,1380,1384,1388,1392,1396,1401],{"type":40,"tag":138,"props":1372,"children":1373},{"style":172},[1374],{"type":45,"value":1375},"cat",{"type":40,"tag":138,"props":1377,"children":1378},{"style":150},[1379],{"type":45,"value":1065},{"type":40,"tag":138,"props":1381,"children":1382},{"style":150},[1383],{"type":45,"value":180},{"type":40,"tag":138,"props":1385,"children":1386},{"style":145},[1387],{"type":45,"value":1009},{"type":40,"tag":138,"props":1389,"children":1390},{"style":198},[1391],{"type":45,"value":848},{"type":40,"tag":138,"props":1393,"children":1394},{"style":150},[1395],{"type":45,"value":385},{"type":40,"tag":138,"props":1397,"children":1398},{"style":150},[1399],{"type":45,"value":1400}," \u003C\u003C",{"type":40,"tag":138,"props":1402,"children":1403},{"style":150},[1404],{"type":45,"value":1405},"'STATESQL'\n",{"type":40,"tag":138,"props":1407,"children":1408},{"class":140,"line":480},[1409],{"type":40,"tag":138,"props":1410,"children":1411},{"style":198},[1412],{"type":45,"value":1413},"ATTACH IF NOT EXISTS 'RESOLVED_PATH' AS my_data;\n",{"type":40,"tag":138,"props":1415,"children":1416},{"class":140,"line":489},[1417],{"type":40,"tag":138,"props":1418,"children":1419},{"style":198},[1420],{"type":45,"value":1421},"USE my_data;\n",{"type":40,"tag":138,"props":1423,"children":1424},{"class":140,"line":498},[1425],{"type":40,"tag":138,"props":1426,"children":1427},{"style":150},[1428],{"type":45,"value":1429},"STATESQL\n",{"type":40,"tag":41,"props":1431,"children":1432},{},[1433,1435,1440,1442,1447],{"type":45,"value":1434},"Replace ",{"type":40,"tag":53,"props":1436,"children":1438},{"className":1437},[],[1439],{"type":45,"value":123},{"type":45,"value":1441}," and ",{"type":40,"tag":53,"props":1443,"children":1445},{"className":1444},[],[1446],{"type":45,"value":1295},{"type":45,"value":1448}," with the actual values. If the alias would conflict with an existing one in the file, ask the user for a name.",{"type":40,"tag":92,"props":1450,"children":1452},{"id":1451},"step-7-verify-the-state-file-works",[1453],{"type":45,"value":1454},"Step 7 — Verify the state file works",{"type":40,"tag":127,"props":1456,"children":1458},{"className":129,"code":1457,"language":131,"meta":132,"style":132},"duckdb -init \"$STATE_DIR\u002Fstate.sql\" -c \"SHOW TABLES;\"\n",[1459],{"type":40,"tag":53,"props":1460,"children":1461},{"__ignoreMap":132},[1462],{"type":40,"tag":138,"props":1463,"children":1464},{"class":140,"line":141},[1465,1469,1474,1478,1482,1486,1490,1494,1498,1503],{"type":40,"tag":138,"props":1466,"children":1467},{"style":172},[1468],{"type":45,"value":8},{"type":40,"tag":138,"props":1470,"children":1471},{"style":198},[1472],{"type":45,"value":1473}," -init",{"type":40,"tag":138,"props":1475,"children":1476},{"style":150},[1477],{"type":45,"value":180},{"type":40,"tag":138,"props":1479,"children":1480},{"style":145},[1481],{"type":45,"value":1009},{"type":40,"tag":138,"props":1483,"children":1484},{"style":198},[1485],{"type":45,"value":848},{"type":40,"tag":138,"props":1487,"children":1488},{"style":150},[1489],{"type":45,"value":385},{"type":40,"tag":138,"props":1491,"children":1492},{"style":198},[1493],{"type":45,"value":390},{"type":40,"tag":138,"props":1495,"children":1496},{"style":150},[1497],{"type":45,"value":180},{"type":40,"tag":138,"props":1499,"children":1500},{"style":198},[1501],{"type":45,"value":1502},"SHOW TABLES;",{"type":40,"tag":138,"props":1504,"children":1505},{"style":150},[1506],{"type":45,"value":283},{"type":40,"tag":41,"props":1508,"children":1509},{},[1510],{"type":45,"value":1511},"If this fails, fix the state file and retry.",{"type":40,"tag":92,"props":1513,"children":1515},{"id":1514},"step-8-report",[1516],{"type":45,"value":1517},"Step 8 — Report",{"type":40,"tag":41,"props":1519,"children":1520},{},[1521],{"type":45,"value":1522},"Summarize for the user:",{"type":40,"tag":285,"props":1524,"children":1525},{},[1526,1536,1546,1564,1574],{"type":40,"tag":289,"props":1527,"children":1528},{},[1529,1534],{"type":40,"tag":68,"props":1530,"children":1531},{},[1532],{"type":45,"value":1533},"Database path",{"type":45,"value":1535},": the resolved absolute path",{"type":40,"tag":289,"props":1537,"children":1538},{},[1539,1544],{"type":40,"tag":68,"props":1540,"children":1541},{},[1542],{"type":45,"value":1543},"Alias",{"type":45,"value":1545},": the database alias used in the state file",{"type":40,"tag":289,"props":1547,"children":1548},{},[1549,1554,1556,1562],{"type":40,"tag":68,"props":1550,"children":1551},{},[1552],{"type":45,"value":1553},"State file",{"type":45,"value":1555},": the resolved ",{"type":40,"tag":53,"props":1557,"children":1559},{"className":1558},[],[1560],{"type":45,"value":1561},"STATE_DIR\u002Fstate.sql",{"type":45,"value":1563}," path",{"type":40,"tag":289,"props":1565,"children":1566},{},[1567,1572],{"type":40,"tag":68,"props":1568,"children":1569},{},[1570],{"type":45,"value":1571},"Tables",{"type":45,"value":1573},": name, column count, row count for each table (or note the DB is empty)",{"type":40,"tag":289,"props":1575,"children":1576},{},[1577,1579],{"type":45,"value":1578},"Confirm the database is now active for ",{"type":40,"tag":53,"props":1580,"children":1582},{"className":1581},[],[1583],{"type":45,"value":1584},"\u002Fduckdb-skills:query",{"type":40,"tag":41,"props":1586,"children":1587},{},[1588],{"type":45,"value":1589},"If the database is empty, suggest creating tables or importing data.",{"type":40,"tag":1591,"props":1592,"children":1593},"style",{},[1594],{"type":45,"value":1595},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":1597,"total":1685},[1598,1604,1621,1637,1648,1658,1671],{"slug":4,"name":4,"fn":5,"description":6,"org":1599,"tags":1600,"stars":22,"repoUrl":23,"updatedAt":24},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1601,1602,1603],{"name":13,"slug":14,"type":15},{"name":17,"slug":18,"type":15},{"name":20,"slug":21,"type":15},{"slug":1605,"name":1605,"fn":1606,"description":1607,"org":1608,"tags":1609,"stars":22,"repoUrl":23,"updatedAt":1620},"convert-file","convert data files between formats","Convert any data file to another format: CSV, Parquet, JSON, Excel, GeoJSON, and more. Use when the user says \"convert to parquet\", \"save as xlsx\", \"export as JSON\", \"make this a CSV\", \"turn into parquet\", or any variation of format-to-format conversion for data files. Also triggers when the user wants to write Parquet, Excel, or other binary formats that Claude cannot produce natively.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1610,1611,1614,1617],{"name":13,"slug":14,"type":15},{"name":1612,"slug":1613,"type":15},"Data Engineering","data-engineering",{"name":1615,"slug":1616,"type":15},"Excel","excel",{"name":1618,"slug":1619,"type":15},"Spreadsheets","spreadsheets","2026-07-12T07:54:39.62274",{"slug":1622,"name":1622,"fn":1623,"description":1624,"org":1625,"tags":1626,"stars":22,"repoUrl":23,"updatedAt":1636},"duckdb-docs","search DuckDB documentation and blog posts","Search DuckDB and DuckLake documentation and blog posts. Returns relevant doc chunks for a question or keyword using full-text search against a locally cached index.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1627,1630,1633],{"name":1628,"slug":1629,"type":15},"Documentation","documentation",{"name":1631,"slug":1632,"type":15},"Research","research",{"name":1634,"slug":1635,"type":15},"Search","search","2026-07-12T07:54:38.216517",{"slug":1638,"name":1638,"fn":1639,"description":1640,"org":1641,"tags":1642,"stars":22,"repoUrl":23,"updatedAt":1647},"install-duckdb","install and update DuckDB extensions","Install or update DuckDB extensions. Each argument is either a plain extension name (installs from core) or name@repo (e.g. magic@community). Pass --update to update extensions instead of installing.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1643,1644],{"name":17,"slug":18,"type":15},{"name":1645,"slug":1646,"type":15},"Engineering","engineering","2026-07-12T07:54:42.330952",{"slug":1649,"name":1649,"fn":1650,"description":1651,"org":1652,"tags":1653,"stars":22,"repoUrl":23,"updatedAt":1657},"query","run SQL queries against DuckDB","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.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1654,1655,1656],{"name":13,"slug":14,"type":15},{"name":17,"slug":18,"type":15},{"name":20,"slug":21,"type":15},"2026-07-12T07:54:28.352759",{"slug":1659,"name":1659,"fn":1660,"description":1661,"org":1662,"tags":1663,"stars":22,"repoUrl":23,"updatedAt":1670},"read-file","read and profile data files","Read any data file (CSV, JSON, Parquet, Avro, Excel, spatial, SQLite) or remote URL (S3, HTTPS). Use when user references a data file, asks \"what's in this file\", or wants to preview\u002Fprofile a dataset. Not for source code.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1664,1665,1668,1669],{"name":13,"slug":14,"type":15},{"name":1666,"slug":1667,"type":15},"Data Quality","data-quality",{"name":17,"slug":18,"type":15},{"name":20,"slug":21,"type":15},"2026-07-12T07:54:33.514298",{"slug":1672,"name":1672,"fn":1673,"description":1674,"org":1675,"tags":1676,"stars":22,"repoUrl":23,"updatedAt":1684},"read-memories","recall past Claude Code session logs","Search past Claude Code session logs to recall prior decisions, patterns, or unresolved work. Use when user says \"do you remember\", \"what did we do\", references past conversations, or you need context from prior sessions.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1677,1680,1683],{"name":1678,"slug":1679,"type":15},"Claude Code","claude-code",{"name":1681,"slug":1682,"type":15},"Memory","memory",{"name":1634,"slug":1635,"type":15},"2026-07-12T07:54:40.860856",9,{"items":1687,"total":1685},[1688,1694,1701,1707,1712,1718,1725,1731,1744],{"slug":4,"name":4,"fn":5,"description":6,"org":1689,"tags":1690,"stars":22,"repoUrl":23,"updatedAt":24},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1691,1692,1693],{"name":13,"slug":14,"type":15},{"name":17,"slug":18,"type":15},{"name":20,"slug":21,"type":15},{"slug":1605,"name":1605,"fn":1606,"description":1607,"org":1695,"tags":1696,"stars":22,"repoUrl":23,"updatedAt":1620},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1697,1698,1699,1700],{"name":13,"slug":14,"type":15},{"name":1612,"slug":1613,"type":15},{"name":1615,"slug":1616,"type":15},{"name":1618,"slug":1619,"type":15},{"slug":1622,"name":1622,"fn":1623,"description":1624,"org":1702,"tags":1703,"stars":22,"repoUrl":23,"updatedAt":1636},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1704,1705,1706],{"name":1628,"slug":1629,"type":15},{"name":1631,"slug":1632,"type":15},{"name":1634,"slug":1635,"type":15},{"slug":1638,"name":1638,"fn":1639,"description":1640,"org":1708,"tags":1709,"stars":22,"repoUrl":23,"updatedAt":1647},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1710,1711],{"name":17,"slug":18,"type":15},{"name":1645,"slug":1646,"type":15},{"slug":1649,"name":1649,"fn":1650,"description":1651,"org":1713,"tags":1714,"stars":22,"repoUrl":23,"updatedAt":1657},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1715,1716,1717],{"name":13,"slug":14,"type":15},{"name":17,"slug":18,"type":15},{"name":20,"slug":21,"type":15},{"slug":1659,"name":1659,"fn":1660,"description":1661,"org":1719,"tags":1720,"stars":22,"repoUrl":23,"updatedAt":1670},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1721,1722,1723,1724],{"name":13,"slug":14,"type":15},{"name":1666,"slug":1667,"type":15},{"name":17,"slug":18,"type":15},{"name":20,"slug":21,"type":15},{"slug":1672,"name":1672,"fn":1673,"description":1674,"org":1726,"tags":1727,"stars":22,"repoUrl":23,"updatedAt":1684},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1728,1729,1730],{"name":1678,"slug":1679,"type":15},{"name":1681,"slug":1682,"type":15},{"name":1634,"slug":1635,"type":15},{"slug":1732,"name":1732,"fn":1733,"description":1734,"org":1735,"tags":1736,"stars":22,"repoUrl":23,"updatedAt":1743},"s3-explore","explore and query remote storage data","Explore and query data on S3, Cloudflare R2, GCS, MinIO, or any S3-compatible storage. Use when the user mentions an s3:\u002F\u002F, r2:\u002F\u002F, gs:\u002F\u002F, or gcs:\u002F\u002F URL, asks \"what's in this bucket\", wants to list remote files, preview remote Parquet\u002FCSV\u002FJSON, or query data on object storage without downloading it. Also triggers when the user wants to know the size, schema, or row count of remote datasets.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1737,1740,1741,1742],{"name":1738,"slug":1739,"type":15},"Cloud","cloud",{"name":1612,"slug":1613,"type":15},{"name":17,"slug":18,"type":15},{"name":20,"slug":21,"type":15},"2026-07-12T07:54:36.928868",{"slug":1745,"name":1745,"fn":1746,"description":1747,"org":1748,"tags":1749,"stars":22,"repoUrl":23,"updatedAt":1756},"spatial","query spatial data with DuckDB","Answer questions about spatial data using DuckDB. Use when the user mentions locations, coordinates, lat\u002Flng, distances, maps, addresses, \"near\", \"within\", \"closest\", geographic names, or spatial file formats (GeoJSON, Shapefile, GeoPackage, GPX, GeoParquet). Also triggers when the user wants to find places, buildings, or roads — Overture Maps provides free global data on S3 with zero API keys. Handles spatial joins, distance calculations, containment checks, density analysis, and format conversions for geographic data.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1750,1751,1752,1755],{"name":13,"slug":14,"type":15},{"name":17,"slug":18,"type":15},{"name":1753,"slug":1754,"type":15},"Maps","maps",{"name":20,"slug":21,"type":15},"2026-07-12T07:54:32.004105"]