clerk-backend-api by clerk/skills
npx skills add https://github.com/clerk/skills --skill clerk-backend-api用户提示:$ARGUMENTS
在执行任何操作之前,请运行以下命令获取可用的规范版本和标签:
bash scripts/api-specs-context.sh
使用输出来确定最新版本和可用标签。
缓存: 如果您在此对话中之前已经获取过规范上下文,请不要再次获取。请重用之前调用中的版本和标签。
platform 相关的端点/模式。CLERK_BAPI_SCOPES 是否包含所需的作用域。如果不包含,请直接询问用户:"这是一个写入/删除操作,您当前的作用域不允许执行。是否使用 --admin 来绕过?" 请不要先尝试请求然后失败——在执行前询问。根据选项上下文中的用户提示确定活动模式:
| 模式 | 触发条件 | 行为 |
|---|---|---|
help |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
提示为空,或仅包含 help / -h / --help |
| 打印使用示例(步骤 0) |
browse | 提示是 tags,或一个标签名称(例如 Users) | 列出所有标签或某个标签的所有端点 |
execute | 特定端点(例如 GET /users)或自然语言操作(例如 "获取用户 john_doe") | 查找端点,执行请求 |
detail | 端点 + help / -h / --help(例如 GET /users help) | 显示端点模式,不执行 |
默认使用 API 规范上下文中的最新版本。如果用户指定了不同的版本(例如 --version 2024-10-01),则使用该版本。
确定活动模式,然后按照以下适用步骤执行。
模式: 仅 help — 对于 browse、execute 和 detail 模式跳过。
逐字打印以下示例给用户:
Browse
/clerk-backend-api tags — 列出所有标签
/clerk-backend-api Users — 浏览 Users 标签下的端点
/clerk-backend-api Users version 2025-11-10.yml — 使用不同版本进行浏览
Execute
/clerk-backend-api GET /users — 获取所有用户
/clerk-backend-api get user john_doe — 自然语言同样有效
/clerk-backend-api POST /invitations — 创建邀请
Inspect
/clerk-backend-api GET /users help — 显示端点模式而不执行
/clerk-backend-api POST /invitations -h — 查看请求/响应详细信息
Options
--admin — 绕过写入/删除操作的作用域限制
--version [date], version [date] — 使用特定的规范版本
--help, -h, help — 检查端点而不是执行
在此停止。
模式: browse(当提示是 tags 或未指定标签时) — 对于 help、execute 和 detail 模式跳过。
如果使用非最新版本,则获取该版本的标签:
curl -s https://raw.githubusercontent.com/clerk/openapi-specs/main/bapi/${version_name} | node scripts/extract-tags.js
否则,使用 API 规范上下文中已有的标签。
以表格形式分享标签,并提示用户选择一个查询。
模式: browse(当提供了标签名称时) — 对于 help、execute 和 detail 模式跳过。
获取指定标签的所有端点:
curl -s https://raw.githubusercontent.com/clerk/openapi-specs/main/bapi/${version_name} | bash scripts/extract-tag-endpoints.sh "${tag_name}"
与用户分享结果(端点、模式、参数)。
模式: execute, detail — 对于 help 和 browse 模式跳过。
对于 execute 模式中的自然语言提示,首先通过搜索上下文中的标签来识别匹配的端点。如果需要,获取标签端点以解析确切的路径和方法。
提取完整的端点定义:
curl -s https://raw.githubusercontent.com/clerk/openapi-specs/main/bapi/${version_name} | bash scripts/extract-endpoint-detail.sh "${path}" "${method}"
${path} — 例如 /users/{user_id}${method} — 小写,例如 getdetail 模式: 与用户分享端点定义和模式。在此停止。
execute 模式: 继续步骤 4。
模式: 仅 execute。
使用步骤 3 中的端点定义来构建请求:
从规范中识别必需和可选的参数。
向用户询问任何必需的路径/查询/正文参数。
通过请求脚本执行:
bash scripts/execute-request.sh [--admin] ${METHOD} "${path}" ['${body_json}']
--admin — 如果用户确认了管理员绕过(参见规则),则传递此参数${METHOD} — 大写的 HTTP 方法${path} — 已解析并填充了参数的路径(例如 /users/user_abc123)${body_json} — 用于 POST/PUT/PATCH 的可选 JSON 正文每周安装数
452
仓库
GitHub 星标数
22
首次出现
8 天前
安全审计
安装于
codex446
cursor444
gemini-cli443
github-copilot443
opencode443
cline442
User Prompt: $ARGUMENTS
Before doing anything, fetch the available spec versions and tags by running:
bash scripts/api-specs-context.sh
Use the output to determine the latest version and available tags.
Caching: If you already fetched the spec context earlier in this conversation, do NOT fetch it again. Reuse the version and tags from the previous call.
platform.CLERK_BAPI_SCOPES includes the required scope. If not, ask the user upfront: "This is a write/delete operation and your current scopes don't allow it. Run with --admin to bypass?" Do NOT attempt the request first and fail — ask before executing.Determine the active mode based on the user prompt in Options context:
| Mode | Trigger | Behavior |
|---|---|---|
help | Prompt is empty, or contains only help / -h / --help | Print usage examples (step 0) |
browse | Prompt is tags, or a tag name (e.g. Users) | List all tags or endpoints for a tag |
execute | Specific endpoint (e.g. GET /users) or natural language action (e.g. "get user john_doe") | Look up endpoint, execute request |
detail | Endpoint + help / -h / --help (e.g. GET /users help) | Show endpoint schema, don't execute |
Use the LATEST VERSION from API specs context by default. If the user specifies a different version (e.g. --version 2024-10-01), use that version instead.
Determine the active mode, then follow the applicable steps below.
Modes: help only — Skip for browse, execute, and detail.
Print the following examples to the user verbatim:
Browse
/clerk-backend-api tags — list all tags
/clerk-backend-api Users — browse endpoints for the Users tag
/clerk-backend-api Users version 2025-11-10.yml — browse using a different version
Execute
/clerk-backend-api GET /users — fetch all users
/clerk-backend-api get user john_doe — natural language works too
/clerk-backend-api POST /invitations — create an invitation
Inspect
/clerk-backend-api GET /users help — show endpoint schema without executing
/clerk-backend-api POST /invitations -h — view request/response details
Options
--admin — bypass scope restrictions for write/delete
--version [date], version [date] — use a specific spec version
--help, -h, help — inspect endpoint instead of executing
Stop here.
Modes: browse (when prompt is tags or no tag specified) — Skip for help, execute, and detail.
If using a non-latest version, fetch tags for that version:
curl -s https://raw.githubusercontent.com/clerk/openapi-specs/main/bapi/${version_name} | node scripts/extract-tags.js
Otherwise, use the TAGS already in API specs context.
Share tags in a table and prompt the user to select a query.
Modes: browse (when a tag name is provided) — Skip for help, execute, and detail.
Fetch all endpoints for the identified tag:
curl -s https://raw.githubusercontent.com/clerk/openapi-specs/main/bapi/${version_name} | bash scripts/extract-tag-endpoints.sh "${tag_name}"
Share the results (endpoints, schemas, parameters) with the user.
Modes: execute, detail — Skip for help and browse.
For natural language prompts in execute mode, first identify the matching endpoint by searching the tags in context. Fetch tag endpoints if needed to resolve the exact path and method.
Extract the full endpoint definition:
curl -s https://raw.githubusercontent.com/clerk/openapi-specs/main/bapi/${version_name} | bash scripts/extract-endpoint-detail.sh "${path}" "${method}"
${path} — e.g. /users/{user_id}${method} — lowercase, e.g. getdetail mode: Share the endpoint definition and schemas with the user. Stop here.
execute mode: Continue to step 4.
Modes: execute only.
Use the endpoint definition from step 3 to build the request:
bash scripts/execute-request.sh [--admin] ${METHOD} "${path}" ['${body_json}']
--admin — pass this if the user confirmed admin bypass (see Rules)${METHOD} — uppercase HTTP method${path} — resolved path with parameters filled in (e.g. /users/user_abc123)${body_json} — optional JSON body for POST/PUT/PATCHWeekly Installs
452
Repository
GitHub Stars
22
First Seen
8 days ago
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
codex446
cursor444
gemini-cli443
github-copilot443
opencode443
cline442
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
102,200 周安装