[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6CWJP70JKJJA52MQTSRY177":3,"skill-same:01M6CWJP70JKJJA52MQTSRY177":75},{"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":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":51,"commitSha":52,"skillDirectory":53,"forksCount":54,"repositoryHtmlUrl":55,"repositoryHomepageUrl":56,"ownerHtmlUrl":57,"ownerBlogUrl":58,"ownerDescription":59,"updatedAt":60,"install":61,"resources":74},"01M6CWJP70JKJJA52MQTSRY177","data-quality-gate",null,"Add or extend data validation checks in the pipeline when data quality issues are detected — null-percentage thresholds, value ranges, referential integrity, and row-count sanity checks. Use when a pipeline breaks on bad data, when onboarding a new dataset, or when asked to \"add a quality check for {column}\".","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\u002Fdata-quality-gate\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"quality","data quality gate","gate","quality gate","data quality","data","etl","pipeline","integrity","issues","validation","check","session","use","version","only","core","data-quality","quality check","integrity checks","2026-11-10 10:12:30",false,"---\nname: data-quality-gate\ndescription: Add or extend data validation checks in the pipeline when data quality issues are detected — null-percentage thresholds, value ranges, referential integrity, and row-count sanity checks. Use when a pipeline breaks on bad data, when onboarding a new dataset, or when asked to \"add a quality check for {column}\".\nmetadata:\n  forged-by: claude-agent\n  forged-from: session-2026-03-22\n  forged-reason: \"Forked from analytics-core\u002Fdata-quality-gate — that skill only covered numeric-range checks; this version adds null-percentage and referential-integrity checks for ETL pipelines\"\n  fork-of: analytics-core\u002Fdata-quality-gate\n  usage-count: \"8\"\n  last-used: \"2026-05-28\"\n---\n\n# Data Quality Gate\n\nAdd or extend validation checks that block bad data from propagating through the pipeline.\n\n## Inputs\n- Stage name where the gate should run (e.g., `customer_events`)\n- Check type: `null_rate` | `range` | `referential` | `row_count` | `custom`\n- Column(s) affected\n- Threshold or reference table (depending on check type)\n- Severity: `warn` (log and continue) or `fail` (halt the pipeline)\n\n## Steps\n\n1. **Identify where to add the gate**\n   Gates run after ingestion (raw → staging) or after a transform (staging → marts).\n   Most gaps are caught earliest; prefer adding checks at the earliest stage where the data is available.\n\n2. **Write the check**\n\n   **Null-rate check:**\n   ```python\n   def check_null_rate(df, column, threshold=0.05):\n       rate = df[column].isnull().mean()\n       if rate > threshold:\n           raise DataQualityError(\n               f\"{column} null rate {rate:.1%} exceeds threshold {threshold:.1%}\"\n           )\n   ```\n\n   **Range check:**\n   ```python\n   def check_range(df, column, min_val, max_val):\n       out_of_range = df[(df[column] \u003C min_val) | (df[column] > max_val)]\n       if len(out_of_range) > 0:\n           raise DataQualityError(\n               f\"{column}: {len(out_of_range)} rows outside [{min_val}, {max_val}]\"\n           )\n   ```\n\n   **Referential integrity check:**\n   ```python\n   def check_referential(df, fk_column, reference_df, pk_column):\n       orphans = df[~df[fk_column].isin(reference_df[pk_column])]\n       if len(orphans) > 0:\n           raise DataQualityError(\n               f\"{fk_column}: {len(orphans)} rows with no matching {pk_column}\"\n           )\n   ```\n\n   **Row-count sanity check:**\n   ```python\n   def check_row_count(df, min_rows, max_rows=None):\n       n = len(df)\n       if n \u003C min_rows:\n           raise DataQualityError(f\"Only {n} rows; expected at least {min_rows}\")\n       if max_rows and n > max_rows:\n           raise DataQualityError(f\"{n} rows exceeds max {max_rows}\")\n   ```\n\n3. **Register the check in the stage's test suite**\n   Add the check to `pipelines\u002Fingestion\u002F{stage_name}\u002Ftests\u002Ftest_quality.py` or the dbt schema YAML:\n   ```yaml\n   # dbt schema\n   - name: {column}\n     tests:\n       - not_null\n       - dbt_utils.accepted_range:\n           min_value: {min}\n           max_value: {max}\n   ```\n\n4. **Set the severity**\n   - `warn`: emit a metric + log; allow the pipeline to continue.\n   - `fail`: raise `DataQualityError`; the scheduler marks the run as failed.\n   Document the choice and rationale in the check's docstring.\n\n5. **Test the check**\n   Write a test that intentionally violates the threshold and confirms the exception is raised:\n   ```python\n   def test_null_rate_fails():\n       bad_df = pd.DataFrame({\"col\": [None] * 10})\n       with pytest.raises(DataQualityError):\n           check_null_rate(bad_df, \"col\", threshold=0.05)\n   ```\n\n6. **Document in the data dictionary**\n   Add a \"Quality checks\" section to `docs\u002Fdata-dictionary\u002F{stage_name}.md`:\n   | Check | Column | Threshold | Severity |\n   |-------|--------|-----------|----------|\n   | null_rate | {col} | \u003C 5% | fail |\n\n## Conventions\n- All checks are functions in `pipelines\u002Fquality\u002Fchecks.py`; imported by stage test files\n- `DataQualityError` is defined in `pipelines\u002Fquality\u002Ferrors.py`\n- Metrics emitted: `data_quality.{stage}.{check}.{column}` (gauge, 0=pass, 1=fail)\n- Null-rate thresholds are per-column, not global\n- Referential checks are `warn` severity by default unless the FK is critical for downstream joins\n\n## Edge Cases\n- **Threshold is too tight and causes false positives:** Increase the threshold and document the change in git with a comment; don't just bump it silently.\n- **Data arrives in batches (some partitions are empty):** Add a `min_rows_per_partition` check rather than a total row-count check.\n- **Reference table is unavailable (API down):** Wrap the referential check in a try\u002Fexcept; emit a `warn`-level metric and continue rather than failing the pipeline.\n- **Check runs too slowly on large datasets:** Sample 10% of rows for range\u002Fnull checks; document the sampling in the check's docstring.\n","# Data Quality Gate\n\nAdd or extend validation checks that block bad data from propagating through the pipeline.\n\n## Inputs\n- Stage name where the gate should run (e.g., `customer_events`)\n- Check type: `null_rate` | `range` | `referential` | `row_count` | `custom`\n- Column(s) affected\n- Threshold or reference table (depending on check type)\n- Severity: `warn` (log and continue) or `fail` (halt the pipeline)\n\n## Steps\n\n1. **Identify where to add the gate**\n   Gates run after ingestion (raw → staging) or after a transform (staging → marts).\n   Most gaps are caught earliest; prefer adding checks at the earliest stage where the data is available.\n\n2. **Write the check**\n\n   **Null-rate check:**\n   ```python\n   def check_null_rate(df, column, threshold=0.05):\n       rate = df[column].isnull().mean()\n       if rate > threshold:\n           raise DataQualityError(\n               f\"{column} null rate {rate:.1%} exceeds threshold {threshold:.1%}\"\n           )\n   ```\n\n   **Range check:**\n   ```python\n   def check_range(df, column, min_val, max_val):\n       out_of_range = df[(df[column] \u003C min_val) | (df[column] > max_val)]\n       if len(out_of_range) > 0:\n           raise DataQualityError(\n               f\"{column}: {len(out_of_range)} rows outside [{min_val}, {max_val}]\"\n           )\n   ```\n\n   **Referential integrity check:**\n   ```python\n   def check_referential(df, fk_column, reference_df, pk_column):\n       orphans = df[~df[fk_column].isin(reference_df[pk_column])]\n       if len(orphans) > 0:\n           raise DataQualityError(\n               f\"{fk_column}: {len(orphans)} rows with no matching {pk_column}\"\n           )\n   ```\n\n   **Row-count sanity check:**\n   ```python\n   def check_row_count(df, min_rows, max_rows=None):\n       n = len(df)\n       if n \u003C min_rows:\n           raise DataQualityError(f\"Only {n} rows; expected at least {min_rows}\")\n       if max_rows and n > max_rows:\n           raise DataQualityError(f\"{n} rows exceeds max {max_rows}\")\n   ```\n\n3. **Register the check in the stage's test suite**\n   Add the check to `pipelines\u002Fingestion\u002F{stage_name}\u002Ftests\u002Ftest_quality.py` or the dbt schema YAML:\n   ```yaml\n   # dbt schema\n   - name: {column}\n     tests:\n       - not_null\n       - dbt_utils.accepted_range:\n           min_value: {min}\n           max_value: {max}\n   ```\n\n4. **Set the severity**\n   - `warn`: emit a metric + log; allow the pipeline to continue.\n   - `fail`: raise `DataQualityError`; the scheduler marks the run as failed.\n   Document the choice and rationale in the check's docstring.\n\n5. **Test the check**\n   Write a test that intentionally violates the threshold and confirms the exception is raised:\n   ```python\n   def test_null_rate_fails():\n       bad_df = pd.DataFrame({\"col\": [None] * 10})\n       with pytest.raises(DataQualityError):\n           check_null_rate(bad_df, \"col\", threshold=0.05)\n   ```\n\n6. **Document in the data dictionary**\n   Add a \"Quality checks\" section to `docs\u002Fdata-dictionary\u002F{stage_name}.md`:\n   | Check | Column | Threshold | Severity |\n   |-------|--------|-----------|----------|\n   | null_rate | {col} | \u003C 5% | fail |\n\n## Conventions\n- All checks are functions in `pipelines\u002Fquality\u002Fchecks.py`; imported by stage test files\n- `DataQualityError` is defined in `pipelines\u002Fquality\u002Ferrors.py`\n- Metrics emitted: `data_quality.{stage}.{check}.{column}` (gauge, 0=pass, 1=fail)\n- Null-rate thresholds are per-column, not global\n- Referential checks are `warn` severity by default unless the FK is critical for downstream joins\n\n## Edge Cases\n- **Threshold is too tight and causes false positives:** Increase the threshold and document the change in git with a comment; don't just bump it silently.\n- **Data arrives in batches (some partitions are empty):** Add a `min_rows_per_partition` check rather than a total row-count check.\n- **Reference table is unavailable (API down):** Wrap the referential check in a try\u002Fexcept; emit a `warn`-level metric and continue rather than failing the pipeline.\n- **Check runs too slowly on large datasets:** Sample 10% of rows for range\u002Fnull checks; document the sampling in the check's docstring.\n",{"name":5,"metadata":44,"description":7},{"fork-of":45,"forged-by":46,"last-used":47,"forged-from":48,"usage-count":49,"forged-reason":50},"analytics-core\u002Fdata-quality-gate","claude-agent","2026-05-28","session-2026-03-22","8","Forked from analytics-core\u002Fdata-quality-gate — that skill only covered numeric-range checks; this version adds null-percentage and referential-integrity checks for ETL pipelines","main","e959db0147cafe70b738efbd5a128985763fd0df","examples\u002Fdata-pipeline\u002Fskills\u002Fdata-quality-gate",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":62,"prompt":72,"zipAvailable":73},[63,66,69],{"tool":64,"command":65},"npx","npx skills add zakelfassi\u002Fskills-driven-development --skill data-quality-gate",{"tool":67,"command":68},"bunx","bunx skills add zakelfassi\u002Fskills-driven-development --skill data-quality-gate",{"tool":70,"command":71},"pnpm","pnpm dlx skills add zakelfassi\u002Fskills-driven-development --skill data-quality-gate","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fzakelfassi\u002Fskills-driven-development\u002Fblob\u002Fmain\u002Fexamples\u002Fdata-pipeline\u002Fskills\u002Fdata-quality-gate\u002FSKILL.md",true,[],[76,93,98,118,135,156],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":39},"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",[],[78,83,84,85,86,87,32,88,89,90,91,92],"workflow","agentskills","pattern","new skill","reusable","forge","update","create","scaffold","sessions",{"skillNo":94,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":39},"01M6CWKJF5Y1PQBZ4QWA9DDES1","https:\u002F\u002Fgithub.com\u002Fzakelfassi\u002Fskills-driven-development\u002Fblob\u002Fmain\u002Fplugins\u002Fskdd-claude\u002Fskills\u002Fskillforge\u002FSKILL.md",[],[78,83,88,92,84,85,86,87,32,89,90,91],{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":39},"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",[],[105,106,107,108,109,110,111,112,32,31,113,114,115,116,117],"deploy preview","deploy","preview","visual","branches","time","ready","opening a pr","environment","branch","pr","codex","review",{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":124,"publishedAt":39},"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",[],[125,126,91,32,127,128,129,31,130,131,132,90,133,110,134],"component scaffold","component","components","structure","Story","ui","file","generate","react","test",{"skillNo":136,"name":137,"nameZh":6,"description":138,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":139,"categories":140,"keywords":141,"publishedAt":39},"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",[],[142,143,144,145,131,146,147,148,149,150,151,152,153,32,154,31,155],"triage","bug","bug triage","logs","report","toolkit","bug report","github","severity","project","issue","github issue","ops","investigation",{"skillNo":157,"name":158,"nameZh":6,"description":159,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":160,"categories":161,"keywords":162,"publishedAt":39},"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",[],[163,164,165,166,85,110,128,167,168,169,32,31,170,171,29,91,116],"endpoint","api","api endpoint","route","build","endpoints","backend","controller","REST"]