Inngest brownfield audit

From Asymmetric-al/core · View interactive version

Inngest brownfield audit is an AI agent skill from the GitHub repository Asymmetric-al/core. Use 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 Evals, polling loops

How to use this skill

Skill file

Inngest Brownfield Audit

Use this skill when the user asks Codex to inspect an existing codebase, add

Inngest "where it makes sense", migrate fragile background work, or find

durability gaps before making changes.

This is an agent-first workflow. Do the audit from evidence in the repo, name

the specific files and call sites that drove each conclusion, and make small

integration moves that preserve current behavior.

When to Trigger

Use this skill for requests like:

If the user is starting from scratch instead of a brownfield repo, use

inngest-setup, inngest-durable-functions, inngest-events,

inngest-steps, and, for AI workflows, the agent patterns in this skill. Use

inngest-agent-evals when the request includes scoring, sessions, experiments,

deferred scorers, Insights, or outcome-based evaluation.

Audit Loop

  1. Map the project shape.

points, deployment config, and test scripts.

Hono, Fastify, Remix, SvelteKit, Astro, NestJS, worker-only service, or

other.

  1. Find existing Inngest usage.

INNGEST_, step.run, step.sleep, step.waitForEvent,

step.sendEvent, step.invoke, step.ai, inngest.send, and

@inngest/realtime.

registered functions, event naming, env vars, and v3/v4 API shape before

changing anything.

  1. Find durability gaps.

.then( chains, setTimeout, setInterval, detached jobs after HTTP

response, and background work in route handlers.

bullmq, bee-queue, qstash, sqs, temporal, trigger.dev,

deployment cron config, and scheduled API routes.

Slack, Shopify, HubSpot, Linear, Svix, and generic webhook.

processing, embeddings, bulk email, imports, ETL, sync jobs, polling loops,

retries, and external API calls.

human approval, multi-step reasoning, vector search, eval loops, scoring,

experiment assignment, user-feedback signals, and provider calls that need

rate limits or retry-safe state.

  1. Classify each candidate.

webhook, or crash-prone workflow.

noisy 429s, or poor observability.

idempotency key, failure mode, recommended Inngest primitive, migration

size, and confidence.

  1. Choose the smallest safe integration.

Useful Discovery Commands

Run commands that fit the repo. Prefer rg; keep output focused.

rg -n "inngest|createFunction|step\\.|serve\\(|/api/inngest|INNGEST_" .
rg -n "setTimeout|setInterval|Promise\\.all|void [a-zA-Z0-9_]+\\(|\\.then\\(" .
rg -n "cron|node-cron|schedule|bull|bullmq|bee-queue|agenda|qstash|sqs" .
rg -n "webhook|stripe|svix|clerk|github|shopify|slack|hubspot|linear" .
rg -n "retry|backoff|poll|status|timeout|429|rate limit|rate-limit" .
rg -n "openai|anthropic|ai\\.|generateText|streamText|tool|agent|embedding" .

When the repo is large, narrow searches to app source directories and exclude

generated/vendor folders.

Brownfield Decision Matrix

| Existing shape | Inngest fit | Primary primitives |

| ----------------------------------------------------- | --------------------------------------- | -------------------------------------------------------------------------- |

| HTTP handler does slow side effects before responding | Emit event, return fast | inngest.send, event trigger, step.run |

| Webhook must acknowledge quickly but process reliably | Verify signature, emit idempotent event | Event ID, step.run, retries |

| Cron job loses progress midway | Cron-triggered durable function | Cron trigger, page-level step.run, flow control |

| Polling loop waits for external async work | Durable wait or durable poll | step.waitForEvent, step.sleep, step.run |

| Large fan-out exceeds request/serverless limits | Split orchestration and item work | step.sendEvent, per-item function, concurrency |

| External API hits 429s | Move limits to function config | throttle, rateLimit, concurrency |

| Human review can take days | Persist the wait in Inngest | step.waitForEvent, timeout, realtime |

| AI agent/tool loop needs retry-safe progress | One step per tool/model boundary | step.ai, step.run, step.sleep, realtime |

| AI workflow needs production evals | Attach outcome signals to durable runs | meta.sessions, step.score, createScorer, defer, group.experiment |

| Existing queue only hides fragile work | Replace queue boundary gradually | Event trigger, idempotency, function-level retries |

Integration Plan Format

Before editing, summarize findings in this compact shape:

Inngest audit:
- Existing Inngest: none / partial / healthy / risky
- Framework: <framework and evidence>
- Best first slice: <file + workflow>
- Why: <loss/timeout/retry/idempotency failure>
- Proposed primitives: <event, steps, flow control, waits, realtime>
- Idempotency key: <source of truth>
- Files likely touched: <short list>
- Tests/checks: <commands or focused cases>

Then implement unless the user asked for audit-only.

Existing Inngest Checklist

If Inngest is already present, verify:

INNGEST_SIGNING_KEY.

@inngest/realtime package.

Durable Agent Patterns

Use Inngest when an AI or agent workflow needs durable progress across model

calls, tool calls, waits, approvals, or streaming UI updates.

Good candidates:

Recommended shape:

  1. HTTP/UI request stores the user intent and emits an event with a stable

id.

  1. Inngest function loads state inside step.run.
  2. Each model call, tool call, vector search, and external side effect lives in

its own step.ai or step.run boundary.

  1. Human pauses use step.waitForEvent or step.waitForSignal with a timeout.
  2. Progress updates use step.realtime.publish between steps, or

inngest.realtime.publish inside an existing step.run.

  1. Provider rate limits use concurrency, throttle, or rateLimit, not

ad hoc in-process throttlers.

Avoid:

memoized.

itself is durable elsewhere.

Implementation Guardrails

behavior with a thin Inngest slice.

them.

outside steps in the new function.

side effects.

endpoint and run available type/tests.

Verification

Pick checks that prove the integration path:

calls the same domain operations in step boundaries" where the repo supports

it.

the function syncs, then send a sample event.

not verified.

This Repository

These upstream Inngest instructions are vendored for agent tooling and

integration work in this monorepo.

Repository Triggers

Use this skill when inngest-brownfield-audit matches the current Inngest task. If the

right skill is unclear, start with docs/ai/skills/inngest/SKILL.md.

Repository Workflow

  1. Confirm whether the request is agent-tooling guidance or product runtime

integration.

  1. Use inngest-brownfield-audit before changing existing app workflows or

fragile background work.

  1. Follow this upstream guidance under OpenSpec, root AGENTS.md, repo

rulebooks, framework docs, and runtime evidence.

  1. Keep runtime packages, app code, migrations, and INNGEST_* env

requirements out of agent-tooling-only changes.

Repository Checklist

or dependencies.

workflow behavior.

port.

docs/ai/skills/inngest/references/upstream.md.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.