borghei/Claude-Skills / data-analytics/analytics-engineer
analytics-engineer
VerifiedAnalytics engineering across data modeling, dbt, transformation, and semantic layers. Use when building dbt models, designing star schemas, writing staging or mart SQL, configuring data tests, or optimizing warehouse queries.
| File | Kind | Size |
|---|---|---|
| REFERENCE.md | markdown | 4.2 KB |
| SKILL.md | skill md | 13.4 KB |
| assets/dbt_project.yml | config | 1.1 KB |
| assets/macros.sql | other | 1.5 KB |
| assets/schema.yml | config | 1.4 KB |
| assets/source.yml | config | 1.0 KB |
| references/dbt_style_guide.md | markdown | 2.7 KB |
| references/modeling_patterns.md | markdown | 3.2 KB |
| references/optimization.md | markdown | 3.0 KB |
| references/testing_guide.md | markdown | 2.4 KB |
| scripts/doc_generator.pyexecutable | script | 3.2 KB |
| scripts/impact_analyzer.pyexecutable | script | 3.5 KB |
| scripts/quality_scorer.pyexecutable | script | 3.9 KB |
| scripts/schema_diff.pyexecutable | script | 4.0 KB |
scripts/schema_diff.py
View on GitHub#!/usr/bin/env python3
import argparse
import json
import os
import sys
def parse_args():
parser = argparse.ArgumentParser(description="Compare two dbt catalog.json files to detect schema drift.")
parser.add_argument("--source", required=True, help="Path to source catalog.json (e.g. prod)")
parser.add_argument("--target", required=True, help="Path to target catalog.json (e.g. dev)")
parser.add_argument("--json", action="store_true", help="Output in JSON format")
return parser.parse_args()
def load_catalog(path):
if not os.path.exists(path):
print(f"Error: Catalog not found at {path}", file=sys.stderr)
sys.exit(1)
with open(path, 'r') as f:
return json.load(f)
def build_schema_map(catalog):
nodes = catalog.get("nodes", {})
schema_map = {}
for node_id, data in nodes.items():
if node_id.startswith("model."):
model_name = data.get("metadata", {}).get("name") or node_id.split(".")[-1]
columns = data.get("columns", {})
schema_map[model_name] = {
c_name.lower(): c_data.get("type", "UNKNOWN").upper()
for c_name, c_data in columns.items()
}
return schema_map
def compare_schemas(source_map, target_map):
results = {
"new_models": [],
"dropped_models": [],
"modified_models": {}
}
for model, s_cols in source_map.items():
if model not in target_map:
results["dropped_models"].append(model)
else:
t_cols = target_map[model]
model_diff = {"new_columns": [], "dropped_columns": [], "type_changes": []}
for c_name, c_type in s_cols.items():
if c_name not in t_cols:
model_diff["dropped_columns"].append(c_name)
elif t_cols[c_name] != c_type:
model_diff["type_changes"].append({
"column": c_name,
"old_type": c_type,
"new_type": t_cols[c_name]
})
for c_name in t_cols.keys():
if c_name not in s_cols:
model_diff["new_columns"].append(c_name)
if any(model_diff.values()):
results["modified_models"][model] = model_diff
for model in target_map.keys():
if model not in source_map:
results["new_models"].append(model)
return results
def main():
args = parse_args()
source_cat = load_catalog(args.source)
target_cat = load_catalog(args.target)
source_map = build_schema_map(source_cat)
target_map = build_schema_map(target_cat)
diff = compare_schemas(source_map, target_map)
if args.json:
print(json.dumps(diff, indent=2))
return
print("Schema Diff Analysis")
print("=" * 40)
print(f"New Models Added : {len(diff['new_models'])}")
print(f"Models Dropped : {len(diff['dropped_models'])}")
print(f"Models Modified : {len(diff['modified_models'])}")
if diff["dropped_models"]:
print("\n[WARN] Models Dropped:")
for m in diff["dropped_models"]:
print(f" - {m}")
if diff["modified_models"]:
print("\nModel Modifications:")
for model, changes in diff["modified_models"].items():
if changes["dropped_columns"]:
print(f"\n [!] {model} - DROPPED COLUMNS (Breaking Change!):")
for c in changes["dropped_columns"]:
print(f" - {c}")
if changes["type_changes"]:
print(f"\n [~] {model} - TYPE CHANGES:")
for tc in changes["type_changes"]:
print(f" - {tc['column']}: {tc['old_type']} -> {tc['new_type']}")
if changes["new_columns"]:
print(f"\n [+] {model} - NEW COLUMNS:")
for c in changes["new_columns"]:
print(f" - {c}")
if __name__ == "__main__":
main()
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |