vtex-io-service-runtime

Compose VTEX IO Node services with typed handlers and service.json runtime configuration.

Updated Mar 27, 2026
One-click install
npx skills add https://github.com/exilonX/ap2 --skill vtex-io-service-runtime-exilonx
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vtex-io-service-runtime
Source: https://github.com/exilonX/ap2/tree/main/.agents/skills/vtex-io-service-runtime
Command: npx skills add https://github.com/exilonX/ap2 --skill vtex-io-service-runtime-exilonx

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves confusion and runtime failures in VTEX IO backend apps caused by mixing business logic into the Service entrypoint and by leaving execution settings (timeout, memory, replicas, rate limits) unclear or incorrectly configured.

Core Features & Use Cases

  • Runtime composition for Node builder services: Define node/index.ts as the composition root that wires clients and registers runtime surfaces (routes, events, GraphQL handlers).
  • Typed Context and State contracts: Establish consistent, type-safe contracts so middleware and handlers can safely share ctx.state, ctx.vtex, and params without falling back to any.
  • Explicit platform execution configuration: Put runtime knobs in service.json (timeouts, ttl, workers, replicas, rate limiting) and ensure route/event exposure is intentionally declared (including public and smartcache where appropriate).
  • Use Case: When your service intermittently times out or scales poorly, restructure the entrypoint and move execution behavior into service.json, then re-check that routes and event handlers are registered through the runtime layer with matching typed contracts.

Quick Start

Use the vtex-io-service-runtime skill to design your node/index.ts runtime composition and generate an explicit service.json contract for routes, events, and execution sizing for a VTEX IO backend app.

Frequently Asked Questions about vtex-io-service-runtime

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a VTEX IO Node service to prevent runtime failures?

Structure VTEX IO Node services by using `node/index.ts` as the composition root to wire clients and register runtime surfaces like routes and events. Keep business logic out of the entrypoint and move execution behavior into `service.json`.

What is the service.json contract used for in VTEX IO runtime?

The `service.json` contract in VTEX IO defines explicit platform execution configuration. It sets runtime knobs for timeouts, ttl, workers, replicas, rate limiting, and intentionally declares route or event exposure including `public` and `smartcache` settings.

How do I configure scaling and timeouts for a VTEX IO backend app?

Configure VTEX IO backend app scaling and timeouts by defining explicit execution settings in `service.json`. Adjust runtime knobs for memory, replicas, workers, and rate limiting to resolve intermittent execution-model failures and poor scaling behavior.

How do I set up typed Context and State contracts for VTEX IO event handlers?

Set up typed Context and State contracts for VTEX IO handlers by establishing type-safe contracts so middleware and handlers share `ctx.state`, `ctx.vtex`, and params safely. This avoids falling back to `any` when composing routes, events, and GraphQL handlers.

Why does my VTEX IO node service intermittently time out or scale poorly?

VTEX IO node services intermittently time out or scale poorly when business logic mixes into the Service entrypoint and execution settings remain unclear. Restructure the entrypoint, move execution behavior into `service.json`, and verify routes are registered through the runtime layer.

Can I use GraphQL handlers with typed Context in a VTEX IO runtime service?

Yes, you can compose GraphQL handlers with typed Context in a VTEX IO runtime service. Register GraphQL handlers through the runtime composition layer in `node/index.ts` while using type-safe contracts for `ctx.state` and `ctx.vtex` to ensure safe parameter sharing.