GR

groq-local-dev-loop

Scaffolds a development environment for Groq with hot-reloading, unit testing with mocks, and live integration testing patterns.

Install

mkdir -p .claude/skills/groq-local-dev-loop && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/8857" && unzip -o skill.zip -d .claude/skills/groq-local-dev-loop && rm skill.zip

Installs to .claude/skills/groq-local-dev-loop

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Configure Groq local development with hot reload, mocking, and testing.
71 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Scaffold Groq project structure
  • Implement memoized singleton client
  • Configure model constants for dev
  • Execute mocked unit tests
  • Run gated live integration tests

How it works

This skill scaffolds a project with a memoized client and a two-tier testing strategy. It uses vitest to mock the SDK for unit tests and gates live API calls behind environment variables.

Inputs & outputs

You give it
Project initialization and test execution commands
You get back
Scaffolded directory structure and test suite

When to use groq-local-dev-loop

  • Setting up a local development environment for Groq
  • Implementing mocked unit tests for AI workflows
  • Creating a fast iteration loop for LLM prompts
  • Managing live vs. mocked testing environments

About this skill

Groq Local Dev Loop

Overview

Set up a fast, reproducible local development workflow for Groq. Groq's sub-second response times make it uniquely suited for tight dev loops -- you get LLM responses fast enough to iterate without context-switching. This skill scaffolds a project, a memoized client, model constants, and a two-tier test strategy (mocked unit tests + opt-in live integration tests). The lean skeleton lives here; the full code lives in references/implementation.md and references/examples.md.

Prerequisites

  • groq-sdk installed (npm install groq-sdk)
  • GROQ_API_KEY set (free tier is fine for development)
  • Node.js 18+ with tsx for TypeScript execution
  • vitest for testing

Authentication

The groq-sdk client reads GROQ_API_KEY from the environment automatically — new Groq() and getGroqClient() both pick it up. Get a key at console.groq.com/keys, store it in a git-ignored .env.local, and commit only .env.example as a template. Never hardcode the key or commit .env.local.

Instructions

Follow these seven steps in order. Steps 1-2 lay out the project; steps 3-4 centralize the client and model IDs; steps 5-6 establish the test tiers; step 7 templates the environment. Full code for each is in the reference files.

  1. Project structure — create src/groq/{client,models,completions}.ts, tests/, and .env.local / .env.example.
  2. Package setup — wire dev (tsx watch), test / test:watch (vitest), and test:integration scripts.
  3. Singleton client — a lazily-memoized getGroqClient() that fails fast when GROQ_API_KEY is missing and a resetClient() for tests.
  4. Model constants — a MODELS map with DEV_MODEL defaulting to llama-3.1-8b-instant to conserve dev quota.
  5. Unit tests with mockingvi.mock("groq-sdk") so unit tests run sub-second with zero API calls.
  6. Integration tests — guard live-API tests behind GROQ_INTEGRATION=1 with describe.skipIf so the default run stays offline.
  7. Environment template — commit .env.example, git-ignore .env.local.
// src/groq/client.ts -- lazily-memoized singleton
import Groq from "groq-sdk";

let _client: Groq | null = null;

export function getGroqClient(): Groq {
  if (!_client) {
    if (!process.env.GROQ_API_KEY) {
      throw new Error("GROQ_API_KEY not set. Copy .env.example to .env.local");
    }
    _client = new Groq({ apiKey: process.env.GROQ_API_KEY, maxRetries: 2, timeout: 30_000 });
  }
  return _client;
}
export function resetClient(): void { _client = null; }

See references/implementation.md for the full project scaffold, package.json, model constants, and .env.example, and references/examples.md for the complete unit and integration test files.

Output

Applying the workflow produces:

  • A scaffolded project with src/groq/{client,models,completions}.ts and a tests/ directory.
  • A memoized getGroqClient() that shares one configured client and throws an actionable error when GROQ_API_KEY is unset.
  • A MODELS map + DEV_MODEL constant so dev runs on the cheap 8B model.
  • A two-tier test suite: mocked unit tests (npm run test:watch, no API calls) and opt-in live tests (npm run test:integration, gated on GROQ_INTEGRATION=1).
  • A .env.example template committed for the team, with real secrets in a git-ignored .env.local.

Error Handling

ErrorCauseSolution
GROQ_API_KEY not setMissing .env.localCopy from .env.example
Test timeoutLive API call in unit testMock groq-sdk in unit tests
429 rate_limit_exceededFree tier RPM hitWait 60s or use test:watch with longer intervals
Port already in useAnother tsx watch runningKill process or change port

Dev Tips

  • Use llama-3.1-8b-instant during development (lowest quota usage, fastest).
  • Set temperature: 0 for deterministic outputs during debugging.
  • Set max_tokens conservatively to avoid burning through free tier.
  • Groq free tier: 30 RPM for 70B and 8B models -- plan your dev loops accordingly.

