[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6CWJJM3RMEMCDNVF5YBKBPA":3,"skill-same:01M6CWJJM3RMEMCDNVF5YBKBPA":72},{"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":37,"linkOnly":38,"markdownContent":39,"markdownBody":40,"frontMatter":41,"refName":48,"commitSha":49,"skillDirectory":50,"forksCount":51,"repositoryHtmlUrl":52,"repositoryHomepageUrl":53,"ownerHtmlUrl":54,"ownerBlogUrl":55,"ownerDescription":56,"updatedAt":57,"install":58,"resources":71},"01M6CWJJM3RMEMCDNVF5YBKBPA","backfill-runbook",null,"Safely backfill historical data for a pipeline stage — scope the date range, run a dry-run, execute in chunks to avoid overwhelming the database, and verify row counts after each chunk. Use when historical data is missing, when a pipeline stage is added retroactively, or when asked to \"backfill the {stage} table from {start_date}\".","zakelfassi\u002Fskills-driven-development","zakelfassi","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1274085?v=4","01M6CWHB4BNG8NYGSW0YS08B7E","Zak El Fassi","01M6CWHB8QCK700M6B2S6Y1QPD",18,"MIT","https:\u002F\u002Fgithub.com\u002Fzakelfassi\u002Fskills-driven-development\u002Fblob\u002Fmain\u002Fexamples\u002Fdata-pipeline\u002Fskills\u002Fbackfill-runbook\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36],"backfill runbook","runbook","first","chunking","enforce","use","session","execute","table","verify","codex","Production","pipeline","data","start","database","chunk","run","2026-11-10 10:12:30",false,"---\nname: backfill-runbook\ndescription: Safely backfill historical data for a pipeline stage — scope the date range, run a dry-run, execute in chunks to avoid overwhelming the database, and verify row counts after each chunk. Use when historical data is missing, when a pipeline stage is added retroactively, or when asked to \"backfill the {stage} table from {start_date}\".\nmetadata:\n  forged-by: codex-agent\n  forged-from: session-2026-04-20\n  forged-reason: \"Our first unsupervised backfill (90-day range, 4M rows) locked the production table for 40 minutes. Forged this skill to enforce chunking and dry-run gates.\"\n  usage-count: \"3\"\n  last-used: \"2026-04-30\"\n---\n\n# Backfill Runbook\n\nSafely reprocess historical data for a pipeline stage without locking tables or losing existing rows.\n\n## Inputs\n- Stage name (e.g., `customer_ltv`)\n- Start date (`YYYY-MM-DD`)\n- End date (`YYYY-MM-DD`, defaults to yesterday)\n- Chunk size (number of days per chunk, defaults to `7`)\n- Dry run? (boolean, defaults to `true` — always start with dry-run)\n\n## Steps\n\n1. **Scope the backfill**\n   Estimate the volume:\n   ```sql\n   select count(*), min(event_date), max(event_date)\n   from raw.{source_table}\n   where event_date between '{start_date}' and '{end_date}';\n   ```\n   Multiply by your stage's typical row-expansion ratio. If the result is >10M rows, reduce the chunk size to 3 days.\n\n2. **Dry-run the first chunk**\n   ```bash\n   python pipelines\u002Ftransforms\u002F{stage_name}\u002Ftransform.py \\\n     --start {start_date} \\\n     --end {start_date + 6 days} \\\n     --dry-run\n   ```\n   The dry-run prints the SQL or DataFrame operations without writing output. Review for correctness before proceeding.\n\n3. **Back up the target table** (if it exists)\n   ```sql\n   create table {stage_name}_backup_{today} as\n   select * from {layer}.{stage_name};\n   ```\n   Keep the backup for 7 days.\n\n4. **Execute in chunks**\n   ```bash\n   python scripts\u002Fbackfill.py \\\n     --stage {stage_name} \\\n     --start {start_date} \\\n     --end {end_date} \\\n     --chunk-days {chunk_size} \\\n     --pause-seconds 5\n   ```\n   The backfill script:\n   - Processes one chunk at a time\n   - Pauses `{pause_seconds}` between chunks (reduces lock contention)\n   - Logs progress: `[chunk {n}\u002F{total}] {start}–{end}: {rows_written} rows`\n   - Writes a checkpoint file (`backfill-{stage}-{run_id}.checkpoint`) so it can resume after a failure\n\n5. **Verify each chunk** (or verify the full range after completion)\n   ```sql\n   -- Row count by date\n   select event_date, count(*) as rows\n   from {layer}.{stage_name}\n   where event_date between '{start_date}' and '{end_date}'\n   group by event_date\n   order by event_date;\n   ```\n   Compare against the raw source counts from step 1. Flag any date with zero rows.\n\n6. **Run the data quality gate** (invoke `data-quality-gate` skill)\n   Check null rates, ranges, and referential integrity on the backfilled range.\n\n7. **Drop the backup** (after 7 days, if no issues)\n   ```sql\n   drop table {stage_name}_backup_{today};\n   ```\n\n## Conventions\n- Always start with `--dry-run`; never skip this step\n- Chunk size ≤ 7 days for tables with >1M rows\u002Fday; ≤ 30 days for smaller tables\n- Backfills run during off-peak hours (after 22:00 UTC on weekdays, any time on weekends)\n- The backfill script uses `INSERT OVERWRITE` (or `REPLACE INTO`) semantics — idempotent per chunk\n- Checkpoint files are committed to `backfills\u002F` so the team can see what has been run\n\n## Edge Cases\n- **Pipeline failure mid-chunk:** Resume from the last checkpoint: `python scripts\u002Fbackfill.py --resume backfill-{stage}-{run_id}.checkpoint`.\n- **Source data changed retroactively (late-arriving events):** Add `--allow-late-data` flag; document in the backfill log that the range was reprocessed for late-arrival reasons.\n- **Backfill conflicts with a running daily load:** Check the scheduler; delay the backfill or pause the daily DAG temporarily. Never run both simultaneously on the same partition.\n- **Very long date range (>1 year):** Split into multiple backfill jobs of ≤90 days each; run sequentially and verify between jobs.\n","# Backfill Runbook\n\nSafely reprocess historical data for a pipeline stage without locking tables or losing existing rows.\n\n## Inputs\n- Stage name (e.g., `customer_ltv`)\n- Start date (`YYYY-MM-DD`)\n- End date (`YYYY-MM-DD`, defaults to yesterday)\n- Chunk size (number of days per chunk, defaults to `7`)\n- Dry run? (boolean, defaults to `true` — always start with dry-run)\n\n## Steps\n\n1. **Scope the backfill**\n   Estimate the volume:\n   ```sql\n   select count(*), min(event_date), max(event_date)\n   from raw.{source_table}\n   where event_date between '{start_date}' and '{end_date}';\n   ```\n   Multiply by your stage's typical row-expansion ratio. If the result is >10M rows, reduce the chunk size to 3 days.\n\n2. **Dry-run the first chunk**\n   ```bash\n   python pipelines\u002Ftransforms\u002F{stage_name}\u002Ftransform.py \\\n     --start {start_date} \\\n     --end {start_date + 6 days} \\\n     --dry-run\n   ```\n   The dry-run prints the SQL or DataFrame operations without writing output. Review for correctness before proceeding.\n\n3. **Back up the target table** (if it exists)\n   ```sql\n   create table {stage_name}_backup_{today} as\n   select * from {layer}.{stage_name};\n   ```\n   Keep the backup for 7 days.\n\n4. **Execute in chunks**\n   ```bash\n   python scripts\u002Fbackfill.py \\\n     --stage {stage_name} \\\n     --start {start_date} \\\n     --end {end_date} \\\n     --chunk-days {chunk_size} \\\n     --pause-seconds 5\n   ```\n   The backfill script:\n   - Processes one chunk at a time\n   - Pauses `{pause_seconds}` between chunks (reduces lock contention)\n   - Logs progress: `[chunk {n}\u002F{total}] {start}–{end}: {rows_written} rows`\n   - Writes a checkpoint file (`backfill-{stage}-{run_id}.checkpoint`) so it can resume after a failure\n\n5. **Verify each chunk** (or verify the full range after completion)\n   ```sql\n   -- Row count by date\n   select event_date, count(*) as rows\n   from {layer}.{stage_name}\n   where event_date between '{start_date}' and '{end_date}'\n   group by event_date\n   order by event_date;\n   ```\n   Compare against the raw source counts from step 1. Flag any date with zero rows.\n\n6. **Run the data quality gate** (invoke `data-quality-gate` skill)\n   Check null rates, ranges, and referential integrity on the backfilled range.\n\n7. **Drop the backup** (after 7 days, if no issues)\n   ```sql\n   drop table {stage_name}_backup_{today};\n   ```\n\n## Conventions\n- Always start with `--dry-run`; never skip this step\n- Chunk size ≤ 7 days for tables with >1M rows\u002Fday; ≤ 30 days for smaller tables\n- Backfills run during off-peak hours (after 22:00 UTC on weekdays, any time on weekends)\n- The backfill script uses `INSERT OVERWRITE` (or `REPLACE INTO`) semantics — idempotent per chunk\n- Checkpoint files are committed to `backfills\u002F` so the team can see what has been run\n\n## Edge Cases\n- **Pipeline failure mid-chunk:** Resume from the last checkpoint: `python scripts\u002Fbackfill.py --resume backfill-{stage}-{run_id}.checkpoint`.\n- **Source data changed retroactively (late-arriving events):** Add `--allow-late-data` flag; document in the backfill log that the range was reprocessed for late-arrival reasons.\n- **Backfill conflicts with a running daily load:** Check the scheduler; delay the backfill or pause the daily DAG temporarily. Never run both simultaneously on the same partition.\n- **Very long date range (>1 year):** Split into multiple backfill jobs of ≤90 days each; run sequentially and verify between jobs.\n",{"name":5,"metadata":42,"description":7},{"forged-by":43,"last-used":44,"forged-from":45,"usage-count":46,"forged-reason":47},"codex-agent","2026-04-30","session-2026-04-20","3","Our first unsupervised backfill (90-day range, 4M rows) locked the production table for 40 minutes. Forged this skill to enforce chunking and dry-run gates.","main","e959db0147cafe70b738efbd5a128985763fd0df","examples\u002Fdata-pipeline\u002Fskills\u002Fbackfill-runbook",1,"https:\u002F\u002Fgithub.com\u002Fzakelfassi\u002Fskills-driven-development","https:\u002F\u002Fskdd.dev","https:\u002F\u002Fgithub.com\u002Fzakelfassi","https:\u002F\u002Fzakelfassi.com","I build systems and write about what they do to us. Founder @TalkAndComment.","2026-11-06 14:19:15",{"source":8,"skillName":5,"commands":59,"prompt":69,"zipAvailable":70},[60,63,66],{"tool":61,"command":62},"npx","npx skills add zakelfassi\u002Fskills-driven-development --skill backfill-runbook",{"tool":64,"command":65},"bunx","bunx skills add zakelfassi\u002Fskills-driven-development --skill backfill-runbook",{"tool":67,"command":68},"pnpm","pnpm dlx skills add zakelfassi\u002Fskills-driven-development --skill backfill-runbook","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fzakelfassi\u002Fskills-driven-development\u002Fblob\u002Fmain\u002Fexamples\u002Fdata-pipeline\u002Fskills\u002Fbackfill-runbook\u002FSKILL.md",true,[],[73,90,95,114,131,152],{"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":37},"01M6CWKMXZDBQ8TK30ZV1X2KM7","skillforge","Create or update a reusable agent skill. Use when you notice a repeated pattern, when a workflow should be persisted for future sessions, or when asked to forge\u002Fcreate\u002Fscaffold a new skill.","https:\u002F\u002Fgithub.com\u002Fzakelfassi\u002Fskills-driven-development\u002Fblob\u002Fmain\u002Fskillforge\u002FSKILL.md",[],[75,80,81,82,83,84,24,85,86,87,88,89],"workflow","agentskills","pattern","new skill","reusable","forge","update","create","scaffold","sessions",{"skillNo":91,"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":92,"categories":93,"keywords":94,"publishedAt":37},"01M6CWKJF5Y1PQBZ4QWA9DDES1","https:\u002F\u002Fgithub.com\u002Fzakelfassi\u002Fskills-driven-development\u002Fblob\u002Fmain\u002Fplugins\u002Fskdd-claude\u002Fskills\u002Fskillforge\u002FSKILL.md",[],[75,80,85,89,81,82,83,84,24,86,87,88],{"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":37},"01M6CWKFTNP9RBAD9SBEKRVMR2","deploy-preview","Deploy a preview branch to the staging environment for review. Use when a feature branch is ready for visual review, when someone asks to \"deploy this for review\", or before opening a PR.","https:\u002F\u002Fgithub.com\u002Fzakelfassi\u002Fskills-driven-development\u002Fblob\u002Fmain\u002Fexamples\u002Fwebapp-starter\u002Fskills\u002Fdeploy-preview\u002FSKILL.md",[],[102,103,104,105,106,107,108,109,24,25,110,111,112,29,113],"deploy preview","deploy","preview","visual","branches","time","ready","opening a pr","environment","branch","pr","review",{"skillNo":115,"name":116,"nameZh":6,"description":117,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":118,"categories":119,"keywords":120,"publishedAt":37},"01M6CWKCSCQ6PV8TVKV2MDRAHH","component-scaffold","Create a new React component with co-located test, story, and styles. Use when creating new UI components, when asked to scaffold\u002Fgenerate a component, or when building new pages.","https:\u002F\u002Fgithub.com\u002Fzakelfassi\u002Fskills-driven-development\u002Fblob\u002Fmain\u002Fexamples\u002Fwebapp-starter\u002Fskills\u002Fcomponent-scaffold\u002FSKILL.md",[],[121,122,88,24,123,124,125,25,126,127,128,87,129,107,130],"component scaffold","component","components","structure","Story","ui","file","generate","react","test",{"skillNo":132,"name":133,"nameZh":6,"description":134,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":135,"categories":136,"keywords":137,"publishedAt":37},"01M6CWKA7S16TW2KZZ7ADK9YSA","bug-triage","Triage a bug report into an actionable GitHub issue with severity, reproduction steps, and assignment. Use when a bug is reported, when error logs need investigation, or when asked to file\u002Ftriage an issue.","https:\u002F\u002Fgithub.com\u002Fzakelfassi\u002Fskills-driven-development\u002Fblob\u002Fmain\u002Fexamples\u002Fwebapp-starter\u002Fskills\u002Fbug-triage\u002FSKILL.md",[],[138,139,140,141,127,142,143,144,145,146,147,148,149,24,150,25,151],"triage","bug","bug triage","logs","report","toolkit","bug report","github","severity","project","issue","github issue","ops","investigation",{"skillNo":153,"name":154,"nameZh":6,"description":155,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":156,"categories":157,"keywords":158,"publishedAt":37},"01M6CWK6Y4VB6HFNKP84WA3C6G","api-endpoint","Scaffold a REST API endpoint with route, controller, validation, and tests. Use when creating new API endpoints, adding resources, or when asked to build a new backend route.","https:\u002F\u002Fgithub.com\u002Fzakelfassi\u002Fskills-driven-development\u002Fblob\u002Fmain\u002Fexamples\u002Fwebapp-starter\u002Fskills\u002Fapi-endpoint\u002FSKILL.md",[],[159,160,161,162,82,107,124,163,164,165,24,25,166,167,168,88,29],"endpoint","api","api endpoint","route","build","endpoints","backend","controller","REST","validation"]