
Micro
Work safely in legacy Vercel micro HTTP handlers and migrate toward modern Web Request/Response route handlers via vercel-functions.
Overview
Micro is an agent skill most often used in Build (also Ship review) that documents the Vercel micro HTTP framework and steers legacy send(res) code toward modern route handlers via vercel-functions.
Install
npx skills add https://github.com/vercel-labs/vercel-plugin --skill microWhat is this skill?
- Expert guidance for Vercel micro async HTTP microservices and lightweight API endpoints
- Detects legacy `from 'micro'` and `send(res, …)` via validate rules with recommended severity
- Chains upgrades to vercel-functions skill for Web Request/Response route handlers
- Retrieval aliases: microservice, http server, lightweight api, async handler
- Skips upgrade nags when files already export GET/POST handlers or use Response.json
- Validate rule with recommended severity for legacy micro imports and send(res) usage
- Explicit chainTo vercel-functions when legacy micro pattern is detected
Adoption & trust: 25 installs on skills.sh; 187 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your repo still uses micro and send(res, status, data) but you need guidance on lightweight APIs and a clear path to Vercel's current Web Request/Response handlers.
Who is it for?
Maintainers of small Node APIs on micro who want agent-aware linting and a scripted mental model for Vercel serverless migration.
Skip if: Greenfield Next.js App Router projects that already use only route handlers, or teams standardized on Express/Fastify without micro in the tree.
When should I use this skill?
Building lightweight HTTP servers, API endpoints, or microservices with the micro library; intents include create microservice, build http server, set up api endpoint, use micro.
What do I get? / Deliverables
Handlers follow micro best practices where retained, and detected legacy patterns get a documented upgrade chain to vercel-functions with Response.json-style exports.
- Micro-style route handlers or documented migration notes toward Response.json handlers
- Validation findings listing legacy micro patterns and vercel-functions upgrade path
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Micro is primarily a Build backend concern when maintaining or spotting legacy APIs, with carryover into Ship when validation flags outdated patterns before deploy. Backend subphase covers async micro handlers, `send(res, …)` style endpoints, and the recommended upgrade path to `Response.json` route handlers.
Where it fits
Extend an existing micro handler for a new JSON endpoint without breaking async conventions.
Run validation before deploy to flag send(res) and chain the agent to vercel-functions for modernization.
How it compares
Legacy micro framework skill with validation—not the same as vercel-functions; invoke vercel-functions when validate or chainTo fires on micro imports.
Common Questions / FAQ
Who is micro for?
Solo and indie backend developers on Vercel maintaining micro-based HTTP services or auditing older serverless code for deprecated response patterns.
When should I use micro?
In Build when adding micro endpoints or imports; in Ship when reviewing APIs before deploy and you need validate rules that recommend vercel-functions for send(res) legacy code.
Is micro safe to install?
Review the Security Audits panel on this Prism page; the skill reads project files and may suggest refactors—no substitute for your own dependency and deploy review.
Workflow Chain
Then invoke: vercel functions
SKILL.md
READMESKILL.md - Micro
# micro — Asynchronous HTTP Microservices You are an expert in micro, Vercel's lightweight framework for building asynchronous HTTP microservices in Node.js. micro makes it easy to write single-purpose HTTP endpoints with minimal boilerplate. ## Installation ```bash npm install micro ``` ## Basic Usage Create a module that exports a request handler: ```ts // index.ts import { serve } from 'micro' const handler = (req: Request) => { return new Response('Hello, World!') } serve(handler) ``` Or use the classic API: ```ts import { IncomingMessage, ServerResponse } from 'http' export default (req: IncomingMessage, res: ServerResponse) => { res.end('Hello, World!') } ``` Run with: ```bash npx micro ``` ## Core API ### `json(req)` — Parse JSON Body ```ts import { json } from 'micro' export default async (req: IncomingMessage, res: ServerResponse) => { const body = await json(req) return { received: body } } ``` ### `text(req)` — Parse Text Body ```ts import { text } from 'micro' export default async (req: IncomingMessage, res: ServerResponse) => { const body = await text(req) return `You said: ${body}` } ``` ### `buffer(req)` — Parse Raw Body ```ts import { buffer } from 'micro' export default async (req: IncomingMessage, res: ServerResponse) => { const raw = await buffer(req) return `Received ${raw.length} bytes` } ``` ### `send(res, statusCode, data)` — Send Response ```ts import { send } from 'micro' export default (req: IncomingMessage, res: ServerResponse) => { send(res, 200, { status: 'ok' }) } ``` ### `createError(statusCode, message)` — HTTP Errors ```ts import { createError } from 'micro' export default (req: IncomingMessage, res: ServerResponse) => { if (!req.headers.authorization) { throw createError(401, 'Unauthorized') } return { authorized: true } } ``` ## Development with micro-dev `micro-dev` provides hot-reloading for development: ```bash npm install --save-dev micro-dev # Run in dev mode npx micro-dev index.js ``` ## Composition Chain multiple handlers with function composition: ```ts import { IncomingMessage, ServerResponse } from 'http' const cors = (fn: Function) => async (req: IncomingMessage, res: ServerResponse) => { res.setHeader('Access-Control-Allow-Origin', '*') return fn(req, res) } const handler = async (req: IncomingMessage, res: ServerResponse) => { return { hello: