[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6GXKSYMA47MJSET2JMVFK6F":3,"skill-same:01M6GXKSYMA47MJSET2JMVFK6F":80},{"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":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":43,"commitSha":44,"skillDirectory":45,"forksCount":46,"repositoryHtmlUrl":47,"repositoryHomepageUrl":6,"ownerHtmlUrl":48,"ownerBlogUrl":49,"ownerDescription":50,"updatedAt":51,"install":52,"resources":65},"01M6GXKSYMA47MJSET2JMVFK6F","backfill-a-partitioned-table",null,"Use when reprocessing historical partitions after a bug, a logic change, or new data. Runs the backfill in bounded idempotent chunks with a concurrency cap and verifies each partition before moving on.","jiayaoqijia\u002Fcryptoskill","jiayaoqijia","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1453879?v=4","01M6GMYTX7Q7S504VC6E756ENR","YQ","01M6GMYV1QKJ1CC75MTTGT9PR0",81,"MIT","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-backfill-a-partitioned-table\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-backfill-a-partitioned-table\u002FSKILL.md",[],[20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"table","backfill","backfill a partitioned table","logic","new","when","chunks","idempotent","bounded","with","change","partitions","cap","bug","use","partition","concurrency","data","2026-11-10 10:12:30",false,"---\nname: backfill-a-partitioned-table\ndescription: Use when reprocessing historical partitions after a bug, a logic change, or new data. Runs the backfill in bounded idempotent chunks with a concurrency cap and verifies each partition before moving on.\n---\n\n# Backfill a Partitioned Table\n\nA backfill re-derives history with fixed logic. Done carelessly it locks the table, blows the budget, or overwrites good data with half-computed results. Run it in idempotent chunks through the same code path as the daily job.\n\n## Procedure\n\n1. Reuse the production job code with only the partition range changed. Never a one-off script that drifts from the daily logic.\n2. Compute the affected range precisely: the first and last partition the bug touched. Do not backfill everything for a narrow fix.\n3. Write to a shadow partition and swap, or merge on the natural key, so a failed chunk leaves the original intact.\n4. Chunk by partition and cap concurrency at 2-4 partitions at once, to bound source load and keep each chunk cheaply retryable.\n5. Make each chunk idempotent (upsert) so a retried chunk converges.\n6. Verify each chunk before moving on: row count and checksum for the partition, compared to a recompute from the source.\n7. Order: oldest-to-newest when later partitions depend on earlier ones (cumulative snapshots), newest-to-oldest when only freshness matters and time is short.\n8. Rate-limit against the source: a backfill on the same replica as production can starve it; add a query tag and a per-query budget.\n9. Record progress in a table so the backfill is resumable after a stop.\n10. Pin the code revision in the progress record, so a mid-flight deploy does not produce partitions computed by two different versions.\n\n## Pitfalls\n\n- Overwriting the target partition in place means a crash mid-write leaves it empty or partial.\n- Backfilling new logic into partitions downstream already consumed creates a silent inconsistency with cached results.\n- Running all partitions in parallel exhausts the source connection pool.\n- Backfilling from a source table that was itself already corrected changes nothing; check the raw history still exists.\n- Forgetting the trailing late-data horizon re-introduces the gap the backfill was meant to fix.\n- No progress table means a restart redoes the whole range.\n- A deploy that changes the transform while a backfill is running mixes two logic versions across the range.\n- Verifying only the first and last partition misses a bad middle chunk.\n\n## Verification\n\n```sh\npsql -c \"SELECT dt, count(*), sum(amount) FROM sales WHERE dt BETWEEN '2026-09-01' AND '2026-09-30' GROUP BY dt ORDER BY dt\"\n```\n\nEvery partition's count and sum match the source; run the query twice to confirm idempotency (no growth). Report the range backfilled, partitions verified, rows written, and any partition left failing.","# Backfill a Partitioned Table\n\nA backfill re-derives history with fixed logic. Done carelessly it locks the table, blows the budget, or overwrites good data with half-computed results. Run it in idempotent chunks through the same code path as the daily job.\n\n## Procedure\n\n1. Reuse the production job code with only the partition range changed. Never a one-off script that drifts from the daily logic.\n2. Compute the affected range precisely: the first and last partition the bug touched. Do not backfill everything for a narrow fix.\n3. Write to a shadow partition and swap, or merge on the natural key, so a failed chunk leaves the original intact.\n4. Chunk by partition and cap concurrency at 2-4 partitions at once, to bound source load and keep each chunk cheaply retryable.\n5. Make each chunk idempotent (upsert) so a retried chunk converges.\n6. Verify each chunk before moving on: row count and checksum for the partition, compared to a recompute from the source.\n7. Order: oldest-to-newest when later partitions depend on earlier ones (cumulative snapshots), newest-to-oldest when only freshness matters and time is short.\n8. Rate-limit against the source: a backfill on the same replica as production can starve it; add a query tag and a per-query budget.\n9. Record progress in a table so the backfill is resumable after a stop.\n10. Pin the code revision in the progress record, so a mid-flight deploy does not produce partitions computed by two different versions.\n\n## Pitfalls\n\n- Overwriting the target partition in place means a crash mid-write leaves it empty or partial.\n- Backfilling new logic into partitions downstream already consumed creates a silent inconsistency with cached results.\n- Running all partitions in parallel exhausts the source connection pool.\n- Backfilling from a source table that was itself already corrected changes nothing; check the raw history still exists.\n- Forgetting the trailing late-data horizon re-introduces the gap the backfill was meant to fix.\n- No progress table means a restart redoes the whole range.\n- A deploy that changes the transform while a backfill is running mixes two logic versions across the range.\n- Verifying only the first and last partition misses a bad middle chunk.\n\n## Verification\n\n```sh\npsql -c \"SELECT dt, count(*), sum(amount) FROM sales WHERE dt BETWEEN '2026-09-01' AND '2026-09-30' GROUP BY dt ORDER BY dt\"\n```\n\nEvery partition's count and sum match the source; run the query twice to confirm idempotency (no growth). Report the range backfilled, partitions verified, rows written, and any partition left failing.",{"name":5,"description":7},"main","3df1d0d67b30ff15236561f8c0f9f06d33f42dfd","skills\u002Fpayments\u002F0xklen-backfill-a-partitioned-table",17,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia","https:\u002F\u002Feth2030.com","Hardcore infra. Building @alt-research and applied cryptography.","2026-11-12 02:28:42",{"source":8,"skillName":5,"commands":53,"prompt":63,"zipAvailable":64},[54,57,60],{"tool":55,"command":56},"npx","npx skills add jiayaoqijia\u002Fcryptoskill --skill backfill-a-partitioned-table",{"tool":58,"command":59},"bunx","bunx skills add jiayaoqijia\u002Fcryptoskill --skill backfill-a-partitioned-table",{"tool":61,"command":62},"pnpm","pnpm dlx skills add jiayaoqijia\u002Fcryptoskill --skill backfill-a-partitioned-table","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-backfill-a-partitioned-table\u002FSKILL.md",true,[66,70,76],{"path":67,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":69,"sourceHtmlUrl":16},"LICENSE","许可证",1063,{"path":71,"resourceType":72,"resourceTypeDesc":73,"sizeBytes":74,"sourceHtmlUrl":75},"SOURCE.md","REFERENCE","参考文档",354,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-backfill-a-partitioned-table\u002FSOURCE.md",{"path":77,"resourceType":72,"resourceTypeDesc":73,"sizeBytes":78,"sourceHtmlUrl":79},"TRUST.auto.yaml",2195,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-backfill-a-partitioned-table\u002FTRUST.auto.yaml",[81,109,132,149,162,172],{"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":15,"licenseFileUrl":85,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":38},"01M712C436EQYE43342Q4E7GG1","recipe-performance","Diagnose a specific MetaMask user flow's real-app performance and Sentry critical-user-flow telemetry with deterministic mm-harness recipes. Use for CUF boundaries, cold\u002Fwarm\u002Fbackground-resume behavior, latency regressions, lifecycle tags, duplicate or blocking network requests, long tasks, layout\u002Fpaint cost, screen redraws, React rerenders, or browser trace analysis where tests alone cannot prove the real app.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fwallets\u002Fmetamask-official-recipe-performance\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fwallets\u002Fmetamask-official-recipe-performance\u002FSKILL.md",[],[89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108],"performance","recipe performance","recipe","mm","sentry","harness","app","deterministic","recipes","flow","cold","critical","analysis","tasks","react","browser","layout","screen","network","metamask",{"skillNo":110,"name":111,"nameZh":6,"description":112,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":113,"licenseFileUrl":114,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":38},"01M70XT2F8A5CQZ81JBP98KSW3","mexc-spot-websocket","MEXC Spot WebSocket workflows for public streams, protobuf handling, depth maintenance, listen keys, and private streams without exposing API keys.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fmncrftfrcnm-mexc-spot-websocket\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fmncrftfrcnm-mexc-spot-websocket\u002FSKILL.md",[],[118,119,120,121,122,123,124,125,126,127,128,129,130,131],"mexc spot websocket","spot","websocket","api","workflows","public","listen","streams","depth","keys","for","api keys","maintenance","protobuf",{"skillNo":133,"name":134,"nameZh":6,"description":135,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":113,"licenseFileUrl":136,"sourceHtmlUrl":137,"categories":138,"keywords":139,"publishedAt":38},"01M70XT0MBXN3WZY1BKN0CPNKR","mexc-spot-rest","MEXC Spot REST workflows for public data, signed account requests, orders, wallet\u002Fadmin actions, and secure signing without exposing API keys.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fmncrftfrcnm-mexc-spot-rest\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fmncrftfrcnm-mexc-spot-rest\u002FSKILL.md",[],[140,119,141,142,143,144,145,129,128,127,146,147,37,123,148,122,121],"mexc spot rest","REST","admin","signing","Wallet","requests","actions","secure","orders",{"skillNo":150,"name":151,"nameZh":6,"description":152,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":113,"licenseFileUrl":153,"sourceHtmlUrl":154,"categories":155,"keywords":156,"publishedAt":38},"01M70XSYSVZ2N0N91XCAR2CAK0","mexc-futures-websocket","MEXC Futures WebSocket workflows for public streams, private account\u002Forder\u002Fposition streams, ping\u002Fpong, subscriptions, and depth maintenance.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fmncrftfrcnm-mexc-futures-websocket\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fmncrftfrcnm-mexc-futures-websocket\u002FSKILL.md",[],[157,158,120,159,160,130,128,161,126,125,123,122],"mexc futures websocket","futures","position","ping","subscriptions",{"skillNo":163,"name":164,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":165,"sourceHtmlUrl":166,"categories":167,"keywords":168,"publishedAt":38},"01M6H0ZWHVE5W04WG2DKQE2SQC","0xklen-version-and-refresh-sanctions-lists","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-version-and-refresh-sanctions-lists\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-version-and-refresh-sanctions-lists\u002FSKILL.md",[],[169,170,171],"refresh","0xklen version and refresh sanctions lists","version",{"skillNo":173,"name":174,"nameZh":6,"description":175,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":176,"sourceHtmlUrl":177,"categories":178,"keywords":179,"publishedAt":38},"01M6H0Z28Q3R8J0S799GJQWXM3","verify-tests-cover-changed-lines","Use when a PR adds code that the existing suite may not exercise. Measures patch coverage — the share of newly changed lines hit by tests — before approving.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-verify-tests-cover-changed-lines\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-verify-tests-cover-changed-lines\u002FSKILL.md",[],[180,181,182,183,184,185,186,34,187,188,189],"tests","cover","verify tests cover changed lines","verify","coverage","pr","exercise","patch","code","share"]