workos

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
<!-- refined:sha256:4bc2401b2288 -->
<!-- refined:sha256:4bc2401b2288 -->

WorkOS Skill Router

WorkOS 技能路由

How to Use

使用方法

When a user needs help with WorkOS, consult the tables below to route to the right skill.
当用户需要WorkOS相关帮助时,请参考下表路由到对应的技能。

Loading Skills

加载技能

AuthKit skills are registered plugins — load them directly via the Skill tool.
All other skills are bundled files. To load one, Read
skills/workos/{name}.md
from this plugin directory and follow its instructions.
AuthKit技能是已注册的插件——可通过Skill工具直接加载。
所有其他技能均为捆绑文件。如需加载,请从插件目录中读取
skills/workos/{name}.md
并按照其中的说明操作。

Disambiguation Rules

歧义消除规则

Feature Skill vs API Reference

功能技能与API参考文档

  • User asks about implementation (how to set up, configure, integrate) → Load the feature skill
  • User explicitly asks for "API reference", "endpoints", "request/response format", or "API docs" → Load the API reference skill
  • User asks "how does X work" or "what does X do" → Load the feature skill (conceptual guide)
  • 用户询问实现相关问题(如如何设置、配置、集成)→ 加载功能技能文档
  • 用户明确询问「API参考文档」「端点」「请求/响应格式」或「API文档」 → 加载API参考技能文档
  • 用户询问「X是如何工作的」或「X有什么作用」 → 加载功能技能文档(概念指南)

AuthKit vs Feature-Specific Skills

AuthKit与特定功能技能

  • User mentions "login", "sign-up", "authentication", "sign-in", "session management" WITHOUT naming a specific feature → Route to AuthKit (detect framework below)
  • User mentions "SSO", "SAML", "OAuth connection" explicitly → Load
    workos-sso.md
    (not AuthKit)
  • User mentions "MFA", "multi-factor", "2FA", "TOTP" explicitly → Load
    workos-mfa.md
  • User mentions "roles", "permissions", "RBAC" explicitly → Load
    workos-rbac.md
  • User mentions "directory sync", "SCIM", "user provisioning" explicitly → Load
    workos-directory-sync.md
Priority rule: If the user mentions BOTH AuthKit AND a feature (e.g., "set up AuthKit with SSO"), load AuthKit first. The AuthKit skill will reference SSO configuration as a next step.
  • 用户提及「登录」「注册」「身份认证」「登入」「会话管理」但未指定具体功能 → 路由到AuthKit(如下检测框架)
  • 用户明确提及「SSO」「SAML」「OAuth连接」 → 加载
    workos-sso.md
    (而非AuthKit)
  • 用户明确提及「MFA」「多因素认证」「2FA」「TOTP」 → 加载
    workos-mfa.md
  • 用户明确提及「角色」「权限」「RBAC」 → 加载
    workos-rbac.md
  • 用户明确提及「目录同步」「SCIM」「用户配置」 → 加载
    workos-directory-sync.md
优先级规则:如果用户同时提及AuthKit和某一功能(例如「设置AuthKit与SSO」),请先加载AuthKit。AuthKit技能会将SSO配置作为下一步操作进行说明。

Multiple Features Mentioned

提及多个功能

Route to the MOST SPECIFIC skill first. Examples:
  • "SSO with MFA" → Load
    workos-sso.md
    (SSO is the primary integration, MFA is a configuration option)
  • "Audit logs for admin portal" → Load
    workos-audit-logs.md
    (audit logs is the feature being configured)
  • "Directory sync with RBAC" → Load
    workos-directory-sync.md
    (directory sync is the primary feature)
The user can request additional skills after completing the first one.
优先路由到最具体的技能。示例:
  • "SSO搭配MFA" → 加载
    workos-sso.md
    (SSO是主要集成功能,MFA为配置选项)
  • "管理门户的审计日志" → 加载
    workos-audit-logs.md
    (审计日志是待配置的功能)
  • "目录同步搭配RBAC" → 加载
    workos-directory-sync.md
    (目录同步是主要功能)
用户可在完成第一个技能后请求其他技能。

Migration Context

