Token导航 LogoToken导航TokenDH.com
前端设计敏感数据github未标认证来源可访问许可证需确认审计通过

cloudflare-pagescloudflare 页面

Agent Skill

cloudflare-pages 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

569

周安装

23

GitHub Stars

14

下载量

178
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:cloudflare-pages(cloudflare 页面)
来源仓库:https://github.com/itechmeat/llm-code
仓库路径:skills/cloudflare-pages
安装命令:
npx skills add https://github.com/itechmeat/llm-code --skill cloudflare-pages
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/itechmeat/llm-code --skill cloudflare-pages

简介

cloudflare-pages 用于处理 GitHub 仓库、Issue、Pull Request 等代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中进行项目状态跟踪。

  • 适用于 Cloudflare Pages 相关的网站部署和静态资源管理工作。
  • 通过 GitHub API 调用、代码审查和协作流程管理来处理开发任务。
  • 安装命令:npx skills add https://github.com/itechmeat/llm-code --skill cloudflare-pages
  • 建议确认 GitHub 访问权限和仓库读写权限,注意 API 调用限制

SKILL.md

Cloudflare Pages

Full-stack application hosting with Git-based or Direct Upload deployments to Cloudflare's global network.

Quick Navigation

  • Deployment methods → references/deployment.md
  • Build configuration → references/build.md
  • Pages Functions → references/functions.md
  • Bindings → references/bindings.md
  • Headers & Redirects → references/headers-redirects.md
  • Custom domains → references/domains.md
  • Wrangler CLI → references/wrangler.md

When to Use

  • Deploying static sites or JAMstack applications
  • Building full-stack apps with serverless functions
  • Configuring Git-based CI/CD deployments
  • Using Direct Upload for prebuilt assets
  • Setting up preview deployments for branches/PRs
  • Configuring custom domains and redirects

Deployment Methods

MethodBest ForLimits
Git integrationCI/CD from GitHub/GitLabCannot switch to Direct Upload later
Direct UploadPrebuilt assets, CI pipelinesWrangler: 20k files, 25 MiB/file
C3 CLINew project scaffoldingFramework-dependent

Quick Deploy

# Create project
npx wrangler pages project create my-project

# Deploy
npx wrangler pages deploy ./dist

# Preview deployment (branch)
npx wrangler pages deploy ./dist --branch=feature-x

Build Configuration

# Framework presets (command → output directory)
# React (Vite): npm run build → dist
# Next.js:      npx @cloudflare/next-on-pages@1 → .vercel/output/static
# Nuxt.js:      npm run build → dist
# Astro:        npm run build → dist
# SvelteKit:    npm run build → .svelte-kit/cloudflare
# Hugo:         hugo → public

Environment Variables (build-time)

VariableValue
CF_PAGES1
CF_PAGES_BRANCHBranch name
CF_PAGES_COMMIT_SHACommit SHA
CF_PAGES_URLDeployment URL

Pages Functions

File-based routing in /functions directory:

/functions/index.js       → example.com/
/functions/api/users.js   → example.com/api/users
/functions/users/[id].js  → example.com/users/:id
// functions/api/hello.js
export function onRequest(context) {
  return new Response("Hello from Pages Function!");
}

Handler Types

ExportTrigger
onRequestAll methods
onRequestGetGET only
onRequestPostPOST only

Context Object

interface EventContext {
  request: Request;
  env: Env; // Bindings
  params: Params; // Route parameters
  waitUntil(promise: Promise<any>): void;
  next(): Promise<Response>;
  data: Record<string, any>;
}

Bindings

Access Cloudflare resources via context.env:

BindingAccess Pattern
KVcontext.env.MY_KV.get("key")
R2context.env.MY_BUCKET.get("file")
D1context.env.MY_DB.prepare("...").all()
Workers AIcontext.env.AI.run(model, input)
For detailed binding configuration, see: cloudflare-workers skill.

Headers & Redirects

Create _headers and _redirects in build output directory.

# _headers
/*
  X-Frame-Options: DENY
/static/*
  Cache-Control: public, max-age=31536000, immutable
# _redirects
/old-page /new-page 301
/blog/* https://blog.example.com/:splat
Warning: _headers and _redirects do NOT apply to Pages Functions responses.

Functions Invocation Routes

Control when Functions are invoked with _routes.json:

{
  "version": 1,
  "include": ["/api/*"],
  "exclude": ["/static/*"]
}

Wrangler Configuration

// wrangler.jsonc
{
  "name": "my-pages-app",
  "pages_build_output_dir": "./dist",
  "compatibility_date": "2024-01-01",
  "kv_namespaces": [{ "binding": "KV", "id": "<NAMESPACE_ID>" }],
  "d1_databases": [{ "binding": "DB", "database_name": "my-db", "database_id": "<ID>" }]
}

Local Development

npx wrangler pages dev ./dist

# With bindings
npx wrangler pages dev ./dist --kv=MY_KV --d1=MY_DB=<ID>

Critical Prohibitions

  • Do NOT expect _headers/_redirects to apply to Pages Functions responses — attach headers in code
  • Do NOT convert Direct Upload project to Git integration — not supported
  • Do NOT exceed redirect limits — 2,000 static + 100 dynamic redirects max
  • Do NOT use absolute URLs for proxying in _redirects — relative URLs only
  • Do NOT edit bindings in dashboard when using Wrangler config — file is source of truth
  • Do NOT store secrets in wrangler.toml — use dashboard or .dev.vars for local

Common Gotchas

IssueSolution
Functions not invokedCheck _routes.json include/exclude patterns
Headers not appliedEnsure not a Functions response; attach in code
Build failsCheck build command exit code (must be 0)
Custom domain inactiveVerify DNS CNAME points to <site>.pages.dev
Preview URLs indexedDefault X-Robots-Tag: noindex applied automatically

Quick Recipes

Conditional Build Command

#!/bin/bash
if [ "$CF_PAGES_BRANCH" == "production" ]; then
  npm run build:prod
else
  npm run build:dev
fi

SPA Fallback (404.html)

Upload 404.html in build output root for SPA routing.

Disable Functions for Static Assets

// _routes.json
{
  "version": 1,
  "include": ["/api/*"],
  "exclude": ["/*"]
}

Links

Related Skills

  • cloudflare-workers — Worker runtime, bindings API details
  • cloudflare-d1 — D1 SQL database operations
  • cloudflare-r2 — R2 object storage
  • cloudflare-kv — KV namespace operations

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.36%
按下载量换算65

Claude

29.43%
按下载量换算52

Cursor

19.4%
按下载量换算35

Gemini CLI

8.99%
按下载量换算16

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills