[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M74DG41XRVBV5WX9E4H2J51C":3,"skill-same:01M74DG41XRVBV5WX9E4H2J51C":55},{"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":26,"commitSha":27,"skillDirectory":28,"forksCount":25,"repositoryHtmlUrl":29,"repositoryHomepageUrl":30,"ownerHtmlUrl":31,"ownerBlogUrl":32,"ownerDescription":33,"updatedAt":34,"install":35,"resources":48},"01M74DG41XRVBV5WX9E4H2J51C","procedure-rebuild-pg-get-functiondef",null,"Procedure Rebuild via pg_get_functiondef","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\u002Fprocedure-rebuild-pg-get-functiondef\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: procedure-rebuild-pg-get-functiondef\ndescription: \"Procedure Rebuild via pg_get_functiondef\"\nmetadata:\n  short-description: \"Procedure Rebuild via pg_get_functiondef\"\n  original-index: 06\n---\n\n# Procedure Rebuild via pg_get_functiondef\n\n## What\n\nA technique for modifying stored procedures by extracting their current\ndefinition from the catalog, performing text replacements on the SQL source,\nand re-executing the modified definition -- all within a single DO block.\n\n## Why\n\nManually rewriting a stored procedure is error-prone and doesn't scale. By\nusing `pg_get_functiondef`, you get the **exact** current definition from\nPostgreSQL's catalog, modify only what you need, and re-create it with\n`CREATE OR REPLACE`. This guarantees you don't accidentally change anything\nelse in the procedure.\n\n## How\n\n```sql\nDO $$\nDECLARE\n    v_def text;\nBEGIN\n    -- Step 1: Extract current definition\n    SELECT pg_get_functiondef(p.oid) INTO v_def\n    FROM pg_proc p\n    WHERE p.proname = 'MyProcedure'\n      AND p.pronamespace = 'public'::regnamespace;\n\n    -- Step 2: Check if replacement is needed\n    IF v_def IS NOT NULL\n       AND v_def LIKE '%\"OldColumnName\"%'\n    THEN\n        -- Step 3: Text replacement (surgical)\n        v_def := replace(v_def, '\"OldColumnName\"', '\"NewColumnName\"');\n\n        -- Step 4: Re-create the procedure\n        EXECUTE v_def;\n\n        RAISE NOTICE 'Updated: MyProcedure';\n    ELSE\n        RAISE NOTICE 'Skipped: MyProcedure (already correct or not found)';\n    END IF;\nEND $$;\n```\n\n## What pg_get_functiondef Returns\n\nIt returns a complete `CREATE OR REPLACE FUNCTION\u002FPROCEDURE` statement including:\n- Full signature with parameter names and types\n- Function body\n- Language declaration\n- Security attributes\n- All options (VOLATILE, COST, ROWS, etc.)\n\nThis means `EXECUTE v_def` is equivalent to running the original DDL -- it\nreplaces the procedure in-place without dropping it.\n\n## When to Use\n\n- Renaming column references inside procedures\n- Any bulk search-and-replace across procedure bodies\n- When you need to modify procedures atomically alongside other DDL changes\n\n## Where We Used It\n\n- ****: Updated 4 procedures to replace misspelled quoted column names\n  with corrected spellings. Each procedure had its definition extracted,\n  4 replacements applied, and re-created via EXECUTE.\n\n## Gotchas\n\n- `pg_get_functiondef` returns the definition as PostgreSQL sees it, which may\n  differ from the original DDL (formatting, quoting, etc.)\n- The `replace()` function is case-sensitive -- match the exact casing\n- Parameter names appear in the function signature AND may appear in the body;\n  use **quoted** column names in your LIKE\u002Freplace to avoid accidentally\n  modifying parameter references\n- If two procedures have the same name but different signatures (overloads),\n  you need to disambiguate by OID or argument types\n\n---\n\n*Category: DDL | Origin: *\n","# Procedure Rebuild via pg_get_functiondef\n\n## What\n\nA technique for modifying stored procedures by extracting their current\ndefinition from the catalog, performing text replacements on the SQL source,\nand re-executing the modified definition -- all within a single DO block.\n\n## Why\n\nManually rewriting a stored procedure is error-prone and doesn't scale. By\nusing `pg_get_functiondef`, you get the **exact** current definition from\nPostgreSQL's catalog, modify only what you need, and re-create it with\n`CREATE OR REPLACE`. This guarantees you don't accidentally change anything\nelse in the procedure.\n\n## How\n\n```sql\nDO $$\nDECLARE\n    v_def text;\nBEGIN\n    -- Step 1: Extract current definition\n    SELECT pg_get_functiondef(p.oid) INTO v_def\n    FROM pg_proc p\n    WHERE p.proname = 'MyProcedure'\n      AND p.pronamespace = 'public'::regnamespace;\n\n    -- Step 2: Check if replacement is needed\n    IF v_def IS NOT NULL\n       AND v_def LIKE '%\"OldColumnName\"%'\n    THEN\n        -- Step 3: Text replacement (surgical)\n        v_def := replace(v_def, '\"OldColumnName\"', '\"NewColumnName\"');\n\n        -- Step 4: Re-create the procedure\n        EXECUTE v_def;\n\n        RAISE NOTICE 'Updated: MyProcedure';\n    ELSE\n        RAISE NOTICE 'Skipped: MyProcedure (already correct or not found)';\n    END IF;\nEND $$;\n```\n\n## What pg_get_functiondef Returns\n\nIt returns a complete `CREATE OR REPLACE FUNCTION\u002FPROCEDURE` statement including:\n- Full signature with parameter names and types\n- Function body\n- Language declaration\n- Security attributes\n- All options (VOLATILE, COST, ROWS, etc.)\n\nThis means `EXECUTE v_def` is equivalent to running the original DDL -- it\nreplaces the procedure in-place without dropping it.\n\n## When to Use\n\n- Renaming column references inside procedures\n- Any bulk search-and-replace across procedure bodies\n- When you need to modify procedures atomically alongside other DDL changes\n\n## Where We Used It\n\n- ****: Updated 4 procedures to replace misspelled quoted column names\n  with corrected spellings. Each procedure had its definition extracted,\n  4 replacements applied, and re-created via EXECUTE.\n\n## Gotchas\n\n- `pg_get_functiondef` returns the definition as PostgreSQL sees it, which may\n  differ from the original DDL (formatting, quoting, etc.)\n- The `replace()` function is case-sensitive -- match the exact casing\n- Parameter names appear in the function signature AND may appear in the body;\n  use **quoted** column names in your LIKE\u002Freplace to avoid accidentally\n  modifying parameter references\n- If two procedures have the same name but different signatures (overloads),\n  you need to disambiguate by OID or argument types\n\n---\n\n*Category: DDL | Origin: *\n",{"name":5,"metadata":24,"description":7},{"original-index":25,"short-description":7},6,"master","b4414608cd5a3f87d1525b518f1c6add8363540d","skills\u002Fprocedure-rebuild-pg-get-functiondef","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":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add CarlosCaPe\u002Foctorato --skill procedure-rebuild-pg-get-functiondef",{"tool":41,"command":42},"bunx","bunx skills add CarlosCaPe\u002Foctorato --skill procedure-rebuild-pg-get-functiondef",{"tool":44,"command":45},"pnpm","pnpm dlx skills add CarlosCaPe\u002Foctorato --skill procedure-rebuild-pg-get-functiondef","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FCarlosCaPe\u002Foctorato\u002Fblob\u002Fmaster\u002Fskills\u002Fprocedure-rebuild-pg-get-functiondef\u002FSKILL.md",true,[49],{"path":50,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":53,"sourceHtmlUrl":54},"skill.json","REFERENCE","参考文档",175,"https:\u002F\u002Fgithub.com\u002FCarlosCaPe\u002Foctorato\u002Fblob\u002Fmaster\u002Fskills\u002Fprocedure-rebuild-pg-get-functiondef\u002Fskill.json",[56,65,73,80,88,96],{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":60,"licenseFileUrl":61,"sourceHtmlUrl":62,"categories":63,"keywords":64,"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":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":60,"licenseFileUrl":69,"sourceHtmlUrl":70,"categories":71,"keywords":72,"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":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"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":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":60,"licenseFileUrl":84,"sourceHtmlUrl":85,"categories":86,"keywords":87,"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":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":60,"licenseFileUrl":92,"sourceHtmlUrl":93,"categories":94,"keywords":95,"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":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"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",[],[]]