Token导航 LogoToken导航

Agent Skill · 研究检索

adk-frontend(adk 前端)

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

adk-frontend 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证为 MIT,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 32,538。

总安装 2,497周安装 102GitHub Stars 11下载 756核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/botpress/skills --skill adk-frontend

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

此技能涵盖了 Botpress ADK 的完整前端集成故事: 核心主题: 使用 PAT 和 cookie 进行身份验证 使用 Zustand 进行客户管理 使用三斜杠引用进行类型生成和导入 调用具有完整类型安全性的机器人操作 何时使用: 任何前端集成问题 身份验证和安全模式 类型安全和生成类型 客户端设置和配置 操作调用和错误处理 关键原则: 始终提供强调类型安全性、保密性和可维护性的生产就绪模式。

每周安装量 102 存储库 机器人新闻/技能 GitHub 之星 11 第一次看到 今天 安全审计 Gen Agent Trust Hub 通行证 套接字通行证 斯尼克通行证

来源仓库内路径:skills/adk-frontend

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

adk-frontend 怎么安装?

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

adk-frontend 支持哪些 AI 工具?

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

adk-frontend 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

adk-frontend 是免费的吗?

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

adk-frontend 用的人多吗?

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

adk-frontend 安全吗?

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

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

值得选的地方

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

先想清楚的地方

  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

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

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

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

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
adk-frontend

adk 前端 · 本页

2,49711需要联网MIT通过

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

SKILL.md 原文

ADK Frontend Integration

Use this skill when users ask questions about building frontend applications that connect to Botpress ADK bots. This covers authentication patterns, type-safe API calls, client configuration, and integrating generated types.

What is ADK Frontend Integration?

When you build a bot with the Botpress ADK, you often need a frontend application that interacts with it. This skill provides production-tested patterns for:

  • Authentication - Cookie-based PAT storage with OAuth flow
  • Client Management - Zustand store pattern for client caching and reuse
  • Type Generation - Using ADK-generated types for full type safety
  • Action Calls - Calling bot actions with proper error handling and optimistic updates

Key Technologies

  • @botpress/client - Official TypeScript client for Botpress API
  • Triple-slash references - TypeScript pattern for importing generated types
  • React Query - For mutations and cache management (optional but recommended)
  • Zustand - For client state management

When to Use This Skill

Activate this skill when users ask frontend-related questions like:

Authentication Questions

  • "How do I authenticate with Botpress from my frontend?"
  • "What are Personal Access Tokens (PATs)?"
  • "Should I use cookies or localStorage for tokens?"
  • "How do I implement OAuth login flow?"
  • "How do I protect routes based on authentication?"
  • "How do I handle token expiration?"

Client Setup Questions

  • "How do I initialize the Botpress client?"
  • "What's the best way to manage multiple client instances?"
  • "Why use a client store?"
  • "How do I create workspace-scoped vs bot-scoped clients?"
  • "What's the difference between regular client and Zai client?"

Type Generation Questions

  • "How do I get types for my bot's actions?"
  • "What are triple-slash references?"
  • "How do I import generated types?"
  • "Where are the.adk type files?"
  • "How do I keep types in sync between bot and frontend?"
  • "Why can't TypeScript find my action types?"

Calling Actions Questions

  • "How do I call a bot action from my frontend?"
  • "What's the syntax for client.callAction()?"
  • "How do I handle errors when calling actions?"
  • "How do I implement optimistic updates?"
  • "How do I chain multiple action calls?"
  • "How do I use React Query with bot actions?"

Available Documentation

Documentation files in ./references/:

Core Integration Patterns

  • authentication.md - Complete authentication system with PATs, cookies, OAuth, route protection
  • botpress-client.md - Client initialization, Zustand store pattern, Zai client setup
  • calling-actions.md - Type-safe action calls, mutations, error handling, optimistic updates
  • type-generation.md - Triple-slash references, generated types, maintaining type safety

