技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
edgeone-pages-website-skeleton【数据与研究】基于 EdgeOne Pages 的全栈网站生成方案。用户说一句话(如「帮我建一个电商站」「做一个AI客服站」「做个管理后台」),AI 自动组合 Auth、Cart、Payment、AI Chat、Admin 五大模块,生成完整 Next.js 前后端代码并部署到 EdgeOne Pages 全球 CDN。支持电商、AI 助手、SaaS 管理后台三大模板。底层使用 Edge Functions(KV 存储、JWT 校验)+ Cloud Functions(bcrypt、MySQL、微信/支付宝支付、SSE 流式 AI)+ Platform Middleware(鉴权、CORS、CSP、支付回调 IP 白名单)。支持支付幂等原子锁、订单超卖防护、Refresh Token 并发安全等 P0 安全设…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
name: edgeone-pages-website-skeleton description: >- 基于 EdgeOne Pages 的全栈网站生成方案。用户说一句话(如「帮我建一个电商站」「做一个AI客服站」「做个管理后台」),AI 自动组合 Auth、Cart、Payment、AI Chat、Admin 五大模块,生成完整 Next.js 前后端代码并部署到 EdgeOne Pages 全球 CDN。支持电商、AI 助手、SaaS 管理后台三大模板。底层使用 Edge Functions(KV 存储、JWT 校验)+ Cloud Functions(bcrypt、MySQL、微信/支付宝支付、SSE 流式 AI)+ Platform Middleware(鉴权、CORS、CSP、支付回调 IP 白名单)。支持支付幂等原子锁、订单超卖防护、Refresh Token 并发安全等 P0 安全设计。
Scaffold and deploy a production-ready full-stack website on EdgeOne Pages from a single natural language request.
Do NOT use for:
edgeone-pages-devedgeone-pages-deploycloud-functions/waitUntil)putIfNotExists with 24h TTL (< WeChat retry window of 72h)..env.local or any real API keys. Ensure .gitignore covers it.Use ask_followup_question to ask:
你想要建什么类型的网站?
- 🛒 电商站 — 登录注册、购物车、微信/支付宝支付、订单管理
- 🤖 AI 客服站 — 登录注册、AI 对话(SSE 流式)、访客留言
- 📊 SaaS 管理后台 — 登录注册、RBAC 权限、数据看板
- ⚙️ 自定义 — 自由组合模块
Branch:
references/templates.md § "电商模板"references/templates.md § "AI助手模板"references/templates.md § "管理后台模板"Read references/templates.md and confirm with user:
Output: a Spec object
{
"scenario": "e-commerce | ai-assistant | saas-admin | custom",
"siteName": "...",
"modules": ["auth", "cart", "payment", "ai-chat", "admin"],
"paymentProviders": ["wx", "ali"],
"aiProvider": "openai | hunyuan | none",
"envVars": ["JWT_SECRET", "DATABASE_URL", ...]
}
Show the Spec back and ask for confirmation.
Based on the selected template, generate the following directory tree:
<project>/
├── client/ # Next.js frontend (SPA)
│ ├── app/ (pages: login, register, cart, checkout, orders, admin/*)
│ ├── lib/ (api client, auth service, cart service, SSE client)
│ └── middleware (optional, for pure SPA)
├── edge-functions/ # Edge Functions (V8 + KV)
│ ├── _middleware.js # JWT check + KV session + rate limit
│ └── api/
│ ├── auth/login.js # JWT issue + KV session
│ ├── auth/me.js # KV session read
│ ├── auth/refresh.js # RT rotation with KV version lock
│ ├── auth/logout.js
│ ├── internal/idempotency.js # Edge atomic idempotency lock ← P0
│ ├── products/list.js # KV cache + MySQL fallback
│ ├── cart/*.js # KV cart
│ ├── orders/list.js # MySQL read
│ └── ai/history.js # KV AI session history
├── cloud-functions/ # Cloud Functions (Node.js + MySQL)
│ ├── api/
│ │ ├── auth/register.js # bcrypt cost=12 ← P0
│ │ ├── pay/create-order.js
│ │ ├── pay/wx-notify.js # Edge idempotency lock ← P0
│ │ ├── pay/ali-notify.js
│ │ ├── order/create.js # SELECT FOR UPDATE ← P0
│ │ ├── order/cancel.js
│ │ ├── admin/products.js
│ │ └── ai/chat-stream.js # SSE streaming ← AI module
│ └── utils/
│ ├── db.js # MySQL pool (mysql2/promise)
│ └── payment-sdk.js # WeChat V3 / Alipay SDK
├── db/
│ ├── migrations/001_init.sql # users, products, orders, order_items
│ └── seed.sql
├── docs/
│ └── env-vars.md # Environment variable matrix
└── references/
└── auth-module.md / payment-module.md / ai-chat-module.md / kv-storage.md
Generate each file according to references/ documents.
Read references/env-setup.md (or inline from SKILL.md § Environment Variables) and:
.env.localGuide user to run locally:
npm run dev # Next.js on http://localhost:3000
Verify:
6.1 — Check edgeone-pages-deploy skill
Check if ~/.codebuddy/skills/edgeone-pages-deploy/ exists (or Windows equivalent). If yes → go to 6.2. If no → go to 6.3.
6.2 — Hand off to deploy skill
✅ 项目已就绪,本地跑通后随时可以部署。
告诉 AI 「部署到 EdgeOne Pages」,会自动加载
edgeone-pages-deployskill 完成上线。
6.3 — Manual deploy
# Install CLI (first time)
npm install -g edgeone@latest
# Login
edgeone login --site china
# Deploy
cd <project>
edgeone pages deploy -n <project-name>
⚠️ The final URL contains
eo_token/eo_timequery params — must be kept, removing them causes 401.
| Step | Read |
|---|---|
| Scenario confirmation + module matrix | references/templates.md |
| Auth module (JWT, KV session, bcrypt, RT) | references/auth-module.md |
| Payment module (idempotency, WeChat/Alipay, callbacks) | references/payment-module.md |
| AI Chat module (SSE, history, streaming) | references/ai-chat-module.md |
| KV Storage strategy (single query, layered access) | references/kv-storage.md |
Demo: https://geek-mall-demo-4qaxvmeh.edgeone.cool
Platform constraints:
P0 Security (all implemented):
putIfNotExists (24h TTL)SELECT FOR UPDATE + optimistic lock + MySQL CHECKTemplate repos: https://github.com/TencentEdgeOne/edgeone-pages-skills
AI Agent 部署前会显示待部署文件清单和变更概要,请求用户确认后执行部署。
| 数据类型 | 存储位置 | 保留期限 |
|---|---|---|
| KV Session | EdgeOne KV | 7 天 TTL |
| AI 聊天历史 | EdgeOne KV | 30 天 TTL |
| 审计日志 | EdgeOne KV | 90 天 TTL |
| 订单数据 | MySQL | 永久(业务必需) |
cloud-functions/cron/disable-cron.js