Initialize a new Cloudflare Workers project with Hono routing, Vite plugin, and Static Assets. Uses production-tested templates that prevent 8 common issues.
Creates a production-ready Cloudflare Worker with Hono, Vite, and static assets.
/plugin marketplace add jezweb/claude-skills/plugin install jezweb-cloudflare-worker-base-skills-cloudflare-worker-base@jezweb/claude-skillsInitialize a new Cloudflare Workers project with Hono routing, Vite plugin, and Static Assets. Uses production-tested templates that prevent 8 common issues.
Follow these steps to scaffold a new Cloudflare Workers project.
Ask the user for:
If user doesn't specify, use sensible defaults:
Create the following directory structure:
{project-name}/
├── src/
│ └── index.ts
├── public/
│ └── index.html
├── package.json
├── tsconfig.json
├── vite.config.ts
├── wrangler.jsonc
└── .gitignore
Use templates from: ~/.claude/skills/cloudflare-worker-base/templates/
Copy and customize these files:
templates/package.json → Update name fieldtemplates/tsconfig.json → Copy as-istemplates/vite.config.ts → Copy as-istemplates/wrangler.jsonc → Update name, optionally add bindingstemplates/src/index.ts → Copy as-is (or customize for features)templates/public/index.html → Copy as-isIf user requested D1, R2, KV, or other bindings, add them to wrangler.jsonc:
D1 Database:
"d1_databases": [{
"binding": "DB",
"database_name": "{project-name}-db",
"database_id": "to-be-created"
}]
Tell user: "Run npx wrangler d1 create {project-name}-db and update the database_id"
R2 Bucket:
"r2_buckets": [{
"binding": "BUCKET",
"bucket_name": "{project-name}-bucket"
}]
Tell user: "Run npx wrangler r2 bucket create {project-name}-bucket"
KV Namespace:
"kv_namespaces": [{
"binding": "KV",
"id": "to-be-created"
}]
Tell user: "Run npx wrangler kv namespace create KV and update the id"
node_modules/
.wrangler/
dist/
.dev.vars
*.log
.DS_Store
If the skill has rules, copy them to the new project:
mkdir -p {project-name}/.claude/rules
cp ~/.claude/skills/cloudflare-worker-base/rules/*.md {project-name}/.claude/rules/
This ensures Claude has the correction rules available in the new project.
Run:
cd {project-name}
npm install
Output a summary:
✅ Cloudflare Worker project "{project-name}" created!
📁 Structure:
- src/index.ts (Hono API routes)
- public/ (Static assets)
- wrangler.jsonc (Cloudflare config)
🚀 Next steps:
1. cd {project-name}
2. npm run dev (Start local dev server)
3. npx wrangler deploy (Deploy to Cloudflare)
{If bindings were added, list the wrangler commands to create them}
📚 Skill loaded: cloudflare-worker-base
- 8 common issues auto-prevented
- Correction rules copied to .claude/rules/
This command applies patterns from the cloudflare-worker-base skill:
export default app (not { fetch: app.fetch })@cloudflare/vite-plugin for unified dev experienceThe templates prevent these documented issues: