onboarding
它能做什么
这项技能说明如何在 Agent-Native 应用中添加面向用户的设置步骤,例如连接服务或输入密钥。适合基于该框架构建应用的开发者。
适用场景
- ✓当一项新功能在工作前需要 API 密钥或账户连接的时候。
- ✓当你添加了用户必须自行连接的第三方服务的时候。
- ✓当你希望设置项出现在智能体侧边栏的设置清单中的时候。
技能链接
https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/onboarding/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请添加一个设置步骤,让用户在使用此功能之前连接自己的账户。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体注册每个设置步骤,使其显示在清单中,并引导用户到一个安全的位置输入凭据,而不是把凭据写进代码。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Onboarding Steps
Rule
If a feature requires user-facing setup (API keys, OAuth, connecting a third-party service), register an onboarding step so it appears in the agent sidebar's setup checklist.
Onboarding must point users to a secure credential path; it must never encode
the credential value in source, docs, fixtures, prompts, or generated content.
For a provider represented in the workspace connection catalog, check the
connection readiness and app grant first, then resolve credentials through the
scoped workspace-connection helper. Only when no reusable connection exists
should API keys and service tokens use registerRequiredSecret() from the
secrets skill. For OAuth, check the scoped OAuth token store. Use deployment
env vars only for deploy-level configuration, not per-user credentials.
Model onboarding around the logical connection outcome, not its individual
fields. Because registerRequiredSecret({ required: true }) auto-injects a
checklist item per registration, do not mark every credential/config field as
required by reflex. Use one composite onboarding step or connection readiness
check when several values are needed for one provider.
A custom setup page is appropriate only when it adds provider-specific prerequisites, sequencing, or health checks. Keep it as a thin guide over the shared settings, vault, OAuth, and action surfaces; never make it a second place that stores or manages credentials.
Registering a Step
import { registerOnboardingStep } from "@agent-native/core/onboarding";
import { hasOAuthTokens } from "@agent-native/core/oauth-tokens";
registerOnboardingStep({
id: "gmail",
order: 100,
title: "Connect Gmail",
description: "Grant read/send access.",
methods: [
{
id: "oauth",
kind: "link",
primary: true,
label: "Sign in with Google",
payload: { url: "/_agent-native/google/auth-url" },
},
],
isComplete: async (ctx) =>
ctx?.userEmail ? hasOAuthTokens("google", ctx.userEmail) : false,
});
See packages/core/docs/content/onboarding.md for method kinds and built-in steps.
For S3-compatible file storage, declare a kind: "file-storage" method instead
of a form with S3_* fields. It renders the shared StorageSettingsForm,
which saves through the manage-file-storage action (owners and admins only),
so onboarding, Settings, and templates cannot drift into different rules. A
provider that serves files without a public URL sets
publicBaseUrlOptional: true on its FileUploadProvider.
Shared services: one list for first-run and Infrastructure
WORKSPACE_SERVICES (packages/core/src/onboarding/workspace-services.ts,
exported from @agent-native/core/onboarding) is the one list of services
every app shares: AI model, storage, voice, images, embeddings, and the
Builder.io-only services. First-run "Choose your setup" reads it through
getOnboardingAppProfile(), which tags each capability with its service id
(and builderOnly). Settings › Organization › Infrastructure renders one
Services row per entry and takes its Required/Recommended tags from those ids.
- To add a shared service, add it to
WORKSPACE_SERVICESand give it a row inInfrastructureSettingsPage.tsx; its records are keyed by service id, so the page won't compile without one. Never add a label to first-run alone. - To tailor a service for one app, declare a capability in that app's profile
with one of the service's
capabilityIds(Clips'video-storage). It replaces the default copy and can raise the tag, never lower it. - An app's own capabilities (a Figma token, a Gmail connection) stay out of
WORKSPACE_SERVICES. First-run shows them only when required or suggested. - List a Builder.io capability only if Builder.io actually powers it in code.
Transactional email is deployment configuration, not an onboarding form. The
built-in email step links to the host variables (RESEND_API_KEY or
SENDGRID_API_KEY, plus EMAIL_FROM) and is hidden when the deployment
already provides email. Don't add a step that saves those keys.
Related Skills
adding-a-feature— The four-area checklist; onboarding is often part of a new integrationauthentication— Most onboarding steps involve OAuth or credentials
常见问题
用户在哪里看到这些设置步骤?
它们显示在智能体侧边栏的设置清单中。
凭据的值可以写进代码吗?
绝对不可以。凭据的值绝不能保存在源代码、文档或提示词中。
什么时候需要自定义设置页面?
只有当需要添加特定服务商的步骤、排序或健康检查时才需要;否则使用共享的设置。
详情
作者的原始描述
How to register user-facing setup steps (API keys, OAuth, connecting third-party services) for the sidebar setup checklist. Use when adding a feature that needs initial user configuration.
repo: BuilderIO/agent-native
热度
- GitHub 星标
- 7.6k
- 排名
- #13170
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …