cloudflare-edge-hardening
Skill23 starsChanged 7 days agoMITView on GitHub
Harden Cloudflare Workers, SvelteKit edge routes, WAF and Browser Integrity Check rules, security headers, CSP, CSRF exemptions, SSRF guards, and telemetry scrubbing. Use when adding or modifying public routes, static assets, webhooks, outbound fetches, auth callbacks, or Cloudflare WAF and header config.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- heymegabyte/claude-skillstheir own version, first seen Nov 29, 2026
- heymegabyte/agent-skillstheir own version, first seen Nov 29, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- heymegabyte/agent-skills★ 30same name
- heymegabyte/claude-skills★ 30same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository46 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agents-autonomous-loopsSkill
- agents-correctSkill
- agents-create-verification-skillSkill
- agents-reflectSkill
- agents-swarmSkill
- alchemy-infraSkill
- cloudflare-gradual-releaseSkill
- comms-howSkill
- comms-impactSkill
- comms-interrogateSkill
- comms-promo-videoSkill
- comms-slidesSkill
- comms-technical-writingSkill
- comms-unslopSkill
- comms-whySkill
- drizzle-postgresSkill
- effect-boundary-validationSkill
- effect-seam-migrationSkill
- effectSkill
- eng-agent-dx-cli-scaleSkill
- eng-ai-featuresSkill
- eng-benchmark-checklistSkill
- eng-blast-radiusSkill
- eng-change-checklistSkill
- eng-cutover-verificationSkill
- eng-data-backward-compatSkill
- eng-migrationSkill
- eng-monorepoSkill
- eng-qa-cujsSkill
- eng-state-machineSkill
- eng-tddSkill
- eng-testingSkill
- gh-ci-triageSkill
- gh-issue-burndownSkill
- gh-pr-commit-reviewSkill
- gh-pr-feedback-loopSkill
- nix-darwinSkill
- reg-suitSkill
- sentry-bugfixSkill
- sentry-perfSkill
- seo-coachSkill
- svelte-shadcnSkill
- svelte-ui-deliverySkill
- ui-audit-loopSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 1 is distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Every public route sits behind four layers: zone WAF and Browser Integrity Check (BIC), static asset _headers, Worker or framework …
- Very specific: line 14
Before adding a route, static machine file (/llms.txt, /robots.txt, /schemas/*), or content-negotiated endpoint, declare five properties in …
- Very specific: line 24
Capped ingress: use the repo's shared streaming byte-capped body helper on every POST, PUT, and PATCH, including routes with trailing …
- Very specific: line 25
SSRF-safe egress: use the repo's shared SSRF fetch helper (redirect: "manual", per-hop DNS and CIDR re-validation, trailing-dot …
- Distinctive: line 26
Privacy scrubbing: never log raw parse errors, request URLs with query strings, or auth headers to error trackers.
- Very specific: line 28
Strict CSP: avoid unsafe-inline and inline style= attributes in app shells.
- Very specific: line 32
Run sgpack security rules, the repo's security lint pack, and edge-router tests covering the full Worker entrypoint, not an isolated …
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Cloudflare edge hardening
Every public route sits behind four layers: zone WAF and Browser Integrity Check (BIC), static asset _headers, Worker or framework middleware, and outbound or telemetry boundaries. Changing one layer without the others causes 1010 agent outages, missing headers on Worker responses, or silent security regressions.
Repo facts (from AGENTS.md): the route manifest or router entrypoint, WAF and BIC config, static _headers and server hook paths, the repo's shared edge security helpers (capped body reader, SSRF fetch, security-header hook, telemetry scrubber, analytics wrapper), sgpack security rules, and the security lint and edge-router test commands.
Classify every route once
Before adding a route, static machine file (/llms.txt, /robots.txt, /schemas/*), or content-negotiated endpoint, declare five properties in the repo's single route table (or verify all surfaces in one change):
- Audience: browser page, non-browser API or AI agent, webhook receiver, or OAuth callback.
- WAF and BIC: non-browser clients fail Cloudflare BIC (error 1010) unless exempted. Match exact path prefixes and parse
Acceptmedia-type quality values strictly sotext/markdown;q=0never bypasses browser rules. - Methods and 405: list allowed HTTP methods explicitly and return JSON 405 with an
Allowheader for unsupported methods rather than falling through to an HTML 404. - Headers on every response path: static
_headersdoes not cover Worker-generated JSON, auth redirects, or framework 404 or 500 responses. Emit HSTS, CSP,X-Content-Type-Options, andReferrer-Policyin server hooks too. Check thatReferrer-PolicypreservesOriginon same-origin POSTs so CSRF checks do not seeOrigin: null. - Auth and CSRF: authenticate before reading bodies on protected routes (
effect-boundary-validation); add explicit narrow exemptions for external OAuth callbacks and signed webhooks.
Harden ingress, egress, and telemetry
- Capped ingress: use the repo's shared streaming byte-capped body helper on every POST, PUT, and PATCH, including routes with trailing slashes or missing
Content-Length. Never buffer unbounded bodies in Workers or Durable Objects. - SSRF-safe egress: use the repo's shared SSRF fetch helper (
redirect: "manual", per-hop DNS and CIDR re-validation, trailing-dot normalization, outer timeout) rather than rawfetchor hand-rolled IP bitmasks. Keep registration-time and delivery-time URL checks identical. - Privacy scrubbing: never log raw parse errors, request URLs with query strings, or auth headers to error trackers. Pin a regression test asserting sensitive fields are scrubbed so later SDK refactors cannot silently drop the scrubber.
- Third-party analytics: strip private route paths and referrers before sending events, and suspend tracking on excluded or authenticated admin routes.
- Strict CSP: avoid
unsafe-inlineand inlinestyle=attributes in app shells; verify built pages and 404 pages against the live CSP header. Followalchemy-infrafor zone and Worker bindings.
Verify
- Run
sgpacksecurity rules, the repo's security lint pack, and edge-router tests covering the full Worker entrypoint, not an isolated handler. - Probe a wrong HTTP method (expect 405 with
Allow), an oversized body withoutContent-Length(expect 413), a non-browserUser-Agenton agent routes, and a Worker 404 or redirect for required security headers. - Confirm telemetry scrubber and analytics exclusion tests assert on actual emitted payloads.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

