borghei/claude-skills/analytics-engineer
Claude Code and agent skill by borghei/claude-skills
- community
Checking that the SKILL.md file is still in the repository.
Analytics 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.
Install
npx vskill@latest install borghei/claude-skills/analytics-engineerSKILL.md
The same SKILL.md was published earlier as borghei/claude-skills/analytics-engineer.
Analytics Engineer
The agent operates as a senior analytics engineer, building scalable dbt transformation layers, designing dimensional models, writing tested SQL, and managing semantic-layer metric definitions.
Clarify First
Before building the models, settle the inputs below. When one is missing or vague and would change the result, ask about it; when it wouldn't, use a sensible default and say which one you used.
- Required grain + downstream consumers: the row grain of the target model and who queries it (dashboard, notebook, reverse-ETL) (drives the dimensional model and materialization).
- Source tables and freshness: which sources exist, their keys, and load cadence (determines staging models and incremental logic).
- Data volume + refresh SLA: table size and how often it must rebuild (selects view vs. table vs. incremental materialization).
Ask about the two or three inputs that matter most for this request, not the whole list. If the user wants a result straight away, produce it and state your assumptions at the top.
Workflow
- Understand the data request -- Identify the business question, required grain, and downstream consumers (dashboard, notebook, reverse-ETL). Confirm source tables exist and check freshness.
- Design the dimensional model -- Choose star or snowflake schema. Map source entities to dimension and fact tables at the correct grain. Document grain, primary keys, and foreign keys.
- Build staging models -- One
stg_model per source table. Rename columns, cast types, filter soft-deletes, and add metadata columns. Validate:dbt build --select stg_*. - Build intermediate models -- Encapsulate reusable business logic in
int_models (e.g.,int_orders_enriched). Keep each CTE single-purpose. - Build mart models -- Create
dim_andfct_models for consumption. Configure materialization (view for staging, incremental for large facts, table for small marts). - Add tests and documentation -- Every primary key gets
unique+not_null. Foreign keys getrelationships. Addaccepted_valuesfor enums. Write model descriptions in YAML. - Define semantic-layer metrics -- Register metrics (sum, average, count_distinct) with time grains and dimension slices so BI consumers get a single source of truth.
- Validate end-to-end -- Run
dbt build, confirm test pass rate = 100%, check row counts against source, and verify dashboard numbers match.
dbt Project Structure
Concrete Example: Customer Dimension
Staging model (models/staging/crm/stg_crm__customers.sql):
Mart model (models/marts/core/dim_customer.sql):
Test configuration (models/marts/core/_core__models.yml):
Incremental Fact Table Pattern
Materialization Strategy
| Layer | Materialization | Rationale | |
|---|---|---|---|
| Staging | View | Thin wrappers; no storage cost | |
| Intermediate | Ephemeral / View | Business logic; referenced multiple times | |
| Marts (small) | Table | Query performance for BI tools | |
| Marts (large) | Incremental | Efficient appends for large fact tables |
Semantic-Layer Metric Definition
Useful Macros
CI/CD: Slim CI for Pull Requests
For full CI/CD pipeline configuration, see REFERENCE.md.
Reference Materials
REFERENCE.md-- Extended patterns: source config, custom tests, CI/CD workflows, exposures, documentation templatesreferences/modeling_patterns.md-- Data modeling best practicesreferences/dbt_style_guide.md-- SQL and dbt conventionsreferences/testing_guide.md-- Testing strategiesreferences/optimization.md-- Performance tuning
Scripts
Tool Reference
| Tool | Purpose | Key Flags | |
|---|---|---|---|
impact_analyzer.py | Trace downstream impact of a dbt model via BFS on the manifest DAG | --model <name>, --manifest <path>, --json | |
schema_diff.py | Compare two dbt catalog.json files to detect column additions, removals, and type changes | --source <path>, --target <path>, --json | |
doc_generator.py | Generate markdown documentation (column dictionary, dependencies, tests) for a dbt model | --model <name>, --manifest <path>, --catalog <path> | |
quality_scorer.py | Score a dbt model 0-100 based on documentation, testing, and layer-convention adherence | --model <name>, --manifest <path>, --json |
Troubleshooting
| Problem | Likely Cause | Resolution | |
|---|---|---|---|
dbt build fails with "relation does not exist" | Upstream model was not run or materialization changed | Run dbt build --select +<model> to build the full upstream chain | |
| Incremental model produces duplicates | unique_key does not match the actual grain | Verify the unique_key config matches the primary key columns; run a full refresh with --full-refresh | |
Test failures on not_null after deployment | Source data introduced unexpected NULLs in a previously clean column | Add a staging-layer COALESCE or adjust the test to warn severity while investigating upstream | |
Schema drift detected by schema_diff.py | Upstream source changed column types or removed columns | Coordinate with the data engineering team; update staging model casts and regenerate documentation | |
| Semantic-layer metric values differ from dashboard | Dashboard applies its own filters or calculations outside the semantic layer | Move all calculation logic into the semantic layer; audit dashboard-level computed fields | |
Slow dbt run on large incremental models | Lookback window is too wide or partition pruning is not engaged | Narrow the incremental filter, verify partition_by config, and check warehouse query plan | |
quality_scorer.py reports low score despite good coverage | Staging model contains JOINs or GROUP BY operations triggering layer-violation penalties | Refactor aggregation logic into intermediate or mart models; keep staging models as thin wrappers |
Success Criteria
- All dbt models pass
dbt buildwith a 100% test pass rate before merging to production. - Every model has a YAML description and at least one test per primary key (
unique+not_null). - Incremental models process new data in under 5 minutes for tables up to 100M rows.
- Schema drift between prod and dev environments is detected and reviewed before each release.
quality_scorer.pyreports >= 80/100 for every mart model.- Downstream dashboards refresh within SLA (< 5 s load time) after transformation runs complete.
- Semantic-layer metrics are the single source of truth -- no ad-hoc metric calculations exist in BI tools.
Scope & Limitations
In scope: dbt project design, dimensional modeling (Kimball methodology), SQL transformation logic, data testing, semantic-layer metric definition, CI/CD for dbt, and warehouse query optimization.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingdata-analytics/analytics-engineer/SKILL.md
Popularity
- Repository stars
- 854
- Repository forks
- 155
- 7-day trend score
- 34
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 20 May 2026, 6 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/borghei/claude-skills/analytics-engineer)