blitzhash-cloudflare-production-skills / rules
Cursor rule0 starsChanged 9 days agoMITView on GitHub
Set up Cloudflare Turnstile (CAPTCHA alternative) end to end: create a widget, add the client widget to a form, and verify tokens server-side with siteverify (Next.js, Express, Workers). Use when the user wants to stop spam or bot signups on login, signup, contact or checkout forms.
- Reads credentials
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 4,183 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository14 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/cloudflare-dns-records.mdcCursor rule
- .cursor/rules/cloudflare-rate-limiting.mdcCursor rule
- .cursor/rules/cloudflare-safety.mdcCursor rule
- .cursor/rules/cloudflare-waf-rules.mdcCursor rule
- .cursor/rules/cloudflare-zone-audit.mdcCursor rule
- .cursor/rules/cloudflare-zones-overview.mdcCursor rule
- cloudflare-dns-recordsSkill
- cloudflare-rate-limitingSkill
- cloudflare-turnstileSkill
- cloudflare-waf-rulesSkill
- cloudflare-zone-auditSkill
- cloudflare-zones-overviewSkill
The file
We split this cloudflare-turnstile.mdc into the rules it gives an agent
8 rules. About 0 are common, 1 is distinctive, and 7 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.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 9
Run commands with npx -y github:blitzhash360-web/blitzhash-cloudflare-production-skills <command> or, inside a clone of the repo, node …
- Very specific: line 13
Create the widget (dry run first): cf-skills turnstile create --name "Signup form" --domains example.com,www.example.com --secret-out …
- Very specific: line 17
Put TURNSTILE_SECRET_KEY in the hosting provider env vars.
- Very specific: line 18
Test with Cloudflare's documented dummy keys first (secret 1x0000000000000000000000000000000AA always passes, …
- Very specific: line 29
Every write command is a dry run by default.
- Very specific: line 30
Only after that "yes", re-run the same command with --apply --yes (your shell is not interactive).
- Distinctive: line 31
Never delete records or rules the user did not name.
- Very specific: line 32
Run cf-skills audit before and after changes and tell the user what moved.
≈ “Common” is an estimate: at least 1 in 5 of the 6,668 Cursor rule 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
--- description: Set up Cloudflare Turnstile (CAPTCHA alternative) end to end: create a widget, add the client widget to a form, and verify tokens server-side with siteverify (Next.js, Express, Workers). Use when the user wants to stop spam or bot signups on login, signup, contact or checkout forms. alwaysApply: false --- <!-- Generated from skills/cloudflare-turnstile/SKILL.md by scripts/build-cursor-rules.mjs. Edit the skill, not this file. --> # Cloudflare Turnstile setup Run commands with `npx -y github:blitzhash360-web/blitzhash-cloudflare-production-skills <command>` or, inside a clone of the repo, `node bin/cf-skills.mjs <command>`. Below, `cf-skills` means either. Zone is `--zone <domain or zone id>` or `$CLOUDFLARE_ZONE_ID`. ## Steps 1. Create the widget (dry run first): `cf-skills turnstile create --name "Signup form" --domains example.com,www.example.com --secret-out .env.local` - The site key (public) is printed. The secret is masked and only written to the git-ignored file given in `--secret-out`. 2. Client: `cf-skills turnstile snippet --framework html --sitekey <sitekey>` and paste inside the form. 3. Server (required, the widget alone protects nothing): `cf-skills turnstile snippet --framework next|express|worker` and copy `snippets/turnstile/siteverify.mjs` into the project. 4. Put `TURNSTILE_SECRET_KEY` in the hosting provider env vars. Never in a `NEXT_PUBLIC_` / `VITE_` variable. 5. Test with Cloudflare's documented dummy keys first (secret `1x0000000000000000000000000000000AA` always passes, `2x0000000000000000000000000000000AA` always fails). ## Guidance - `verifyTurnstile` fails closed (network error = not verified), rejects tokens over 2048 chars, and can check the expected hostname and action. - Tokens are single use and expire after 300 seconds; verify once per submission. - Token: Account > Turnstile Edit (only for `create`/`list`); `snippet` needs no token. ## Safety rules (always) - The API token lives only in the environment (`CLOUDFLARE_API_TOKEN`) or a git-ignored `.env`. Never ask the user to paste it into chat, never print it, never pass it as a flag, never commit it. - Every write command is a **dry run** by default. Run it without `--apply` first, show the user the printed plan, and wait for an explicit "yes" in chat. - Only after that "yes", re-run the **same** command with `--apply --yes` (your shell is not interactive). Never add `--yes` on your own initiative. - Never delete records or rules the user did not name. Never widen the token's permissions. - Run `cf-skills audit` before and after changes and tell the user what moved.
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.

