/groq-pack:groq-local-dev-loopfrom groq-pack
Sets up a Groq local development workflow with hot reload, mocked unit tests, and opt-in integration tests. Triggered by 'groq dev setup'.
Ships in groq-pack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
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.
groq-sdk installed (npm install groq-sdk)GROQ_API_KEY set (free tier is fine for development)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.
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.
src/groq/{client,models,completions}.ts, tests/, and .env.local / .env.example.dev (tsx watch), test / test:watch (vitest), and test:integration scripts.getGroqClient() that fails fast when GROQ_API_KEY is missing and a resetClient() for tests.MODELS map with DEV_MODEL defaulting to llama-3.1-8b-instant to conserve dev quota.vi.mock("groq-sdk") so unit tests run sub-second with zero API calls.GROQ_INTEGRATION=1 with describe.skipIf so the default run stays offline..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.
Applying the workflow produces:
src/groq/{client,models,completions}.ts and a tests/ directory.getGroqClient() that shares one configured client and throws an actionable error when GROQ_API_KEY is unset.MODELS map + DEV_MODEL constant so dev runs on the cheap 8B model.npm run test:watch, no API calls) and opt-in live tests (npm run test:integration, gated on GROQ_INTEGRATION=1)..env.example template committed for the team, with real secrets in a git-ignored .env.local.| Error | Cause | Solution |
|---|---|---|
GROQ_API_KEY not set | Missing .env.local | Copy from .env.example |
| Test timeout | Live API call in unit test | Mock groq-sdk in unit tests |
429 rate_limit_exceeded | Free tier RPM hit | Wait 60s or use test:watch with longer intervals |
| Port already in use | Another tsx watch running | Kill process or change port |
llama-3.1-8b-instant during development (lowest quota usage, fastest).temperature: 0 for deterministic outputs during debugging.max_tokens conservatively to avoid burning through free tier.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.
groq-sdk-patterns skill.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Groq, TypeScript, Node, Vitest
groq, local-development, testing, workflow, dev-loop, hot-reload
24 skills in this plugin
/groq-ci-integrationConfigure Groq CI/CD integration with GitHub Actions, testing, and model validation.
Use when setting up automated testing, configuring CI pipelines,
or integrating Groq tests into your build process.
Trigger with phrases like "groq CI", "groq GitHub Actions",
"groq automated tests", "CI groq".
/groq-common-errorsDiagnose and fix Groq API errors with real error codes and solutions.
Use when encountering Groq errors, debugging failed requests,
or troubleshooting integration issues.
Trigger with phrases like "groq error", "fix groq",
"groq not working", "debug groq", "groq 429".
/groq-core-workflow-aExecute Groq's primary workflow: chat completions with tool use and JSON mode.
Use when implementing chat interfaces, function calling, structured output,
or building AI features with Groq's fast inference.
Trigger with phrases like "groq chat completion", "groq tool use",
"groq function calling", "groq JSON mode".
/groq-core-workflow-bUse when you need Groq's non-chat endpoints — transcribing or translating
audio with Whisper, understanding images with Llama 4 vision, generating
speech (TTS), or benchmarking models for speed vs quality.
Trigger with phrases like "groq whisper", "groq transcription",
"groq audio", "groq vision", "groq TTS", "groq speech".
/groq-cost-tuningOptimize Groq costs through model routing, token management, and usage monitoring.
Use when analyzing Groq billing, reducing API costs,
or implementing usage monitoring and budget alerts.
Trigger with phrases like "groq cost", "groq billing",
"reduce groq costs", "groq pricing", "groq expensive", "groq budget".
/groq-data-handlingUse when you need to keep PII out of Groq API calls, filter model responses,
audit-log conversations, or track token cost and usage for a Groq integration.
Implements prompt sanitization, PII redaction, response filtering, and usage
tracking. Trigger with phrases like "groq data", "groq PII", "groq GDPR",
"groq data retention", "groq privacy", "groq compliance".
npx claudepluginhub jeremylongshore/tons-of-skills-marketplace --plugin groq-packOther plugins' skills for the same job