迁移场景

  • User says "migrate from [provider]" or "switch from [provider]" → Load the migration skill for that provider
  • User asks "how to import users" or "bring existing users" WITHOUT naming a source → Load
    workos-migrate-other-services.md
    (generic migration guide)
  • User mentions a provider not in the migration table → Load
    workos-migrate-other-services.md
  • 用户提及「从[服务商]迁移」或「从[服务商]切换」 → 加载对应服务商的迁移技能文档
  • 用户询问「如何导入用户」或「迁移现有用户」但未指定来源 → 加载
    workos-migrate-other-services.md
    (通用迁移指南)
  • 用户提及的服务商不在迁移表格中 → 加载
    workos-migrate-other-services.md

Ambiguous Requests

模糊请求

  • "How do I use WorkOS?" → Load
    workos-authkit-base
    for architectural overview, then detect framework if they want to proceed with installation
  • "WorkOS setup" → Ask: "Are you setting up authentication (AuthKit), or a specific feature like SSO, MFA, or Directory Sync?"
  • "WorkOS API" → Ask: "Which WorkOS feature are you working with?" Then route to the corresponding API reference
  • "WorkOS integration" → Ask: "Are you integrating an identity provider (SSO/Directory Sync), or embedding WorkOS features in your app?"
  • 「如何使用WorkOS?」 → 加载
    workos-authkit-base
    获取架构概述,若用户需要继续安装则检测其使用的框架
  • 「WorkOS设置」 → 询问:「您是要设置身份认证(AuthKit),还是特定功能如SSO、MFA或目录同步?」
  • 「WorkOS API」 → 询问:「您正在使用WorkOS的哪项功能?」然后路由到对应的API参考文档
  • 「WorkOS集成」 → 询问:「您是要集成身份提供商(SSO/目录同步),还是要在应用中嵌入WorkOS功能?」

Topic → Skill Map

主题→技能映射

AuthKit (load via Skill tool)

AuthKit(通过Skill工具加载)

User wants to...Skill tool name
Install AuthKit in Next.jsworkos-authkit-nextjs
Install AuthKit in React SPAworkos-authkit-react
Install AuthKit with React Routerworkos-authkit-react-router
Install AuthKit with TanStack Startworkos-authkit-tanstack-start
Install AuthKit in vanilla JSworkos-authkit-vanilla-js
AuthKit architecture referenceworkos-authkit-base
用户需求...Skill工具名称
在Next.js中安装AuthKitworkos-authkit-nextjs
在React单页应用中安装AuthKitworkos-authkit-react
搭配React Router安装AuthKitworkos-authkit-react-router
搭配TanStack Start安装AuthKitworkos-authkit-tanstack-start
在原生JS中安装AuthKitworkos-authkit-vanilla-js
AuthKit架构参考文档workos-authkit-base

Features (Read
skills/workos/{name}.md
)

