cloudflare-bundler-apps
यह क्या करती है
यह स्किल एजेंट को प्रोजेक्ट का ढाँचा ऐसा बनाना सिखाती है कि Cloudflare worker bundler उसे साफ़ तरीके से बना सके। इसमें wrangler कॉन्फ़िग, फ़ोल्डर लेआउट, स्टैटिक फ़ाइलें और सर्वर एंट्री पॉइंट शामिल हैं।
कब इस्तेमाल करें
- ✓जब कोई डेवलपर ऐसा प्रोजेक्ट बनाता या बदलता है जो Cloudflare worker bundler से बनेगा।
- ✓जब किसी Cloudflare प्रोजेक्ट के प्रीव्यू में खाली पेज या बिल्ड फ़ेल दिखे।
- ✓जब किसी प्रोजेक्ट को सर्वर एंट्री पॉइंट के साथ स्टैटिक असेट भी परोसने हों।
Skill का लिंक
https://github.com/cloudflare/vibesdk/blob/main/worker/agents/think/skills/app-file-structure/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरा Cloudflare प्रोजेक्ट इस तरह सेट कीजिए कि bundler उसे बनाए और प्रीव्यू बिना गलती के पेज दिखाए।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट मुख्य एंट्री, कंपैटिबिलिटी सेटिंग्स और असेट फ़ोल्डर के लिए wrangler कॉन्फ़िग पढ़ता है, फिर प्रोजेक्ट को bundler के नियमों के अनुसार लगाता है। वह डिपेंडेंसी सीमाएँ और खाली पेज की आम गलतियाँ जाँचता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
This skill teaches how to build apps that deploy cleanly through the space deploy pipeline. Every project committed to a space is built by @cloudflare/worker-bundler (createApp when there are static assets, createWorker when there are none) and served on a Dynamic Worker via WorkerLoader. Get the conventions right and the preview "just works". Get them wrong and you get a blank page, a 500, or a Build failed error.
How the pipeline works
When deploy_space(branch) is called, the space DO:
- Reads every file from the branch's working tree (skipping
.git/). - Parses
wrangler.json/wrangler.jsonc/wrangler.tomlformain,compatibility_date,compatibility_flags, and[assets]. - If
[assets].directoryis set, files under that directory become static assets served host-side byhandleAssetRequest. Everything else is built into a Worker viacreateApp(withserver: <main>). - If no assets directory is configured, only
createWorker({ entryPoint: <main> })is run. The output is loaded as a Dynamic Worker; all requests go to the Worker. - Previews are served at
/space/:name/preview/:branch/*. Responses withcontent-type: text/htmlare run throughHTMLRewriter, which prefixes root-relativesrc/href/actionattributes with the preview base path. JS-side fetches and dynamic imports are NOT rewritten.
Practical consequences:
- You can rely on root-relative
src="/foo.js"andhref="/style.css"in HTML. They will be rewritten to the preview path automatically. - You cannot rely on root-relative paths inside JS strings:
fetch("/api/x"),new URL("/foo", location.origin), dynamicimport("/lib.js"). These hit the wrong path under the preview prefix. Use relative paths (./api/x,import.meta.url) or read the base path from<base href>/ a meta tag injected at build time. - The
<base href>tag is also rewritten if present — using it lets all relative URLs resolve against the preview path.
Project layout
A typical full-stack space project:
/
├── wrangler.json # required for non-trivial setups
├── package.json # npm deps (text-only packages, see limits below)
├── src/
│ └── index.ts # server entry: export default { fetch }
└── public/ # static assets directory (configurable)
├── index.html
├── app.js # compiled, no JSX
└── styles.css
A static-only SPA can skip src/ entirely — just wrangler.json + public/ is enough as long as main points to a minimal pass-through worker or you accept that all requests fall through assets.
Wrangler config
Minimum viable wrangler.json:
{
"main": "src/index.ts",
"compatibility_date": "2025-04-01",
"assets": {
"directory": "./public",
"html_handling": "auto-trailing-slash",
"not_found_handling": "single-page-application"
}
}
Notes:
mainis required when there's any server code. The bundler also auto-detectssrc/index.ts,src/index.js,index.ts,index.jsif missing.compatibility_datedefaults to2025-04-01if omitted. Set it explicitly for newer features.- Add
"compatibility_flags": ["nodejs_compat"]only if you actually need Node built-ins. assets.directoryis the only way to ship static files. Files outside this directory are bundled into the Worker or ignored — they will not be reachable via URL.html_handling: "auto-trailing-slash"is usually what you want for multi-page sites; SPAs should also setnot_found_handling: "single-page-application"so deep links returnindex.html.
TOML works too (wrangler.toml), but the parser only handles top-level scalar fields plus an [assets] table — no inline tables, no env overrides. Prefer JSON.
Server entry: one Durable Object class named App
Your entire backend is one Durable Object. Your main module exports
a class named App extending DurableObject. The platform loads it as
a Cloudflare Durable Object
Facet
of the host SpaceDO and forwards every non-asset request — including
WebSocket upgrades — to your App.fetch(request).
Do not export default { fetch }. A default fetch handler will be
ignored. There is no separate worker; the DO is the worker.
// src/index.ts
import { DurableObject } from "cloudflare:workers";
export class App extends DurableObject {
async fetch(request: Request): Promi
अक्सर पूछे जाने वाले सवाल
खाली प्रीव्यू का कारण क्या होता है?
स्किल कॉन्फ़िग और लेआउट की उन गलतियों को सूचीबद्ध करती है जिनसे खाली पेज या बिल्ड फ़ेल होते हैं।
क्या ब्राउज़र के अनुरोध फिर से लिखे जाते हैं?
स्किल कहती है कि प्रीव्यू पथ के लिए HTML एट्रिब्यूट फिर से लिखे जाते हैं, लेकिन JavaScript के fetch और import नहीं।
यह कौन-सी कॉन्फ़िग फ़ाइलें पढ़ती है?
यह wrangler.json, wrangler.jsonc या wrangler.toml पढ़ती है।
जानकारी
लेखक का मूल विवरण
Author Cloudflare Worker Bundler-compatible apps that build and preview correctly inside a space. Use this skill whenever you scaffold, modify, or deploy a project that will be built with `@cloudflare/worker-bundler` (i.e. anything served from `/space/:name/preview/:branch/`). Covers wrangler config, project layout, static asset rules, server entry conventions, npm dependency limits, and the most common cause of blank previews (JSX in browser scripts).
repo: cloudflare/vibesdk
लोकप्रियता
- GitHub स्टार
- 5.4k
- रैंकिंग में स्थान
- #14846
- लाइसेंस
- MIT
- अपडेट की गई
- 21/10/2026
कमेंट
- …
इस repository की और skills
app-ai-binding
5.4kयह आपके एजेंट को Workers AI की बिल्ट-इन बाइंडिंग से जनरेट की गई ऐप में चैट, सारांश, वर्गीकरण, सर्च और ट्रांसक्रिप्शन जैसी AI सुविधाएँ जोड़ने देती है।
frontend-design-landing-page
5.4kयह आपके एजेंट को साफ़ हीरो सेक्शन, फ़ीचर ग्रिड, प्राइसिंग और कॉल टू एक्शन वाला गर्मजोशी भरा, कन्वर्ज़न पर केंद्रित मार्केटिंग लैंडिंग पेज डिज़ाइन करने देती है।
frontend-design-saas
5.4kयह आपके एजेंट को डैशबोर्ड, सेटिंग्स पेज, बिलिंग स्क्रीन और डेटा टेबल जैसी घनी, साफ़ प्रोडक्ट इंटरफ़ेस शांत, तटस्थ SaaS शैली में डिज़ाइन करने देती है।
मिलती-जुलती skills
api-connector-builder
280kयह आपके एजेंट को मौजूदा pattern के हिसाब से नए API connections बनाने देता है। जब बिना कोई नया तरीका बनाए एक और integration जोड़ना हो, तब इसका इस्तेमाल करें।
api-design
280kयह आपके एजेंट को best practices के हिसाब से REST APIs डिज़ाइन करने में मदद करता है। यह तय करने में काम आता है कि APIs आपस में कैसे बात करें, errors कैसे दिखें, और data को कैसे व्यवस्थित करें।
backend-patterns
280kआपके एजेंट को server-side architecture patterns और database optimization में मदद करता है। server पर चलने वाला code बनाने या review करने के लिए उपयोगी है।