Community生产力与协作github.com

wshobson/data-quality-frameworks

使用 Great Expectations、dbt 测试和数据契约实现数据质量验证。适用于构建数据质量管道、实施验证规则或建立数据契约的场景。

data-quality-frameworks 是什么?

该技能为 AI 代理提供了一套全面的数据质量验证框架,涵盖 Great Expectations、dbt 测试和数据契约三大核心工具。Great Expectations 用于定义和执行数据质量期望,支持自动化数据验证和文档生成;dbt 测试则集成在数据转换管道中,提供内置的测试框架(如唯一性、非空性检查)以及自定义 SQL 测试;数据契约则允许团队明确定义表结构、数据类型约束和业务规则,确保数据消费方与生产方之间的一致性。该技能适用于构建可靠的数据管道、实现数据质量监控以及建立跨团队的数据契约治理。支持的平台包括 CLI 环境以及支持 Markdown 指令的 AI 代理工具(如 Claude Code、Cursor、Codex)。使用该技能时,代理会生成相应的配置文件、测试脚本和契约文档,帮助开发者在数据项目中自动化质量保障流程。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/wshobson/agents/tree/main/skills/data-quality-frameworks

Installed? Explore more 生产力与协作 skills: steipete/gemini, steipete/gh-issues, steipete/skill-creator · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

data-quality-frameworks 是做什么的?

使用 Great Expectations、dbt 测试和数据契约实现数据质量验证。适用于构建数据质量管道、实施验证规则或建立数据契约的场景。

概述

本技能提供了一套完整的数据质量框架实现方案,帮助开发者通过 Great Expectations 的期望定义、dbt 的测试机制以及数据契约的规范约定,系统性地保障数据管道的可靠性。

核心组件

Great Expectations

  • 使用 Expectation Suites 定义数据质量期望
  • 自动化数据验证并生成详细文档
  • 支持多种数据源(PostgreSQL、Snowflake、BigQuery 等)
  • 集成 Airflow 等调度系统

dbt 测试

  • 内置通用测试(unique、not_null、accepted_values 等)
  • 自定义 SQL 测试满足复杂业务规则
  • 支持测试分类与选择性运行
  • 生成测试结果报告

数据契约

  • 以 YAML 或 JSON 格式定义表结构约束
  • 明确字段类型、长度、精度等元数据
  • 支持业务规则编码(如外键约束、范围校验)
  • 提供版本化管理和变更追踪

使用场景

场景说明
数据管道验证在 ETL/ELT 流程中自动检查数据质量
数据迁移审核对比源系统和目标系统的数据一致性
数据仓库治理建立团队级数据质量规范
实时数据监控结合事件流实现持续验证

快速开始

安装依赖

pip install great_expectations
pip install dbt-core
git clone https://github.com/wshobson/data-quality-frameworks.git

配置 Great Expectations

  1. 初始化项目目录:
    great_expectations init
    
  2. 定义数据源:编辑 great_expectations.yml 配置文件
  3. 创建期望套件:
    great_expectations suite new
    

配置 dbt 测试

  1. 在 models/ 目录下的 SQL 文件中定义模型
  2. 在 tests/ 目录添加测试 SQL 文件
  3. 运行测试:
    dbt test --select my_model
    

定义数据契约

创建 contract.yml 文件并指定字段规则:

version: 1
contract:
  tables:
    - name: orders
      schema:
        - field: order_id
          type: integer
          nullable: false
          unique: true
        - field: order_date
          type: date
          nullable: false
      rules:
        - field: order_amount
          type: decimal(10,2)
          minimum: 0
          maximum: 1000000

最佳实践

  • 将 Great Expectations 检查和 dbt 测试集成到 CI/CD 管道的测试阶段
  • 对核心业务表建立完整的数据契约,并作为版本管理的一部分
  • 使用 airflow 调度器周期性运行验证套件,实现数据质量监控
  • 在数据变更流程中引入契约变更审核机制

参考资源

许可证

MIT

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

wshobson/accessibility-compliance

Implement WCAG 2.2 compliant interfaces with mobile accessibility, inclusive design patterns, and assistive technology support. Use when auditing accessibility, implementing ARIA patterns, building for screen readers, or ensuring inclusive user experiences.

wshobson/airflow-dag-patterns

Build production Apache Airflow DAGs with best practices for operators, sensors, testing, and deployment. Use when creating data pipelines, orchestrating workflows, or scheduling batch jobs.