Architecture & Setup

  • overview.md - Architecture overview, when to use ADK frontends, project structure
  • project-setup.md - Vite + React scaffolding, TypeScript config, environment setup
  • recommended-stack.md - Recommended tech stack with rationale

Data & State Patterns

  • service-layer.md - Service layer pattern for wrapping API calls with types
  • data-fetching.md - TanStack Query patterns, mutations, optimistic updates
  • state-management.md - Zustand vs TanStack Query, when to use each
  • realtime-updates.md - Polling strategies, interval tiers, performance considerations

How to Answer Frontend Questions

Frontend questions typically fall into these categories:

1. Authentication Implementation

When users ask about authentication, reference the complete pattern from authentication.md:

Key Concepts:

  • PAT generation in Botpress Cloud
  • Cookie-based storage (not localStorage)
  • AuthContext with React Context API
  • OAuth callback flow via cli-login
  • Route protection with TanStack Router
  • Profile fetching from both Botpress API and bot tables

Response Pattern:

  1. Explain the authentication strategy (cookies vs localStorage)
  2. Show the AuthProvider implementation
  3. Demonstrate the OAuth flow
  4. Provide route protection examples
  5. Highlight security best practices

2. Client Setup and Management

When users ask about client configuration, reference botpress-client.md:

Key Concepts:

  • Client initialization with apiUrl, workspaceId, token, botId
  • Zustand store for client caching
  • Dynamic client keys for reuse
  • Workspace-scoped vs bot-scoped clients
  • Extended timeouts for Zai operations

Response Pattern:

  1. Show the clientsStore.ts pattern
  2. Explain how client caching works
  3. Demonstrate getApiClient() usage
  4. Show when to use workspace vs bot-scoped clients
  5. Explain getZaiClient() for AI operations

3. Type Generation and Import

When users ask about types, reference type-generation.md:

Key Concepts:

  • ADK generates types in .adk/ directory during dev/build
  • Triple-slash directives for referencing external types
  • Generated files: action-types.d.ts, table-types.d.ts, workflow-types.d.ts
  • Creating type aliases for cleaner code
  • Keeping types in sync with adk dev

Response Pattern:

  1. Explain how ADK generates types
  2. Show triple-slash reference syntax
  3. Demonstrate importing generated types
  4. Provide examples of creating type aliases
  5. Show how types stay in sync automatically

4. Calling Bot Actions

When users ask about calling actions, reference calling-actions.md:

Key Concepts:

  • client.callAction() signature
  • Type-safe input/output with BotActionDefinitions
  • Service layer pattern for reusable action calls
  • Using useMutation for loading states and error handling
  • Optimistic updates for instant UI feedback
  • Chaining actions (sequential vs parallel)

Response Pattern:

  1. Show the basic callAction() syntax
  2. Demonstrate type-safe service functions
  3. Provide useMutation examples
  4. Show error handling patterns
  5. Explain optimistic updates when relevant

Common Patterns Reference

Authentication Flow

// 1. Cookie helpers
function setCookie(name: string, value: string, days = 365);
function getCookie(name: string): string | null;
function deleteCookie(name: string);

// 2. AuthContext
interface AuthContextType {
  token: string | null;
  isAuthenticated: boolean;
  userProfile: UserProfile | null;
  isLoadingProfile: boolean;
  login: (token: string) => void;
  logout: () => void;
}

// 3. OAuth Flow
// Redirect: https://app.botpress.cloud/cli-login?redirect=...
// Callback: /auth/callback?pat=bp_pat_...
// Store PAT in cookie and navigate to app

Client Store Pattern

