deepgram-local-dev-loop
Configure Deepgram local development workflow with testing and mocks. Use when setting up development environment, configuring test fixtures, or establishing rapid iteration patterns for Deepgram integration. Trigger: "deepgram local dev", "deepgram development setup", "deepgram test environment", "deepgram dev workflow", "deepgram mock".
Best use case
deepgram-local-dev-loop is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Configure Deepgram local development workflow with testing and mocks. Use when setting up development environment, configuring test fixtures, or establishing rapid iteration patterns for Deepgram integration. Trigger: "deepgram local dev", "deepgram development setup", "deepgram test environment", "deepgram dev workflow", "deepgram mock".
Teams using deepgram-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/deepgram-local-dev-loop/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How deepgram-local-dev-loop Compares
| Feature / Agent | deepgram-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 Deepgram local development workflow with testing and mocks. Use when setting up development environment, configuring test fixtures, or establishing rapid iteration patterns for Deepgram integration. Trigger: "deepgram local dev", "deepgram development setup", "deepgram test environment", "deepgram dev workflow", "deepgram mock".
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.
SKILL.md Source
# Deepgram Local Dev Loop
## Overview
Set up a fast local development workflow for Deepgram: test fixtures with sample audio, mock responses for offline unit tests, Vitest integration tests against the real API, and a watch-mode transcription dev server.
## Prerequisites
- `@deepgram/sdk` installed, `DEEPGRAM_API_KEY` configured
- `npm install -D vitest tsx dotenv` for testing and dev server
- Optional: `curl` for downloading test fixtures
## Instructions
### Step 1: Project Structure
```bash
mkdir -p src tests/mocks fixtures
touch src/transcribe.ts tests/transcribe.test.ts tests/mocks/deepgram-responses.ts
```
### Step 2: Download Test Fixtures
```bash
# Deepgram provides free sample audio files
curl -o fixtures/nasa-podcast.wav \
https://static.deepgram.com/examples/nasa-podcast.wav
curl -o fixtures/bueller.wav \
https://static.deepgram.com/examples/Bueller-Life-moves-702702706.wav
```
### Step 3: Environment Config
```bash
# .env.development
DEEPGRAM_API_KEY=your-dev-key
DEEPGRAM_MODEL=nova-3
# .env.test (use a separate test key with low limits)
DEEPGRAM_API_KEY=your-test-key
DEEPGRAM_MODEL=base
```
```json
{
"scripts": {
"dev": "tsx watch src/transcribe.ts",
"test": "vitest",
"test:watch": "vitest --watch",
"test:integration": "vitest run tests/integration/"
}
}
```
### Step 4: Mock Deepgram Responses
```typescript
// tests/mocks/deepgram-responses.ts
export const mockPrerecordedResult = {
metadata: {
request_id: 'mock-request-id-001',
created: '2026-01-01T00:00:00.000Z',
duration: 12.5,
channels: 1,
models: ['nova-3'],
model_info: { 'nova-3': { name: 'nova-3', version: '2026-01-01' } },
},
results: {
channels: [{
alternatives: [{
transcript: 'Life moves pretty fast. If you don\'t stop and look around once in a while, you could miss it.',
confidence: 0.98,
words: [
{ word: 'life', start: 0.08, end: 0.32, confidence: 0.99, punctuated_word: 'Life' },
{ word: 'moves', start: 0.32, end: 0.56, confidence: 0.98, punctuated_word: 'moves' },
{ word: 'pretty', start: 0.56, end: 0.88, confidence: 0.97, punctuated_word: 'pretty' },
{ word: 'fast', start: 0.88, end: 1.12, confidence: 0.99, punctuated_word: 'fast.' },
],
}],
}],
utterances: [{
speaker: 0,
transcript: 'Life moves pretty fast. If you don\'t stop and look around once in a while, you could miss it.',
start: 0.08,
end: 5.44,
confidence: 0.98,
}],
},
};
export const mockLiveTranscript = {
type: 'Results',
channel_index: [0, 1],
duration: 1.5,
start: 0.0,
is_final: true,
speech_final: true,
channel: {
alternatives: [{
transcript: 'Hello, how are you today?',
confidence: 0.95,
words: [
{ word: 'hello', start: 0.0, end: 0.3, confidence: 0.98, punctuated_word: 'Hello,' },
{ word: 'how', start: 0.35, end: 0.5, confidence: 0.96, punctuated_word: 'how' },
],
}],
},
};
export const mockTtsResponse = {
content_type: 'audio/wav',
request_id: 'mock-tts-001',
model_name: 'aura-2-thalia-en',
characters: { count: 42, limit: 100000 },
};
```
### Step 5: Unit Tests with Mocks
```typescript
// tests/transcribe.test.ts
import { describe, it, expect, vi, beforeEach } from 'vitest';
import { mockPrerecordedResult } from './mocks/deepgram-responses';
// Mock the SDK
vi.mock('@deepgram/sdk', () => ({
createClient: () => ({
listen: {
prerecorded: {
transcribeUrl: vi.fn().mockResolvedValue({
result: mockPrerecordedResult,
error: null,
}),
transcribeFile: vi.fn().mockResolvedValue({
result: mockPrerecordedResult,
error: null,
}),
},
},
speak: {
request: vi.fn().mockResolvedValue({
getStream: () => Promise.resolve(null),
}),
},
}),
}));
describe('DeepgramTranscriber', () => {
it('transcribes URL and returns transcript text', async () => {
const { createClient } = await import('@deepgram/sdk');
const client = createClient('mock-key');
const { result } = await client.listen.prerecorded.transcribeUrl(
{ url: 'https://example.com/audio.wav' },
{ model: 'nova-3', smart_format: true }
);
expect(result.results.channels[0].alternatives[0].transcript).toContain('Life moves');
expect(result.metadata.duration).toBe(12.5);
expect(result.metadata.request_id).toBe('mock-request-id-001');
});
it('returns word-level timing data', async () => {
const { createClient } = await import('@deepgram/sdk');
const client = createClient('mock-key');
const { result } = await client.listen.prerecorded.transcribeUrl(
{ url: 'https://example.com/audio.wav' },
{ model: 'nova-3' }
);
const words = result.results.channels[0].alternatives[0].words;
expect(words[0].word).toBe('life');
expect(words[0].start).toBe(0.08);
expect(words[0].confidence).toBeGreaterThan(0.9);
});
});
```
### Step 6: Integration Tests (Real API)
```typescript
// tests/integration/deepgram.test.ts
import { describe, it, expect } from 'vitest';
import { createClient } from '@deepgram/sdk';
describe('Deepgram Integration', () => {
const client = createClient(process.env.DEEPGRAM_API_KEY!);
it('transcribes sample audio URL', async () => {
const { result, error } = await client.listen.prerecorded.transcribeUrl(
{ url: 'https://static.deepgram.com/examples/Bueller-Life-moves-702702706.wav' },
{ model: 'nova-3', smart_format: true }
);
expect(error).toBeNull();
expect(result.results.channels[0].alternatives[0].transcript).toBeTruthy();
expect(result.results.channels[0].alternatives[0].confidence).toBeGreaterThan(0.8);
}, 30000);
it('verifies API key with project listing', async () => {
const { result, error } = await client.manage.getProjects();
expect(error).toBeNull();
expect(result.projects.length).toBeGreaterThan(0);
});
});
```
## Output
- Project structure with src, tests, fixtures directories
- Mock response objects matching real Deepgram API shape
- Unit tests with mocked SDK (no API calls)
- Integration tests against real API with timeout
- Watch mode for rapid iteration
## Error Handling
| Error | Cause | Solution |
|-------|-------|----------|
| Fixture 404 | Deepgram moved sample URL | Check latest URLs at developers.deepgram.com |
| `DEEPGRAM_API_KEY` undefined in test | `.env.test` not loaded | Configure Vitest `env` or use `dotenv/config` |
| Integration test timeout | Network or API slow | Increase timeout to 30000ms |
| Mock shape mismatch | API response changed | Update mocks from real response capture |
## Resources
- [Vitest Documentation](https://vitest.dev/)
- [Deepgram Sample Audio](https://static.deepgram.com/examples/)
- [SDK Testing Guide](https://developers.deepgram.com/docs/testing)
## Next Steps
Proceed to `deepgram-sdk-patterns` for production-ready code patterns.Related Skills
exa-local-dev-loop
Configure Exa local development with hot reload, testing, and mock responses. Use when setting up a development environment, writing tests against Exa, or establishing a fast iteration cycle. Trigger with phrases like "exa dev setup", "exa local development", "exa test setup", "develop with exa", "mock exa".
evernote-local-dev-loop
Set up efficient local development workflow for Evernote integrations. Use when configuring dev environment, setting up sandbox testing, or optimizing development iteration speed. Trigger with phrases like "evernote dev setup", "evernote local development", "evernote sandbox", "test evernote locally".
elevenlabs-local-dev-loop
Configure local ElevenLabs development with mocking, hot reload, and audio testing. Use when setting up a dev environment for TTS/voice projects, configuring test workflows, or building a fast iteration cycle with ElevenLabs audio. Trigger: "elevenlabs dev setup", "elevenlabs local development", "elevenlabs dev environment", "develop with elevenlabs", "test elevenlabs locally".
documenso-local-dev-loop
Set up local development environment and testing workflow for Documenso. Use when configuring dev environment, setting up test workflows, or establishing rapid iteration patterns with Documenso. Trigger with phrases like "documenso local dev", "documenso development", "test documenso locally", "documenso dev environment".
deepgram-webhooks-events
Implement Deepgram callback and webhook handling for async transcription. Use when implementing callback URLs, processing async transcription results, or handling Deepgram event notifications. Trigger: "deepgram callback", "deepgram webhook", "async transcription", "deepgram events", "deepgram notifications", "deepgram async".
deepgram-upgrade-migration
Plan and execute Deepgram SDK upgrades and model migrations. Use when upgrading SDK versions (v3->v4->v5), migrating models (Nova-2 to Nova-3), or planning API version transitions. Trigger: "upgrade deepgram", "deepgram migration", "update deepgram SDK", "deepgram version upgrade", "nova-3 migration".
deepgram-security-basics
Apply Deepgram security best practices for API key management and data protection. Use when securing Deepgram integrations, implementing key rotation, or auditing security configurations. Trigger: "deepgram security", "deepgram API key security", "secure deepgram", "deepgram key rotation", "deepgram data protection", "deepgram PII redaction".
deepgram-sdk-patterns
Apply production-ready Deepgram SDK patterns for TypeScript and Python. Use when implementing Deepgram integrations, refactoring SDK usage, or establishing team coding standards for Deepgram. Trigger: "deepgram SDK patterns", "deepgram best practices", "deepgram code patterns", "idiomatic deepgram", "deepgram typescript".
deepgram-reference-architecture
Implement Deepgram reference architecture for scalable transcription systems. Use when designing transcription pipelines, building production architectures, or planning Deepgram integration at scale. Trigger: "deepgram architecture", "transcription pipeline", "deepgram system design", "deepgram at scale", "enterprise deepgram", "deepgram queue".
deepgram-rate-limits
Implement Deepgram rate limiting and backoff strategies. Use when handling API quotas, implementing request throttling, or dealing with 429 rate limit errors. Trigger: "deepgram rate limit", "deepgram throttling", "429 error deepgram", "deepgram quota", "deepgram backoff", "deepgram concurrency".
deepgram-prod-checklist
Execute Deepgram production deployment checklist. Use when preparing for production launch, auditing production readiness, or verifying deployment configurations. Trigger: "deepgram production", "deploy deepgram", "deepgram prod checklist", "deepgram go-live", "production ready deepgram".
deepgram-performance-tuning
Optimize Deepgram API performance for faster transcription and lower latency. Use when improving transcription speed, reducing latency, or optimizing audio processing pipelines. Trigger: "deepgram performance", "speed up deepgram", "optimize transcription", "deepgram latency", "deepgram faster", "deepgram throughput".