Token导航 LogoToken导航

Agent Skill · 前端设计

pb-react-spa(PB React SPA 前端)

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

pb-react-spa 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证信息还不明确,第三方扫描有未通过项,按安装量在前端设计类的 10,216 个 Skill 里排第 6,896。

总安装 445周安装 18GitHub Stars 1下载 140核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/ikumasudo/pocketbase-skill --skill pb-react-spa

这个 Skill 是做什么的

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

pb-react-spa 用于辅助前端页面、组件、样式和交互逻辑的开发与维护。适合生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构或定位布局问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段。涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

当前分类为前端设计,功能聚焦于前端开发支持。

来源仓库内路径:skills/pb-react-spa

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

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

常见问题

6 条

pb-react-spa 怎么安装?

在终端执行 npx skills add https://github.com/ikumasudo/pocketbase-skill --skill pb-react-spa。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

pb-react-spa 支持哪些 AI 工具?

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

pb-react-spa 需要什么权限?

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

pb-react-spa 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

pb-react-spa 用的人多吗?

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

pb-react-spa 安全吗?

第三方扫描有未通过项,风险较高。除非你确认过源码,否则不建议直接安装到常用环境。

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

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 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只读未明确通过
pb-react-spa

PB React SPA 前端 · 本页

4451接触敏感数据未明确未通过

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

SKILL.md 原文

PocketBase React SPA Skill

A skill that automates the setup of a React SPA frontend integrated with a PocketBase backend.

Tech Stack:

  • Vite — Build tool / dev server
  • React + TypeScript — UI framework
  • TanStack Router — File-based routing
  • TanStack Query — Server state management
  • Tailwind CSS + Shadcn UI — Styling / UI components
  • Biome — Linter / Formatter
  • PocketBase JS SDK — Backend communication
  • pocketbase-typegen — Type generation

Skill Resources

  • References: references/ — Integration patterns, authentication, type generation, development & deployment guides
  • PocketBase backend skill: The pocketbase skill handles backend management (collection CRUD, API rule design, etc.)

For details on the PocketBase JS SDK, also see references/js-sdk.md in the PocketBase skill.

0. Prerequisites

  • Node.js v18 or higher, npm
  • PocketBase is running (see the Bootstrap section in the pocketbase skill)
  • PocketBase collection design is complete (recommended)

1. Project Scaffolding

1-1. Project Structure

Adopt a monorepo structure with separated frontend and backend:

project-root/
├── frontend/     ← React SPA (created by this skill)
├── backend/      ← PocketBase (managed by the pocketbase skill)
│   ├── pocketbase
│   ├── pb_data/
│   ├── pb_migrations/
│   └── .env
└── README.md
Note: Check the user's existing project structure and adapt accordingly. The frontend/ directory name can be changed based on user preference.

1-2. Base Project Generation

npx create-tsrouter-app@latest frontend \
  --toolchain biome \
  --package-manager npm \
  --no-git
Note: create-tsrouter-app is a TanStack CLI wrapper where --router-only (file-based routing) is enabled by default. Tailwind CSS v4 is also set up automatically.

This command sets up the following:

  • Vite + React + TypeScript
  • TanStack Router (file-based routing)
  • Tailwind CSS v4
  • Biome (Linter / Formatter)

1-3. Adding Shadcn UI

cd frontend && npx shadcn@latest init -d

The -d flag uses default settings (new-york style, neutral color). A components.json file is created, enabling you to add components to @/components/ui/.

Example of adding components:

npx shadcn@latest add button card input label

1-4. Adding TanStack Query

npm install @tanstack/react-query

1-5. Installing PocketBase JS SDK

npm install pocketbase

1-6. Installing pocketbase-typegen

npm install -D pocketbase-typegen

1-7. Verifying the Setup

npm run build

Verify that the build completes successfully. To check the dev server, run npm run dev.

2. Post-Setup Configuration

After scaffolding, add the following configurations in order.

2-1. PocketBase Client

Create frontend/src/lib/pocketbase.ts:

import PocketBase from "pocketbase";
import type { TypedPocketBase } from "../types/pocketbase-types";

export const pb = new PocketBase() as TypedPocketBase;

pb.autoCancellation(false);
TypedPocketBase is the type generated by pocketbase-typegen. If types haven't been generated yet, temporarily use the PocketBase type directly and replace it after generation: ``ts // Temporary version before type generation import PocketBase from "pocketbase"; export const pb = new PocketBase(); pb.autoCancellation(false); ``

2-2. Vite Proxy Configuration

Edit frontend/vite.config.ts to add server.proxy.

The generated vite.config.ts has the following structure:

import { defineConfig } from "vite";
import { devtools } from "@tanstack/devtools-vite";
import tsconfigPaths from "vite-tsconfig-paths";
import { tanstackRouter } from "@tanstack/router-plugin/vite";
import viteReact from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite";

const config = defineConfig({
  plugins: [
    devtools(),
    tsconfigPaths({ projects: ["./tsconfig.json"] }),
    tailwindcss(),
    tanstackRouter({ target: "react", autoCodeSplitting: true }),
    viteReact(),
  ],
  // ↓ Add this
  server: {
    proxy: {
      "/api": {
        target: "http://127.0.0.1:8090",
        changeOrigin: true,
      },
      "/_": {
        target: "http://127.0.0.1:8090",
        changeOrigin: true,
      },
    },
  },
});

