[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M74B3BSM7RFX77RC6YNB4XQR":3,"skill-same:01M74B3BSM7RFX77RC6YNB4XQR":56},{"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":29,"repositoryHtmlUrl":30,"repositoryHomepageUrl":31,"ownerHtmlUrl":32,"ownerBlogUrl":33,"ownerDescription":34,"updatedAt":35,"install":36,"resources":49},"01M74B3BSM7RFX77RC6YNB4XQR","data-retention-policy-lifecycle",null,"Data Retention Policy Lifecycle","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\u002Fdata-retention-policy-lifecycle\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: data-retention-policy-lifecycle\ndescription: \"Data Retention Policy Lifecycle\"\nmetadata:\n  short-description: \"Data Retention Policy Lifecycle\"\n  original-index: 21\n---\n\n# Data Retention Policy Lifecycle\n\n## What\n\nA five-phase approach to implementing data retention policies in PostgreSQL:\nsize analysis, rule definition, maintenance procedure, scheduled execution,\nand validation with rollback.\n\n## Why\n\nTables like audit logs, error logs, and shift history grow unbounded. Without\na retention policy, they consume storage, slow backups, and degrade query\nperformance. A proper retention lifecycle ensures data is purged safely,\nautomatically, and with full audit trail.\n\n## How\n\n### Phase 1: Size analysis\n```sql\n-- How big is the table? How fast is it growing?\nSELECT\n    pg_size_pretty(pg_total_relation_size('\"ShiftAuditLog\"')) AS total_size,\n    (SELECT COUNT(*) FROM public.\"ShiftAuditLog\") AS row_count,\n    MIN(\"CreatedDate\") AS oldest_row,\n    MAX(\"CreatedDate\") AS newest_row\nFROM public.\"ShiftAuditLog\";\n```\n\n### Phase 2: Rule definition\nDocument the retention rule with business justification:\n```markdown\n| Table | Retention | Justification |\n|-------|-----------|---------------|\n| ShiftAuditLog | 90 days | Audit requirement: 90-day lookback |\n| ErrorLog | 30 days | Debugging window: 30 days max |\n| RefreshTokens | 7 days past expiry | Expired tokens have no value |\n```\n\n### Phase 3: Maintenance procedure\n```sql\nCREATE OR REPLACE PROCEDURE maintenance.purge_shift_audit_log(\n    p_retention_days int DEFAULT 90\n)\nLANGUAGE plpgsql AS $$\nDECLARE\n    v_cutoff timestamptz;\n    v_deleted bigint;\nBEGIN\n    v_cutoff := now() - (p_retention_days || ' days')::interval;\n\n    DELETE FROM public.\"ShiftAuditLog\"\n    WHERE \"CreatedDate\" \u003C v_cutoff;\n\n    GET DIAGNOSTICS v_deleted = ROW_COUNT;\n    RAISE NOTICE 'Purged % rows older than %', v_deleted, v_cutoff;\nEND;\n$$;\n```\n\n### Phase 4: Schedule via pg_cron (see Skill #16 for full pg_cron patterns)\n```sql\nSELECT cron.schedule(\n    'purge-shift-audit-log',\n    '0 3 * * 0',  -- weekly, Sunday 3 AM\n    $$CALL maintenance.purge_shift_audit_log(90)$$\n);\n```\n\n### Phase 5: Validate + rollback plan\n```sql\n-- Validate: check job ran and purged rows\nSELECT * FROM cron.job_run_details\nWHERE jobid = (SELECT jobid FROM cron.job WHERE jobname = 'purge-shift-audit-log')\nORDER BY start_time DESC LIMIT 5;\n\n-- Rollback: disable if needed\nSELECT cron.unschedule('purge-shift-audit-log');\n```\n\n## Supporting indexes\nAlways ensure the retention column is indexed (Skill #10):\n```sql\nCREATE INDEX CONCURRENTLY IF NOT EXISTS ix_shiftauditlog_createddate\n    ON public.\"ShiftAuditLog\" (\"CreatedDate\");\n```\n\nWithout this index, the DELETE does a sequential scan of the entire table.\n\n## When to Use\n\n- Any table that grows unbounded (audit logs, error logs, session data)\n- After audit findings flag tables with no retention strategy\n- When storage costs or backup times become a concern\n\n## Where We Used It\n\n- ****: Full 5-phase retention lifecycle for ShiftAuditLog (90-day retention)\n- ****: Retention policy indexes for logging tables\n- ****: Token purge via pg_cron (simplified retention)\n\n## Related Skills\n\n- **Skill #16** (pg_cron Scheduled Maintenance) -- scheduling engine for Phase 4\n- **Skill #10** (Index CONCURRENTLY) -- supporting indexes on retention columns\n- **Skill #20** (Procedure Hardening) -- error handling in the purge procedure\n\n## References\n\n- [PostgreSQL Best Practices](..\u002FDOCUMENTS\u002FPostgreSQL_BestPractices_Azure.md)\n  -- see Backlog #13 (Log rotation without partitioning) and\n  \"Maintenance, vacuum, and bloat\" section\n\n## Gotchas\n\n- **Test the DELETE query first** with `SELECT COUNT(*)` before running the purge\n- Large deletes can bloat the table (dead tuples) -- schedule `VACUUM` after\n- Consider batched deletes for very large tables (delete 10K rows at a time)\n- Always index the retention column BEFORE scheduling the purge job\n- Document the retention rule in the ticket README -- future engineers need\n  to know WHY 90 days was chosen\n\n---\n\n*Category: Process | Origin: , , *\n","# Data Retention Policy Lifecycle\n\n## What\n\nA five-phase approach to implementing data retention policies in PostgreSQL:\nsize analysis, rule definition, maintenance procedure, scheduled execution,\nand validation with rollback.\n\n## Why\n\nTables like audit logs, error logs, and shift history grow unbounded. Without\na retention policy, they consume storage, slow backups, and degrade query\nperformance. A proper retention lifecycle ensures data is purged safely,\nautomatically, and with full audit trail.\n\n## How\n\n### Phase 1: Size analysis\n```sql\n-- How big is the table? How fast is it growing?\nSELECT\n    pg_size_pretty(pg_total_relation_size('\"ShiftAuditLog\"')) AS total_size,\n    (SELECT COUNT(*) FROM public.\"ShiftAuditLog\") AS row_count,\n    MIN(\"CreatedDate\") AS oldest_row,\n    MAX(\"CreatedDate\") AS newest_row\nFROM public.\"ShiftAuditLog\";\n```\n\n### Phase 2: Rule definition\nDocument the retention rule with business justification:\n```markdown\n| Table | Retention | Justification |\n|-------|-----------|---------------|\n| ShiftAuditLog | 90 days | Audit requirement: 90-day lookback |\n| ErrorLog | 30 days | Debugging window: 30 days max |\n| RefreshTokens | 7 days past expiry | Expired tokens have no value |\n```\n\n### Phase 3: Maintenance procedure\n```sql\nCREATE OR REPLACE PROCEDURE maintenance.purge_shift_audit_log(\n    p_retention_days int DEFAULT 90\n)\nLANGUAGE plpgsql AS $$\nDECLARE\n    v_cutoff timestamptz;\n    v_deleted bigint;\nBEGIN\n    v_cutoff := now() - (p_retention_days || ' days')::interval;\n\n    DELETE FROM public.\"ShiftAuditLog\"\n    WHERE \"CreatedDate\" \u003C v_cutoff;\n\n    GET DIAGNOSTICS v_deleted = ROW_COUNT;\n    RAISE NOTICE 'Purged % rows older than %', v_deleted, v_cutoff;\nEND;\n$$;\n```\n\n### Phase 4: Schedule via pg_cron (see Skill #16 for full pg_cron patterns)\n```sql\nSELECT cron.schedule(\n    'purge-shift-audit-log',\n    '0 3 * * 0',  -- weekly, Sunday 3 AM\n    $$CALL maintenance.purge_shift_audit_log(90)$$\n);\n```\n\n### Phase 5: Validate + rollback plan\n```sql\n-- Validate: check job ran and purged rows\nSELECT * FROM cron.job_run_details\nWHERE jobid = (SELECT jobid FROM cron.job WHERE jobname = 'purge-shift-audit-log')\nORDER BY start_time DESC LIMIT 5;\n\n-- Rollback: disable if needed\nSELECT cron.unschedule('purge-shift-audit-log');\n```\n\n## Supporting indexes\nAlways ensure the retention column is indexed (Skill #10):\n```sql\nCREATE INDEX CONCURRENTLY IF NOT EXISTS ix_shiftauditlog_createddate\n    ON public.\"ShiftAuditLog\" (\"CreatedDate\");\n```\n\nWithout this index, the DELETE does a sequential scan of the entire table.\n\n## When to Use\n\n- Any table that grows unbounded (audit logs, error logs, session data)\n- After audit findings flag tables with no retention strategy\n- When storage costs or backup times become a concern\n\n## Where We Used It\n\n- ****: Full 5-phase retention lifecycle for ShiftAuditLog (90-day retention)\n- ****: Retention policy indexes for logging tables\n- ****: Token purge via pg_cron (simplified retention)\n\n## Related Skills\n\n- **Skill #16** (pg_cron Scheduled Maintenance) -- scheduling engine for Phase 4\n- **Skill #10** (Index CONCURRENTLY) -- supporting indexes on retention columns\n- **Skill #20** (Procedure Hardening) -- error handling in the purge procedure\n\n## References\n\n- [PostgreSQL Best Practices](..\u002FDOCUMENTS\u002FPostgreSQL_BestPractices_Azure.md)\n  -- see Backlog #13 (Log rotation without partitioning) and\n  \"Maintenance, vacuum, and bloat\" section\n\n## Gotchas\n\n- **Test the DELETE query first** with `SELECT COUNT(*)` before running the purge\n- Large deletes can bloat the table (dead tuples) -- schedule `VACUUM` after\n- Consider batched deletes for very large tables (delete 10K rows at a time)\n- Always index the retention column BEFORE scheduling the purge job\n- Document the retention rule in the ticket README -- future engineers need\n  to know WHY 90 days was chosen\n\n---\n\n*Category: Process | Origin: , , *\n",{"name":5,"metadata":24,"description":7},{"original-index":25,"short-description":7},21,"master","b4414608cd5a3f87d1525b518f1c6add8363540d","skills\u002Fdata-retention-policy-lifecycle",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":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add CarlosCaPe\u002Foctorato --skill data-retention-policy-lifecycle",{"tool":42,"command":43},"bunx","bunx skills add CarlosCaPe\u002Foctorato --skill data-retention-policy-lifecycle",{"tool":45,"command":46},"pnpm","pnpm dlx skills add CarlosCaPe\u002Foctorato --skill data-retention-policy-lifecycle","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FCarlosCaPe\u002Foctorato\u002Fblob\u002Fmaster\u002Fskills\u002Fdata-retention-policy-lifecycle\u002FSKILL.md",true,[50],{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"skill.json","REFERENCE","参考文档",161,"https:\u002F\u002Fgithub.com\u002FCarlosCaPe\u002Foctorato\u002Fblob\u002Fmaster\u002Fskills\u002Fdata-retention-policy-lifecycle\u002Fskill.json",[57,66,74,81,89,97],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":61,"licenseFileUrl":62,"sourceHtmlUrl":63,"categories":64,"keywords":65,"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":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":61,"licenseFileUrl":70,"sourceHtmlUrl":71,"categories":72,"keywords":73,"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":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"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":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":61,"licenseFileUrl":85,"sourceHtmlUrl":86,"categories":87,"keywords":88,"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":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":61,"licenseFileUrl":93,"sourceHtmlUrl":94,"categories":95,"keywords":96,"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":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"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",[],[]]