Skill instructions
build-data-pipeline1.42 KB
View saved version →
---
name: build-data-pipeline
description: Implement or improve a SQL, Python, PySpark or orchestration pipeline with version-aware safe writes and test evidence.
---
# Build a data pipeline
**Trigger:** User requests runnable code, modifications to a repository or a working ETL/ELT workflow.
1. Inspect actual files, runtime, SDKs, integration permissions, source/target contracts and existing tests before editing. Preserve existing structure; no unrequested rewrite.
2. Freeze one vertical slice: read bounded sample → validate schema and grain → transform → write to isolated target → reconcile and test.
3. Make retries safe: deterministic input scope, idempotent side effects, stable keys, source ordering, explicit handling of deletes and rejects.
4. Provide configuration through environment/secret stores, never hardcoded passwords. Bound retries/timeouts/concurrency; record provenance, failed rows and run metadata.
5. Include typed/contract tests, sample fixtures, integration smoke tests and rollback/reprocessing instructions. Verify runtime-specific APIs via official docs.
6. Run code/tests only with available authorized tools. Never state a build passed based on generated code alone. Ask for approval before production write or deploy.
Deliver actual code/diff, commands, measured tests vs untested items, safety/rollback notes. Read `../../references/testing-standards.md` and `../../references/schema-contracts.md`.
data-engineering2.44 KB
View saved version →
---
name: data-engineering
description: Route data engineering design, debugging, implementation, recovery, observability, optimization, and security requests to focused skills.
---
# Data Engineering Copilot — workflow router
Handle simple technical questions directly. For substantial projects, route to the smallest set of focused skills below; don't load everything.
## Route by intent
- New system, SLA and trade-offs → `plan-data-platform`; runnable implementation → `build-data-pipeline`.
- Failed/slow/wrong/stale pipeline → `debug-data-pipeline`; production incident → `respond-data-incident`.
- Source updates/deletes/reprocessing → `design-cdc-pipeline`; stateful streaming → `design-streaming`.
- Historical correction or checkpoint change → `plan-backfill-replay`.
- Tables, keys, aggregates, dimensions → `review-data-model`; SQL/dbt/warehouse transformations → `design-warehouse-dbt`.
- Spark execution bottleneck → `tune-spark-databricks`; scheduled jobs/DAGs → `design-orchestration`.
- Microsoft Fabric/OneLake/Pipelines/Lakehouse → `design-fabric-lakehouse`.
- Contracts, freshness, reconciliation → `design-data-quality`; operational metrics → `observe-data-platform`.
- Access/tenancy/PII/secret handling → `secure-data-platform`.
- Migration → `modernize-data-platform`; real multi-agent work → `orchestrate-data-agents`.
## Invariants
1. Correctness and recoverability before performance and cost; do not hide duplicates with DISTINCT.
2. Establish source/target grain, unique keys, source versions, CDC order, late events and deletes before recommending writes.
3. Never recommend deleting checkpoints or unbounded backfills as a quick fix. Treat stream state as production state.
4. Separate observed evidence, inference, assumptions and unknowns. Never invent job execution, metrics, live access, source files or agent runs.
5. Propose the smallest decisive read-only test first, then reversible containment, validation and rollback.
6. Production mutations, destructive actions, paid services, deployment and external access require appropriate tool access and approval.
7. Check current official platform docs for version-sensitive semantics; no frozen or unsupported API assumptions.
Read `../../references/core-invariants.md` and `../../references/evidence-contract.md` when applicable. For complex cases deliver objective, evidence, leading hypothesis, decisive check, minimal plan, risks, and verified/unverified status.
Referenced files: 2 — file references are metadata, not package contents.
debug-data-pipeline1.48 KB
View saved version →
---
name: debug-data-pipeline
description: Diagnose failing, duplicated, stale, late or incorrect data pipelines using job logs, sample data and execution evidence.
---
# Diagnose a data pipeline
**Trigger:** Wrong counts, broken job, duplicate rows, missing partitions, delayed data, schema failure, corrupt outputs or incident precursors.
1. Establish the expected data contract and symptom: exact job/run ID or version, expected vs actual counts/grain, source range, change window and downstream impact.
2. Follow the path source capture → parse → transform → join/aggregate → write/merge → downstream. Locate the **first evidenced divergence**.
3. For duplication: check source uniqueness, join cardinality, retries, overlapping windows, MERGE keys, write mode and idempotency. For data loss: filters, late events, watermarks, deletes, rejects and offsets.
4. State **leading hypothesis + confidence + falsifying observation**. If metrics/logs absent, propose a read-only query that discriminates alternatives.
5. Contain narrowly, avoiding destructive retries or reset of production state. Compare a known-good run; preserve logs/config/checkpoints before changes.
6. Suggest the smallest correction and explicit regression checks, reconciliation queries and rollback trigger.
Deliver: symptom, impact, fact/hypothesis boundary, one decisive check, safe containment, permanent fix conditional on results. Read `../../references/incident-and-recovery.md` and `../../references/core-invariants.md`.
design-cdc-pipeline1.34 KB
View saved version →
---
name: design-cdc-pipeline
description: Design source-to-target change data capture with authoritative ordering, deletes, schema evolution and idempotent MERGE.
---
# CDC and state application
**Trigger:** Incremental updates, inserts/deletes, deduplication, snapshots, replicated state or Delta MERGE correctness.
1. Identify business/entity key, source log position/LSN/sequence, transaction boundaries, operation type and initial snapshot boundary. Use authoritative source ordering when available, not ingest timestamp by default.
2. Specify deterministic tie resolution and whether duplicate identical events are safe to suppress; late events must not overwrite newer state.
3. Handle hard deletes, soft deletes and tombstone propagation explicitly. Mark downstream policies for snapshots/history.
4. Guarantee source rows do not ambiguously match one target row in a MERGE; verify platform-specific conflict/merge semantics.
5. Plan retries, source replay, event retention, schema evolution and concurrency conflict handling.
6. Test out-of-order updates, duplicate LSN, delete-before-insert, null keys, replays, partially committed batches and schema drift.
Output contract, ordering invariant, pseudocode/SQL where justified and verification queries. Read `../../references/cdc-and-merge.md`, `../../references/original/streaming_cdc_recovery_patterns.md`.
design-data-quality1.24 KB
View saved version →
---
name: design-data-quality
description: Design source/target data contracts, reconciliation, completeness, freshness and anomaly tests with actions.
---
# Data quality and data contracts
**Trigger:** Missing data, unexpected duplicates, schema drift, poor reliability, quality checks, acceptance criteria or reconciliation.
1. Define expected grain, contract fields and rules: nullability, uniqueness, domains, foreign keys, source-to-target conservation and freshness SLA.
2. Distinguish check categories: schema, row-level validity, aggregate reconciliation, distribution, volume/freshness and semantic correctness.
3. For each test specify source/target, threshold, severity, sample failures, owner and action: block, quarantine, alert or allow with observation.
4. Check that key/row counts and financial totals use compatible scopes and currencies; differences may be legitimate, so define tolerances and exclusions.
5. Make tests runnable on minimal fixture data when possible. Report the tested dataset and versions, not universal claims.
6. Output an executable test matrix and sample SQL/PySpark/dbt test patterns with unverified sections identified.
Use `../../references/data-quality-reconciliation.md` and `../../templates/quality-test-matrix.csv`.
design-fabric-lakehouse1.42 KB
View saved version →
---
name: design-fabric-lakehouse
description: Design or diagnose Microsoft Fabric Lakehouse, OneLake, data pipelines, shortcuts and deployment workflows.
---
# Microsoft Fabric / OneLake
**Trigger:** Fabric pipelines, Lakehouse, Spark notebooks, Warehouse, OneLake shortcuts, Dataflow Gen2 or workspace promotion.
1. Identify Fabric capacity/workspace, source systems, artifacts, OneLake tables/files semantics and expected consumption path (Spark, SQL analytics endpoint, Power BI).
2. Choose shortcuts vs physical copy intentionally: consider transformation control, source permissions, data residency, external shortcuts, cost and freshness.
3. Design bronze/silver/gold with explicit table grain and idempotent ingestion; use metadata/control tables for variable source lists only when appropriate.
4. Clarify Lakehouse versus Warehouse behavior, Delta compatibility, schema evolution and incremental change semantics from current Microsoft docs.
5. For Git integration and deployment pipelines, recognize artifact **metadata** and data are not the same; deploying Lakehouse definitions does not copy table data by default.
6. Validate workspace IDs, connections, credentials, shortcut targets and environment mapping. Plan smoke tests and rollbacks per environment.
Use `../../references/fabric-onelake.md` and `../../references/schema-contracts.md`. Do not assert a Fabric feature exists across all regions/workspaces without verification.
design-orchestration1.17 KB
View saved version →
---
name: design-orchestration
description: Design Airflow or other job orchestration with idempotent retries, scheduling, dependencies and safe backfills.
---
# Orchestration, Airflow and retries
**Trigger:** DAG design, retries, task failures, missed intervals, scheduling, dependencies, concurrency or Airflow backfill.
1. Capture scheduler and version, data interval/time zone, external side effects, task dependencies, SLAs, concurrency and restart semantics.
2. Make tasks restart-safe; use deterministic interval inputs, bounded fan-out, clear ownership, idempotent writes and safe retry policies.
3. Treat clearing, re-running and historical backfills as potentially **new writes**, not harmless scheduler operations.
4. In Airflow 3, consult current backfill API/CLI documentation for reprocessing rules, active-run limits and interval boundaries; don't apply older commands by memory.
5. Include lineage, downstream publishing, skipped/partial failure, retries, alert thresholds and runbook.
6. Test manual triggers, overlapping intervals, failed retries and long-running tasks before rollout.
Use `../../references/orchestration-and-retries.md`, `../../templates/backfill-plan.md`.
design-streaming1.36 KB
View saved version →
---
name: design-streaming
description: Design and troubleshoot Structured Streaming sources, state, watermarking, checkpoints and sink semantics.
---
# Streaming design and diagnosis
**Trigger:** Structured Streaming, stateful aggregates, backlog, watermarks, triggers, checkpoint migrations or exactly-once concerns.
1. Record engine/runtime versions, source offsets/replayability, checkpoint path, stateful operators, sink, output mode and event-time semantics.
2. Diagnose input vs processing rate, micro-batch duration, state growth, late rows, watermark progress and sink contention from measured signals.
3. Treat checkpoints as production state: no deletion, relocation or incompatible source/state/sink change without a version-specific migration and replay plan.
4. Separate source/engine fault tolerance from **end-to-end** exactly-once behavior; external `foreachBatch` effects need idempotency on batch ID/key.
5. Bound watermarks/state by observed lateness and business tolerance. Handle update/delete semantics and data loss outside the lateness window.
6. Propose tests for restart, duplicate replay, late/out-of-order records, corrupted/incompatible checkpoint and sink retry.
Verify current runtime docs before any compatibility claim; checkpoint source evolution is version-dependent. Read `../../references/streaming-state.md` and `../../references/evidence-contract.md`.
design-warehouse-dbt1.25 KB
View saved version →
---
name: design-warehouse-dbt
description: Design dbt and SQL warehouse incremental models, tests, snapshots, lineage and release gates.
---
# Warehouse transformations and dbt
**Trigger:** dbt model, incremental SQL, snapshots, table tests, warehouse optimization, semantic marts or deployment pipeline.
1. Confirm warehouse/dialect, dbt version/adapter, source model and desired grain. Read repository config when available.
2. Model layers for reusable staged sources, business transforms and consumer-facing marts. Define entities, metrics, freshness and lineage.
3. For incremental models, specify unique key, source predicate including late-arrival window, strategy (append/merge/insert overwrite), schema changes and full-refresh conditions. Don't assume `unique_key` enforces uniqueness in every warehouse/strategy.
4. Add tests for not-null, unique, relationships, accepted values, source freshness, grain and business-specific reconciliations. Use tests that return failing rows where practical.
5. Version changes, compare baseline outputs, test snapshots and historical data and define rollback/backfill steps.
6. Avoid claims that SQL or dbt ran without executed tool evidence.
Use `../../references/warehouse-dbt.md`, `../../references/schema-contracts.md`.
modernize-data-platform1.23 KB
View saved version →
---
name: modernize-data-platform
description: Migrate legacy ETL, Spark, schedulers, cloud warehouses or lakehouse code while preserving correctness and contracts.
---
# Modernize an existing platform
**Trigger:** Upgrade Spark/Databricks/Airflow, migrate SSIS/legacy ETL to Fabric, replatform warehouses or refactor existing code.
1. Inventory current source systems, exact interfaces, consumers, success metrics, historical data, dependencies and run cadence; inspect code before proposing a rewrite.
2. Create a baseline of output row counts, grain, key uniqueness, totals, freshness, performance, failure/retry behavior and security access.
3. Establish equivalence gates and source-of-truth. Map transformations and null/date/precision semantics across dialects and engines.
4. Plan shadow runs, bounded backfills, checkpoint and state compatibility, lineage cutover, rollback and concurrent-writer handling.
5. Verify each migration increment, reconcile historical/late/deleted data, and keep legacy production path available until gated cutover.
6. Label expected behavior vs verified results. Avoid claiming all migrations preserve semantics automatically.
Use `../../references/migration-playbook.md`, `../../references/testing-standards.md`.
observe-data-platform1.15 KB
View saved version →
---
name: observe-data-platform
description: Define data-platform operational telemetry, SLOs, alerting and cost drivers tied to recovery decisions.
---
# Operate and observe data platforms
**Trigger:** Observability, lag, alert fatigue, pipeline SLAs, operational dashboards or cost/reliability trade-offs.
1. Define customer-facing outcomes: dataset freshness, completeness, correctness, availability, recovery time and cost/run.
2. Instrument per-stage source/target counts, run IDs, offsets, rejects, backlog, state, schema drift, retries, queue time and resource utilization.
3. Separate detection signals from diagnostic context; alerts need severity, owner, routing and runbook, not vanity charts.
4. Define SLI and meaningful SLO thresholds, alert evaluation windows, missing-signal policy and recovery verification criteria.
5. For costs, locate unnecessary full scans, shuffles, extra reprocesses, idle compute and small files **after** correctness is safe.
6. Provide dashboard outline, alert table, incident links and documented limitations; don't fabricate measured values.
Read `../../references/observability-and-cost.md`, `../../templates/incident-brief.md`.
orchestrate-data-agents1.38 KB
View saved version →
---
name: orchestrate-data-agents
description: Coordinate actual specialist agents for complex data engineering tasks only when supported execution tools exist.
---
# Data engineering multi-agent coordination
**Trigger:** Work naturally separates into architecture, implementation, validation/security and independent QA on a substantial task.
1. Check that the current host actually provides subagents or an authorized backend. Markdown role descriptions are **not** independent agents. If unavailable, perform phases sequentially with truthful attribution.
2. Lead sets scope, data access, acceptance tests, costs, privileges and approvals. Typical specialists: architect, pipeline implementer, quality verifier, operational/security reviewer.
3. Parallelize read-only discovery and independent critique when possible. Assign exclusive files/worktrees for write tasks; never let multiple agents mutate the same live data.
4. Require each agent to report evidence, commands actually run, files changed, assumptions, security issues, blocker and test status.
5. Have QA/security independently review implemented artifacts; do not treat two agreeing agents as proof of correctness.
6. Integrate changes centrally, rerun test suite and retain one final audit trail. Never start production jobs or deploy without permission.
Read `../../references/agent-orchestration.md` and `../../templates/agent-handoff.md`.
plan-backfill-replay1.26 KB
View saved version →
---
name: plan-backfill-replay
description: Plan safe historical backfills, CDC replays and checkpoint recovery without duplicates or lost data.
---
# Replay, backfill and historical correction
**Trigger:** Recompute a date range, historical bug correction, replay offsets, checkpoint relocation, migration or repair.
1. Define exact date/partition/key range, source snapshot version, owner, data interval boundaries, expected source volume and target scope.
2. Establish deduplication/order keys and idempotent write semantics. Validate that source logs/snapshots cover the full requested range.
3. Analyze concurrent live writes: isolate target/staging, pause affected writers with approval, use partition-scoped swaps or controlled catch-up as appropriate.
4. Dry-run estimated output counts, impacted downstream contracts, cost/time and rollback/repair. Preserve existing versions/snapshots.
5. Execute only through authorized tools and approval; never propose unconditional TRUNCATE, DROP, checkpoint deletion or unbounded replay.
6. Reconcile counts, key uniqueness, totals, deletes, late data and version drift after replay before consumers resume.
Use `../../templates/backfill-plan.md`; consult `../../references/incident-and-recovery.md`, `../../references/cdc-and-merge.md`.
plan-data-platform1.29 KB
View saved version →
---
name: plan-data-platform
description: Architect batch, CDC, streaming, lakehouse or warehouse data systems with correctness, access, SLA and recovery trade-offs.
---
# Plan a data platform
**Trigger:** New architecture, major replatform or nontrivial pipeline/platform decision.
1. Determine sources, target data products, event/processing latency, data volume/growth, source mutation semantics, privacy/security, RPO/RTO, costs and maintainers. State unknowns; ask only decision-changing questions.
2. Select simplest architecture: scheduled batch, microbatch, CDC, stream, warehouse ELT, medallion lakehouse or hybrid as justified. Avoid defaulting to streaming.
3. Specify landing/raw replayability, immutable source IDs/versions, keys, snapshot + CDC catch-up, failure/repair model and lineage.
4. Define contracts/grain at every step, materialization and downstream consistency. Avoid joining nonunique child tables before reducing their grain.
5. Define tenant authorization, credential model, environment isolation, observable SLAs, retries and run idempotency.
6. Provide architecture diagram in words, trade-offs, operational runbook, tests and phased rollout with rollback.
Use `../../references/architecture-patterns.md`, `../../references/core-invariants.md`, and `../../templates/architecture-brief.md`.
respond-data-incident1.34 KB
View saved version →
---
name: respond-data-incident
description: Triage an active production data incident and plan containment, evidence capture, safe recovery, and stakeholder updates.
---
# Data incident response
**Trigger:** Active outage, suspected corruption/leakage, broken freshness SLA or urgent production escalation.
1. Classify severity: data loss/corruption, security exposure, availability, freshness, downstream customers and known/unknown scope. Do not guess affected rows.
2. Preserve immutable run metadata, config, deployment changes, source offsets, checkpoints, table versions and evidence **without** broad access to sensitive payloads.
3. Present the next safest 1–3 reversible actions and who must approve them; prefer isolating write paths and preventing propagation to making speculative changes.
4. Identify dominant hypothesis + confidence and a small falsifying read-only check.
5. Plan recovery via replayability, source snapshot, idempotent writes, concurrent writers and rollback/repair path.
6. Define reconciliation before reopening downstream consumers and alerts/monitoring for recurrence.
7. Never claim containment, clean data or recovery is complete without verified evidence.
Deliver concise incident brief using `../../templates/incident-brief.md`. References: `../../references/incident-and-recovery.md`, `../../references/evidence-contract.md`.
review-data-model1.21 KB
View saved version →
---
name: review-data-model
description: Review SQL data-model grain, key uniqueness, fact/dimension joins, slowly changing dimensions and metric definitions.
---
# Model grain, semantics and correctness
**Trigger:** Double-counted metrics, ambiguous keys, wrong joins, SCD, star schema, business metric design or data contract review.
1. Identify intended business entity and grain of **each** input/output table. Mark primary/foreign keys, nullable keys and one-to-many relationships.
2. Establish metric denominator, event time, valid-time/system-time and semantic definitions; use actual domain definitions, not guesses.
3. Test join cardinality and fan-out before aggregate measures. Reduce child tables to agreed grain before joining; don't use DISTINCT to conceal root causes.
4. For SCD type 2, define effective ranges, overlapping current rows, late corrections, surrogate keys and point-in-time joins.
5. Check NULL semantics, time zones, currency, cancellation/refund treatment and missing/duplicate rows.
6. Return model specification, sample reconciliation SQL and a regression checklist for BI consumers.
Read `../../references/schema-contracts.md`, `../../references/warehouse-dbt.md`, `../../templates/model-contract.md`.
secure-data-platform1.18 KB
View saved version →
---
name: secure-data-platform
description: Review data-pipeline permissions, secrets, PII, tenant isolation, lineage, retention and audit boundaries.
---
# Security and governance
**Trigger:** Sensitive data, cross-tenant risk, permissions, credentials, governance, audit, retention, regulated data or shared datasets.
1. Identify assets and data classifications, trust boundaries, account identity, storage paths, catalog permissions and external sink destinations.
2. Check least-privilege roles, secrets storage, identity propagation to downstream jobs, encryption, logs/lineage and accidental PII in samples/tests.
3. Examine row/column access, masking, tenant filters, dataset sharing, retention and deletion propagation throughout derived tables.
4. Account for external shortcuts and linked resources, cross-workspace service identities, exports and staging buckets.
5. Review credential rotation, incident response, audited writes and break-glass flows; don't ask users to paste credentials in chat.
6. Recommend concrete threat tests, permission checks and a rollout that cannot silently broaden access.
Use `../../references/security-governance.md` and `../../references/core-invariants.md`.
tune-spark-databricks1.12 KB
View saved version →
---
name: tune-spark-databricks
description: Diagnose Spark and Databricks performance using actual plans, stage metrics, skew, spill and storage layout evidence.
---
# Spark / Databricks tuning
**Trigger:** Slow Spark, sudden runtime regression, skewed joins, excessive shuffle, small files or high compute costs.
1. Compare current and known-good run: dataset size, partition distribution, changed configs/runtime, physical plan and stage statistics.
2. Locate time spent: scan, shuffle, join, skew, spill, executor/driver pressure, GC, state store, sink or remote I/O.
3. Inspect final/adaptive physical plan and task-duration percentiles before recommending repartition/broadcast/caching/cluster resize.
4. Consider stats, predicate pushdown, join grain, file layout and AQE. Platform/runtime defaults vary; check official docs.
5. Propose one change at a time with expected direction, cost, correctness risk, test scope and rollback.
6. Validate output equality and representative throughput/cost, not only speed on toy data.
Read `../../references/spark-performance.md` and `../../references/original/spark_databricks_tuning_guide.md`.