cloudflare-bundler-apps
하는 일
이 스킬은 Cloudflare 워커 번들러가 프로젝트를 깔끔하게 빌드할 수 있도록 구조를 짜는 방법을 에이전트에게 가르칩니다. wrangler 설정, 폴더 레이아웃, 정적 파일, 서버 진입점을 다룹니다.
사용하는 경우
- ✓개발자가 Cloudflare 워커 번들러로 빌드될 프로젝트를 만들거나 바꿀 때.
- ✓Cloudflare 프로젝트의 미리 보기가 빈 페이지를 보여 주거나 빌드가 실패하는 경우.
- ✓프로젝트에 서버 진입점과 함께 정적 에셋을 제공해야 할 때.
스킬 링크
https://github.com/cloudflare/vibesdk/blob/main/worker/agents/think/skills/app-file-structure/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“번들러가 빌드하고 미리 보기에 오류 없이 페이지가 보이도록 제 Cloudflare 프로젝트를 설정해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 wrangler 설정에서 메인 진입점, 호환성 설정, 에셋 폴더를 읽은 뒤, 번들러 규칙에 맞게 프로젝트를 배치합니다. 의존성 제한과 빈 페이지를 일으키는 흔한 실수를 확인합니다.
기술 내용 (원본 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
- 업데이트
- 2026. 10. 21.
댓글
- …
이 저장소의 다른 스킬
app-ai-binding
5.4k에이전트가 Cloudflare의 내장 Workers AI 바인딩으로 만든 앱에 채팅, 요약, 분류, 검색, 전사 기능을 추가하도록 돕습니다.
frontend-design-landing-page
5.4k에이전트가 명확한 히어로 섹션, 기능 그리드, 가격, 행동 유도 버튼을 갖춘 따뜻하고 전환에 초점을 맞춘 마케팅 랜딩 페이지를 디자인하도록 돕습니다.
frontend-design-saas
5.4k에이전트가 대시보드, 설정 페이지, 결제 화면, 데이터 표 같은 밀도 높고 깔끔한 제품 인터페이스를 차분한 중립 SaaS 스타일로 디자인하도록 돕습니다.
비슷한 스킬
api-connector-builder
280k에이전트가 기존 패턴을 따라 새로운 API 연결을 만들도록 합니다. 새로운 방식을 도입하지 않고 연동을 하나 더 추가할 때 씁니다.
api-design
280k에이전트가 모범 사례에 따라 REST API를 설계하도록 돕습니다. API가 통신하는 방식, 오류를 보여 주는 방식, 데이터를 정리하는 방식을 정하는 데 유용합니다.
backend-patterns
280k에이전트가 서버 쪽 아키텍처 패턴과 데이터베이스 최적화를 다루도록 돕습니다. 서버에서 실행되는 코드를 만들거나 검토할 때 유용합니다.