// stores/clientsStore.ts
const useClientsStore = create<ClientsState>()((set, get) => ({
  APIClients: {},
  getAPIClient: (props) => {
    const key = props?.botId
      ? `${props.workspaceId}-${props.botId}`
      : (props?.workspaceId ?? DEFAULT_API_CLIENT_KEY);

    const cached = get().APIClients[key];
    if (cached) return cached;

    const newClient = new APIClient({
      apiUrl: API_BASE_URL,
      workspaceId: props?.workspaceId,
      token: getPat() ?? "",
      botId: props?.botId,
    });

    set((state) => ({
      APIClients: { ...state.APIClients, [key]: newClient },
    }));

    return newClient;
  },
}));

export const getApiClient = (props?) =>
  useClientsStore.getState().getAPIClient(props);

Type Import Pattern

// types/index.ts
/// <reference path="../../../bot/.adk/action-types.d.ts" />
/// <reference path="../../../bot/.adk/table-types.d.ts" />

import type { BotActionDefinitions } from "@botpress/runtime/_types/actions";
import type { TableDefinitions } from "@botpress/runtime/_types/tables";

// Create type aliases
export type SendMessageAction = BotActionDefinitions["sendMessage"];
export type TicketTableRow = TableDefinitions["TicketsTable"]["Output"];

Action Call Pattern

// services/bot-service.ts
export async function sendMessage(input: SendMessageAction["input"]) {
  const client = getApiClient({ botId, workspaceId });
  const result = await client.callAction({
    type: "sendMessage",
    input,
  });
  return result.output as SendMessageAction["output"];
}

// Component usage with useMutation
const { mutate: send, isPending } = useMutation({
  mutationFn: sendMessage,
  onSuccess: () => {
    toast.success("Message sent");
    queryClient.invalidateQueries({ queryKey: ["messages"] });
  },
  onError: (error) => {
    toast.error("Failed to send message");
  },
});

Examples of Questions This Skill Answers

Beginner Questions

  • "How do I connect my React app to a Botpress bot?"
  • "What is a Personal Access Token?"
  • "Where do I find my workspace ID and bot ID?"
  • "How do I install @botpress/client?"

Authentication Questions

  • "How should I store authentication tokens?"
  • "How do I implement login/logout?"
  • "How do I protect authenticated routes?"
  • "Should I use cookies or localStorage?"
  • "How do I handle the OAuth callback?"

Type Safety Questions

  • "How do I get TypeScript types for my bot?"
  • "What are triple-slash references?"
  • "Why can't TypeScript find my action types?"
  • "How do I keep types in sync?"
  • "Where are the generated type files?"

Implementation Questions

  • "How do I call a bot action?"
  • "How do I query bot tables from my frontend?"
  • "How do I handle loading states?"
  • "How do I implement optimistic updates?"
  • "How do I chain multiple action calls?"

Advanced Questions

  • "How do I use Zai from my frontend?"
  • "What's the difference between workspace and bot-scoped clients?"
  • "How do I implement client caching?"
  • "How do I handle token expiration?"
  • "How do I implement retry logic?"

Response Format

When answering:

  1. Start with a concise explanation (1-2 paragraphs)
  2. Provide working code examples from the references
  3. Include file references (e.g., "From authentication.md:60-85")
  4. Highlight security considerations when relevant
  5. Show common pitfalls and how to avoid them
  6. Link to related topics for deeper exploration

Example Response Structure

Question: "How do I authenticate users in my frontend?"

Answer:
The recommended pattern uses cookie-based PAT storage with OAuth flow.
Here's the complete implementation:

1. Cookie Helpers (authentication.md:89-111)
   [code example]

2. AuthContext Setup (authentication.md:64-76)
   [code example]

3. OAuth Flow (authentication.md:473-533)
   [code example]

Key Security Considerations:
- Use SameSite=Lax for CSRF protection
- Always use HTTPS in production
- Never log PATs to console
- Implement token expiration handling

Related Topics:
- Route protection: authentication.md:369-467
- Profile fetching: authentication.md:304-347
- Client initialization: botpress-client.md:29-51

Critical Patterns to Always Reference

