snowflake-local-dev-loop
Configure Snowflake local development with testing, mocking, and fast iteration. Use when setting up dev environment, writing tests against Snowflake, or establishing a fast iteration cycle with SnowSQL and dev warehouses. Trigger with phrases like "snowflake dev setup", "snowflake local development", "snowflake dev environment", "develop with snowflake", "snowflake testing".
Best use case
snowflake-local-dev-loop is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Configure Snowflake local development with testing, mocking, and fast iteration. Use when setting up dev environment, writing tests against Snowflake, or establishing a fast iteration cycle with SnowSQL and dev warehouses. Trigger with phrases like "snowflake dev setup", "snowflake local development", "snowflake dev environment", "develop with snowflake", "snowflake testing".
Teams using snowflake-local-dev-loop should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/snowflake-local-dev-loop/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How snowflake-local-dev-loop Compares
| Feature / Agent | snowflake-local-dev-loop | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Configure Snowflake local development with testing, mocking, and fast iteration. Use when setting up dev environment, writing tests against Snowflake, or establishing a fast iteration cycle with SnowSQL and dev warehouses. Trigger with phrases like "snowflake dev setup", "snowflake local development", "snowflake dev environment", "develop with snowflake", "snowflake testing".
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
Cursor vs Codex for AI Workflows
Compare Cursor and Codex for AI coding workflows, repository assistance, debugging, refactoring, and reusable developer skills.
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
SKILL.md Source
# Snowflake Local Dev Loop
## Overview
Set up a fast, reproducible local development workflow for Snowflake with separate dev warehouses, mocked tests, and SnowSQL for rapid iteration.
## Prerequisites
- Completed `snowflake-install-auth` setup
- Node.js 18+ or Python 3.9+
- A dedicated dev warehouse (e.g., `DEV_WH_XS`) with auto-suspend
## Instructions
### Step 1: Create Dev-Specific Snowflake Objects
```sql
-- Run once to set up isolated dev environment
CREATE WAREHOUSE IF NOT EXISTS DEV_WH_XS
WAREHOUSE_SIZE = 'XSMALL'
AUTO_SUSPEND = 60
AUTO_RESUME = TRUE
INITIALLY_SUSPENDED = TRUE;
CREATE DATABASE IF NOT EXISTS DEV_DB;
CREATE SCHEMA IF NOT EXISTS DEV_DB.SANDBOX;
-- Grant to dev role
GRANT USAGE ON WAREHOUSE DEV_WH_XS TO ROLE DEV_ROLE;
GRANT ALL ON DATABASE DEV_DB TO ROLE DEV_ROLE;
```
### Step 2: Project Structure
```
my-snowflake-project/
├── src/
│ ├── snowflake/
│ │ ├── connection.ts # Connection wrapper with connectAsync
│ │ ├── queries.ts # Typed query functions
│ │ └── types.ts # Row type definitions
│ └── index.ts
├── tests/
│ ├── unit/
│ │ └── queries.test.ts # Mocked — no Snowflake needed
│ └── integration/
│ └── snowflake.test.ts # Requires SNOWFLAKE_* env vars
├── sql/
│ ├── migrations/ # Versioned DDL scripts
│ │ ├── V001__create_users.sql
│ │ └── V002__add_orders.sql
│ └── seeds/
│ └── dev-data.sql # Sample data for dev
├── .env.local # Local secrets (git-ignored)
├── .env.example # Template for team
└── package.json
```
### Step 3: Connection Wrapper with Async/Await
```typescript
// src/snowflake/connection.ts
import snowflake from 'snowflake-sdk';
// Enable promise-based API
snowflake.configure({ logLevel: 'WARN' });
export function createSnowflakeConnection() {
return snowflake.createConnection({
account: process.env.SNOWFLAKE_ACCOUNT!,
username: process.env.SNOWFLAKE_USER!,
password: process.env.SNOWFLAKE_PASSWORD!,
warehouse: process.env.SNOWFLAKE_WAREHOUSE || 'DEV_WH_XS',
database: process.env.SNOWFLAKE_DATABASE || 'DEV_DB',
schema: process.env.SNOWFLAKE_SCHEMA || 'SANDBOX',
role: process.env.SNOWFLAKE_ROLE || 'DEV_ROLE',
});
}
// Promise wrapper for connection.execute
export function executeQuery(
conn: snowflake.Connection,
sqlText: string,
binds?: any[]
): Promise<any[]> {
return new Promise((resolve, reject) => {
conn.execute({
sqlText,
binds,
complete: (err, stmt, rows) => {
if (err) reject(err);
else resolve(rows || []);
},
});
});
}
// Promise wrapper for connect
export function connectAsync(
conn: snowflake.Connection
): Promise<snowflake.Connection> {
return new Promise((resolve, reject) => {
conn.connect((err, conn) => {
if (err) reject(err);
else resolve(conn);
});
});
}
```
### Step 4: Unit Tests with Mocked Snowflake
```typescript
// tests/unit/queries.test.ts
import { describe, it, expect, vi, beforeEach } from 'vitest';
// Mock the snowflake-sdk module
vi.mock('snowflake-sdk', () => ({
default: {
configure: vi.fn(),
createConnection: vi.fn(() => ({
connect: vi.fn((cb) => cb(null, { getId: () => 'mock-id' })),
execute: vi.fn(({ sqlText, complete }) => {
// Return mock data based on query
if (sqlText.includes('CURRENT_WAREHOUSE')) {
complete(null, {}, [{ WAREHOUSE: 'DEV_WH_XS' }]);
} else if (sqlText.includes('SELECT')) {
complete(null, {}, [
{ ID: 1, NAME: 'Alice' },
{ ID: 2, NAME: 'Bob' },
]);
} else {
complete(null, { getNumUpdatedRows: () => 1 }, []);
}
}),
destroy: vi.fn((cb) => cb(null)),
})),
},
}));
import { createSnowflakeConnection, executeQuery, connectAsync } from '../../src/snowflake/connection';
describe('Snowflake Queries', () => {
it('should connect and execute a query', async () => {
const conn = createSnowflakeConnection();
await connectAsync(conn);
const rows = await executeQuery(conn, 'SELECT * FROM USERS');
expect(rows).toHaveLength(2);
expect(rows[0].NAME).toBe('Alice');
});
});
```
### Step 5: Integration Tests (Against Real Snowflake)
```typescript
// tests/integration/snowflake.test.ts
import { describe, it, expect, beforeAll, afterAll } from 'vitest';
import { createSnowflakeConnection, connectAsync, executeQuery } from '../../src/snowflake/connection';
describe.skipIf(!process.env.SNOWFLAKE_ACCOUNT)('Snowflake Integration', () => {
let conn: any;
beforeAll(async () => {
conn = createSnowflakeConnection();
await connectAsync(conn);
// Create temp table for test isolation
await executeQuery(conn, `
CREATE TEMPORARY TABLE test_users (
id INTEGER AUTOINCREMENT, name VARCHAR(100)
)
`);
});
afterAll(async () => {
conn?.destroy(() => {});
});
it('should insert and query data', async () => {
await executeQuery(conn,
'INSERT INTO test_users (name) VALUES (?)', ['TestUser']
);
const rows = await executeQuery(conn, 'SELECT * FROM test_users');
expect(rows.length).toBeGreaterThan(0);
expect(rows[0].NAME).toBe('TestUser');
});
});
```
### Step 6: SnowSQL for Quick Iteration
```bash
# Install SnowSQL CLI
brew install --cask snowflake-snowsql # macOS
# Configure named connection
cat >> ~/.snowsql/config << 'EOF'
[connections.dev]
accountname = myorg-myaccount
username = my_user
dbname = DEV_DB
schemaname = SANDBOX
warehousename = DEV_WH_XS
rolename = DEV_ROLE
EOF
# Quick queries
snowsql -c dev -q "SELECT COUNT(*) FROM my_table"
# Run migration scripts
snowsql -c dev -f sql/migrations/V001__create_users.sql
```
## Error Handling
| Error | Cause | Solution |
|-------|-------|----------|
| `000606: No active warehouse` | Dev warehouse suspended | Set `AUTO_RESUME = TRUE` on warehouse |
| `Module not found: snowflake-sdk` | Not installed | Run `npm install snowflake-sdk` |
| `Tests timeout` | Warehouse resuming from suspend | Increase test timeout to 30s, or pre-warm |
| `002003: Object does not exist` | Wrong database/schema context | Check `.env.local` DB and SCHEMA values |
## Resources
- [Node.js Driver Options](https://docs.snowflake.com/en/developer-guide/node-js/nodejs-driver-options)
- [Vitest Documentation](https://vitest.dev/)
- [SnowSQL Reference](https://docs.snowflake.com/en/user-guide/snowsql)
## Next Steps
See `snowflake-sdk-patterns` for production-ready code patterns.Related Skills
workhuman-local-dev-loop
Workhuman local dev loop for employee recognition and rewards API. Use when integrating Workhuman Social Recognition, or building recognition workflows with HRIS systems. Trigger: "workhuman local dev loop".
wispr-local-dev-loop
Wispr Flow local dev loop for voice-to-text API integration. Use when integrating Wispr Flow dictation, WebSocket streaming, or building voice-powered applications. Trigger: "wispr local dev loop".
windsurf-local-dev-loop
Configure Windsurf local development workflow with Cascade, Previews, and terminal integration. Use when setting up a development environment, configuring Turbo mode, or establishing a fast iteration cycle with Windsurf AI. Trigger with phrases like "windsurf dev setup", "windsurf local development", "windsurf dev environment", "windsurf workflow", "develop with windsurf".
webflow-local-dev-loop
Configure a Webflow local development workflow with TypeScript, hot reload, mocked API tests, and webhook tunneling via ngrok. Use when setting up a development environment, configuring test workflows, or establishing a fast iteration cycle with the Webflow Data API. Trigger with phrases like "webflow dev setup", "webflow local development", "webflow dev environment", "develop with webflow".
vercel-local-dev-loop
Configure Vercel local development with vercel dev, environment variables, and hot reload. Use when setting up a development environment, testing serverless functions locally, or establishing a fast iteration cycle with Vercel. Trigger with phrases like "vercel dev setup", "vercel local development", "vercel dev environment", "develop with vercel locally".
veeva-local-dev-loop
Veeva Vault local dev loop for REST API and clinical operations. Use when working with Veeva Vault document management and CRM. Trigger: "veeva local dev loop".
vastai-local-dev-loop
Configure Vast.ai local development with testing and fast iteration. Use when setting up a development environment, testing instance provisioning, or building a fast iteration cycle for GPU workloads. Trigger with phrases like "vastai dev setup", "vastai local development", "vastai dev environment", "develop with vastai".
twinmind-local-dev-loop
Set up local development workflow with TwinMind API integration. Use when building applications that integrate TwinMind transcription, testing API calls locally, or developing meeting automation tools. Trigger with phrases like "twinmind dev setup", "twinmind local development", "twinmind API testing", "build with twinmind".
together-local-dev-loop
Together AI local dev loop for inference, fine-tuning, and model deployment. Use when working with Together AI's OpenAI-compatible API. Trigger: "together local dev loop".
techsmith-local-dev-loop
TechSmith local dev loop for Snagit COM API and Camtasia automation. Use when working with TechSmith screen capture and video editing automation. Trigger: "techsmith local dev loop".
supabase-local-dev-loop
Configure Supabase local development with the CLI, Docker, and migration workflow. Use when initializing a Supabase project locally, starting the local stack, writing migrations, seeding data, or iterating on schema changes. Trigger with phrases like "supabase local dev", "supabase start", "supabase init", "supabase db reset", "supabase local setup".
stackblitz-local-dev-loop
Configure local development for WebContainer applications with hot reload and testing. Use when building browser-based IDEs, testing WebContainer file operations, or setting up development workflows for WebContainer projects. Trigger: "stackblitz dev setup", "webcontainer local", "test webcontainers locally".