val-town
Write and deploy server-side TypeScript functions instantly with Val Town. Use when someone asks to "deploy a function quickly", "serverless TypeScript", "quick API endpoint", "webhook handler", "cron job in the cloud", "Val Town", "instant API without infrastructure", or "deploy a script without a server". Covers HTTP vals, cron vals, email vals, SQLite storage, and the Val Town API.
What this skill does
# Val Town
## Overview
Val Town is a platform for writing and deploying TypeScript functions instantly — no infrastructure, no build step, no deployment pipeline. Write a function in the browser, get a URL. HTTP endpoints, cron jobs, email handlers, and persistent SQLite storage. Think "GitHub Gists that run."
## When to Use
- Need a quick API endpoint or webhook handler (minutes, not hours)
- Scheduled tasks (cron) without managing servers
- Prototyping an idea before building proper infrastructure
- Webhook receivers for Stripe, GitHub, Slack integrations
- Glue code between services (fetch from API A, transform, POST to API B)
- Storing small amounts of data with built-in SQLite
## Instructions
### HTTP Val (API Endpoint)
```typescript
// @user/myApi — Deployed instantly at https://user-myapi.web.val.run
export default async function(req: Request): Promise<Response> {
const url = new URL(req.url);
if (req.method === "GET") {
const name = url.searchParams.get("name") || "World";
return Response.json({ message: `Hello, ${name}!` });
}
if (req.method === "POST") {
const body = await req.json();
// Process the data
return Response.json({ received: body, timestamp: Date.now() });
}
return new Response("Method not allowed", { status: 405 });
}
```
### Cron Val (Scheduled Task)
```typescript
// @user/dailyReport — Runs on a schedule
export default async function() {
// Fetch data from an API
const response = await fetch("https://api.example.com/stats");
const stats = await response.json();
// Send to Slack
await fetch(Deno.env.get("SLACK_WEBHOOK")!, {
method: "POST",
body: JSON.stringify({
text: `📊 Daily Report: ${stats.users} users, ${stats.revenue} revenue`,
}),
});
}
```
### SQLite Storage
```typescript
// @user/todoApi — CRUD API with persistent SQLite storage
import { sqlite } from "https://esm.town/v/std/sqlite";
// Initialize table
await sqlite.execute(`
CREATE TABLE IF NOT EXISTS todos (
id INTEGER PRIMARY KEY AUTOINCREMENT,
title TEXT NOT NULL,
done BOOLEAN DEFAULT FALSE,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
)
`);
export default async function(req: Request): Promise<Response> {
const url = new URL(req.url);
if (req.method === "GET") {
const todos = await sqlite.execute("SELECT * FROM todos ORDER BY created_at DESC");
return Response.json(todos.rows);
}
if (req.method === "POST") {
const { title } = await req.json();
await sqlite.execute("INSERT INTO todos (title) VALUES (?)", [title]);
return Response.json({ ok: true }, { status: 201 });
}
if (req.method === "DELETE") {
const id = url.searchParams.get("id");
await sqlite.execute("DELETE FROM todos WHERE id = ?", [id]);
return Response.json({ ok: true });
}
return new Response("Not found", { status: 404 });
}
```
### Webhook Handler
```typescript
// @user/stripeWebhook — Handle Stripe webhooks
export default async function(req: Request): Promise<Response> {
const signature = req.headers.get("stripe-signature");
const body = await req.text();
// Verify webhook signature
// In Val Town, use Deno.env.get() for secrets
const secret = Deno.env.get("STRIPE_WEBHOOK_SECRET");
const event = JSON.parse(body);
switch (event.type) {
case "checkout.session.completed":
// Handle successful payment
await fetch("https://api.myapp.com/activate", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ customerId: event.data.object.customer }),
});
break;
case "customer.subscription.deleted":
// Handle cancellation
break;
}
return Response.json({ received: true });
}
```
## Examples
### Example 1: Quick monitoring endpoint
**User prompt:** "I need a quick URL that checks if my website is up and returns the status."
The agent will create an HTTP val that fetches the target URL, measures response time, and returns a JSON status report.
### Example 2: GitHub webhook to Slack
**User prompt:** "When someone stars my GitHub repo, send a message to my Slack channel."
The agent will create an HTTP val that handles GitHub webhook events, filters for star events, and posts to a Slack webhook URL.
## Guidelines
- **HTTP vals are standard Web API** — `Request` in, `Response` out
- **Environment variables via `Deno.env.get()`** — store secrets in Val Town settings
- **SQLite is per-account** — shared across all your vals, persistent
- **Free tier: 10 vals, 100 cron runs/day** — enough for prototyping
- **Import from URLs** — `import { x } from "https://esm.town/v/user/module"`
- **Deno runtime** — use Deno APIs, npm packages via `npm:package` specifier
- **No cold starts** — vals are always warm, sub-50ms response times
- **Use for glue code** — connect APIs, transform data, automate workflows
- **Not for production traffic** — great for webhooks, cron, prototypes; use proper infra for high-traffic APIs
Related 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.