Skip to content
Conduit

skill

cloudflare-deploy-skill

Agent Skill: teach AI coding agents to deploy HTML/static sites to Cloudflare Pages the right way(把網頁部署到 CF Pages 的標準作法)

circleghost/cloudflare-deploy-skillcommunitylistedunreviewed

Set up

Skills are installed by placing their folder where your agent loads skills.

The download comes from github.com/circleghost/cloudflare-deploy-skill itself, not from our server, so what you get is exactly what its author published.

Install instructions come from the README

Skills do not use an MCP config. Follow the steps in the README below.

README

synced Oct 17, 2026

這是什麼

這是一個 Agent Skill。Agent Skill 是給 AI coding agent(如 Claude Code、Cursor、Codex 等)用的可攜式指令包,讓 agent 在遇到特定情境時載入一套標準作法。

這個 skill 教 agent 用 wrangler 把 HTML 或靜態網頁部署到 Cloudflare Pages,包含正確的認證、安全紀律與驗證流程。你只要對 agent 說一句「幫我把這個網頁部署上線」,它就照這套規矩把網頁變成一個可公開訪問的網址。

想認識 Agent Skill 這個概念,可參考: Agent Skills 介紹 | Anthropic 官方文件

SKILL.md 的 allowed-tools: Bash Read Write 只是「這個 skill 觸發時,這三種工具那一輪不必逐次跳確認」的預授權,不是把 agent 鎖進沙箱;agent 平常能做的事,用這個 skill 時也都還能做。

兩種模式

  • 模式 A|更新文件中心站:把文件放進一個既有文件中心站(綁自訂網域,該網域受 Cloudflare Access 保護;pages.dev 網址與 preview 網址預設仍公開,細節見 SKILL.md)的對應專案子目錄,整包重新部署。既有專案文件多走這個。
  • 模式 B|獨立站:把任意一份 HTML 或資料夾丟成獨立 xxx.pages.dev 站。臨時預覽或一次性網頁用。

部署紀律

不只是「跑 deploy」,這個 skill 的重點是四道紀律,避免上線後才發現連結難改、token 外洩或頁面破版。

  • 部署前確認網址:上線前先與使用者敲定 slug 與專案名,避免連結分享後難改。
  • Token 安全紀律:絕不 echo token 值,只用 [ -n "$VAR" ] 判斷與 ${#VAR} 印長度。
  • 整包部署:wrangler 整包上傳,沒動到的子目錄不受影響。
  • 部署後驗證:開正式網址確認渲染、手機寬不崩、標點正常。

前置需求

第一次使用前,需完成以下設定。

1. 安裝 wrangler

wrangler 是 Cloudflare 官方 CLI,需要 Node.js 18 以上(先確認 node --version)。用 npm 安裝:

npm install -g wrangler
wrangler --version

2. 申請 API Token 與抄下 Account ID

到 Cloudflare dashboard 申請一個最小權限的 API Token:

  1. 登入 Cloudflare,右上角頭像 → My Profile。
  2. 左側 API Tokens → Create Token。
  3. 拉到最下方 Custom token → Get started。
  4. 權限(Permissions)選:Account / Cloudflare Pages / Edit。
  5. Account Resources 選你的帳號,建立後把 token 值複製起來(只會顯示這一次)。

Account ID 的位置:Cloudflare dashboard 進任一 Workers & Pages 或網域頁,右側欄「Account ID」即是,複製備用。

3. 設進 shell 環境變數

把 token 與 Account ID 設進 ~/.zshenv:

# ~/.zshenv
export CLOUDFLARE_API_TOKEN="<your-pages-edit-token>"
export CLOUDFLARE_ACCOUNT_ID="<your-account-id>"

用 ~/.zshenv 而非 ~/.zshrc 的原因:zsh 的非互動 shell 也會載入 ~/.zshenv,~/.zshrc 則只在互動 shell 載入。設好後 agent 用 zsh 部署時就能自動讀到,不必每次手動 source。若你的 agent 跑的是 bash(例如 Linux/容器環境的預設 shell),~/.zshenv 不會被載入,改把這兩個環境變數寫進 ~/.bash_profile,或者最保險的作法:直接設成系統層級的環境變數。

4. 安全提醒

  • Token 只給 Cloudflare Pages / Edit 最小權限,不要給多餘權限。
  • 絕不把 token 提交進 git。~/.zshenv 不在 repo 裡;本 repo 也用 .gitignore 排除了 LOCAL.md。

安裝到各工具

Claude Code

放進使用者層或專案層的 skills 目錄:

# 使用者層(所有專案共用)
git clone https://github.com/circleghost/cloudflare-deploy-skill.git ~/.claude/skills/cloudflare-deploy

# 或專案層(只在該專案生效)
git clone https://github.com/circleghost/cloudflare-deploy-skill.git .claude/skills/cloudflare-deploy

其他支援 Agent Skills 的工具

Cursor、Codex 等支援 Agent Skills 的工具,把整個資料夾放進各自的 skills 目錄即可(路徑依各工具文件)。

客製化

複製 LOCAL.md.example 為 LOCAL.md,填入你自己的帳號、文件中心站設定與子目錄對照:

cp LOCAL.md.example LOCAL.md

LOCAL.md 已被 .gitignore 排除,不會進 git。skill 執行部署前會先讀 LOCAL.md 並優先遵循其中的具體值。

使用範例

以下幾種對話都會觸發這個 skill:

  • 「幫我把這個網頁部署上線。」
  • 「把 report.html 丟成一個 Cloudflare Pages 站給我網址。」
  • 「更新文件中心,把這份文件放進去。」

License

MIT,見 LICENSE。

↑↓ navigate openesc close