功能技能(读取
skills/workos/{name}.md

User wants to...Read file
Configure email delivery
skills/workos/workos-email.md
Add WorkOS Widgets
skills/workos/workos-widgets.md
Encrypt data with Vault
skills/workos/workos-vault.md
Configure Single Sign-On
skills/workos/workos-sso.md
Implement RBAC / roles
skills/workos/workos-rbac.md
Add Multi-Factor Auth
skills/workos/workos-mfa.md
Set up IdP integration
skills/workos/workos-integrations.md
Handle WorkOS Events / webhooks
skills/workos/workos-events.md
Set up Directory Sync
skills/workos/workos-directory-sync.md
Set up Custom Domains
skills/workos/workos-custom-domains.md
Set up Audit Logs
skills/workos/workos-audit-logs.md
Enable Admin Portal
skills/workos/workos-admin-portal.md
用户需求...读取文件
配置邮件发送
skills/workos/workos-email.md
添加WorkOS组件
skills/workos/workos-widgets.md
使用Vault加密数据
skills/workos/workos-vault.md
配置单点登录
skills/workos/workos-sso.md
实现RBAC/角色管理
skills/workos/workos-rbac.md
添加多因素认证
skills/workos/workos-mfa.md
设置身份提供商集成
skills/workos/workos-integrations.md
处理WorkOS事件/ Webhooks
skills/workos/workos-events.md
设置目录同步
skills/workos/workos-directory-sync.md
设置自定义域名
skills/workos/workos-custom-domains.md
设置审计日志
skills/workos/workos-audit-logs.md
启用管理门户
skills/workos/workos-admin-portal.md

API References (Read
skills/workos/{name}.md
)

API参考文档(读取
skills/workos/{name}.md

User wants to...Read file
Admin portal API Reference
skills/workos/workos-api-admin-portal.md
Audit logs API Reference
skills/workos/workos-api-audit-logs.md
Authkit API Reference
skills/workos/workos-api-authkit.md
Directory sync API Reference
skills/workos/workos-api-directory-sync.md
Events API Reference
skills/workos/workos-api-events.md
Organization API Reference
skills/workos/workos-api-organization.md
Roles API Reference
skills/workos/workos-api-roles.md
Sso API Reference
skills/workos/workos-api-sso.md
Vault API Reference
skills/workos/workos-api-vault.md
Widgets API Reference
skills/workos/workos-api-widgets.md
用户需求...读取文件
管理门户API参考文档
skills/workos/workos-api-admin-portal.md
审计日志API参考文档
skills/workos/workos-api-audit-logs.md
AuthKit API参考文档
skills/workos/workos-api-authkit.md
目录同步API参考文档
skills/workos/workos-api-directory-sync.md
事件API参考文档
skills/workos/workos-api-events.md
组织API参考文档
skills/workos/workos-api-organization.md
角色API参考文档
skills/workos/workos-api-roles.md
SSO API参考文档
skills/workos/workos-api-sso.md
Vault API参考文档
skills/workos/workos-api-vault.md
Widgets API参考文档
skills/workos/workos-api-widgets.md

Migrations (Read
skills/workos/{name}.md
)

迁移(读取
skills/workos/{name}.md

User wants to...Read file
Migrate from Supabase Auth
skills/workos/workos-migrate-supabase-auth.md
Migrate from Stytch
skills/workos/workos-migrate-stytch.md
Migrate from the standalone SSO API
skills/workos/workos-migrate-the-standalone-sso-api.md
Migrate from other services
skills/workos/workos-migrate-other-services.md
Migrate from Firebase
skills/workos/workos-migrate-firebase.md
Migrate from Descope
skills/workos/workos-migrate-descope.md
Migrate from Clerk
skills/workos/workos-migrate-clerk.md
Migrate from Better Auth
skills/workos/workos-migrate-better-auth.md
Migrate from AWS Cognito
skills/workos/workos-migrate-aws-cognito.md
Migrate from Auth0
skills/workos/workos-migrate-auth0.md
用户需求...读取文件
从Supabase Auth迁移
skills/workos/workos-migrate-supabase-auth.md
从Stytch迁移
skills/workos/workos-migrate-stytch.md
从独立SSO API迁移
skills/workos/workos-migrate-the-standalone-sso-api.md
从其他服务商迁移
skills/workos/workos-migrate-other-services.md
从Firebase迁移
skills/workos/workos-migrate-firebase.md
从Descope迁移
skills/workos/workos-migrate-descope.md
从Clerk迁移
skills/workos/workos-migrate-clerk.md
从Better Auth迁移
skills/workos/workos-migrate-better-auth.md
从AWS Cognito迁移
skills/workos/workos-migrate-aws-cognito.md
从Auth0迁移
skills/workos/workos-migrate-auth0.md

AuthKit Installation Detection

AuthKit安装框架检测

If the user wants to install AuthKit, detect their framework by checking their project in this exact priority order (first match wins):
1. package.json contains "@tanstack/start"           → Skill tool: workos-authkit-tanstack-start
2. package.json contains "react-router"              → Skill tool: workos-authkit-react-router
3. next.config.js OR next.config.mjs exists          → Skill tool: workos-authkit-nextjs
4. vite.config.* exists AND package.json has "react" → Skill tool: workos-authkit-react
5. None of the above detected                        → Skill tool: workos-authkit-vanilla-js
Why this order?
  • TanStack Start and React Router are checked FIRST because they can coexist with Vite+React, and we need the most specific match.
  • Next.js is checked BEFORE generic Vite+React because Next.js projects may also have React in deps.
  • Vanilla JS is the fallback for projects with no detectable framework (plain HTML/JS, non-React SPAs, or server-rendered apps without a supported framework).
Edge cases:
  • Multiple frameworks detected (e.g., Next.js config + TanStack Start dep): Follow the priority order — TanStack Start wins.
  • Monorepo with multiple frameworks: Ask the user which app/package they want to add AuthKit to, then detect framework in that specific directory.
  • Framework not listed (e.g., SvelteKit, Remix, Angular): Load
    workos-authkit-base
    for architectural guidance, then direct the user to https://workos.com/docs/llms.txt to check if their framework is supported.
如果用户想要安装AuthKit,请按照以下精确优先级顺序检测其项目框架(匹配到第一个即停止):
1. package.json包含"@tanstack/start"           → Skill工具:workos-authkit-tanstack-start
2. package.json包含"react-router"              → Skill工具:workos-authkit-react-router
3. 存在next.config.js或next.config.mjs          → Skill工具:workos-authkit-nextjs
4. 存在vite.config.*且package.json包含"react" → Skill工具:workos-authkit-react
5. 未检测到上述任何框架                        → Skill工具:workos-authkit-vanilla-js
为何采用此顺序?
  • 优先检测TanStack Start和React Router,因为它们可与Vite+React共存,我们需要最具体的匹配结果。
  • 先检测Next.js再检测通用Vite+React,因为Next.js项目的依赖中也可能包含React。
  • 原生JS是未检测到框架的项目的 fallback 选项(纯HTML/JS、非React单页应用或不支持的服务端渲染应用)。
边缘情况:
  • 检测到多个框架(例如同时存在Next.js配置文件和TanStack Start依赖):遵循优先级顺序——TanStack Start优先。
  • 包含多个框架的单体仓库:询问用户要为哪个应用/包添加AuthKit,然后在对应目录中检测框架。
  • 未列出的框架(例如SvelteKit、Remix、Angular):加载
    workos-authkit-base
    获取架构指导,然后引导用户访问https://workos.com/docs/llms.txt 查看其框架是否受支持。

General Decision Flow

通用决策流程

User request about WorkOS?
  |
  +-- Mentions "migrate", "switch from", or "import from [provider]"?
  |     → Read skills/workos/workos-migrate-[provider].md
  |     → If provider not in table → Read skills/workos/workos-migrate-other-services.md
  |
  +-- Mentions SPECIFIC feature by name (SSO, MFA, RBAC, Directory Sync, Audit Logs, Vault, etc.)?
  |     → Read skills/workos/workos-[feature].md
  |     → Exception: If also mentions "API reference" → Read skills/workos/workos-api-[feature].md
  |
  +-- Explicitly asks for "API reference", "endpoints", or "request/response format"?
  |     → Read skills/workos/workos-api-[feature].md
  |     → If feature unclear → Ask which feature's API they need
  |
  +-- Mentions "login", "sign-up", "authentication", "sign-in", or "session" WITHOUT naming a feature?
  |     → Detect framework using AuthKit Installation Detection rules above
  |     → Skill tool: workos-authkit-[framework]
  |
  +-- Mentions "IdP", "identity provider", "SAML setup", or "OAuth provider setup"?
  |     → Read skills/workos/workos-integrations.md
  |
  +-- Mentions "webhooks" or "events"?
  |     → Read skills/workos/workos-events.md
  |
  +-- Request is vague ("How do I use WorkOS?", "WorkOS setup", "WorkOS integration")?
  |     → Ask clarifying question (see "Ambiguous Requests" above)
  |
  +-- No clear match?
  |     → WebFetch https://workos.com/docs/llms.txt
  |     → Find the relevant section URL
  |     → WebFetch that section
  |     → Synthesize an answer OR route to the closest skill if one exists
用户请求关于WorkOS?
  |
  +-- 提及「迁移」「从...切换」或「从[服务商]导入」?
  |     → 读取skills/workos/workos-migrate-[provider].md
  |     → 若服务商不在表格中 → 读取skills/workos/workos-migrate-other-services.md
  |
  +-- 明确提及特定功能名称(SSO、MFA、RBAC、目录同步、审计日志、Vault等)?
  |     → 读取skills/workos/workos-[feature].md
  |     → 例外:若同时提及「API参考文档」→ 读取skills/workos/workos-api-[feature].md
  |
  +-- 明确询问「API参考文档」「端点」或「请求/响应格式」?
  |     → 读取skills/workos/workos-api-[feature].md
  |     → 若功能不明确 → 询问用户需要哪项功能的API文档
  |
  +-- 提及「登录」「注册」「身份认证」「登入」或「会话」但未指定功能?
  |     → 根据上述AuthKit安装框架检测规则检测框架
  |     → Skill工具:workos-authkit-[framework]
  |
  +-- 提及「IdP」「身份提供商」「SAML设置」或「OAuth提供商设置」?
  |     → 读取skills/workos/workos-integrations.md
  |
  +-- 请求模糊(「如何使用WorkOS?」「WorkOS设置」「WorkOS集成」)?
  |     → 询问澄清问题(见上方「模糊请求」部分)
  |
  +-- 无明确匹配?
  |     → WebFetch https://workos.com/docs/llms.txt
  |     → 找到相关章节的URL
  |     → WebFetch该章节内容
  |     → 合成答案或路由到最接近的技能文档(如果存在)

Edge Cases

边缘情况

Multiple Features in One Request

单个请求包含多个功能

Examples:
  • "Set up SSO with MFA" → Load
    workos-sso.md
    first (SSO is the primary integration). The skill will reference MFA configuration.
  • "AuthKit with custom domains" → Load the AuthKit skill for their framework first. After installation, load
    workos-custom-domains.md
    .
  • "Directory Sync with RBAC" → Load
    workos-directory-sync.md
    first (directory sync is the source of user data). RBAC is configured after users are synced.
General rule: Route to the skill that represents the PRIMARY integration or feature being configured. Dependent features can be loaded as follow-up steps.
示例:
  • 「设置SSO搭配MFA」 → 先加载
    workos-sso.md
    (SSO是主要集成功能),该技能文档会提及MFA配置。
  • 「AuthKit搭配自定义域名」 → 先加载对应框架的AuthKit技能文档,安装完成后再加载
    workos-custom-domains.md
  • 「目录同步搭配RBAC」 → 先加载
    workos-directory-sync.md
    (目录同步是用户数据的来源),用户同步完成后再配置RBAC。
通用规则:路由到代表主要集成或待配置功能的技能文档。附属功能可作为后续步骤加载。

Framework Detection Failures

框架检测失败

  • No framework detected → Load
    workos-authkit-vanilla-js
    (covers plain HTML/JS and server-rendered apps)
  • Unsupported framework (e.g., Laravel, Django, Ruby on Rails) → Load
    workos-authkit-base
    for architecture overview, then WebFetch https://workos.com/docs/llms.txt to check for backend SDK docs
  • 未检测到框架 → 加载
    workos-authkit-vanilla-js
    (涵盖纯HTML/JS和服务端渲染应用)
  • 不支持的框架(例如Laravel、Django、Ruby on Rails)→ 加载
    workos-authkit-base
    获取架构概述,然后WebFetch https://workos.com/docs/llms.txt 查看后端SDK文档

User Asks About Multiple Topics

用户询问多个主题

Examples:
  • "How do SSO and Directory Sync work together?" → Load
    workos-sso.md
    first (explains SSO connections), then load
    workos-directory-sync.md
    (explains user provisioning from IdP)
  • "What's the difference between SSO and AuthKit?" → Load
    workos-authkit-base
    (explains AuthKit's role), then explain that SSO is a CONNECTION TYPE that AuthKit can use
示例:
  • 「SSO和目录同步如何配合工作?」 → 先加载
    workos-sso.md
    (解释SSO连接),再加载
    workos-directory-sync.md
    (解释从身份提供商同步用户)
  • 「SSO和AuthKit有什么区别?」 → 加载
    workos-authkit-base
    (解释AuthKit的作用),然后说明SSO是AuthKit可使用的一种连接类型

No Skill Matches

无匹配技能

If the user's request does not match ANY skill in the tables above:
  1. WebFetch https://workos.com/docs/llms.txt to get the full documentation index
  2. Identify the relevant section URL from the index
  3. WebFetch that section URL
  4. If the fetched content suggests a skill exists but wasn't matched, re-evaluate routing rules
  5. Otherwise, synthesize an answer from the fetched documentation
如果用户的请求与上述表格中的任何技能都不匹配:
  1. WebFetch https://workos.com/docs/llms.txt 获取完整文档索引
  2. 从索引中找到相关章节的URL
  3. WebFetch该章节内容
  4. 如果获取的内容表明存在匹配的技能但未被匹配,则重新评估路由规则
  5. 否则,根据获取的文档内容合成答案

If No Skill Matches

无匹配技能时的处理

WebFetch the full docs index: https://workos.com/docs/llms.txt Then WebFetch the specific section URL for the user's topic.
WebFetch完整文档索引:https://workos.com/docs/llms.txt 然后WebFetch用户主题对应的具体章节URL。