data-quality-frameworks – skill Dữ liệu & Khoa học cho agent AI
Triển khai kiểm tra chất lượng dữ liệu với Great Expectations, dbt tests và data contracts. Dùng khi xây dựng pipeline chất lượng dữ liệu, cài đặt quy tắc kiểm tra hoặc thiết lập data contracts.
Cài skill data-quality-frameworks bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/data-quality-frameworks-48621.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /data-quality-frameworks – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/data-quality-frameworks-48621.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $data-quality-frameworks – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/data-quality-frameworks-48621.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /data-quality-frameworks – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/data-quality-frameworks-48621.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /data-quality-frameworks – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
Data Quality Frameworks
Production patterns for implementing data quality with Great Expectations, dbt tests, and data contracts to ensure reliable data pipelines.
When to Use This Skill
- Implementing data quality checks in pipelines
- Setting up Great Expectations validation
- Building comprehensive dbt test suites
- Establishing data contracts between teams
- Monitoring data quality metrics
- Automating data validation in CI/CD
Core Concepts
1. Data Quality Dimensions
| Dimension | Description | Example Check |
| ---------------- | ------------------------ | -------------------------------------------------- |
| Completeness | No missing values | expect_column_values_to_not_be_null |
| Uniqueness | No duplicates | expect_column_values_to_be_unique |
| Validity | Values in expected range | expect_column_values_to_be_in_set |
| Accuracy | Data matches reality | Cross-reference validation |
| Consistency | No contradictions | expect_column_pair_values_A_to_be_greater_than_B |
| Timeliness | Data is recent | expect_column_max_to_be_between |
2. Testing Pyramid for Data
/\
/ \ Integration Tests (cross-table)
/────\
/ \ Unit Tests (single column)
/────────\
/ \ Schema Tests (structure)
/────────────\Quick Start
Great Expectations Setup
# Install
pip install great_expectations
# Initialize project
great_expectations init
# Create datasource
great_expectations datasource new# great_expectations/checkpoints/daily_validation.yml
import great_expectations as gx
# Create context
context = gx.get_context()
# Create expectation suite
suite = context.add_expectation_suite("orders_suite")
# Add expectations
suite.add_expectation(
gx.expectations.ExpectColumnValuesToNotBeNull(column="order_id")
)
suite.add_expectation(
gx.expectations.ExpectColumnValuesToBeUnique(column="order_id")
)
# Validate
results = context.run_checkpoint(checkpoint_name="daily_orders")Detailed patterns and worked examples
Detailed pattern documentation lives in references/details.md. Read that file when the navigation tier above is insufficient.
Summary: {total_passed}/{total_tables} tables passed")
report.append("")
for table, result in results.items():
status = "✅" if result.passed else "❌"
report.append(f"### {status} {table}")
report.append(f"- Expectations: {result.total_expectations}")
report.append(f"- Failed: {result.failed_expectations}")
if not result.passed:
report.append("- Failed checks:")
for detail in result.details:
if not detail["success"]:
report.append(f" - {detail['expectation']}: {detail['observed_value']}")
report.append("")
return "\n".join(report)
Usage
context = gx.get_context()
pipeline = DataQualityPipeline(context)
tables_to_validate = {
"orders": "orders_suite",
"customers": "customers_suite",
"products": "products_suite",
}
results = pipeline.run_all(tables_to_validate)
report = pipeline.generate_report(results)
Fail pipeline if any table failed
if not all(r.passed for r in results.values()):
print(report)
raise ValueError("Data quality checks failed!")
## Best Practices
### Do's
- **Test early** - Validate source data before transformations
- **Test incrementally** - Add tests as you find issues
- **Document expectations** - Clear descriptions for each test
- **Alert on failures** - Integrate with monitoring
- **Version contracts** - Track schema changes
### Don'ts
- **Don't test everything** - Focus on critical columns
- **Don't ignore warnings** - They often precede failures
- **Don't skip freshness** - Stale data is bad data
- **Don't hardcode thresholds** - Use dynamic baselines
- **Don't test in isolation** - Test relationships tooSkill liên quan
- notion-meeting-intelligence – Chuẩn bị tài liệu họp với ngữ cảnh từ Notion và nghiên cứu từ Codex. Dùng khi thu thập…
- alumni-re-hire-tracker – Sổ đăng ký cựu nhân viên và tái tuyển dụng: vị trí cũ, ngày làm việc cuối cùng, điều…
- data-storytelling – Biến dữ liệu thành câu chuyện thuyết phục bằng trực quan hóa, bối cảnh và cấu trúc có…
- database-migration – Thực hiện migration cơ sở dữ liệu trên nhiều ORM và nền tảng, với chiến lược…
- notion-research-documentation – Nghiên cứu trên Notion và tổng hợp thành tài liệu có cấu trúc. Dùng khi thu thập thông…
- chroma – Cơ sở dữ liệu embedding cho RAG và tìm kiếm ngữ nghĩa.
- observability-and-instrumentation – Gắn công cụ đo lường (instrumentation) vào code để hành vi production có thể quan sát và…
- depmap – Truy xuất và phân tích dữ liệu bản phát hành Cancer Dependency Map (DepMap), gồm hiệu…