[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M74GKAJX6QWST60Q06KN2CJP":3,"skill-same:01M74GKAJX6QWST60Q06KN2CJP":50},{"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":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":43},"01M74GKAJX6QWST60Q06KN2CJP","data-pipeline",null,"Design a data pipeline — ETL vs ELT, batch vs streaming, orchestration\u002FDAG, idempotent backfills, schema handling, data-quality checks, and lineage.","MohammadBafkar\u002Fpolymath","MohammadBafkar","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F34940462?v=4","01M74G540TQFZWK6KVAPKFVGNR","Mohammad Bafkar","01M74G541HG19QP9V5DQCJVKYE",0,"MIT","https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-streaming\u002Fskills\u002Fdata-pipeline\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: data-pipeline\ndescription: Design a data pipeline — ETL vs ELT, batch vs streaming, orchestration\u002FDAG, idempotent backfills, schema handling, data-quality checks, and lineage.\n---\n\n# data-pipeline\n\n> A pipeline that can't be safely re-run is a pipeline that will eventually corrupt your warehouse. Design idempotency and backfill before you design transforms.\n\n**Mode:** analytical — judgment inside a fixed frame. Keep the output shape; every verdict cites its evidence; unknowns are marked `[TBD]` or `[VERIFY]`, never filled in.\n\n## When to use\n\n- Building or reworking ingestion\u002Ftransformation from sources into a warehouse\u002Flake.\n- A pipeline is non-idempotent, hard to backfill, or silently dropping\u002Fduplicating rows.\n- A workflow invokes `polymath-streaming:data-pipeline`.\n\nNot this when: you are choosing the target table shape — that is `polymath-streaming:data-modeling`. For the streaming transport itself, `polymath-streaming:streaming-design`. For analytic query tuning, `polymath-data:sql-optimize`.\n\n## Inputs\n\n- Sources (DBs, events, files, APIs), volumes, freshness SLA, and destination.\n- Whether late\u002Fout-of-order or corrected data arrives.\n\n## Procedure\n\n1. **ETL vs ELT**: prefer ELT (load raw, transform in-warehouse) when the destination is a modern warehouse\u002Flake — it preserves raw data and makes transforms re-runnable; use ETL when you must transform\u002Ffilter before landing (PII, cost). State the choice.\n2. **Batch vs streaming** by the freshness SLA: batch (scheduled, simpler, cheaper) unless sub-minute freshness genuinely matters; micro-batch as the middle ground. Don't pay for streaming you don't need.\n3. **Orchestration**: model as a DAG with explicit dependencies (Airflow\u002FDagster\u002Fetc.); each task is retryable and observable. Avoid hidden cron chains.\n4. **Idempotency + backfill** — the core: design every step so re-running a window produces the same result (idempotent writes: upsert\u002Fmerge on a key, or delete-insert per partition). A backfill for any date range must be a first-class, safe operation.\n5. **Schema handling**: validate on ingest; decide schema-on-read vs schema-on-write; version schemas and handle drift (new\u002Fremoved\u002Frenamed columns) without breaking downstream.\n6. **Data quality**: assertions at boundaries (row counts, null\u002Frange\u002Funiqueness, referential checks); fail or quarantine on violation rather than propagating bad data.\n7. **Late\u002Fout-of-order data**: define the lateness window and the correction strategy (reprocess affected partitions).\n8. **Lineage + observability**: track source→table lineage, freshness, and volume; alert on staleness and anomalies.\n\n## Output\n\n```text\nData pipeline: orders → warehouse (Dagster, BigQuery)\n\nDecisions: ELT (raw lands first; PII columns hashed at load) · daily batch — freshness SLA is 6 h, streaming not needed\nDAG\n  extract_orders      CDC snapshot per day partition         retry 3× · idempotent: overwrite partition\n  load_raw            → raw.orders (partition = order_date)  idempotent: delete-insert per partition\n  transform_orders    raw → staging → marts.fct_orders       idempotent: MERGE on order_id\n  quality_gate        row count ±20% vs 7-day mean · order_id unique · amount ≥ 0 · FK to dim_customer\n                      on failure: quarantine the partition, stop downstream, page data on-call\nBackfill: `dagster job backfill --partitions 2026-01-01...2026-03-31` — same code path, partition by partition\nSchema drift: new source columns land in raw automatically; marts only change via a reviewed model PR; removed columns alert\nLate data: corrections up to 3 days old → reprocess those 3 partitions nightly\nLineage + freshness: dbt\u002FDagster lineage graph; alert when fct_orders is older than 6 h\n```\n\n## Quality bar\n\n- Every step is idempotent; re-running a window is safe and produces identical output.\n- Backfill of an arbitrary range is a defined, first-class operation.\n- Data-quality assertions gate the boundaries; violations quarantine, not propagate.\n- Batch-vs-streaming is justified by the freshness SLA, not fashion.\n","# data-pipeline\n\n> A pipeline that can't be safely re-run is a pipeline that will eventually corrupt your warehouse. Design idempotency and backfill before you design transforms.\n\n**Mode:** analytical — judgment inside a fixed frame. Keep the output shape; every verdict cites its evidence; unknowns are marked `[TBD]` or `[VERIFY]`, never filled in.\n\n## When to use\n\n- Building or reworking ingestion\u002Ftransformation from sources into a warehouse\u002Flake.\n- A pipeline is non-idempotent, hard to backfill, or silently dropping\u002Fduplicating rows.\n- A workflow invokes `polymath-streaming:data-pipeline`.\n\nNot this when: you are choosing the target table shape — that is `polymath-streaming:data-modeling`. For the streaming transport itself, `polymath-streaming:streaming-design`. For analytic query tuning, `polymath-data:sql-optimize`.\n\n## Inputs\n\n- Sources (DBs, events, files, APIs), volumes, freshness SLA, and destination.\n- Whether late\u002Fout-of-order or corrected data arrives.\n\n## Procedure\n\n1. **ETL vs ELT**: prefer ELT (load raw, transform in-warehouse) when the destination is a modern warehouse\u002Flake — it preserves raw data and makes transforms re-runnable; use ETL when you must transform\u002Ffilter before landing (PII, cost). State the choice.\n2. **Batch vs streaming** by the freshness SLA: batch (scheduled, simpler, cheaper) unless sub-minute freshness genuinely matters; micro-batch as the middle ground. Don't pay for streaming you don't need.\n3. **Orchestration**: model as a DAG with explicit dependencies (Airflow\u002FDagster\u002Fetc.); each task is retryable and observable. Avoid hidden cron chains.\n4. **Idempotency + backfill** — the core: design every step so re-running a window produces the same result (idempotent writes: upsert\u002Fmerge on a key, or delete-insert per partition). A backfill for any date range must be a first-class, safe operation.\n5. **Schema handling**: validate on ingest; decide schema-on-read vs schema-on-write; version schemas and handle drift (new\u002Fremoved\u002Frenamed columns) without breaking downstream.\n6. **Data quality**: assertions at boundaries (row counts, null\u002Frange\u002Funiqueness, referential checks); fail or quarantine on violation rather than propagating bad data.\n7. **Late\u002Fout-of-order data**: define the lateness window and the correction strategy (reprocess affected partitions).\n8. **Lineage + observability**: track source→table lineage, freshness, and volume; alert on staleness and anomalies.\n\n## Output\n\n```text\nData pipeline: orders → warehouse (Dagster, BigQuery)\n\nDecisions: ELT (raw lands first; PII columns hashed at load) · daily batch — freshness SLA is 6 h, streaming not needed\nDAG\n  extract_orders      CDC snapshot per day partition         retry 3× · idempotent: overwrite partition\n  load_raw            → raw.orders (partition = order_date)  idempotent: delete-insert per partition\n  transform_orders    raw → staging → marts.fct_orders       idempotent: MERGE on order_id\n  quality_gate        row count ±20% vs 7-day mean · order_id unique · amount ≥ 0 · FK to dim_customer\n                      on failure: quarantine the partition, stop downstream, page data on-call\nBackfill: `dagster job backfill --partitions 2026-01-01...2026-03-31` — same code path, partition by partition\nSchema drift: new source columns land in raw automatically; marts only change via a reviewed model PR; removed columns alert\nLate data: corrections up to 3 days old → reprocess those 3 partitions nightly\nLineage + freshness: dbt\u002FDagster lineage graph; alert when fct_orders is older than 6 h\n```\n\n## Quality bar\n\n- Every step is idempotent; re-running a window is safe and produces identical output.\n- Backfill of an arbitrary range is a defined, first-class operation.\n- Data-quality assertions gate the boundaries; violations quarantine, not propagate.\n- Batch-vs-streaming is justified by the freshness SLA, not fashion.\n",{"name":5,"description":7},"main","23f6e21841a39580c9da2b5ec941f39dda17cd86","plugins\u002Fpolymath-streaming\u002Fskills\u002Fdata-pipeline","https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath","https:\u002F\u002Fgithub.com\u002FMohammadBafkar","2026-10-29 18:34:59",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add MohammadBafkar\u002Fpolymath --skill data-pipeline",{"tool":36,"command":37},"bunx","bunx skills add MohammadBafkar\u002Fpolymath --skill data-pipeline",{"tool":39,"command":40},"pnpm","pnpm dlx skills add MohammadBafkar\u002Fpolymath --skill data-pipeline","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-streaming\u002Fskills\u002Fdata-pipeline\u002FSKILL.md",true,[44],{"path":45,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":48,"sourceHtmlUrl":49},"routing.yaml","REFERENCE","参考文档",405,"https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-streaming\u002Fskills\u002Fdata-pipeline\u002Frouting.yaml",[51,58,65,72,79,86],{"skillNo":52,"name":53,"nameZh":6,"description":54,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":55,"categories":56,"keywords":57,"publishedAt":19},"01M74GN87EBRHM9N87M7AP1HDD","runbook","Write or refresh an operational runbook for an alert\u002Fsymptom; structured as TL;DR + Pre-checks + Steps + Verification + Rollback + Escalation.","https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-writing\u002Fskills\u002Frunbook\u002FSKILL.md",[],[],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":19},"01M74GN5GPKEC1JEKP2DFQNEQJ","rfc","Draft a lightweight design RFC to docs\u002Frfcs\u002F\u003Cslug>.md; Summary, Motivation, Detailed design, Drawbacks, Alternatives, Unresolved questions. A proposal to debate, not a recorded decision (adr).","https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-writing\u002Fskills\u002Frfc\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":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M74GN2F4CWPMV4X09TG4E304","editorial-pass","Review and tighten prose in a Markdown artifact for a target tone (terse, formal, friendly) without dropping information; preserve quotations and load-bearing constraints.","https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-writing\u002Fskills\u002Feditorial-pass\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},"01M74GMZWGYMZ37C4DYGT6P23G","architecture-review-facilitation","Run an architecture review as a process — entry criteria, reviewer checklist, decision log, and follow-up actions — pairing the design artifact with a red-team pass.","https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-writing\u002Fskills\u002Farchitecture-review-facilitation\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":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M74GMXVX0YX3ETDXS527XDGM","architecture-doc","Write a C4-style architecture document; System Context + Containers (+ Components when interesting) with mermaid diagrams. Describes structure, not a decision (adr) or proposal (rfc).","https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-writing\u002Fskills\u002Farchitecture-doc\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M74GMVG1WSMCK066S3KE6V5K","adr","Write an Architecture Decision Record (Michael Nygard format) to docs\u002Fadrs\u002FNNNN-\u003Cslug>.md; frontmatter validated by the ADR artifact schema. Records a made decision, not a proposal to debate (rfc).","https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-writing\u002Fskills\u002Fadr\u002FSKILL.md",[],[]]