Token导航 LogoToken导航

Agent Skill · 前端设计

cloudflare-full-stack-integration(cloudflare 全栈集成)

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

cloudflare-full-stack-integration 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证为 MIT,第三方扫描已通过,按安装量在前端设计类的 10,216 个 Skill 里排第 4,711。

总安装 823周安装 35GitHub Stars 14下载 288核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/jackspace/claudeskillz --skill cloudflare-full-stack-integration

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

cloudflare-full-stack-integration 实现 React 前端与 Workers 后端的全栈集成。集成 Clerk 身份验证并解决 CORS 和令牌注入问题。提供受保护路由和数据库访问的完整代码示例。包含环境变量配置和环境隔离的最佳实践建议。

适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/cloudflare-full-stack-integration

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/jackspace/claudeskillz --skill cloudflare-full…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

cloudflare-full-stack-integration 怎么安装?

在终端执行 npx skills add https://github.com/jackspace/claudeskillz --skill cloudflare-full-stack-int…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

cloudflare-full-stack-integration 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

cloudflare-full-stack-integration 需要什么权限?

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

cloudflare-full-stack-integration 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

cloudflare-full-stack-integration 用的人多吗?

公开数据是累计安装 823 次,近一周安装 35 次,下载 288 次,GitHub 14 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

cloudflare-full-stack-integration 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
cloudflare-full-stack-integration

cloudflare 全栈集成 · 本页

82314接触敏感数据MIT通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Cloudflare Full-Stack Integration Patterns

Production-tested patterns for React + Cloudflare Workers + Hono + Clerk authentication.

When to Use This Skill

Use this skill when you need to:

  • Connect a React frontend to a Cloudflare Worker backend
  • Implement authentication with Clerk in a full-stack app
  • Set up API calls that automatically include auth tokens
  • Fix CORS errors between frontend and backend
  • Prevent race conditions with auth loading
  • Configure environment variables correctly
  • Set up D1 database access from API routes
  • Create protected routes that require authentication

What This Skill Provides

Templates

Frontend (templates/frontend/):

  • lib/api-client.ts - Fetch wrapper with automatic token attachment
  • components/ProtectedRoute.tsx - Auth gate pattern with loading states

Backend (templates/backend/):

  • middleware/cors.ts - CORS configuration for dev and production
  • middleware/auth.ts - JWT verification with Clerk
  • routes/api.ts - Example API routes with all patterns integrated

Config (templates/config/):

  • wrangler.jsonc - Complete Workers configuration with bindings
  • .dev.vars.example - Environment variables setup
  • vite.config.ts - Cloudflare Vite plugin configuration

References (references/):

  • common-race-conditions.md - Complete guide to auth loading issues

Critical Architectural Insights

1. @cloudflare/vite-plugin Runs on SAME Port

Key Insight: The Worker and frontend run on the SAME port during development.

// ✅ CORRECT: Use relative URLs
fetch('/api/data')

// ❌ WRONG: Don't use absolute URLs or proxy
fetch('http://localhost:8787/api/data')

Why: The Vite plugin runs your Worker using workerd directly in the dev server. No proxy needed!

2. CORS Must Be Applied BEFORE Routes

// ✅ CORRECT ORDER
app.use('/api/*', cors())
app.post('/api/data', handler)

// ❌ WRONG ORDER - Will cause CORS errors
app.post('/api/data', handler)
app.use('/api/*', cors())

3. Auth Loading is NOT a Race Condition

Most "race conditions" are actually missing isLoaded checks:

// ❌ WRONG: Calls API before token ready
useEffect(() => {
  fetch('/api/data') // 401 error!
}, [])

// ✅ CORRECT: Wait for auth to load
const { isLoaded, isSignedIn } = useSession()
useEffect(() => {
  if (!isLoaded || !isSignedIn) return
  fetch('/api/data') // Now token is ready
}, [isLoaded, isSignedIn])

4. Environment Variables Have Different Rules

Frontend (Vite):

  • MUST start with VITE_ prefix
  • Defined in .env file
  • Access: import.meta.env.VITE_VARIABLE_NAME

Backend (Workers):

  • NO prefix required
  • Defined in .dev.vars file (dev) or wrangler secrets (prod)
  • Access: env.VARIABLE_NAME

5. D1 Bindings Are Always Available

D1 is accessed via bindings - no connection management needed:

// ✅ CORRECT: Direct access via binding
const { results } = await env.DB.prepare('SELECT * FROM users').run()

// ❌ WRONG: No need to "connect" first
const connection = await env.DB.connect() // This doesn't exist!

Step-by-Step Integration Guide

Step 1: Project Setup

# Create project with Cloudflare Workers + React
npm create cloudflare@latest my-app
cd my-app

# Install dependencies
npm install hono @clerk/clerk-react @clerk/backend
npm install -D @cloudflare/vite-plugin @tailwindcss/vite

Step 2: Configure Vite

Copy templates/config/vite.config.ts to your project root.

Key points:

  • Includes cloudflare() plugin
  • No proxy configuration needed
  • Sets up path aliases for clean imports

Step 3: Configure Wrangler

Copy templates/config/wrangler.jsonc to your project root.

Update:

  • Replace name with your app name
  • Add D1/KV/R2 bindings as needed
  • Set run_worker_first: ["/api/*"] for API routes

Step 4: Set Up Environment Variables

Create .dev.vars (gitignored):

CLERK_PUBLISHABLE_KEY=pk_test_xxxxx
CLERK_SECRET_KEY=sk_test_xxxxx

Create .env for frontend:

