.agents/skills/add-hub-template/SKILL.md
Create a new sandbox hub template (a pre-configured micro VM environment). Use when adding support for a new language, framework, or toolchain as a reusable sandbox image.
npx skillsauth add blaxel-ai/sandbox add-hub-templateInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Hub templates are pre-built sandbox images stored in hub/<template-name>/. Each template is a Docker image with a sandbox-api binary pre-installed and a configured entrypoint.
mkdir hub/<template-name>
Convention: use lowercase kebab-case (e.g., ruby-app, go-app, playwright-firefox).
Create hub/<template-name>/Dockerfile. The Dockerfile must:
sandbox-api binary (or build it from source)8080 for the sandbox-apisandbox-apiMinimal example (adapts the base-image pattern):
FROM ubuntu:22.04
# Install runtime dependencies
RUN apt-get update && apt-get install -y \
curl \
<your-tools> \
&& rm -rf /var/lib/apt/lists/*
# Copy sandbox-api binary (built by the multi-stage or pre-built)
COPY sandbox-api/sandbox-api /usr/local/bin/sandbox-api
RUN chmod +x /usr/local/bin/sandbox-api
# Working directory for user code
WORKDIR /blaxel/app
EXPOSE 8080
ENTRYPOINT ["/usr/local/bin/sandbox-api"]
Look at existing templates for reference patterns:
hub/base-image/Dockerfile — minimal baselinehub/py-app/Dockerfile — Python with piphub/ts-app/Dockerfile — Node.js/TypeScripthub/expo/Dockerfile — Expo with entrypoint script that auto-starts a dev serverIf your template needs to auto-start a service on boot, create an entrypoint.sh script and call it before sandbox-api (see hub/expo/entrypoint.sh for an example using curl to POST to /process).
Create hub/<template-name>/template.json:
{
"name": "<template-name>",
"displayName": "<Human Readable Name>",
"categories": [],
"description": "Short one-line description",
"longDescription": "Longer description explaining use cases and what's included.",
"url": "https://link-to-upstream-project",
"icon": "https://url-to-icon-image.png",
"memory": 4096,
"ports": [
{
"name": "sandbox-api",
"target": 8080,
"protocol": "HTTP"
}
],
"enterprise": false,
"coming_soon": false
}
memory: RAM in MB (4096 = 4GB is standard; increase for heavy workloads)ports: List all ports the template exposes. Add extra entries for app ports (e.g., 3000 for a dev server)enterprise: Set true to restrict to enterprise workspacescoming_soon: Set true to show the template in the UI but disable creationAdd a service entry so you can test locally:
<template-name>:
platform: linux/amd64
build:
context: .
dockerfile: hub/<template-name>/Dockerfile
env_file:
- .env
ports:
- "8080:8080"
- "<app-port>:<app-port>" # add any extra ports
- "3010:3010"
# Build the image
docker-compose build <template-name>
# Start it
docker-compose up <template-name>
# Verify sandbox-api is running
curl http://localhost:8080/health
# Run a process inside it
curl -X POST http://localhost:8080/process \
-H "Content-Type: application/json" \
-d '{"command": "echo hello", "waitForCompletion": true}'
cd sandbox-api/integration-tests
API_HOST=localhost API_PORT=8080 ./run_tests.sh
hub/<template-name>/Dockerfile builds successfullyhub/<template-name>/template.json is valid JSON with all required fieldsdocker-compose.yamlcurl http://localhost:8080/health returns 200 OKREADME.md under the Templates sectiondevelopment
Regenerate the OpenAPI reference documentation after adding, modifying, or removing API endpoints in sandbox-api. Run this whenever handler signatures, route paths, or swag annotations change.
development
Run the sandbox-api integration tests against a live API instance. Use after making changes to sandbox-api to verify all endpoints still work correctly.
development
Run the full end-to-end test suite against a custom sandbox image deployed locally or on Blaxel. Use before merging significant changes to validate the complete sandbox-api binary, not just unit/integration tests.
testing
Deploy a Playwright sandbox (chromium or firefox) on Blaxel and run e2e tests against it. Use to validate that playwright hub images work end-to-end (browser connection, page navigation, DOM interaction) after changes.