Skip to content

try-works/role-model / .agents/skills/turnstile-spin

turnstile-spin

Verified

Set up Cloudflare Turnstile end-to-end in a project — scan the codebase, create the widget via the Cloudflare API, deploy the managed siteverify Worker, write the frontend snippets, validate, and persist the skill. Load this when a user asks to add Turnstile, set up CAPTCHA, protect a form from bots, or fix a Turnstile integration. Mirrors developers.cloudflare.com/turnstile/spin.

templates/worker/test/deploy.test.ts

View on GitHub
/**
 * tests/3 — Deploy-to-clean-account smoke test.
 *
 * Asserts that a clean `wrangler deploy` of this Worker into an empty account
 * completes in under 4 seconds (Spin's MVP target). This test is gated on
 * CLOUDFLARE_API_TOKEN + CLOUDFLARE_ACCOUNT_ID being set in the environment;
 * skipped in normal CI runs.
 *
 * Run with:
 *   CLOUDFLARE_API_TOKEN=... CLOUDFLARE_ACCOUNT_ID=... \
 *     npx vitest run test/deploy.test.ts
 */

import { describe, expect, it } from 'vitest';
import { execSync, spawnSync } from 'node:child_process';

const HAS_CREDS = Boolean(process.env.CLOUDFLARE_API_TOKEN && process.env.CLOUDFLARE_ACCOUNT_ID);
const TARGET_MS = 4000;

const describeIfCreds = HAS_CREDS ? describe : describe.skip;

describeIfCreds('deploy-to-clean-account speed', () => {
	const workerName = `turnstile-siteverify-deploytest-${Date.now()}`;

	it(`completes wrangler deploy in under ${TARGET_MS}ms`, () => {
		const start = Date.now();

		const result = spawnSync(
			'npx',
			['wrangler', 'deploy', '--name', workerName, '--dry-run', '--outdir', '/tmp/spin-deploy-test'],
			{
				cwd: process.cwd(),
				env: { ...process.env },
				encoding: 'utf-8',
			},
		);

		const elapsed = Date.now() - start;

		if (result.status !== 0) {
			throw new Error(`wrangler deploy --dry-run failed:\n${result.stderr}`);
		}

		expect(elapsed).toBeLessThan(TARGET_MS);
	}, 30_000);

	it('cleans up the test Worker', () => {
		// Idempotent — if the dry-run never produced a real Worker, this is a no-op.
		execSync(`npx wrangler delete --name ${workerName} 2>&1 || true`, { stdio: 'ignore' });
	});
});

describe('deploy artifacts present', () => {
	it('wrangler.toml has the expected name', () => {
		const fs = require('node:fs');
		const text = fs.readFileSync('wrangler.toml', 'utf-8');
		expect(text).toMatch(/^name\s*=\s*"turnstile-siteverify"/m);
	});

	it('wrangler.toml configures the post-deploy assets directory', () => {
		const fs = require('node:fs');
		const text = fs.readFileSync('wrangler.toml', 'utf-8');
		expect(text).toMatch(/\[assets\]/);
		expect(text).toMatch(/directory\s*=\s*"\.\/public"/);
	});

	it('public/post-deploy.html exists', () => {
		const fs = require('node:fs');
		expect(fs.existsSync('public/post-deploy.html')).toBe(true);
	});
});
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 322kUpdated Claude CodeCodexVerifiedInstall
xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release.Stars: 118kUpdated Claude CodeCodexVerifiedInstall