skills/deploy/SKILL.md
Deploy projects to Cloudflare Pages/Workers with pre-flight checks, smoke tests, and automatic rollback on failure. Handles linting, testing, building, deploying, verifying, and tagging releases. Use when asked to deploy, ship, release, push to production, or go live.
npx skillsauth add nhouseholder/nicks-claude-code-superpowers deployInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Full deployment pipeline with verification and rollback for Cloudflare-hosted projects.
This step exists because a catastrophic deploy in March 2026 overwrote v11.9.3 with v10.68 by deploying from a stale directory.
Before ANY deploy for the UFC/MMALogic project:
# CHECK: Are we in the CANONICAL webapp directory?
VERSION=$(grep "APP_VERSION" src/config/version.js 2>/dev/null || echo "NO_VERSION")
echo "Building version: $VERSION"
# ABORT if version is below v11.x — you are in the WRONG directory
# The canonical source is ALWAYS: ufc-predict/webapp/frontend/
# The root webapp/ is ARCHIVED and must NEVER be deployed
ABORT if version.js shows v10.x or lower. You are in the stale root webapp/ directory.
Gate 1: Clean Working Tree
Run git status. If there are uncommitted changes, commit them first. NEVER deploy uncommitted code. A deploy without a backing git commit means the next deploy from git will OVERWRITE your changes. This caused permanent data loss on researcharia.com (2026-03-26).
Gate 2: CF vs Git Timestamp Check (FAILSAFE 9) Compare last Cloudflare deployment timestamp to last git commit:
npx [email protected] deployments list 2>&1 | tail -20 # Last CF deploy date
git log -1 --format='%ci' -- public/ # Last git commit to public/
If CF was deployed MORE RECENTLY than git's last public/ commit: STOP. Someone deployed changes directly to CF without committing. Deploying from git will OVERWRITE those changes with NO recovery path.
Gate 3: Version Regression Check (Universal) Before deploying ANY project:
# Run linter
npm run lint 2>&1 || { echo "ABORT: Lint failures"; exit 1; }
# Run tests
npm test 2>&1 || { echo "ABORT: Test failures"; exit 1; }
# Build production bundle
npm run build 2>&1 || { echo "ABORT: Build failed"; exit 1; }
ABORT if any pre-flight check fails. Do not deploy broken code.
npx wrangler whoamiwrangler.toml config matches target projectfunctions/ directory for Pages Functions that may need separate validation# Save current deployment info for rollback
CURRENT_DEPLOY=$(npx wrangler pages deployment list --project-name <PROJECT> 2>/dev/null | head -5)
echo "$CURRENT_DEPLOY" > .last_deploy_snapshot
# Deploy to Cloudflare Pages
npx wrangler pages deploy <BUILD_DIR> --project-name <PROJECT> 2>&1 | tee deploy.log
Or for Workers:
npx wrangler deploy 2>&1 | tee deploy.log
# Wait for propagation
sleep 30
# Check the live URL returns 200
HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" https://<LIVE_URL>)
if [ "$HTTP_STATUS" != "200" ]; then
echo "VERIFICATION FAILED: Got HTTP $HTTP_STATUS"
# Trigger rollback
fi
Also verify:
/api/ routes)Before deploying (step 3), snapshot key data counts from the live site:
# Snapshot pre-deploy counts (adjust endpoints per project)
PRE_EVENTS=$(curl -s https://<API>/events | jq 'length')
PRE_PICKS=$(curl -s https://<API>/picks | jq 'length')
echo "PRE-DEPLOY: $PRE_EVENTS events, $PRE_PICKS picks" > .deploy_baseline
After deploying (step 5), compare:
POST_EVENTS=$(curl -s https://<API>/events | jq 'length')
POST_PICKS=$(curl -s https://<API>/picks | jq 'length')
if [ "$POST_EVENTS" -lt "$((PRE_EVENTS * 95 / 100))" ]; then
echo "DATA REGRESSION: Events dropped from $PRE_EVENTS to $POST_EVENTS"
# Trigger rollback
fi
If any data count dropped >5%, rollback immediately. A site that loads with missing data is worse than a failed deploy.
If verification fails:
echo "Rolling back to previous deployment..."
npx wrangler pages deployment rollback --project-name <PROJECT>
echo "ROLLBACK COMPLETE — previous deployment restored"
Alert the user immediately about the failed deployment.
# Get current version from package.json
VERSION=$(node -p "require('./package.json').version")
# Tag and push
git tag -a "v$VERSION" -m "Release v$VERSION"
git push origin "v$VERSION"
echo "Deployed and tagged v$VERSION"
For simple deploys without the full pipeline:
npm run build && npx wrangler pages deploy <BUILD_DIR> --project-name <PROJECT>
All user projects are in iCloud Drive. Git operations and builds MUST happen from a non-iCloud clone:
git clone <repo> /tmp/<project-name>/tmp/<project-name>git push from the iCloud directory| Project | Type | Deploy Command | Live URL Pattern |
|---------|------|---------------|-----------------|
| OctagonAI (UFC) | Pages | wrangler pages deploy dist/ | octagonai.net |
| NHL | Workers/Pages | wrangler deploy or wrangler pages deploy | diamondpredictions.com |
| NBA | Pages | wrangler pages deploy dist/ | courtside-ai |
| MyStrainAI | Workers + Pages | wrangler deploy (backend) + wrangler pages deploy (frontend) | mystrainai.com |
| Enhanced Health AI | Workers (OpenNext) | wrangler deploy | enhanced-health-ai |
[[d1_databases]] in wrangler.toml match the production database[[kv_namespaces]] bindings are correct for the environmentwrangler secret list to verify API keys are set (never commit secrets)[vars] in wrangler.toml — production values, not dev defaultscompatibility_date is recent enough for features usedAfter ANY fix, feature, or change to a website — do ALL of these without being asked:
git add changed files + git commit with clear messagegit push origin mainThis pipeline is NOT optional. The user should never have to ask for any of these steps.
| tee deploy.log for all deploy commandstools
Unified context management and session continuity skill. Combines total-recall, strategic-compact, /ledger, and session continuity. Runs in background to preserve critical context across compaction and sessions.
tools
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
tools
Suggest /ultraplan for complex planning tasks on Claude Code CLI (2.1.91+ only). Research preview.
tools
UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 9 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind, shadcn/ui). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient. Integrations: shadcn/ui MCP for component search and examples.