edgeone-makers-tools
EdgeOne Makers platform development router — the single entry point for building, storing data, and deploying on Tencent EdgeOne…
V8-based lightweight edge functions on EdgeOne Makers. Covers routing, KV storage access, request/response handling, and environment variables at the edge.
Claude Code
$ npx -y skills add tencentedgeone/edgeone-makers-tools --skill makers-edge-functions --agent claude-code
Codex
$ npx skills add tencentedgeone/edgeone-makers-tools --skill makers-edge-functions -a codex -y
Cursor
$ npx skills add tencentedgeone/edgeone-makers-tools --skill makers-edge-functions -a cursor -y
Gemini CLI
$ npx skills add tencentedgeone/edgeone-makers-tools --skill makers-edge-functions -a gemini-cli -y
GitHub Copilot
$ npx skills add tencentedgeone/edgeone-makers-tools --skill makers-edge-functions -a github-copilot -y
OpenCode
$ npx skills add tencentedgeone/edgeone-makers-tools --skill makers-edge-functions -a opencode -y
Windsurf
$ npx skills add tencentedgeone/edgeone-makers-tools --skill makers-edge-functions -a windsurf -y
name: edgeone-makers-edge-functions
description: >-
V8-based lightweight edge functions on EdgeOne Makers. Covers routing, KV storage access,
request/response handling, and environment variables at the edge.
pathPatterns:
- edge-functions/**
- functions/**
validate:
- pattern: "process\\.env"
message: "Use context.env in EdgeOne Makers runtime code."
- pattern: "new\\s+Headers\\s*\\("
message: "Use plain object headers for this runtime surface."
- pattern: "fs\\.writeFile"
message: "Edge Functions do not support filesystem writes."
- pattern: "Response\\.json\\s*\\("
message: "Response.json() is not available in this V8 runtime — use new Response(JSON.stringify(data), { headers: { 'Content-Type': 'application/json' } })."
metadata:
author: edgeone
version: "1.0.0"V8-based lightweight functions running at the edge. Ideal for simple APIs, KV storage access, and ultra-low latency responses.
> **Runtime:** V8 (like Cloudflare Workers) — NOT Node.js. Do NOT use Node.js built-ins or npm packages. > > ⚠️ `Response.json()` is **NOT available** in this V8 runtime. Always use `new Response(JSON.stringify(data), { headers: { 'Content-Type': 'application/json' } })` instead.
File: `edge-functions/api/hello.js`
export default function onRequest(context) {
return new Response('Hello from Edge Functions!');
}Access: `GET /api/hello`
// edge-functions/api/users.js
// Handle all methods
export function onRequest(context) {
return new Response('Any method');
}
// Or use specific method handlers:
export function onRequestGet(context) {
return new Response(JSON.stringify({ users: [] }), {
headers: { 'Content-Type': 'application/json' },
});
}
export async function onRequestPost(context) {
const body = await context.request.json();
return new Response(JSON.stringify({ created: true }), {
status: 201,
headers: { 'Content-Type': 'application/json' },
});
}export function onRequest(context) {
const {
request, // Standard Request object
params, // Dynamic route params, e.g. { id: "123" }
env, // Environment variables from Makers console
waitUntil, // Extend function lifetime for async tasks
} = context;
// GEO info available via:
const geo = context.request.eo;
// geo.geo.countryName, geo.geo.cityName, geo.geo.latitude, etc.
return new Response('OK');
}// edge-functions/api/users/[id].js
// Matches: /api/users/123, /api/users/abc
export function onRequestGet(context) {
const userId = context.params.id;
return new Response(JSON.stringify({ userId }), {
headers: { 'Content-Type': 'application/json' },
});
}// edge-functions/api/[[default]].js
// Catches all unmatched routes under /api/
export function onRequest(context) {
return new Response('Catch-all route', { status: 404 });
}> Cross-reference: if your code uses `context.store` or KV APIs, also read `../makers-storage/SKILL.md`.
⚠️ **Prerequisites**: You must enable KV Storage in the EdgeOne Makers console, create a namespace, and bind it to your project before using KV. See [../makers-storage/references/kv.md](../makers-storage/references/kv.md) for full setup instructions.
The KV namespace is a **global variable** (name is set when binding in the console) — it is **NOT** on `context.env`.
// edge-functions/api/counter.js
export async function onRequest(context) {
// ⚠️ my_kv is a GLOBAL variable (name set when binding namespace in console)
// Do NOT use context.env.KV ❌
// Read
const count = await my_kv.get('page_views') || '0';
const newCount = parseInt(count) + 1;
// Write
await my_kv.put('page_views', String(newCount));
return new Response(JSON.stringify({ views: newCount }), {
headers: { 'Content-Type': 'application/json' },
});
}For full KV Storage API reference and usage guide, see: [../makers-storage/references/kv.md](../makers-storage/references/kv.md).
Edge Functions run on V8 and support these Web Standard APIs:
⚠️ **NOT available**: Node.js built-ins (`fs`, `path`, `http`, `crypto` from Node), `require()`, npm packages.
| Resource | Limit | |----------|-------| | Code package size | 5 MB | | Request body | 1 MB | | CPU time per invocation | 200 ms | | Language | JavaScript (ES2023+) only |
Official AI Agent Skills for developing and deploying projects on EdgeOne Makers.
EdgeOne Makers platform development router — the single entry point for building, storing data, and deploying on Tencent EdgeOne…
This skill guides building AI agent endpoints on EdgeOne Makers — five framework routes (DeepAgents, LangGraph, CrewAI, OpenAI…
EdgeOne Makers CLI command reference. Use when running edgeone CLI commands for dev, build, deploy, env management.
EdgeOne Makers Cloud Functions — Node.js, Go, and Python runtimes. Use when building server-side APIs, Express/Koa patterns, or…
This skill deploys frontend and full-stack projects to EdgeOne Makers (Tencent EdgeOne). Trigger this skill whenever deployment…
Environment-specific adaptation rules for EdgeOne Makers Skills running in sandboxed or restricted AI coding environments (e.g.…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.