skills/data-engineering-skills/ai-data-integration/SKILL.md
Use this skill when connecting AI or LLMs to data platforms. Covers MCP servers for warehouses, natural-language-to-SQL, embeddings for data discovery, LLM-powered enrichment, and AI agent data access patterns. Common phrases: "text-to-SQL", "MCP server for Snowflake", "LLM data enrichment", "AI agent access". Do NOT use for general data integration (use data-integration) or dbt modeling (use dbt-transforms).
npx skillsauth add dtsong/my-claude-setup ai-data-integrationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Expert guidance for integrating AI/LLM capabilities with data engineering systems. Covers MCP server patterns for warehouses, NL-to-SQL generation, LLM-powered data transformations, and embeddings for data discovery. Security tiers are deeply integrated -- not bolted on.
Not an ML/MLOps skill. Covers how AI agents interact with data platforms, not model training or deployment.
Activate when: building MCP servers for warehouse data, implementing NL-to-SQL interfaces, using LLMs for data enrichment/classification/extraction in pipelines, building embeddings for catalog search or semantic matching, designing AI agent access with security guardrails, evaluating when AI adds value vs traditional approaches.
Don't use for: ML model training/experiment tracking, general prompt engineering, chatbots/conversational AI, dbt/DLT/orchestration (use domain skills), Python DataFrame transforms without LLM involvement (python-data-engineering).
| reasoning_demand | preferred | acceptable | minimum | |-----------------|-----------|------------|---------| | medium | Sonnet | Sonnet, Opus | Sonnet |
Condition: designing novel security tier taxonomy from scratch → hold at Opus.
Never start with full data access. Graduate through trust levels (see Maturity Model below).
AI agents get minimum data access required: read-only connections, scoped to specific schemas/tables, row-limited queries, cost-capped, and audit-logged with the originating prompt.
LLM calls have real cost in data pipelines. Rule of thumb: if calling an LLM per-row on millions of rows, batch, cache, or use traditional approaches instead. See reference files for cost tables.
AI-generated SQL and transforms need review in regulated environments:
For reproducible pipelines: cache LLM results, use structured output (JSON mode), implement fallback logic for invalid output, log all inputs/outputs.
| Level | Name | AI Can Access | AI Can Do | Security Tier | |-------|------|---------------|-----------|---------------| | 0 | Code Generation | Nothing -- generates code offline | Write SQL, Python, YAML, configs | Tier 3 (Air-Gapped) | | 1 | Metadata Aware | Schemas, column types, row counts, stats | Generate context-aware SQL using real schema | Tier 2-3 | | 2 | Sample Access | Representative data samples (10-100 rows) | Understand data patterns, suggest transforms | Tier 1-2 | | 3 | Guarded Execution | Read-only query results (with limits) | Run NL-to-SQL, explore data, answer questions | Tier 1 |
Most organizations operate at Level 0-1. Level 2-3 requires explicit security review and approval.
Build an MCP server for your warehouse to give AI agents structured, controlled access.
| Principle | Implementation | |-----------|---------------| | Least privilege | Separate tools for metadata vs data access | | Input validation | Prevent SQL injection via parameterized queries or allowlists | | Output limiting | Always enforce row limits; truncate large results | | Audit logging | Log every invocation: who (agent), what (tool + params), when, result summary | | Graceful degradation | Return helpful errors; never expose stack traces or connection strings | | Progressive disclosure | Offer metadata tools first; gate data access behind explicit config |
For MCP server code examples (Snowflake, BigQuery, multi-warehouse, connection pooling, context management), see MCP Data Patterns Reference.
NL-to-SQL translates user questions into warehouse queries -- the most common AI-data integration pattern. Key success factors: provide accurate schema context to the LLM, validate generated SQL before execution, enforce LIMIT clauses and schema allowlists, cache results for repeated questions.
For implementation patterns (schema context strategies, few-shot examples, query validation with sqlglot, caching, evaluation metrics, error recovery), see NL-to-SQL Patterns Reference.
Use LLMs for transforms difficult with traditional code: classification of free-text, entity extraction from unstructured text, enrichment with world knowledge, and data quality assessment.
| Use LLM When | Use Traditional Code When | |--------------|--------------------------| | Classifying free-text into categories | Categories map to simple rules or keywords | | Extracting entities from unstructured text | Data has consistent structure (regex works) | | Enriching records with world knowledge | Enrichment comes from a lookup table or API | | Assessing data quality of text fields | Quality checks are numeric/null/format-based | | Resolving ambiguous entity matches | Exact or fuzzy string matching suffices |
For batch processing patterns (classification, entity extraction, structured output, caching, cost monitoring), see LLM Transform Patterns Reference.
Use embeddings to make your data platform searchable by meaning, not keywords.
| Use Case | Description |
|----------|-------------|
| Data catalog search | "Find tables related to customer churn" -- discover by semantic meaning |
| Column matching | Match columns across systems by meaning: cust_id = customer_identifier |
| Documentation search | RAG over dbt docs, data dictionaries, runbooks |
| Query suggestion | Find similar past queries to reuse validated SQL |
For embedding pipelines (vector stores, chunking, catalog embedding, RAG over documentation, semantic column matching), see Embeddings Pipelines Reference.
User-provided text becomes SQL in NL-to-SQL and MCP server patterns. Treat all user input as untrusted.
| Control | Implementation | |---------|---------------| | Parameterized queries | Never interpolate user input into SQL strings. Use bind parameters for all user-supplied values. | | Schema allowlists | Restrict queryable schemas/tables to an explicit allowlist. Reject queries referencing non-allowed objects. | | Query type restriction | Parse generated SQL with sqlglot or similar. Allow only SELECT statements — reject INSERT, UPDATE, DELETE, DDL, and COPY. | | Input length limits | Cap user prompt length (e.g., 1,000 chars). Reject inputs that embed SQL fragments or escape sequences. | | Output sanitization | Return query results only. Never expose connection strings, internal errors, or stack traces to the user. |
Apply these controls at the MCP tool boundary and the NL-to-SQL execution boundary. See NL-to-SQL Patterns Reference for query validation implementation.
This is the highest-risk skill in the suite -- AI accessing production data requires careful guardrails. See Security & Compliance Patterns for the full framework.
Credentials required: LLM API keys, warehouse connections (read-only), vector database access. Configure via environment variables. Use separate credentials for AI access vs human access.
| Capability | Tier 1 (Cloud-Native) | Tier 2 (Regulated) | Tier 3 (Air-Gapped) | |------------|----------------------|--------------------|--------------------| | Code generation (Level 0) | Yes | Yes | Yes | | Metadata access (Level 1) | Yes (dev/staging) | Schema only, human approval | No -- provide manually | | Sample data (Level 2) | Yes (dev, 10-100 rows) | Synthetic/anonymized only | No data access | | Query execution (Level 3) | Dev/staging with guardrails | No | No | | NL-to-SQL | Generate and execute (dev) | Generate for review | Generate for review | | LLM enrichment | Process dev data | Process anonymized data | Generate code only | | MCP server | Dev/staging | Metadata-only tools | Not deployed | | Embeddings | Embed metadata + data | Metadata only | Documentation only |
STAGING, MARTS -- never RAW or PII)For the AI query audit trail schema, see MCP Data Patterns Reference.
development
Use when planning implementation steps, deciding commit format, or structuring development approach. Provides brainstorm-plan-implement flow with conventional commits. Triggers on 'how should I approach this', 'commit format'.
development
Security audit checklist for web applications. Use when reviewing, auditing, or hardening a web app's security posture. Covers rate limiting, auth headers, IP blocking, CORS, security middleware, input validation, file upload limits, ORM usage, and password hashing. Triggers on requests like "review security", "harden this app", "security audit", "check for vulnerabilities", or when building/reviewing API endpoints.
development
Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".
development
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.