Examples

Run the hot-reload app and the mocked unit-test watcher side by side, then exercise the live API only when you opt in:

npm run dev                # tsx watch src/index.ts (hot reload)
npm run test:watch         # vitest --watch (mocked, no API calls)
npm run test:integration   # GROQ_INTEGRATION=1 vitest (live API)

For the complete mocked unit test (vi.mock("groq-sdk")) and the GROQ_INTEGRATION-gated live integration test, see references/examples.md.

Resources

When not to use it

  • Production environments requiring high-availability failover
  • Projects without Node.js or TypeScript support

Prerequisites

groq-sdk packageGROQ_API_KEYNode.js 18+vitest

Limitations

  • Free tier rate limits apply to development loops
  • Requires manual management of .env.local files

How it compares

Unlike manual setup, this provides a standardized project skeleton with pre-configured mocking and environment-gated integration tests.

Compared to similar skills

groq-local-dev-loop side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
groq-local-dev-loop (this skill)026dReviewIntermediate
playwright-browser-automation297moReviewIntermediate
documenso-local-dev-loop227dReviewBeginner
customerio-local-dev-loop127dReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

More by jeremylongshore

View all by jeremylongshore

analyzing-logs

jeremylongshore

Analyze application logs to detect performance issues, identify error patterns, and improve stability by extracting key insights.

14123

ollama-setup

jeremylongshore

Configure auto-configure Ollama when user needs local LLM deployment, free AI alternatives, or wants to eliminate hosted API costs. Trigger phrases: "install ollama", "local AI", "free LLM", "self-hosted AI", "replace OpenAI", "no API costs". Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.

1167

backtesting-trading-strategies

jeremylongshore

Backtest crypto and traditional trading strategies against historical data. Calculates performance metrics (Sharpe, Sortino, max drawdown), generates equity curves, and optimizes strategy parameters. Use when user wants to test a trading strategy, validate signals, or compare approaches. Trigger with phrases like "backtest strategy", "test trading strategy", "historical performance", "simulate trades", "optimize parameters", or "validate signals".

1071

generating-database-seed-data

jeremylongshore

Process this skill enables AI assistant to generate realistic test data and database seed scripts for development and testing environments. it uses faker libraries to create realistic data, maintains relational integrity, and allows configurable data volumes. u... Use when working with databases or data models. Trigger with phrases like 'database', 'query', or 'schema'.

1033

cursor-codebase-indexing

jeremylongshore

Execute set up and optimize Cursor codebase indexing. Triggers on "cursor index setup", "codebase indexing", "index codebase", "cursor semantic search". Use when working with cursor codebase indexing functionality. Trigger with phrases like "cursor codebase indexing", "cursor indexing", "cursor".

885

testing-mobile-apps

jeremylongshore

Execute mobile app testing on iOS and Android devices/simulators. Use when performing specialized testing. Trigger with phrases like "test mobile app", "run iOS tests", or "validate Android functionality".

810

You might also like

playwright-browser-automation

lackeyjb

Complete browser automation with Playwright. Auto-detects dev servers, writes clean test scripts to /tmp. Test pages, fill forms, take screenshots, check responsive design, validate UX, test login flows, check links, automate any browser task. Use when user wants to test websites, automate browser interactions, validate web functionality, or perform any browser-based testing.

29146

documenso-local-dev-loop

jeremylongshore

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".

26

customerio-local-dev-loop

jeremylongshore

Configure Customer.io local development workflow. Use when setting up local testing, development environment, or offline development for Customer.io integrations. Trigger with phrases like "customer.io local dev", "test customer.io locally", "customer.io development environment", "customer.io sandbox".

12

firecrawl-local-dev-loop

jeremylongshore

Configure FireCrawl local development with hot reload and testing. Use when setting up a development environment, configuring test workflows, or establishing a fast iteration cycle with FireCrawl. Trigger with phrases like "firecrawl dev setup", "firecrawl local development", "firecrawl dev environment", "develop with firecrawl".

12

deepgram-local-dev-loop

jeremylongshore

Configure Deepgram local development workflow with testing and iteration. Use when setting up development environment, configuring test fixtures, or establishing rapid iteration patterns for Deepgram integration. Trigger with phrases like "deepgram local dev", "deepgram development setup", "deepgram test environment", "deepgram dev workflow".

11

maintainx-local-dev-loop

jeremylongshore

Set up a local development loop for MaintainX integration development. Use when configuring dev environment, testing API calls locally, or setting up a sandbox workflow for MaintainX. Trigger with phrases like "maintainx dev setup", "maintainx local", "maintainx development environment", "maintainx testing setup".

11

Search skills

Search the agent skills registry