VITE_CLERK_PUBLISHABLE_KEY=pk_test_xxxxx

Step 5: Add CORS Middleware

Copy templates/backend/middleware/cors.ts to your backend.

Apply in your main worker file:

import { corsMiddleware } from './middleware/cors'

app.use('/api/*', (c, next) => corsMiddleware(c.env)(c, next))

CRITICAL: Apply this BEFORE defining routes!

Step 6: Add Auth Middleware

Copy templates/backend/middleware/auth.ts to your backend.

Apply to protected routes:

import { jwtAuthMiddleware } from './middleware/auth'

app.use('/api/protected/*', jwtAuthMiddleware(c.env.CLERK_SECRET_KEY))

Step 7: Set Up API Client

Copy templates/frontend/lib/api-client.ts to your frontend.

Use in your App component:

import { useApiClient } from '@/lib/api-client'

function App() {
  useApiClient() // Set up token access
  return <YourApp />
}

Step 8: Create Protected Routes

Copy templates/frontend/components/ProtectedRoute.tsx.

Use to wrap authenticated pages:

<ProtectedRoute>
  <Dashboard />
</ProtectedRoute>

Step 9: Create API Routes

Copy templates/backend/routes/api.ts as a reference.

Pattern for all routes:

  1. Apply CORS first
  2. Apply auth middleware to protected routes
  3. Extract user ID from JWT payload
  4. Access D1/KV/R2 via env bindings
  5. Return typed JSON responses

Step 10: Test Integration

# Start dev server
npm run dev

# Both frontend and backend run on http://localhost:5173
# API routes: http://localhost:5173/api/*
# Frontend: http://localhost:5173/*

Common Issues and Solutions

Issue: 401 Unauthorized Errors

Symptom: API calls fail with 401 even though user is signed in

Cause: API called before Clerk session is loaded

Fix: Check isLoaded and isSignedIn before API calls

const { isLoaded, isSignedIn } = useSession()
if (!isLoaded || !isSignedIn) return // Wait for auth

See: references/common-race-conditions.md

Issue: CORS Errors

Symptom: "No 'Access-Control-Allow-Origin' header" errors

Causes:

  1. CORS middleware not applied
  2. CORS middleware applied after routes (wrong order)
  3. Origin not allowed in production

Fix:

// Apply BEFORE routes
app.use('/api/*', cors())
app.post('/api/data', handler)

For production, update corsProdMiddleware with your domain.

Issue: Environment Variables Not Working

Symptom: Variables are undefined in frontend or backend

Frontend Fix:

  • Variables MUST start with VITE_
  • Must be in .env file (not .dev.vars)
  • Access: import.meta.env.VITE_NAME

Backend Fix:

  • Variables in .dev.vars for local dev
  • Use wrangler secret put NAME for production
  • Access: env.NAME

Issue: D1 Queries Fail

Symptom: Database queries throw errors

Causes:

  1. Binding not configured in wrangler.jsonc
  2. SQL syntax errors
  3. Not using parameterized queries

Fix:

// ✅ CORRECT: Parameterized query
await env.DB.prepare('SELECT * FROM users WHERE id = ?')
  .bind(userId)
  .run()

// ❌ WRONG: SQL injection risk
await env.DB.prepare(`SELECT * FROM users WHERE id = ${userId}`).run()

Issue: Token Not Attached to Requests

Symptom: Backend receives requests without Authorization header

Cause: Not using apiClient or not calling useApiClient() hook

Fix:

  1. Call useApiClient() in App component
  2. Use apiClient.get() instead of raw fetch()
// In App.tsx
import { useApiClient } from '@/lib/api-client'
function App() {
  useApiClient() // MUST call this
  return <YourApp />
}

// In components
import { apiClient } from '@/lib/api-client'
const data = await apiClient.get('/api/data')

Integration Checklist

Before deployment, verify:

Frontend:

  • useApiClient() called in App component
  • All protected pages wrapped in <ProtectedRoute>
  • Check isLoaded before making API calls
  • Environment variables start with VITE_
  • Using apiClient for all API calls

Backend:

  • CORS middleware applied BEFORE routes
  • Auth middleware on /api/protected/* routes
  • Environment variables in .dev.vars (dev) and secrets (prod)
  • D1/KV/R2 bindings configured in wrangler.jsonc
  • Using parameterized queries for D1

Config:

  • wrangler.jsonc has correct bindings
  • vite.config.ts includes cloudflare() plugin
  • .dev.vars exists and is gitignored
  • .env exists for frontend vars
  • run_worker_first: ["/api/*"] in wrangler.jsonc

Package Versions (Verified 2025-10-23)

All packages are current stable versions:

{
  "@clerk/clerk-react": "5.53.3",
  "@clerk/backend": "2.19.0",
  "hono": "4.10.2",
  "vite": "7.1.11",
  "@cloudflare/vite-plugin": "1.13.14"
}

Official Documentation Links

Production Evidence

Patterns tested in:

Token Efficiency

Without this skill: ~12k tokens + 2-4 integration errors With this skill: ~4k tokens + 0 errors Savings: ~67% tokens, 100% error prevention


Remember: Most integration issues are just missing isLoaded checks or wrong middleware order. Use the templates and follow the step-by-step guide!

平台分布

Antigravity

26.9%
按下载量换算77

Claude Code

21.37%
按下载量换算62

Gemini CLI

19.26%
按下载量换算55

github-copilot

12.57%
按下载量换算36

windsurf

7.72%
按下载量换算22

Codex

3.63%
按下载量换算10

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

接触敏感数据

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills