deploy-preflight
Pre-flight validation for Cloudflare Workers deployments.
Install
mkdir -p .claude/skills/deploy-preflight && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/16754" && unzip -o skill.zip -d .claude/skills/deploy-preflight && rm skill.zipInstalls to .claude/skills/deploy-preflight
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Pre-deploy verification for the quidproquo Cloudflare Workers site — run lint / astro check / tests / check:references, sanity-check git state and wrangler config, and produce a go/no-go report before `pnpm deploy`. Does NOT deploy. Use when user says 準備 deploy / 上線前檢查 / preflight / 部署前看一下.Key capabilities
- →Check Git status for uncommitted files and branch information
- →Verify `pnpm-lock.yaml` and install dependencies
- →Run lint checks with oxlint
- →Perform type and Astro checks
- →Execute test suites and identify untested features
How it works
The skill performs a series of checks including Git status, dependency installation, linting, type checks, tests, reference checks, build dry-run, and Wrangler/secrets self-checks to produce a go/no-go report for deployment.
Inputs & outputs
When to use deploy-preflight
- →Check deploy readiness
- →Validate cloudflare configuration
- →Run pre-flight tests
About this skill
deploy-preflight skill
部署到 Cloudflare 前的最後檢查。只檢查與報告,不執行 deploy。失敗項目要先修才能上線。
執行步驟
按順序跑,任何一步紅就停,把 log 給使用者看。
1. Git 狀態
git status --short
git rev-parse --abbrev-ref HEAD
git log @{u}.. --oneline 2>/dev/null
報告:
- 有沒有未 commit 的檔案
- 在哪個 branch(不是 main / master 要警告)
- 本地有幾個 commit 還沒 push
- 是否落後 origin
2. 依賴
pnpm install --frozen-lockfile
pnpm-lock.yaml 過期 → 先 pnpm install 更新並要求 commit。
3. Lint
pnpm lint
oxlint,error 一定修;warning 列給使用者看,自己決定。
4. 型別 / Astro 檢查
pnpm astro check
CLAUDE.md 提到 require CJS warning from Workers adapter 是 non-fatal。其他 error 要修。
5. Tests
pnpm test
全綠才能過。沒測試的功能標記為「無覆蓋風險」。
6. 文章參考資料
pnpm check:references
最近改過的 post 一定要過。
7. Build dry-run
pnpm build
Build 成功才表示 cron stub、OG image 生成、astro build 都 OK。Build artifacts 在 dist/,不要 commit。
8. Wrangler / secrets 自查
讀 wrangler.toml / wrangler.jsonc / dist/server/wrangler.json(build 後實際部署用的設定),列出:
- D1 binding(資料庫名、id)
- Vectorize binding
- KV binding
- AI binding
- 預期需要的 secrets(從 progress.txt:
ANTHROPIC_API_KEY/LANGFUSE_PUBLIC_KEY/LANGFUSE_SECRET_KEY/ADMIN_PASSWORD)
不讀或列出 secret 值。只檢查 wrangler secret list 是否齊全:
wrangler secret list
缺哪個就列哪個,提醒使用者 wrangler secret put <NAME>。
9. Feature flags 確認
CLAUDE.md:「Feature flags are mandatory for all advanced/experimental techniques (RAG, embeddings, AI features)」。
問使用者:
- 這次 deploy 有新的 RAG / AI 功能嗎?
- flag 預設關閉嗎?
- 開啟條件寫清楚了嗎?
10. 產出 go/no-go 報告
Preflight: <branch>
─────────────────────
✅ git clean
✅ lint
✅ astro check
🟡 1 commit ahead of origin (建議先 push)
✅ test (24 passed)
✅ check:references
✅ build
🟡 wrangler secret 缺:LANGFUSE_SECRET_KEY
─────────────────────
建議:補 LANGFUSE_SECRET_KEY 後再 deploy
反合理化
| 想偷懶 | 為什麼不行 |
|---|---|
| 「跑 build 就跳過 test」 | build 過 ≠ 邏輯對;test 是另一條防線 |
「直接 pnpm deploy 不 preflight」 | Cloudflare 部署回滾要重新 build,比 preflight 慢得多 |
| 「未 push 也 deploy」 | 線上版跟 git 對不上,後續查 bug 找不到對應 commit |
| 「忽略 wrangler secret 缺」 | 線上會 runtime error,使用者第一個發現問題 |
| 「直接幫 deploy」 | preflight 不 deploy;通過後使用者自己決定要不要 pnpm deploy |
不在這個 skill 範圍
- 實際執行
pnpm deploy(使用者自己跑) - 設定 wrangler secret(使用者自己
wrangler secret put) - 建立 D1 / Vectorize / KV resource(一次性,不在 preflight)
詳細參考
- 部署相關 npm script:
package.json→deploy、build - Cloudflare 設定:
wrangler.toml/wrangler.jsonc
When not to use it
- →When the goal is to deploy the application directly
- →When setting up wrangler secrets or Cloudflare resources for the first time
Limitations
- →The skill does not perform the actual deployment.
- →The skill does not set up Wrangler secrets or Cloudflare resources.
How it compares
This skill automates a complete pre-deployment verification process, identifying potential issues before actual deployment, which is more efficient than manual checks or direct deployment.
Compared to similar skills
deploy-preflight side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| deploy-preflight (this skill) | 0 | 1mo | Review | Intermediate |
| gcp-cloud-run | 5 | 5mo | Review | Intermediate |
| deployment-pipeline-design | 6 | 3mo | Review | Advanced |
| cloudflare-deploy | 3 | 6mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
gcp-cloud-run
aj-geddes
Deploy containerized applications on Google Cloud Run with automatic scaling, traffic management, and service mesh integration. Use for container-based serverless computing.
deployment-pipeline-design
wshobson
Design multi-stage CI/CD pipelines with approval gates, security checks, and deployment orchestration. Use when architecting deployment workflows, setting up continuous delivery, or implementing GitOps practices.
cloudflare-deploy
davila7
Deploy applications and infrastructure to Cloudflare using Workers, Pages, and related platform services. Use when the user asks to deploy, host, publish, or set up a project on Cloudflare.
mlops-engineer
sickn33
Build comprehensive ML pipelines, experiment tracking, and model registries with MLflow, Kubeflow, and modern MLOps tools. Implements automated training, deployment, and monitoring across cloud platforms. Use PROACTIVELY for ML infrastructure, experiment management, or pipeline automation.
github-release-management
ruvnet
Comprehensive GitHub release orchestration with AI swarm coordination for automated versioning, testing, deployment, and rollback management
senior-devops
davila7
Comprehensive DevOps skill for CI/CD, infrastructure automation, containerization, and cloud platforms (AWS, GCP, Azure). Includes pipeline setup, infrastructure as code, deployment automation, and monitoring. Use when setting up pipelines, deploying applications, managing infrastructure, implementing monitoring, or optimizing deployment processes.