When answering questions, always verify these patterns against the documentation:

1. Client Management

// ✅ CORRECT - Use client store
const client = getApiClient({ workspaceId, botId });

// ❌ WRONG - Create new client every time
const client = new Client({ apiUrl, workspaceId, token, botId });

2. Type Imports

// ✅ CORRECT - Triple-slash at top of file
/// <reference path="../../../bot/.adk/action-types.d.ts" />
import type { BotActionDefinitions } from "@botpress/runtime/_types/actions";

// ❌ WRONG - No triple-slash reference
import type { BotActionDefinitions } from "@botpress/runtime/_types/actions";

3. Action Calls

// ✅ CORRECT - Service layer with types
export async function sendMessage(input: SendMessageAction["input"]) {
  const client = getApiClient({ botId, workspaceId });
  const result = await client.callAction({ type: "sendMessage", input });
  return result.output as SendMessageAction["output"];
}

// ❌ WRONG - Direct call in component
const result = await client.callAction({ type: "sendMessage", input: data });

4. Authentication Storage

// ✅ CORRECT - Cookie with SameSite
document.cookie = `token=${value};expires=${expires};path=/;SameSite=Lax`;

// ❌ WRONG - localStorage without security
localStorage.setItem("token", value);

Best Practices to Emphasize

When answering, always mention relevant best practices:

Security

  • Always use HTTPS in production
  • Use cookies with SameSite protection
  • Never log PATs or tokens
  • Implement token expiration handling
  • Use HttpOnly cookies when possible (SSR)

Type Safety

  • Always use generated types from ADK
  • Create type aliases for cleaner code
  • Use triple-slash references correctly
  • Keep types in sync with adk dev
  • Type all action inputs and outputs

Performance

  • Cache clients with Zustand store
  • Use workspace-scoped clients when no bot operations needed
  • Implement optimistic updates for better UX
  • Use React Query for cache management
  • Run independent actions in parallel

Error Handling

  • Always handle 401 (expired token) errors
  • Provide user feedback on errors
  • Implement retry logic for transient failures
  • Log errors appropriately (never log tokens)
  • Show loading states during async operations

Code Organization

  • Use service layer for action calls
  • Centralize types in single file
  • Keep authentication logic in context
  • Separate client configuration from usage
  • Reuse service functions across components

Troubleshooting Common Issues

Be prepared to help with these common problems:

"Cannot find module '@botpress/runtime/_types/actions'"

  • Check triple-slash reference path
  • Verify.adk/ directory exists
  • Restart TypeScript server
  • Ensure adk dev/build has run

"Types not updating after bot changes"

  • Restart adk dev
  • Delete.adk/ and rebuild
  • Restart TypeScript server
  • Check for bot compilation errors

"Authentication fails after reload"

  • Implement reload retry logic (authentication.md:191-220)
  • Check cookie expiration
  • Verify token is being retrieved correctly
  • Check for CORS issues

"Client timeout on long operations"

  • Use getZaiClient() with extended timeout for AI operations
  • Don't use regular client for Zai operations
  • Consider breaking into smaller operations

Summary

This skill covers the complete frontend integration story for Botpress ADK:

Core Topics:

  1. Authentication with PATs and cookies
  2. Client management with Zustand
  3. Type generation and import with triple-slash references
  4. Calling bot actions with full type safety

When to Use:

  • Any frontend integration question
  • Authentication and security patterns
  • Type safety and generated types
  • Client setup and configuration
  • Action calls and error handling

Key Principle: Always provide production-ready patterns that emphasize type safety, security, and maintainability.

平台分布

Claude Code

29.03%
按下载量换算219

Codex

21.83%
按下载量换算165

OpenCode

19.23%
按下载量换算145

Antigravity

11.78%
按下载量换算89

Gemini CLI

8.04%
按下载量换算61

Cursor

3.32%
按下载量换算25

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

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

继续浏览同类 Skills