GTM · Code
Blitz Script Builder
Turns a GTM brief into a runnable Blitz job — the correct SDK surface, API-key safety, real error handling, and the pagination and partition-for-scale patterns a hand-rolled client quietly loses.
This skill ships 6 files. The references are where the method lives — SKILL.md on its own will point at files you do not have, so take the archive rather than the markdown.
SKILL.mdreferences/error-handling.mdreferences/script-templates.mdreferences/sdk-reference.mdscripts/detect_pm.shscripts/verify_sdk.sh
Prefer just the instructions? Download SKILL.md alone.
Use it in your assistant
Claude Code — drop the file in your skills folder and it loads on the next session. Use ~/.claude/skills for every project, or .claude/skills inside a repo to keep it to that project.
mkdir -p ~/.claude/skills
curl -L https://growsteady.io/skills/blitz-create-script/archive | tar xz -C ~/.claude/skillsClaude apps (web and desktop) — Settings → Capabilities → Skills → add a skill. Extract the archive and upload the whole blitz-create-script folder, references included (zip it if an archive is asked for).
No install— paste the file into a Claude Project's custom instructions with “Copy as prompt”. Same behaviour, scoped to that project. Note that a paste carries the instructions only: this skill's references do not come with it, so use a real install if you want the full method.
Turn a GTM brief into a runnable Blitz script that uses the official Blitz SDK (blitz-api-py / blitz-api-js), installs it with the best package manager, and ships with API-key safety, baseline error handling, and correct pagination.
The SDK handles pagination, per-endpoint client-side rate-limiting, and 429/5xx retries for you. Never emit raw `fetch`/`requests` — that re-introduces every bug the SDK exists to remove.
Quick start
Load ./gtm-brief.yaml (or have the user paste it, or run blitz-gtm-brainstorm first). Then work the steps below and output one runnable script plus .env.
scripts/ and references/ paths below are relative to this skill's own directory — run the helpers from there (e.g. bash <skill-dir>/scripts/detect_pm.sh), not the user's project root.
Workflow
- Load the brief. Read
./gtm-brief.yamlif present; else ask the user to paste it; else reconstruct the minimum by a short interview (endpoint, filters, enrichment, output, language). Schema:../blitz-gtm-brainstorm/references/gtm-brief-schema.md.
- Check enum validation (for any enums the brief uses). If the brief uses categorical enums and
enums_verifiedis nottrue, stop and send the user toblitz-gtm-brainstorm(or validate now via itsscripts/pull_enums.sh) — a typo'd case-sensitive enum runs clean and returns nothing. A keyword-only brief needs no gate. (A low but non-zero count instead usually means a lossy enum is filtering to tagged-only records — prefer the keyword backbone:../blitz-gtm-brainstorm/references/strategy.md.)
- Detect the package manager.
bash scripts/detect_pm.sh <python|typescript|javascript>→ Python:uv→poetry→pip(+venv). JS/TS:bun→pnpm→yarn→npm. Theruncommand honors the brief'slanguage:typescriptruns via bun/tsx (script.ts),javascriptruns via bun/node (script.mjs). Pass the brief'slanguagethrough — don't force TS on a JS brief.
- Install and verify the SDK. Install (
uv add blitz-api-py/bun add blitz-api-js/ pip / npm), thenbash scripts/verify_sdk.sh <python|typescript|javascript>. If install or import fails, show the exact error and the install command and stop — do NOT fall back to raw HTTP. A failed install is the signal to fix the environment, not to hand-roll the client.
- Generate the script from references/script-templates.md in the brief's
language—python(script.py),typescript(script.ts), orjavascript(script.mjs, the same template with the type annotations dropped). Respect the user's choice; don't emit TypeScript for ajavascriptbrief. segments, collect all pages per segment, union, and dedupe by `output.dedupe_key`. Map the brief's filters straight into the SDK call. Method surface and client config: references/sdk-reference.md.volume.exceeds_ceiling: false→ single-population template (SDK auto-paginates).volume.exceeds_ceiling: true→ partitioned template: loop thepartition_plan
- Safety and errors. Read the key from
BLITZ_API_KEY(.env; add.envto.gitignore). Add a/v2/account/key-infopreflight, and handlefound == false, empty results, and the US-only phone caveat. See references/error-handling.md.
- Tell the user how to run it — Python:
uv run script.py; TypeScript:bun run script.ts(ornpx tsx script.tswithout bun); JavaScript:bun run script.mjs(ornode script.mjs). And which env vars to set (BLITZ_API_KEY).
Rules
- Enforce the SDK. Never generate raw
fetch/requests. If the SDK cannot install, stop with a clear, actionable error. - Never hardcode the API key; never commit
.env. - Phone enrichment is US-only — guard non-US contacts before calling it.
- Honor the brief: if
exceeds_ceilingis true, the partitioned template is mandatory. - Honor the brief's
language. Ajavascriptbrief gets runnable JS (script.mjs, run withnode/bun) — don't force TypeScript or a TS runtime on it.
