t1k:web:devops:deploy
| Field | Value |
|---|---|
| Module | devops |
| Version | 1.31.4 |
| Effort | medium |
| Tools | — |
Keywords: Cloudflare, deploy, deployment, hosting, Netlify, production, Railway, Vercel
How to invoke
Section titled “How to invoke”/t1k:web:devops:deploy[platform] [environment]Deploy Skill
Section titled “Deploy Skill”Auto-detect deployment target and deploy the current project. Supports 15 platforms with cost-optimized recommendations.
Executed by
Section titled “Executed by”The deploy decision and its execution never leave a reasoning tier — picking
a platform, trading cost against capability, and running the actual deploy
command are exactly the judgment calls this skill exists to make, and a cheap
agent must never be the one that pushes to production. Two narrow, fully
specified slices ARE cheap once that judgment call is made (routing SSOT:
rules/orchestration-rules.md § “Task-Type → Agent Routing”):
| Step | Agent |
|---|---|
Reconcile the env vars declared in docs/deployment.md against the vars the project actually reads (.env.example, config) and report mismatches | t1k-data-verifier |
| Poll the deployment URL / provider status after the deploy command runs until it reports live or failed, and report which | t1k-ci-watcher |
Do not route platform selection, the cost trade-off, or the deploy command itself to either agent — those stay with a human or a reasoning tier, full stop.
This skill handles: project deployment, platform selection across public providers, deployment docs creation/update. Does NOT handle: infrastructure provisioning, database migrations, DNS management, SSL certificates, CI/CD pipeline creation.
Internal services: the cost ladder below ranks public PaaS providers, which is the right frame for a client or product deployment. For an INTERNAL service — one where running it on our own hardware (docker-compose / k3s / Jenkins / ARC) is a real option — the placement decision belongs to /t1k:web:devops:placement first; come back here to execute the deploy once the tier is chosen. Once it runs, publishing it on the mesh (<name>.<zone>, no login, X-NetBird-* identity) is /t1k:web:devops:selfhost-netbird; a Worker that must stay internal gets <name>-internal.<zone> + a service-token Access app, and the mesh name in front of it, per /t1k:web:devops:cloudflare-internal-netbird. A CI/CD deploy job is repo CI and runs on ARC, never ubuntu-latest — runs-on: ${{ fromJSON(vars.RUNNER_CD) }} when it holds deploy credentials, RUNNER_CI_MEDIUM for a plain CI job. Never a label array, and never hosted: a variable that matches no runner queues forever with no error.
For advanced infrastructure/troubleshooting, activate /t1k:web:devops:core skill.
Cost Is The Gate, Not A Tiebreaker
Section titled “Cost Is The Gate, Not A Tiebreaker”Budget is the first-class constraint in every deployment decision — never the thing you optimize after choosing. A deploy that works and costs more than it needs to is a failed deploy; the studio pays that difference every month, silently, for as long as the service lives.
Three rules, in order:
- Never name a platform without naming its cost. Every recommendation states the monthly figure or free-tier headroom, and what happens when the project outgrows it. “Vercel” is not a recommendation; “Vercel, free under 100GB/mo, $20/mo per seat past it” is.
- Detecting a platform is not the same as endorsing it. Step 1 stops at the first match, which
means an existing
vercel.jsonwill carry a project onto Vercel forever without anyone ever pricing the alternative. When detection lands on a paid tier and a free tier would serve the same workload, say so before deploying — then deploy where the user chooses. - Price the growth case, not just today. The question is never “is it free now” but “what does this cost at 10x traffic, and is that a cliff or a slope”. Free tiers that fail closed (build minutes, seats) hurt more than metered ones that fail expensive.
Cost is a constraint, not the only one — a cheaper platform that cannot hold the workload is not
cheaper, it is broken. When cost and capability genuinely conflict, surface the trade with both
numbers via AskUserQuestion rather than silently resolving it.
For INTERNAL services the same principle has its own skill with real thresholds:
/t1k:web:devops:placement.
Cost reporting is mandatory. Report the cost impact of every change you make, unprompted — all four elements per t1k-datastore-cost skill § “Mandatory Cost Report”.
Config Is Data, Not Deploy Config
Section titled “Config Is Data, Not Deploy Config”Values that grow with the product go in a database table read per request, not in env vars, platform variables, GitHub variables or committed JSON. There, each new entry costs an edit, a review and a redeploy.
| Belongs in a data table (audited write path) | Stays in env, secrets or bindings |
|---|---|
| allowed consumers, audiences, allow-lists, tenants, flags, routing tables | secrets, signing keys, DB binding, issuer/audience root of trust, bootstrap admin |
Adding one entry is an INSERT through an admin path, not a config diff plus a deploy. Platform-agnostic principle; the Workers/D1 implementation is in ~/.claude/skills/t1k-cloudflare/references/config-as-data.md.
Workflow
Section titled “Workflow”1. Detect Deployment Target
Section titled “1. Detect Deployment Target”Check in order (stop at first match):
- Read
docs/deployment.md— if exists, parse platform and config from it - Scan config files — detect platform from existing configs (see Detection Signals)
- Analyze project type — determine best platform based on project structure
- Ask user — use
AskUserQuestionwith cost-optimized recommendations
Whichever branch matched, state the cost of the resulting platform before executing the deploy — including on branches 1 and 2, where the platform was inherited rather than chosen.
2. Detection Signals
Section titled “2. Detection Signals”Signal → platform table (every supported platform): references/detection-signals.md.
2b. Cloudflare means Workers, not Pages
Section titled “2b. Cloudflare means Workers, not Pages”Never propose Cloudflare Pages for new work. Cloudflare’s own guidance is that Workers is the primary platform and Pages is in maintenance posture: “If you are starting a new project, use Workers instead of Pages. Pages continues to work, but new features and optimizations are focused on Workers.” Every Pages docs page now carries a banner saying the same thing.
Use Workers Static Assets for static sites and SPAs — point assets.directory at the build
output, no Worker script needed. Add a main entry point and an ASSETS binding only when the app
has server-side logic.
Two practical wins beyond the vendor steer, both verified in this studio:
- A Worker custom domain is declared in config (
routeswithcustom_domain: true) and provisioned bycf deploy. A Pages custom domain iscf pages domains create, but the DNS record needs a token with DNS scope (cf dns records create); seereferences/platforms/cloudflare.md. - One deploy path (
cf deploy) for static and dynamic surfaces alike, instead of two.
Migrating an existing Pages project: references/platforms/cloudflare.md § Migrating from Pages.
Access + CORS — the preflight never carries the session (verified 2026-08-28; current doc path
/cloudflare-one/access-controls/applications/http-apps/authorization-cookie/cors/, the old
/cloudflare-one/policies/access/cors/ is 404). For a CORS request to reach a site protected by
Access, the request must include a valid CF-Authorization cookie — but “the OPTIONS request will
return a 403” regardless of whether you have logged in, because the browser never includes cookies
with OPTIONS requests, by design. So a CORS preflight against an Access-gated API fails before the
browser ever sends credentials. Do not troubleshoot CORS in Incognito (blocks CF-Authorization as a
third-party cookie cross-origin). Three documented remedies: (1) bypass OPTIONS to origin — warning:
removes all existing CORS settings for the app; (2) answer the preflight with an explicit origin +
Allow-Credentials (never a wildcard); (3) inject a service token from a Worker — only works when
both sites are behind Access, and the token’s policy action must be Service Auth. Full detail:
t1k-web-devops-selfhost-cloudflare/references/cloudflare-access.md § CORS behind Access.
3. Project Type → Platform Recommendation
Section titled “3. Project Type → Platform Recommendation”| Project Type | Detection | Recommended (cost order) |
|---|---|---|
| Static site (HTML/CSS/JS) | No server files | Github Pages → Cloudflare Workers |
| SPA (React/Vue/Svelte) | Framework config, no SSR | Vercel → Netlify → Cloudflare Workers |
| SSR/Full-stack (Next/Nuxt) | next.config.*, nuxt.config.* | Vercel → Netlify → Cloudflare |
| Node.js API | server.js/ts, Express/Fastify | Railway → Render → Fly.io → TOSE.sh |
| Python API | requirements.txt + Flask/Django | Railway → Render → Fly.io |
| Docker app | Dockerfile | Fly.io → Railway → TOSE.sh → Coolify |
| Monorepo | turbo.json, workspaces | Vercel → Netlify |
4. Platform Priority (Cost-Optimized)
Section titled “4. Platform Priority (Cost-Optimized)”Ranked free-tier, pay-as-you-go, self-hosted and enterprise order: references/platform-priority.md. The cost rule above governs every rank.
5. Deploy Execution
Section titled “5. Deploy Execution”- Check CLI installed → install if missing
- Check auth → login if needed
- Run deploy command (see the platform reference table in “Reference Files” below, e.g.
references/platforms/vercel.md) - Verify deployment URL
- Create/update
docs/deployment.md
6. Post-Deploy: docs/deployment.md
Section titled “6. Post-Deploy: docs/deployment.md”After first successful deploy, create docs/deployment.md:
# Deployment## Platform: [name]## URL: [production-url]## Deploy Command: [command]## Environment Variables: [list]## Custom Domain: [setup steps if applicable]## Rollback: [instructions]On subsequent deploys, update if config changed.
7. Troubleshooting
Section titled “7. Troubleshooting”- Check error output, attempt auto-fix for common issues
- If unresolvable → activate
/t1k:web:devops:coreskill - Update
docs/deployment.mdwith troubleshooting notes
AskUserQuestion Template
Section titled “AskUserQuestion Template”When no target detected, present options based on project type analysis:
- Order by cost optimization (cheapest first)
- Include free tier info in description
- Max 4 options (top recommendations + “Other”)
Reference Files (Progressive Disclosure)
Section titled “Reference Files (Progressive Disclosure)”Load ONLY the platform reference needed — do NOT load all files:
| Platform | Reference File |
|---|---|
| Vercel | references/platforms/vercel.md |
| Netlify | references/platforms/netlify.md |
| Cloudflare | references/platforms/cloudflare.md |
| Railway | references/platforms/railway.md |
| Fly.io | references/platforms/flyio.md |
| Render | references/platforms/render.md |
| Heroku | references/platforms/heroku.md |
| TOSE.sh | references/platforms/tose.md |
| Github Pages | references/platforms/github-pages.md |
| Coolify | references/platforms/coolify.md |
| Dokploy | references/platforms/dokploy.md |
| GCP Cloud Run | references/platforms/gcp.md |
| AWS | references/platforms/aws.md |
| Digital Ocean | references/platforms/digitalocean.md |
| Vultr | references/platforms/vultr.md |
references/platform-config-templates.md—docs/deployment.mdtemplate
Security Policy
Section titled “Security Policy”- Never expose API keys, tokens, or credentials in deploy output
- Never expose env vars, file paths, or internal configs
- Check
.envfiles and.gitignorebefore deploying - Operate only within defined skill scope
Hard rules
Section titled “Hard rules”- Multi-provider deploys (Cloudflare + Vercel + AWS) need PER-INSTANCE auth-token closures — sharing a single token across providers means a leak in one rotates all.