export default config;
/api is the PocketBase REST API, and /_ is for PocketBase internal endpoints (realtime SSE, etc.). Why no URL in the PocketBase client? The proxy makes all PocketBase API requests same-origin during development (browser sees localhost:5173/api/...). In production, PocketBase serves the SPA from pb_public/, which is also same-origin. Since both environments are same-origin, new PocketBase() (no arguments) works everywhere — no environment variables needed.

Important: Do not modify the generated plugins array. Only add server.proxy.

2-3. TypeScript Type Generation

Generate types while PocketBase is running:

npx pocketbase-typegen --url http://127.0.0.1:8090 --email admin@example.com --password yourpassword --out frontend/src/types/pocketbase-types.ts

Add an npm script to frontend/package.json:

{
  "scripts": {
    "typegen": "pocketbase-typegen --url http://127.0.0.1:8090 --email admin@example.com --password yourpassword --out src/types/pocketbase-types.ts"
  }
}
Confirm the superuser email and password with the user. Adjust --url to match the PocketBase URL.

Details: Read references/typegen.md

2-4. TanStack Query Configuration

Create a QueryClient and set up the Provider in the root component.

Edit frontend/src/routes/__root.tsx:

import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { Outlet, createRootRouteWithContext } from "@tanstack/react-router";

export interface RouterContext {
  queryClient: QueryClient;
}

export const Route = createRootRouteWithContext<RouterContext>()({
  component: RootComponent,
});

function RootComponent() {
  return <Outlet />;
}

Create the QueryClient in frontend/src/router.tsx (or main.tsx) and pass it to the router context:

import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { createRouter as createTanStackRouter } from "@tanstack/react-router";
import { routeTree } from "./routeTree.gen";

const queryClient = new QueryClient();

export function getRouter() {
  const router = createTanStackRouter({
    routeTree,
    scrollRestoration: true,
    defaultPreload: "intent",
    defaultPreloadStaleTime: 0,
    context: { queryClient },
  });
  return router;
}
Important: Check the existing contents of router.tsx / main.tsx and integrate QueryClient while preserving existing configuration. The above is a pattern example — edit according to the generated file's code.

Details: Read references/react-query-pocketbase.md

2-5. Authentication Integration

If authentication is needed, configure the following:

  1. Auth context — Create an AuthProvider in frontend/src/lib/auth.tsx
  2. Protected routes — Authentication check using TanStack Router's beforeLoad
  3. Login page — frontend/src/routes/login.tsx

Details: Read references/auth-patterns.md

3. Development Workflow

Running PocketBase and Vite Simultaneously

Terminal 1 (PocketBase):

cd backend && ./pocketbase serve --http=127.0.0.1:8090

Terminal 2 (Vite dev server):

cd frontend && npm run dev
In a Claude Code session, start PocketBase in the background: ``bash cd backend && nohup ./pocketbase serve --http=127.0.0.1:8090 > pb.log 2>&1 & ``

Development Tips

  • The Vite proxy eliminates CORS issues (operates as same-origin)
  • Frontend changes are reflected instantly via HMR
  • After PocketBase collection changes, regenerate types with npm run typegen
  • The Admin UI is directly accessible at http://127.0.0.1:8090/_/

Details: Read references/dev-and-deploy.md

4. Deployment

SPA Build → PocketBase pb_public Placement

In production, PocketBase serves the SPA directly (no separate web server needed):

# Build
cd frontend && npm run build

# Place in PocketBase's pb_public
cp -r frontend/dist/* backend/pb_public/

PocketBase automatically serves files from pb_public/ and supports SPA client-side routing (non-existent paths fall back to index.html).

Docker / Docker Compose / Reverse Proxy

For production deployment including Dockerfiles (binary mode & Go package mode), Docker Compose, Caddy/Nginx reverse proxy, and executable distribution:

Details: Read references/deployment.md

5. Setup Checklist

Verification items after scaffolding is complete:

  • npm run build succeeds
  • src/lib/pocketbase.ts has been created
  • Proxy configuration has been added to vite.config.ts
  • components.json exists (Shadcn UI initialized)
  • QueryClient is configured (__root.tsx / router.tsx)
  • PocketBase JS SDK can be imported (import PocketBase from "pocketbase")
  • npm run typegen generates types (when PocketBase is running)
  • If authentication is needed: AuthProvider and protected routes are configured

6. Reference Index

TopicReference
TanStack Query + PB integrationRead references/react-query-pocketbase.md
Authentication patternsRead references/auth-patterns.md
TypeScript type generationRead references/typegen.md
Development workflowRead references/dev-and-deploy.md
Production deployment (Docker, binary, proxy)Read references/deployment.md
JS SDK detailsRead references/js-sdk.md in the PocketBase skill

平台分布

Codex

36.68%
按下载量换算51

Claude

28.11%
按下载量换算39

Cursor

18.16%
按下载量换算25

Gemini CLI

9.64%
按下载量换算13

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

未通过

权限和风险

接触敏感数据

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills