Cloudflare platform skills. Use skills in this domain when:
The 2nth.ai deployment substrate. All client applications and platform services run on Cloudflare's edge network.
| Service | Tier | Purpose | 2nth Usage |
|---|---|---|---|
| workers | Free/Paid | Edge compute (JS/TS) | API logic, agent runtimes |
| pages | Free | Static + Functions | Frontend deployments, skills catalog |
| d1 | Free/Paid | SQLite at the edge | Per-client databases |
| kv | Free/Paid | Key-value store | Sessions, feature flags, caching |
| r2 | Free/Paid | Object storage | Documents, assets, zero egress |
| durable-objects | Paid | Stateful compute | WebSockets, per-entity locks |
| queues | Paid | Reliable messaging | Async AI inference, webhook ingestion |
| workflows | Paid (beta) | Durable multi-step execution | AI pipeline orchestration |
| workers-ai | Free/Paid | Edge inference | Intent routing, embeddings |
| ai-gateway | Free/Paid | AI control plane | Token metering, caching, fallback |
| vectorize | Paid | Vector database | RAG for skill retrieval |
| hyperdrive | Paid | DB connection pooling | Client SOR (Postgres/MySQL) access |
| analytics-engine | Included | Time-series metrics | Token economy, billing reports |
| Free | Inbound/outbound email | Penny briefings, client intake | |
| tunnel | Free | Secure outbound connector | On-premise SOR access |
| workers-for-platforms | Paid | Multi-tenant Worker execution | Future: client plugin namespaces |
wrangler pages dev ./public # local dev (Pages)
wrangler dev # local dev (Worker)
wrangler pages deploy ./public # deploy Pages
wrangler deploy # deploy Worker
wrangler d1 execute DB --file=migrations/0001_initial.sql --local
wrangler d1 execute DB --file=migrations/0001_initial.sql --remote
wrangler secret put SECRET_NAME # set encrypted secret
name = "project-name"
compatibility_date = "2024-12-01"
compatibility_flags = ["nodejs_compat"]
[[d1_databases]]
binding = "DB"
database_name = "project-db"
database_id = "your-d1-id"
[[kv_namespaces]]
binding = "KV"
id = "your-kv-id"
[ai]
binding = "AI"
[[r2_buckets]]
binding = "R2"
bucket_name = "project-bucket"
migrations/
0001_initial.sql
0002_add_indexes.sql
0003_descriptive_name.sql
Never modify existing migrations. Always add new files.
const response = await env.AI.run('@cf/meta/llama-3.1-8b-instruct', {
messages: [
{ role: 'system', content: 'Classify intent. Reply with one word: erp | crm | general' },
{ role: 'user', content: userMessage }
],
max_tokens: 10
});
// Fast, zero-latency classification at the edge
// Then route to Claude via AI Gateway for depth
nodejs_compat flag: Required for Node.js built-ins in Workers. Add to wrangler.tomlwrangler.toml and code (env.DB)--local flag uses a local SQLite file, not the remote D1 instancewrangler secret put targets production by default