queue
Background job queue with Inngest — serverless, works on Vercel, no Redis needed. Durable functions with retry, progress tracking, and job history. Use this skill when the user says "add queue", "setup jobs", "background jobs", "add inngest", or "async tasks".
What this skill does
# Background Job Queue (Inngest)
Serverless background job queue using [Inngest](https://www.inngest.com). Jobs survive crashes, retry with exponential backoff, report progress, and persist history to Postgres. Works on Vercel — no Redis or worker processes needed.
## Prerequisites
- Next.js app with `src/` directory and App Router
- `db` skill applied (Drizzle + Postgres)
- `env-config` skill applied (Zod env validation)
- `auth` skill applied (for user context)
## Installation
```bash
bun add inngest
```
## Environment Variables
Add to `.env.local`:
```env
# Inngest
INNGEST_EVENT_KEY=local
INNGEST_SIGNING_KEY=local
```
Add to `src/env.ts` server schema:
```typescript
INNGEST_EVENT_KEY: z.string().default("local"),
INNGEST_SIGNING_KEY: z.string().default("local"),
```
## What Gets Created
```
src/
├── app/
│ └── api/
│ ├── inngest/
│ │ └── route.ts # Inngest serve endpoint
│ └── jobs/
│ ├── route.ts # GET list jobs, POST submit job
│ └── [id]/
│ └── route.ts # GET job status/result
└── lib/
├── db/
│ └── schema/
│ └── jobs.ts # Drizzle schema: jobs table
└── queue/
├── client.ts # Inngest client setup
├── types.ts # Job types and event schemas
└── functions/
└── example-job.ts # Example Inngest function
```
## Setup Steps
### Step 1: Create `src/lib/db/schema/jobs.ts`
```typescript
import { pgTable, text, integer, timestamp, jsonb, uuid } from "drizzle-orm/pg-core";
export const jobs = pgTable("jobs", {
id: uuid("id").primaryKey().defaultRandom(),
userId: text("user_id").notNull(),
type: text("type").notNull(),
status: text("status", {
enum: ["queued", "running", "completed", "failed"],
}).notNull().default("queued"),
progress: integer("progress").notNull().default(0),
input: jsonb("input"),
result: jsonb("result"),
error: text("error"),
inngestRunId: text("inngest_run_id"),
startedAt: timestamp("started_at", { withTimezone: true }),
completedAt: timestamp("completed_at", { withTimezone: true }),
createdAt: timestamp("created_at", { withTimezone: true }).defaultNow().notNull(),
updatedAt: timestamp("updated_at", { withTimezone: true }).defaultNow().notNull(),
});
export type Job = typeof jobs.$inferSelect;
export type NewJob = typeof jobs.$inferInsert;
```
### Step 2: Add export to `src/lib/db/schema/index.ts`
Find the existing exports in `src/lib/db/schema/index.ts` and add:
```typescript
export * from "./jobs";
```
### Step 3: Create `src/lib/queue/types.ts`
```typescript
type JobEventBase = {
data: {
jobId: string;
userId: string;
};
};
export type QueueEvents = {
"job/example": JobEventBase & {
data: JobEventBase["data"] & {
prompt: string;
};
};
};
```
### Step 4: Create `src/lib/queue/client.ts`
```typescript
import { Inngest } from "inngest";
export const inngest = new Inngest({
id: "my-app",
});
```
> **Note:** The Inngest client is intentionally untyped at the client level. Type safety is enforced per-function via `createFunction()` event triggers. This allows the generic `/api/jobs` route to send events for any job type without type conflicts.
### Step 5: Create `src/lib/queue/functions/example-job.ts`
```typescript
import { inngest } from "@/lib/queue/client";
import { db } from "@/lib/db";
import { jobs } from "@/lib/db/schema";
import { eq } from "drizzle-orm";
export const exampleJob = inngest.createFunction(
{
id: "example-job",
retries: 3,
},
{ event: "job/example" },
async ({ event, step }) => {
const { jobId, userId, prompt } = event.data;
// Mark as running
await step.run("mark-running", async () => {
await db
.update(jobs)
.set({
status: "running",
startedAt: new Date(),
updatedAt: new Date(),
})
.where(eq(jobs.id, jobId));
});
// Simulate work with progress updates
const result = await step.run("process", async () => {
// Update progress to 50%
await db
.update(jobs)
.set({ progress: 50, updatedAt: new Date() })
.where(eq(jobs.id, jobId));
// Do the actual work here
const output = { message: `Processed: ${prompt}`, timestamp: Date.now() };
// Update progress to 100%
await db
.update(jobs)
.set({ progress: 100, updatedAt: new Date() })
.where(eq(jobs.id, jobId));
return output;
});
// Mark as completed
await step.run("mark-completed", async () => {
await db
.update(jobs)
.set({
status: "completed",
result,
completedAt: new Date(),
updatedAt: new Date(),
})
.where(eq(jobs.id, jobId));
});
return result;
}
);
```
### Step 6: Create `src/app/api/inngest/route.ts`
```typescript
import { serve } from "inngest/next";
import { inngest } from "@/lib/queue/client";
import { exampleJob } from "@/lib/queue/functions/example-job";
export const { GET, POST, PUT } = serve({
client: inngest,
functions: [exampleJob],
});
```
### Step 7: Create `src/app/api/jobs/route.ts`
```typescript
import { NextResponse } from "next/server";
import { z } from "zod";
import { db } from "@/lib/db";
import { jobs } from "@/lib/db/schema";
import { eq, desc } from "drizzle-orm";
import { inngest } from "@/lib/queue/client";
import { auth } from "@/lib/auth";
import { headers } from "next/headers";
const submitSchema = z.object({
type: z.string(),
input: z.record(z.string(), z.unknown()).optional(),
});
export async function GET(request: Request) {
const session = await auth.api.getSession({
headers: await headers(),
});
if (!session?.user) {
return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
}
const userJobs = await db
.select()
.from(jobs)
.where(eq(jobs.userId, session.user.id))
.orderBy(desc(jobs.createdAt))
.limit(50);
return NextResponse.json(userJobs);
}
export async function POST(request: Request) {
const session = await auth.api.getSession({
headers: await headers(),
});
if (!session?.user) {
return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
}
const body = await request.json();
const { type, input } = submitSchema.parse(body);
// Create job record
const [job] = await db
.insert(jobs)
.values({
userId: session.user.id,
type,
input,
})
.returning();
// Send event to Inngest
await inngest.send({
name: `job/${type}`,
data: {
jobId: job.id,
userId: session.user.id,
...((input as Record<string, unknown>) ?? {}),
},
});
return NextResponse.json(job, { status: 201 });
}
```
### Step 8: Create `src/app/api/jobs/[id]/route.ts`
```typescript
import { NextResponse } from "next/server";
import { db } from "@/lib/db";
import { jobs } from "@/lib/db/schema";
import { eq, and } from "drizzle-orm";
import { auth } from "@/lib/auth";
import { headers } from "next/headers";
export async function GET(
_request: Request,
{ params }: { params: Promise<{ id: string }> }
) {
const session = await auth.api.getSession({
headers: await headers(),
});
if (!session?.user) {
return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
}
const { id } = await params;
const [job] = await db
.select()
.from(jobs)
.where(and(eq(jobs.id, id), eq(jobs.userId, session.user.id)))
.limit(1);
if (!job) {
return NextResponse.json({ error: "Job not found" }, { status: 404 });
}
return NextResponse.json(job);
}
```
### Step 9: Push database schema
```bash
bunx drizzle-kit push
```
## Usage
### Submit a job
```typescript
const response = await fetch("/api/jobs", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JRelated in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.