wshobson/angular-migration

Migrate from AngularJS to Angular using hybrid mode, incremental component rewriting, and dependency injection updates. Use when upgrading AngularJS applications, planning framework migrations, or modernizing legacy Angular code.

wshobson/anti-reversing-techniques

Understand anti-reversing, obfuscation, and protection techniques encountered during software analysis. Use this skill when analyzing malware evasion techniques, when implementing anti-debugging protections for CTF challenges, when reverse engineering packed binaries, or when building security research tools that need to detect virtualized environments.

wshobson/api-design-principles

Master REST and GraphQL API design principles to build intuitive, scalable, and maintainable APIs that delight developers. Use when designing new APIs, reviewing API specifications, or establishing API design standards.

wshobson/architecture-decision-records

Write and maintain Architecture Decision Records (ADRs) following best practices for technical decision documentation. Use when documenting significant technical decisions, reviewing past architectural choices, or establishing decision processes.

wshobson/architecture-patterns

Implement proven backend architecture patterns including Clean Architecture, Hexagonal Architecture, and Domain-Driven Design. Use this skill when designing clean architecture for a new microservice, when refactoring a monolith to use bounded contexts, when implementing hexagonal or onion architecture patterns, or when debugging dependency cycles between application layers.

wshobson/async-python-patterns

Master Python asyncio, concurrent programming, and async/await patterns for high-performance applications. Use when building async APIs, concurrent systems, or I/O-bound applications requiring non-blocking operations.

wshobson/attack-tree-construction

Build comprehensive attack trees to visualize threat paths. Use when mapping attack scenarios, identifying defense gaps, or communicating security risks to stakeholders.

wshobson/auth-implementation-patterns

Master authentication and authorization patterns including JWT, OAuth2, session management, and RBAC to build secure, scalable access control systems. Use when implementing auth systems, securing APIs, or debugging security issues.

wshobson/avoid-ai-writing

Audit and rewrite prose so it stops reading as machine-generated. Use this skill when asked to remove AI-isms, clean up AI writing, edit a draft for AI tells, audit a README, changelog, release note, PR description, or blog post for machine-sounding prose, or make text sound less like AI. Supports a detect-only mode, a rewrite mode, and an edit-in-place mode, with optional voice and context profiles.

wshobson/backtesting-frameworks

Build robust backtesting systems for trading strategies with proper handling of look-ahead bias, survivorship bias, and transaction costs. Use when developing trading algorithms, validating strategies, or building backtesting infrastructure.

wshobson/bash-defensive-patterns

Master defensive Bash programming techniques for production-grade scripts. Use when writing robust shell scripts, CI/CD pipelines, or system utilities requiring fault tolerance and safety.

wshobson/bats-testing-patterns

Master Bash Automated Testing System (Bats) for comprehensive shell script testing. Use when writing tests for shell scripts, CI/CD pipelines, or requiring test-driven development of shell utilities.

wshobson/bazel-build-optimization

Optimize Bazel builds for large-scale monorepos. Use when configuring Bazel, implementing remote execution, or optimizing build performance for enterprise codebases.

wshobson/before-you-build

Pre-build product and feature risk review for founders, product managers, and AI-assisted builders. Use this skill when the user is about to build a landing page, MVP, SaaS product, internal tool, agent workflow, or major feature and needs to check demand, positioning, monetization, retention, trust, distribution, and adoption risk before implementation starts.

wshobson/billing-automation

Build automated billing systems for recurring payments, invoicing, subscription lifecycle, and dunning management. Use when implementing subscription billing, automating invoicing, or managing recurring payment systems.

wshobson/binary-analysis-patterns

Master binary analysis patterns including disassembly, decompilation, control flow analysis, and code pattern recognition. Use when analyzing executables, understanding compiled code, or performing static analysis on binaries.

wshobson/block-no-verify-hook

Configure a PreToolUse hook to prevent AI agents from skipping git pre-commit hooks with --no-verify and other bypass flags. Use when setting up Claude Code projects that enforce commit quality gates.

wshobson/brand-landingpage

Brand-first landing page designer — runs a brand-identity interview (colors, typography, shape language), then generates and iterates on a polished landing page via Stitch with deployment-ready HTML. Use when the user asks to create, design, or build a landing page, homepage, or marketing page and has no established visual direction. Skip when they have a design mockup, need a dashboard or app UI, are working at component level, building a multi-page app, or restyling with known design tokens — use frontend-design instead.

相关技能