在 Manus 中运行任何 Skill
一键导入
一键导入
一键在 Manus 中运行任何 Skill
开始使用cloudflare
星标7
分支0
更新时间2026年1月22日 12:07
Use this when asked to make a cloudflare worker
安装
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
SKILL.md
readonly菜单
Use this when asked to make a cloudflare worker
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | cloudflare |
| title | Cloudflare |
| description | Use this when asked to make a cloudflare worker |
Its your task to create a Cloudflare Worker for the user. Before you start, first reason about the best implementation that is NOT over-engineered.
/// <reference types="@cloudflare/workers-types" />
import { DurableObject } from "cloudflare:workers";
export interface Env {
MYOBJECT: DurableObjectNamespace<MYOBJECT>;
}
export default {
async fetch(
request: Request,
env: Env,
ctx: ExecutionContext,
): Promise<Response> {
// your implementation
return new Response("Hi");
},
} satisfies ExportedHandler<Env>;
// your DO implementation should have this as a minimum
export class MYOBJECT extends DurableObject<Env> {
get = (name: string) =>
this.env.MYOBJECT.get(this.env.MYOBJECT.idFromName(name));
constructor(state: DurableObjectState, env: Env) {
super(state, env);
this.sql = state.storage.sql;
this.env = env;
}
}
// other functionality below
Template wrangler.jsonc (only deviate from this when needed):
{
"$schema": "https://unpkg.com/wrangler@latest/config-schema.json",
"name": "descriptive-do-name",
"main": "worker.ts",
"compatibility_date": "2025-07-14",
"assets": { "directory": "./public" },
"observability": { "logs": { "enabled": true } },
"durable_objects": {
// Use same binding as class name.
"bindings": [{ "name": "MyDO", "class_name": "MyDO" }],
},
// only specify routes if specifically requested. only 'custom_domain's are supported
"routes": [{ "pattern": "userrequesteddomain.com", "custom_domain": true }],
// DO migrations always need 'new_sqlite_classes', never use 'new_classes'
"migrations": [{ "tag": "v1", "new_sqlite_classes": ["MyDO"] }],
// never use kv namespaces or other bindings unless the ID is provided by user
}
state.storage.sql looks like:type SqlStorageValue = ArrayBuffer | string | number | null;
interface SqlStorage {
exec<T extends Record<string, SqlStorageValue>>(
query: string,
...bindings: any[]
): {
columnNames: string[];
raw<U extends SqlStorageValue[]>(): IterableIterator<U>;
toArray(): T[];
get rowsRead(): number;
get rowsWritten(): number;
};
/** size in bytes */
get databaseSize(): number;
}
wrangler.jsonc..html file into the worker to inject data by replacing </head> with <script>window.data = ${JSON.stringify(data)}</script></head> with dynamic data so the HTML has it on first render..dev.vars file,, or wrangler.toml