$npx -y skills add inngest/inngest-skills --skill inngest-brownfield-auditUse when analyzing an existing TypeScript or JavaScript codebase to decide where and how to introduce Inngest. Covers repository discovery, framework and package detection, finding durability gaps in HTTP handlers, webhooks, cron jobs, queues, long-running jobs, AI agents, Agent
| 1 | # Inngest Brownfield Audit |
| 2 | |
| 3 | Use this skill when asked to inspect an existing codebase, add |
| 4 | Inngest "where it makes sense", migrate fragile background work, or find |
| 5 | durability gaps before making changes. |
| 6 | |
| 7 | This is an agent-first workflow. Do the audit from evidence in the repo, name |
| 8 | the specific files and call sites that drove each conclusion, and make small |
| 9 | integration moves that preserve current behavior. |
| 10 | |
| 11 | ## When to Trigger |
| 12 | |
| 13 | Use this skill for requests like: |
| 14 | |
| 15 | - "Audit this repo for Inngest opportunities" |
| 16 | - "Add Inngest to this codebase" |
| 17 | - "Make our webhooks / cron jobs / background tasks reliable" |
| 18 | - "Find places where work can be lost on deploy or process crash" |
| 19 | - "Replace fragile polling, delayed jobs, or fire-and-forget promises" |
| 20 | - "Make this AI workflow / agent durable" |
| 21 | |
| 22 | If the user is starting from scratch instead of a brownfield repo, use |
| 23 | `inngest-setup`, `inngest-durable-functions`, `inngest-events`, |
| 24 | `inngest-steps`, and, for AI workflows, the agent patterns in this skill. Use |
| 25 | `inngest-agent-evals` when the request includes scoring, sessions, experiments, |
| 26 | deferred scorers, Insights, or outcome-based evaluation. |
| 27 | |
| 28 | ## Audit Loop |
| 29 | |
| 30 | 1. **Map the project shape.** |
| 31 | - Read `package.json`, workspace files, app/router structure, server entry |
| 32 | points, deployment config, and test scripts. |
| 33 | - Identify framework: Next.js App Router, Next.js Pages Router, Express, |
| 34 | Hono, Fastify, Remix, SvelteKit, Astro, NestJS, worker-only service, or |
| 35 | other. |
| 36 | - Detect package manager and TypeScript conventions before adding files. |
| 37 | |
| 38 | 2. **Find existing Inngest usage.** |
| 39 | - Search for `inngest`, `createFunction`, `serve(`, `/api/inngest`, |
| 40 | `INNGEST_`, `step.run`, `step.sleep`, `step.waitForEvent`, |
| 41 | `step.sendEvent`, `step.invoke`, `step.ai`, `inngest.send`, and |
| 42 | `@inngest/realtime`. |
| 43 | - If Inngest exists, inspect version, client config, serve endpoint, |
| 44 | registered functions, event naming, env vars, and v3/v4 API shape before |
| 45 | changing anything. |
| 46 | |
| 47 | 3. **Find durability gaps.** |
| 48 | - Search for fire-and-forget work: `void someAsync()`, un-awaited promises, |
| 49 | `.then(` chains, `setTimeout`, `setInterval`, detached jobs after HTTP |
| 50 | response, and background work in route handlers. |
| 51 | - Search for cron and schedulers: `cron`, `node-cron`, `agenda`, `bull`, |
| 52 | `bullmq`, `bee-queue`, `qstash`, `sqs`, `temporal`, `trigger.dev`, |
| 53 | deployment cron config, and scheduled API routes. |
| 54 | - Search for webhooks and at-least-once producers: Stripe, Clerk, GitHub, |
| 55 | Slack, Shopify, HubSpot, Linear, Svix, and generic `webhook`. |
| 56 | - Search for long-running work: PDF generation, exports, video/image |
| 57 | processing, embeddings, bulk email, imports, ETL, sync jobs, polling loops, |
| 58 | retries, and external API calls. |
| 59 | - Search for AI agent shapes: tool loops, LLM calls, streaming tokens, |
| 60 | human approval, multi-step reasoning, vector search, eval loops, scoring, |
| 61 | experiment assignment, user-feedback signals, and provider calls that need |
| 62 | rate limits or retry-safe state. |
| 63 | |
| 64 | 4. **Classify each candidate.** |
| 65 | - **P0:** user-visible loss, duplicate charge/email/action, timeout, missed |
| 66 | webhook, or crash-prone workflow. |
| 67 | - **P1:** fragile but recoverable background work, manual retry burden, |
| 68 | noisy 429s, or poor observability. |
| 69 | - **P2:** cleanup, ergonomics, or future migration opportunity. |
| 70 | - For each candidate, record: file, current trigger, side effects, |
| 71 | idempotency key, failure mode, recommended Inngest primitive, migration |
| 72 | size, and confidence. |
| 73 | |
| 74 | 5. **Choose the smallest safe integration.** |
| 75 | - Prefer one vertical slice over a wide rewrite. |
| 76 | - Keep existing domain functions and data models where possible. |
| 77 | - Add an Inngest client and serve endpoint only once. |
| 78 | - Move side effects into `step.run` one boundary at a time. |
| 79 | - Make event IDs and database writes idempotent before adding retries. |
| 80 | - Add tests around existing behavior and the new event/function boundary. |
| 81 | |
| 82 | ## Useful Discovery Commands |
| 83 | |
| 84 | Run commands that fit the repo. Prefer `rg`; keep output focused. |
| 85 | |
| 86 | ```bash |
| 87 | rg -n "inngest|createFunction|step\\.|serve\\(|/api/inngest|INNGEST_" . |
| 88 | rg -n "setTimeout|setInterval|Promise\\.all|void [a-zA-Z0-9_]+\\(|\\.then\\(" . |
| 89 | rg -n "cron|node-cron|schedule|bull|bullmq|bee-queue|agenda|qstash|sqs" . |
| 90 | rg -n "webhook|stripe|svix|clerk|github|shopify|slack|hubspot|linear" . |
| 91 | rg -n "retry|backoff|poll|status|timeout|429|rate limit|rate-limit" . |
| 92 | rg -n "openai|anthropic|ai\\.|generateText|streamText|tool|agent|embedding" . |
| 93 | ``` |