fcakyon/claude-codex-settings / plugins/cloudflare-skills/skills/turnstile-spin
turnstile-spin
VerifiedSet up, repair, or migrate to Cloudflare Turnstile bot verification in an existing frontend and backend, including server-side Siteverify.
| File | Kind | Size |
|---|---|---|
| README.md | markdown | 3.8 KB |
| SKILL.md | skill md | 28.2 KB |
| references/astro.md | markdown | 5.8 KB |
| references/hugo.md | markdown | 3.8 KB |
| references/nextjs-app.md | markdown | 7.5 KB |
| references/nextjs-pages.md | markdown | 2.7 KB |
| references/skill-feedback.md | markdown | 2.7 KB |
| references/sveltekit.md | markdown | 5.4 KB |
| references/vanilla-html.md | markdown | 5.6 KB |
| scripts/auth-probe.shexecutable | script | 11.0 KB |
| scripts/persist-skill.shexecutable | script | 3.6 KB |
| scripts/validate.shexecutable | script | 4.3 KB |
| scripts/widget-create.shexecutable | script | 4.1 KB |
| tests/test_persist_skill.py | script | 3.1 KB |
| tests/validation.md | markdown | 3.2 KB |
scripts/persist-skill.sh
View on GitHub#!/usr/bin/env bash
# Persists the canonical Spin skill bundle into the current project.
set +x
set -uo pipefail
unset CLOUDFLARE_API_TOKEN CF_API_TOKEN CLOUDFLARE_API_KEY CF_API_KEY
unset CLOUDFLARE_EMAIL CF_API_EMAIL WIDGET_SECRET TURNSTILE_SECRET
unset WRANGLER_BIN WRANGLER_VERSION
unset GITHUB_TOKEN GH_TOKEN GITLAB_TOKEN NPM_TOKEN
need_arg() {
if [[ -z "${2-}" || "$2" == --* ]]; then
echo "persist-skill: missing value for $1" >&2
exit 2
fi
}
PATH_ARG=""
while [[ $# -gt 0 ]]; do
case "$1" in
--path) need_arg "$1" "${2-}"; PATH_ARG="$2"; shift 2 ;;
*) echo "persist-skill: unknown arg $1" >&2; exit 2 ;;
esac
done
[[ -n "$PATH_ARG" ]] || { echo "persist-skill: --path required" >&2; exit 2; }
if [[ "$(basename "$PATH_ARG")" != "SKILL.md" ]]; then
echo "persist-skill: --path must end in SKILL.md for a directory-based skill bundle" >&2
echo '{"status":"error","reason":"file_target_not_supported"}'
exit 2
fi
for command_name in git python3; do
command -v "$command_name" >/dev/null 2>&1 || {
echo "persist-skill: $command_name is required" >&2
echo "{\"status\":\"error\",\"reason\":\"${command_name}_not_available\"}"
exit 1
}
done
PROJECT_ROOT="$(pwd -P)"
TARGET_DIR="$(python3 -I -c 'import os,sys; print(os.path.realpath(os.path.abspath(sys.argv[1])))' "$(dirname "$PATH_ARG")")"
if [[ "$TARGET_DIR" != "$PROJECT_ROOT" && "$TARGET_DIR" != "$PROJECT_ROOT/"* ]]; then
echo "persist-skill: target must be inside the current project" >&2
echo '{"status":"error","reason":"target_outside_project"}'
exit 1
fi
if [[ -e "$TARGET_DIR" ]] && ! python3 -I -c 'import os,sys; raise SystemExit(0 if not os.listdir(sys.argv[1]) else 1)' "$TARGET_DIR"; then
echo "persist-skill: target directory is not empty" >&2
echo '{"status":"error","reason":"target_not_empty"}'
exit 1
fi
if ! TEMP_DIR="$(mktemp -d "${TMPDIR:-/tmp}/turnstile-spin-persist.XXXXXX")"; then
echo "persist-skill: could not create a temporary directory" >&2
echo '{"status":"error","reason":"temporary_directory_failed"}'
exit 1
fi
trap 'rm -rf "$TEMP_DIR"' EXIT
if ! git -c core.hooksPath=/dev/null clone \
--quiet \
--depth 1 \
--filter=blob:none \
--sparse \
"https://github.com/cloudflare/skills.git" \
"$TEMP_DIR/repo"; then
echo "persist-skill: clone failed" >&2
echo '{"status":"error","reason":"clone_failed"}'
exit 1
fi
if ! git -C "$TEMP_DIR/repo" -c core.hooksPath=/dev/null sparse-checkout set skills/turnstile-spin; then
echo "persist-skill: sparse checkout failed" >&2
echo '{"status":"error","reason":"sparse_checkout_failed"}'
exit 1
fi
SOURCE_DIR="$TEMP_DIR/repo/skills/turnstile-spin"
if [[ ! -f "$SOURCE_DIR/SKILL.md" ]]; then
echo "persist-skill: canonical bundle is missing SKILL.md" >&2
echo '{"status":"error","reason":"skill_missing"}'
exit 1
fi
if ! python3 -I - "$SOURCE_DIR" "$TARGET_DIR" <<'PY'
import pathlib
import shutil
import sys
source = pathlib.Path(sys.argv[1])
target = pathlib.Path(sys.argv[2])
if target.exists():
target.rmdir()
target.parent.mkdir(parents=True, exist_ok=True)
shutil.copytree(source, target, dirs_exist_ok=False)
for script in (target / "scripts").glob("*.sh"):
script.chmod(0o755)
PY
then
echo "persist-skill: bundle copy failed" >&2
echo '{"status":"error","reason":"copy_failed"}'
exit 1
fi
python3 -I - "$PATH_ARG" "$TARGET_DIR" <<'PY'
import json
import pathlib
import sys
path_arg, bundle_root = sys.argv[1], pathlib.Path(sys.argv[2])
scripts = sorted(path.name for path in (bundle_root / "scripts").glob("*.sh"))
print(json.dumps({
"status": "ok",
"path": path_arg,
"bundle_root": str(bundle_root),
"scripts": scripts,
}))
PY
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation). | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |