Agent skill
svelte5-cloudflare
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/svelte5-cloudflare
SKILL.md
Svelte5 + Cloudflare
Use this skill for any SvelteKit-on-Cloudflare task.
What To Do First
- Identify runtime model before touching config:
Worker service: usewrangler secret putandwrangler deploy.Pages project: usewrangler pages secret putand Pages build output config.
- Run
scripts/doctor.shfrom this skill and follow fixes in order. - If user asks for “latest” behavior/tools, verify with official docs before advising.
Guardrails (Do Not Skip)
- Do not use
mode: 'no-cors'to hide integration errors. - For SvelteKit API routes, prefer same-origin POST from frontend to
/api/.... - Validate server input and treat upstream logical errors as failures.
- Keep secrets in Cloudflare secrets, never in git or
[vars]for sensitive values. - For Worker deploys of SvelteKit cloudflare output, deploy both worker entry and assets.
Standard Implementation Pattern
A) SvelteKit Cloudflare config
- Adapter:
@sveltejs/adapter-cloudflare - Build output used for manual worker deploy:
.svelte-kit/cloudflare - Worker entry file:
.svelte-kit/cloudflare/_worker.js
B) Waitlist/form backend pattern
- Frontend posts to same-origin
/api/waitlistwithURLSearchParams. - API route validates fields, enforces honeypot, forwards upstream server-side.
- API route returns structured errors:
400validation503missing env502upstream/network failure
C) Cloudflare secrets and deploy
- Worker service secret:
npx wrangler secret put GOOGLE_APPS_SCRIPT_URL --name <worker-name>
- Worker deploy for SvelteKit output:
npx wrangler deploy .svelte-kit/cloudflare/_worker.js --name <worker-name> --assets .svelte-kit/cloudflare
Decision Tree: Pages vs Worker
- If dashboard route is
workers.devand shows Worker versions, treat as Worker service. - If using Pages project/deployments pipeline, treat as Pages.
- If unsure, run both list commands and use whichever returns the target.
Auto-Maintenance Protocol (Living Skill)
Run scripts/refresh-skill-state.sh whenever:
- SvelteKit/adapter/wrangler versions change
- Deploy command changes
- Pages/Worker mode changes
- A new incident is discovered
Then update references/playbook.md with:
- New failure symptom
- Root cause
- Detection command
- Minimal fix
When this skill is invoked, agents should proactively run scripts/doctor.sh and patch drift before feature work.
References
- Operational playbook:
references/playbook.md - Drift/state snapshot:
references/state.json
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?