vtex-io-http-routes
Apply when designing or implementing HTTP endpoints exposed by a VTEX IO backend service. Covers route boundaries, handler structure, middleware composition, request validation, and response modeling for service.json routes. Use for webhook endpoints, partner integrations, callback APIs, or reviewing VTEX IO handlers that should expose explicit HTTP contracts.
What this skill does
# HTTP Routes & Handler Boundaries
## When this skill applies
Use this skill when a VTEX IO service needs to expose explicit HTTP endpoints through `service.json` routes and implement the corresponding handlers under `node/`.
- Building callback or webhook endpoints
- Exposing integration endpoints for partners or backoffice flows
- Structuring route handlers and middleware chains
- Validating params, query strings, headers, or request bodies
- Standardizing response shape and status code behavior
Do not use this skill for:
- sizing or tuning the service runtime
- deciding app policies in `manifest.json`
- designing GraphQL APIs
- modeling async event or worker flows
## Decision rules
- Use HTTP routes when the integration needs explicit URL contracts, webhooks, or callback-style request-response behavior.
- In VTEX IO, `service.json` declares route IDs, paths, and exposure such as `public`, while the Node entrypoint wires those route IDs to handlers exported from `node/routes`. Middlewares are composed in code, not declared directly in `service.json`.
- Keep route handlers small and explicit. Route code should validate input, call domain or integration services, and shape the response.
- Put cross-cutting concerns such as validation, request normalization, or shared auth checks into middlewares instead of duplicating them across handlers.
- Define route params, query expectations, and body shape as close as possible to the handler boundary.
- Use consistent status codes and response structures for similar route families.
- For webhook or callback endpoints, follow the caller's documented expectations for status codes and error bodies, and keep responses small and deterministic to avoid ambiguous retries.
- Emit structured logs or metrics for critical routes so failures, latency, and integration health can be diagnosed without changing the handler contract.
- Prefer explicit route files grouped by bounded domain such as `routes/orders.ts` or `routes/catalog.ts`.
- Treat public routes as explicit external contracts. Do not expand a route to public use without reviewing validation, auth expectations, and response safety.
## Hard constraints
### Constraint: Route handlers must keep the HTTP contract explicit
Each route handler MUST make the request and response contract understandable at the handler boundary. Do not hide required params, body fields, or status code decisions deep inside unrelated services.
**Why this matters**
HTTP integrations depend on predictable contracts. When validation and response shaping are implicit or scattered, partner integrations become fragile and errors become harder to diagnose.
**Detection**
If the handler delegates immediately without validating required params, query values, headers, or request body shape, STOP and make the contract explicit before proceeding.
**Correct**
```typescript
export async function getOrder(ctx: Context, next: () => Promise<void>) {
const { id } = ctx.vtex.route.params
if (!id) {
ctx.status = 400
ctx.body = { message: 'Missing route param: id' }
return
}
const order = await ctx.clients.partnerApi.getOrder(id)
ctx.status = 200
ctx.body = order
await next()
}
```
**Wrong**
```typescript
export async function getOrder(ctx: Context) {
ctx.body = await handleOrder(ctx)
}
```
### Constraint: Shared route concerns must live in middlewares, not repeated in every handler
Repeated concerns such as validation, request normalization, or common auth checks SHOULD be implemented as middlewares and composed through the route chain.
**Why this matters**
Duplicating the same checks in many handlers creates drift and inconsistent route behavior. Middleware keeps the HTTP surface easier to review and evolve.
**Detection**
If multiple handlers repeat the same body validation, header checks, or context preparation, STOP and extract a middleware before adding more duplication.
**Correct**
```typescript
export async function validateSignature(ctx: Context, next: () => Promise<void>) {
const signature = ctx.request.header['x-signature']
if (!signature) {
ctx.status = 401
ctx.body = { message: 'Missing signature' }
return
}
await next()
}
```
**Wrong**
```typescript
export async function routeA(ctx: Context) {
if (!ctx.request.header['x-signature']) {
ctx.status = 401
return
}
}
export async function routeB(ctx: Context) {
if (!ctx.request.header['x-signature']) {
ctx.status = 401
return
}
}
```
### Constraint: HTTP routes should not absorb async or batch work that belongs in events or workers
Routes MUST keep request-response latency bounded. If a route triggers expensive, retry-prone, or batch-oriented work, move that work to an async flow and keep the route as a thin trigger or acknowledgment boundary.
**Why this matters**
Long-running HTTP handlers create poor integration behavior, timeout risk, and operational instability. VTEX IO services should separate immediate route contracts from background processing.
**Detection**
If a route performs large loops, batch imports, heavy retries, or work that is not required to complete before responding, STOP and redesign the flow around async processing.
**Correct**
```typescript
export async function triggerImport(ctx: Context) {
await ctx.clients.importApi.enqueueImport(ctx.request.body)
ctx.status = 202
ctx.body = { accepted: true }
}
```
**Wrong**
```typescript
export async function triggerImport(ctx: Context) {
for (const item of ctx.request.body.items) {
await ctx.clients.importApi.importItem(item)
}
ctx.status = 200
}
```
## Preferred pattern
Recommended file layout:
```text
node/
├── routes/
│ ├── index.ts
│ ├── orders.ts
│ └── webhooks.ts
└── middlewares/
├── validateBody.ts
└── validateSignature.ts
```
Wiring routes in VTEX IO services:
In VTEX IO, `service.json` declares route IDs and paths, the Node entrypoint registers a `routes` object in `new Service(...)`, and `node/routes/index.ts` maps each route ID to the final handler. Middlewares are composed in code, not declared directly in `service.json`.
```json
{
"routes": {
"orders-get": {
"path": "/_v/orders/:id",
"public": false
},
"reviews-create": {
"path": "/_v/reviews",
"public": false
}
}
}
```
```typescript
// node/index.ts
import type { ClientsConfig, RecorderState, ServiceContext } from '@vtex/api'
import { Service } from '@vtex/api'
import { Clients } from './clients'
import routes from './routes'
const clients: ClientsConfig<Clients> = {
implementation: Clients,
options: {
default: {
retries: 2,
timeout: 800,
},
},
}
declare global {
type Context = ServiceContext<Clients, RecorderState>
}
export default new Service<Clients, RecorderState>({
clients,
routes,
})
```
Minimal route pattern:
```typescript
// node/routes/index.ts
import type { RouteHandler } from '@vtex/api'
import { createReview } from './reviews'
import { getOrder } from './orders'
const routes: Record<string, RouteHandler> = {
'orders-get': getOrder,
'reviews-create': createReview,
}
export default routes
```
```typescript
// node/routes/orders.ts
import { compose } from 'koa-compose'
import { validateSignature } from '../middlewares/validateSignature'
async function rawGetOrder(ctx: Context, next: () => Promise<void>) {
const { id } = ctx.vtex.route.params
if (!id) {
ctx.status = 400
ctx.body = { message: 'Missing route param: id' }
return
}
const order = await ctx.clients.partnerApi.getOrder(id)
ctx.status = 200
ctx.body = order
await next()
}
export const getOrder = compose([validateSignature, rawGetOrder])
```
```typescript
export async function createReview(ctx: Context, next: () => Promise<void>) {
const body = ctx.request.body
if (!body?.productId) {
ctx.status = 400
ctx.body = { message: 'Missing productId' }
return
}
const review = awaiRelated 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.