agent-browser
Use Agent Browser for real browser navigation, dynamic pages, and web interaction; also use it as a distinct browser-based path…
Create or update an engineering-style NextClaw Panel component with pnpm, Vite, React, TypeScript, and Tailwind CSS, then build it into a static .panel directory inside a schema v2 package or an explicitly loose workspace Panel. Use for modern, reusable, complex, Agent-powered,
$ npx -y skills add peiiii/nextclaw --skill panel-app-react-vite-creator --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/panel-app-react-vite-creatorContext preview
The summary Claude sees to decide when to auto-load this skill.
Create or update an engineering-style NextClaw Panel component with pnpm, Vite, React, TypeScript, and Tailwind CSS, then build it into a static .panel directory inside a schema v2 package or an explicitly loose workspace Panel. Use for modern, reusable, complex, Agent-powered,
name: panel-app-react-vite-creator description: Create or update an engineering-style NextClaw Panel component with pnpm, Vite, React, TypeScript, and Tailwind CSS, then build it into a static .panel directory inside a schema v2 package or an explicitly loose workspace Panel. Use for modern, reusable, complex, Agent-powered, typed Panel interfaces. description_zh: 使用 pnpm、Vite、React、TypeScript、Tailwind CSS 创建或修改工程化 NextClaw Panel 组件,再构建为 schema v2 包内或明确 loose workspace 中的静态 .panel 目录。适用于现代、可维护、复杂、Agent 驱动或需要类型的 Panel 界面。
本 skill 只负责工程化前端源码和静态产物交付。Panel App 的 manifest、Client SDK、Service Actions、Agent bridge 和授权规则仍以 `panel-app-creator` 为准;需要这些能力时必须同时读取 `panel-app-creator`。
源码工程示例:
my-panel-src/ package.json vite.config.ts src/ public/
完整包内的交付产物示例:
my-app/panels/my-panel.panel/ panel-app.json index.html assets/
如果用户没有指定源码位置,优先在包根的独立前端源码目录或用户当前工作目录下创建工程,不要把完整 npm 工程直接当作最终 `.panel` 组件目录。最终 `.panel` 只保留静态产物;根 `manifest.json.components` 引用该目录。
1. 先确定 `app-id`,必须 kebab-case,例如 `data-reviewer`。 2. 创建 Vite React TS 工程:
pnpm create vite <app-id>-src --template react-ts cd <app-id>-src pnpm install pnpm add -D tailwindcss @tailwindcss/vite
3. 配置 `vite.config.ts`:
import react from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite";
import { defineConfig } from "vite";
export default defineConfig({
base: "./",
plugins: [react(), tailwindcss()],
});4. 在 `src/index.css` 引入 Tailwind:
@import "tailwindcss";
5. 开发 UI 时遵守 Panel App 侧栏约束:默认按 `320px-480px` 窄面板设计,不能横向溢出。 6. 如果要调用 NextClaw 能力,先读取 `panel-app-creator`,按其推荐路径写代码。 7. 构建:
pnpm build
8. 把 `dist/` 内容同步到已确定的 `.panel` 目录,并写入 `panel-app.json`:
{
"id": "data-reviewer",
"title": "Data Reviewer",
"description": "Review and analyze local data in a focused panel.",
"icon": "📊",
"entry": "index.html"
}只有实际使用 `window.nextclaw.client` 时才加 `"client": true`。调用 Service Actions 时仍按 `panel-app-creator` 的当前规则声明 `actions` 并使用推荐 bridge。
使用 `window.nextclaw.client` 时,开发期优先安装 `@nextclaw/client-sdk` 作为类型来源:
pnpm add -D @nextclaw/client-sdk
在源码工程新增 `src/nextclaw-env.d.ts`:
import type { NextClawAppClient } from "@nextclaw/client-sdk";
declare global {
interface Window {
nextclaw?: {
client?: NextClawAppClient;
} & Record<string, unknown>;
}
}
export {};只允许 `import type` 使用 SDK 类型。Panel App 运行时不要 import、new 或 create `@nextclaw/client-sdk`,真实 client 必须来自宿主同步注入的 `window.nextclaw.client`:
const client = window.nextclaw?.client;
if (!client) {
throw new Error("NextClaw App Client 未授权或不可用。");
}需要 API 形状时读取已安装包里的 `@nextclaw/client-sdk` 声明和 README,优先查看 `NextClawAppClient`,让 TypeScript 检查参数和返回值。不要凭记忆写 `panelApps.*`、`serviceApps.*`、旧事件名或不存在的 namespace。
loose Panel 必须运行:
nextclaw app check ~/.nextclaw/workspace/panels/<app-id>.panel
schema v2 包内 Panel 必须从包根运行:
nextclaw app check <app-dir> --json
如果包内包含 Portable Service,前端 build 和 App check 都不能替代 `nextclaw app build/test`;这些 Service 验证归 `service-app-creator`。
如果修改了源码工程,还应运行:
pnpm build
loose Panel 交付时告诉用户刷新 Panel Apps 列表;完整包通过 `app dev/install` 或 Apps 页面打开。不要要求重启 NextClaw,除非有明确证据表明宿主进程异常。
Your long-term personal AI partner. NextClaw's mission is to be a good long-term partner to you. We are building toward a 1.0 that understands you, takes useful initiative, and continuously improves itself.
Use Agent Browser for real browser navigation, dynamic pages, and web interaction; also use it as a distinct browser-based path…
Turn a user request into a scheduled automation by configuring cron jobs, including session-bound follow-ups and periodic checks.
Use when the user asks to keep watching an external state, notify them when something changes or a condition is met, remember…
Use when deciding how to deliver an AI result: reply now, put durable news, reports, recommendations, or articles in the NextClaw…
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced…