[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M74EMKNJHSAPW2WK06ZXWZSD":3,"skill-same:01M74EMKNJHSAPW2WK06ZXWZSD":54},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M74EMKNJHSAPW2WK06ZXWZSD","snowflake-dbt-pitfalls",null,"Snowflake and dbt traps that fail silently or destroy data: CREATE OR REPLACE, Dynamic Tables, PIVOT, sources.yml freshness, versioned models. Each one with its prevention.","CarlosCaPe\u002Foctorato","CarlosCaPe","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F39838249?v=4","01M72WXX4ZRR8MBH1EP1QND2FQ","dataqbs","01M72WXX5NA7YCKRSJ54GW1GQ8",18,"MIT","https:\u002F\u002Fgithub.com\u002FCarlosCaPe\u002Foctorato\u002Fblob\u002Fmaster\u002Fskills\u002Fsnowflake-dbt-pitfalls\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: snowflake-dbt-pitfalls\ndescription: \"Snowflake and dbt traps that fail silently or destroy data: CREATE OR REPLACE, Dynamic Tables, PIVOT, sources.yml freshness, versioned models. Each one with its prevention.\"\n---\n\n# Snowflake and dbt pitfalls (silent \u002F destructive)\n\nFive non-obvious footguns distilled from real engineering sessions. Each is something the docs underplay and that a future task can trigger on. Generic only.\n\n## 1. `CREATE OR REPLACE TABLE` resets the new object's Time Travel lineage\n`CREATE OR REPLACE TABLE` drops the old table and creates a **new object with fresh lineage**. What this breaks:\n- The new object's Time Travel window starts at creation. `SELECT ... AT\u002FBEFORE` on the new table cannot reach the OLD table's history. Anything keyed to the old lineage (streams, downstream Time Travel queries) is severed.\n- The old data is NOT gone, though: the dropped version is retained in Time Travel for its retention window and is recoverable with `UNDROP TABLE`. The catch is `UNDROP` restores to the original name, so if the new same-named table already exists you must rename it out of the way first, then `UNDROP`, then reconcile.\n\nSo the real risk is silent lineage loss and a clumsy recovery, not permanent data loss. Engineers misread it because `CREATE OR REPLACE` is idiomatic for views\u002Fprocs\u002Fstages. **Prevention: CLONE first** for a clean, immediately queryable backup with intact history:\n```sql\nCREATE OR REPLACE TABLE my_table_backup CLONE my_table;\nCREATE OR REPLACE TABLE my_table AS SELECT ...;\n```\n\n## 2. Snowflake Dynamic Table (DT) constraints\n- **`CURRENT_TIMESTAMP` is allowed in filters but not in the SELECT list under incremental refresh.** Since the GA in May 2025, `CURRENT_TIMESTAMP`\u002F`CURRENT_DATE`\u002F`CURRENT_TIME` work in `WHERE`\u002F`HAVING`\u002F`QUALIFY` (the immutable-window pattern, e.g. `WHERE event_time \u003C CURRENT_TIMESTAMP()`). Putting `CURRENT_TIMESTAMP()` in the SELECT list forces FULL refresh; use `METADATA$ROW_LAST_COMMIT_TIME` instead when you need a per-row refresh timestamp. Still restricted for incremental: session-context functions (`CURRENT_USER`\u002F`CURRENT_ROLE`\u002F`CURRENT_WAREHOUSE`) and sequences.\n- **Account limit is 50,000 DTs** (as of 2025; verify in your account limits, it has moved over releases). Not a small number, but design DT-heavy pipelines with it in mind.\n- If a table is **fully reloaded every cycle** anyway, a scheduled-Task `TRUNCATE + INSERT` can be cheaper and simpler than a DT. The DT change-tracking overhead buys little when there is no incremental benefit.\n\n## 3. Snowflake `PIVOT` with dotted column values (two compounding bugs)\n- **`IN(...)` takes quoted string literals that match the source column's VALUES**, and each becomes a generated column header. If a value contains a dot (e.g. `'c2_tag.avg'`), the auto-generated column header is an invalid\u002Fdotted identifier that fails downstream when you reference it unquoted in the outer `SELECT`. The fix is NOT to unquote the `IN` list (it must stay quoted), it is to **normalize the dots in the source values first** so the generated headers are clean identifiers.\n```sql\nWITH normalized AS (\n  SELECT REPLACE(tag_id, '.', '_') AS tag_id_clean, value FROM source_table\n)\nSELECT *\nFROM normalized\nPIVOT(MAX(value) FOR tag_id_clean IN ('c2_tag_avg', 'c3_tag_sum'));\n-- IN values stay quoted literals; headers come back as 'c2_tag_avg' etc.\n-- add  AS p (grp, c2_tag_avg, c3_tag_sum)  if you need bare SELECTable identifiers\n```\nSymptom that points here: PIVOT returns the column-name strings or nulls instead of values.\n\n## 4. dbt `sources.yml` freshness has two underused keys\n- **`filter:`** accepts a WHERE expression evaluated before the freshness check. Without it, freshness checks `max(loaded_at)` across ALL rows including stale\u002Frejected ones. Scope it, e.g. `filter: \"status = 'LOADED'\"`, so freshness reflects meaningful rows.\n- **`identifier:`** maps the logical source name to a different physical table name. Without it dbt assumes node name = table name; after a rename the freshness check silently hits the wrong table or errors. The fix is one `identifier:` key, not a schema change.\nSymptom: a freshness check passing when it should fail (or vice versa).\n\n## 5. dbt versioned-model `include\u002Fexclude` placement\nIn versioned models (`versions:` in `schema.yml`), an `include: all` \u002F `exclude: [col]` block nested **inside** the `columns:` list is structurally invalid and throws a YAML parse error that survives typo fixes (the error is structural, not textual). It belongs at the **version level**, a sibling of `defined_in:`\u002F`config:`:\n```yaml\nversions:\n  - v: 1\n    include: all\n    exclude: [deprecated_col]\n    # NOT under columns:\n```\nSymptom: a dbt YAML parse error pointing at the wrong line that persists after every typo fix.\n\n## Provenance\nDistilled from real Snowflake\u002Fdbt debugging sessions, stripped of any project data. Complements `querymaster-snowflake` (query authoring) and the DDL-safety skills; this one is specifically the silent\u002Fdestructive gotcha set.\n","# Snowflake and dbt pitfalls (silent \u002F destructive)\n\nFive non-obvious footguns distilled from real engineering sessions. Each is something the docs underplay and that a future task can trigger on. Generic only.\n\n## 1. `CREATE OR REPLACE TABLE` resets the new object's Time Travel lineage\n`CREATE OR REPLACE TABLE` drops the old table and creates a **new object with fresh lineage**. What this breaks:\n- The new object's Time Travel window starts at creation. `SELECT ... AT\u002FBEFORE` on the new table cannot reach the OLD table's history. Anything keyed to the old lineage (streams, downstream Time Travel queries) is severed.\n- The old data is NOT gone, though: the dropped version is retained in Time Travel for its retention window and is recoverable with `UNDROP TABLE`. The catch is `UNDROP` restores to the original name, so if the new same-named table already exists you must rename it out of the way first, then `UNDROP`, then reconcile.\n\nSo the real risk is silent lineage loss and a clumsy recovery, not permanent data loss. Engineers misread it because `CREATE OR REPLACE` is idiomatic for views\u002Fprocs\u002Fstages. **Prevention: CLONE first** for a clean, immediately queryable backup with intact history:\n```sql\nCREATE OR REPLACE TABLE my_table_backup CLONE my_table;\nCREATE OR REPLACE TABLE my_table AS SELECT ...;\n```\n\n## 2. Snowflake Dynamic Table (DT) constraints\n- **`CURRENT_TIMESTAMP` is allowed in filters but not in the SELECT list under incremental refresh.** Since the GA in May 2025, `CURRENT_TIMESTAMP`\u002F`CURRENT_DATE`\u002F`CURRENT_TIME` work in `WHERE`\u002F`HAVING`\u002F`QUALIFY` (the immutable-window pattern, e.g. `WHERE event_time \u003C CURRENT_TIMESTAMP()`). Putting `CURRENT_TIMESTAMP()` in the SELECT list forces FULL refresh; use `METADATA$ROW_LAST_COMMIT_TIME` instead when you need a per-row refresh timestamp. Still restricted for incremental: session-context functions (`CURRENT_USER`\u002F`CURRENT_ROLE`\u002F`CURRENT_WAREHOUSE`) and sequences.\n- **Account limit is 50,000 DTs** (as of 2025; verify in your account limits, it has moved over releases). Not a small number, but design DT-heavy pipelines with it in mind.\n- If a table is **fully reloaded every cycle** anyway, a scheduled-Task `TRUNCATE + INSERT` can be cheaper and simpler than a DT. The DT change-tracking overhead buys little when there is no incremental benefit.\n\n## 3. Snowflake `PIVOT` with dotted column values (two compounding bugs)\n- **`IN(...)` takes quoted string literals that match the source column's VALUES**, and each becomes a generated column header. If a value contains a dot (e.g. `'c2_tag.avg'`), the auto-generated column header is an invalid\u002Fdotted identifier that fails downstream when you reference it unquoted in the outer `SELECT`. The fix is NOT to unquote the `IN` list (it must stay quoted), it is to **normalize the dots in the source values first** so the generated headers are clean identifiers.\n```sql\nWITH normalized AS (\n  SELECT REPLACE(tag_id, '.', '_') AS tag_id_clean, value FROM source_table\n)\nSELECT *\nFROM normalized\nPIVOT(MAX(value) FOR tag_id_clean IN ('c2_tag_avg', 'c3_tag_sum'));\n-- IN values stay quoted literals; headers come back as 'c2_tag_avg' etc.\n-- add  AS p (grp, c2_tag_avg, c3_tag_sum)  if you need bare SELECTable identifiers\n```\nSymptom that points here: PIVOT returns the column-name strings or nulls instead of values.\n\n## 4. dbt `sources.yml` freshness has two underused keys\n- **`filter:`** accepts a WHERE expression evaluated before the freshness check. Without it, freshness checks `max(loaded_at)` across ALL rows including stale\u002Frejected ones. Scope it, e.g. `filter: \"status = 'LOADED'\"`, so freshness reflects meaningful rows.\n- **`identifier:`** maps the logical source name to a different physical table name. Without it dbt assumes node name = table name; after a rename the freshness check silently hits the wrong table or errors. The fix is one `identifier:` key, not a schema change.\nSymptom: a freshness check passing when it should fail (or vice versa).\n\n## 5. dbt versioned-model `include\u002Fexclude` placement\nIn versioned models (`versions:` in `schema.yml`), an `include: all` \u002F `exclude: [col]` block nested **inside** the `columns:` list is structurally invalid and throws a YAML parse error that survives typo fixes (the error is structural, not textual). It belongs at the **version level**, a sibling of `defined_in:`\u002F`config:`:\n```yaml\nversions:\n  - v: 1\n    include: all\n    exclude: [deprecated_col]\n    # NOT under columns:\n```\nSymptom: a dbt YAML parse error pointing at the wrong line that persists after every typo fix.\n\n## Provenance\nDistilled from real Snowflake\u002Fdbt debugging sessions, stripped of any project data. Complements `querymaster-snowflake` (query authoring) and the DDL-safety skills; this one is specifically the silent\u002Fdestructive gotcha set.\n",{"name":5,"description":7},"master","b4414608cd5a3f87d1525b518f1c6add8363540d","skills\u002Fsnowflake-dbt-pitfalls",6,"https:\u002F\u002Fgithub.com\u002FCarlosCaPe\u002Foctorato","https:\u002F\u002Fwww.dataqbs.com\u002Foctorato","https:\u002F\u002Fgithub.com\u002FCarlosCaPe","www.dataqbs.com"," AI-powered data engineering\r\n& consulting\r\n\r\nWe build data platforms that turn complexity into clarity — from cloud architecture and ETL pipelines to AI-driven","2026-11-14 00:21:00",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add CarlosCaPe\u002Foctorato --skill snowflake-dbt-pitfalls",{"tool":40,"command":41},"bunx","bunx skills add CarlosCaPe\u002Foctorato --skill snowflake-dbt-pitfalls",{"tool":43,"command":44},"pnpm","pnpm dlx skills add CarlosCaPe\u002Foctorato --skill snowflake-dbt-pitfalls","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FCarlosCaPe\u002Foctorato\u002Fblob\u002Fmaster\u002Fskills\u002Fsnowflake-dbt-pitfalls\u002FSKILL.md",true,[48],{"path":49,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":52,"sourceHtmlUrl":53},"skill.json","REFERENCE","参考文档",293,"https:\u002F\u002Fgithub.com\u002FCarlosCaPe\u002Foctorato\u002Fblob\u002Fmaster\u002Fskills\u002Fsnowflake-dbt-pitfalls\u002Fskill.json",[55,64,72,79,87,95],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":59,"licenseFileUrl":60,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M74EVAA4A4B4AKR5TT732GP4","yeet","Use only when the user explicitly asks to stage, commit, push, and open a GitHub pull request in one flow using the GitHub CLI (`gh`).","Apache-2.0","https:\u002F\u002Fgithub.com\u002FCarlosCaPe\u002Foctorato\u002Fblob\u002Fmaster\u002Fskills\u002Fyeet\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FCarlosCaPe\u002Foctorato\u002Fblob\u002Fmaster\u002Fskills\u002Fyeet\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":59,"licenseFileUrl":68,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M74EV4WMRDKP2NQS4YWR8PXH","wrangler","Cloudflare Workers CLI for deploying, developing, and managing Workers, KV, R2, D1, Vectorize, Hyperdrive, Workers AI, Containers, Queues, Workflows, Pipelines, and Secrets Store. Load before running wrangler commands to ensure correct syntax and best practices. Biases towards retrieval from Cloudflare docs over pre-trained knowledge.","https:\u002F\u002Fgithub.com\u002FCarlosCaPe\u002Foctorato\u002Fblob\u002Fmaster\u002Fskills\u002Fwrangler\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FCarlosCaPe\u002Foctorato\u002Fblob\u002Fmaster\u002Fskills\u002Fwrangler\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M74EV05MHTXKEXD4B2QJEYTF","workspace-skill-discovery","Discover and include ALL skills across the workspace — not just global ones. Use at the start of every session or when the user asks about available skills. Ensures project-level skills (under .claude\u002Fskills\u002F or skills\u002F in any repo) are never missed.","https:\u002F\u002Fgithub.com\u002FCarlosCaPe\u002Foctorato\u002Fblob\u002Fmaster\u002Fskills\u002Fworkspace-skill-discovery\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":59,"licenseFileUrl":83,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M74ETV78525B4VP2F28Z6NRD","workers-best-practices","Reviews and authors Cloudflare Workers code against production best practices. Load when writing new Workers, reviewing Worker code, configuring wrangler.jsonc, or checking for common Workers anti-patterns (streaming, floating promises, global state, secrets, bindings, observability). Biases towards retrieval from Cloudflare docs over pre-trained knowledge.","https:\u002F\u002Fgithub.com\u002FCarlosCaPe\u002Foctorato\u002Fblob\u002Fmaster\u002Fskills\u002Fworkers-best-practices\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FCarlosCaPe\u002Foctorato\u002Fblob\u002Fmaster\u002Fskills\u002Fworkers-best-practices\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":59,"licenseFileUrl":91,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":19},"01M74ETR75NF67WGVEN7288ACV","winui-app","Create, build and design WinUI 3 desktop apps with C# and the Windows App SDK following Microsoft's official guidance and CommunityToolkit. Covers XAML, navigation, theming, accessibility and deployment.","https:\u002F\u002Fgithub.com\u002FCarlosCaPe\u002Foctorato\u002Fblob\u002Fmaster\u002Fskills\u002Fwinui-app\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FCarlosCaPe\u002Foctorato\u002Fblob\u002Fmaster\u002Fskills\u002Fwinui-app\u002FSKILL.md",[],[],{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":19},"01M74ETJFRNPPNSQZ36C6HD6CW","windows-brain-script-portability","Scripts in ~\u002F.claude\u002Fscripts\u002F that run on a Windows brain: use the python3.cmd shim and not bare python3, and reconfigure stdout to UTF-8 if you print symbols. Use it when writing a brain script or triaging a Windows-only crash.","https:\u002F\u002Fgithub.com\u002FCarlosCaPe\u002Foctorato\u002Fblob\u002Fmaster\u002Fskills\u002Fwindows-brain-script-portability\u002FSKILL.md",[],[]]