robel-auth

SKILL开发
开发 未标注权限 许可证不明确

Integrate and maintain Robelest Convex Auth in apps by always checking upstream before implementation. Use when adding auth setup, updating auth wiring, migrating between upstream patterns, or troubleshooting @robelest/convex-auth behavior across projects.

一句话选型结论

按资料字段整理

robel-auth是开发类的 Agent Skill,安装方式:GitHub 仓库,权限级别未标注,许可证不明确,没有现成安装命令,需按说明手动放置 SKILL.md。技能本质是给模型读的说明书,效果取决于模型与客户端;装完先用一个小任务验证,再放进正式流程。

分类开发 安装方式GitHub 仓库 权限级别未标注权限 许可证许可证不明确
累计安装 未标注 本周 未标注
GitHub 星标 594 仓库 markdown-site
下载量 未标注 技能市场下载数
权限级别 未标注权限 安装前请确认风险范围
许可证 许可证不明确 未说明

安装

GitHub 仓库
在支持 Skills 的客户端里执行,装完问一句「你有哪些技能」验证
  1. 1
    确认客户端支持

    确认你的客户端支持 Skills(Claude、Codex、Cursor 等),并升级到较新的版本。

  2. 2
    拿到技能文件

    按安装说明或仓库 README,把 SKILL.md 放到客户端的 skills 目录(一般一个技能一个文件夹)。

  3. 3
    刷新技能列表

    重新打开客户端,或刷新技能列表,让新放进来的技能被加载。

  4. 4
    验证是否生效

    问一句「你有哪些技能」,确认列表里出现它,再拿一个小任务试跑。

技能档案

开发
字段来自技能仓库与公开索引,中文说明由本站标注
作者 / 维护方waynesutton仓库 markdown-site · 版本 未标注
宿主客户端未标注技能可被这些客户端加载
安装方式GitHub 仓库安装包 waynesutton/markdown-site
权限级别未标注权限安装前请确认风险范围
许可证未说明许可证不明确,商用前请自行确认条款
仓库可用性available技能仓库当前是否可访问
最近核验未标注上游最后核验时间 · 数据更新 未标注
正文体量17.3 KBSKILL.md 原文大小,越大说明说明书写得越细

典型使用场景

3 类
按分类整理的常见用法,具体以 SKILL.md 为准
写代码与改 bug

按需求补代码、定位并修掉报错。

读仓库与生成改动

让模型读懂项目结构,再给出可落地的改动。

跑测试与排查故障

按现象排查问题,补测试用例并复跑。

选择建议

装之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 基础信息齐全,可以先按说明装一个试试。

先想清楚的地方

  • 没有标注权限级别,实际能做什么要装好后确认。
  • 许可证不明确,商用或二次分发前先到仓库确认条款。
  • 没有现成安装命令,要按安装说明或仓库 README 手动放置。
  • 没有做站内核验,内容以作者仓库为准。
  • 技能只是说明书,实际效果取决于模型与客户端,装完先用小任务试一遍。

更适合

  • 需要在开发场景里给模型补一套做法的人。
  • 愿意先读一遍 SKILL.md、确认它会让模型做什么的人。

不太适合

  • 对许可证要求很严、必须明确可商用的人。
  • 只想装完就自动变强、不打算看说明书的人。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
技能权限级别安装方式累计安装宿主客户端安装命令
robel-auth当前 未标注权限 GitHub 仓库 未标注 未标注 无
技能审查员 浏览器控制 ClawHub 市场 877.9 万 OpenClaw 有
Vercel React 最佳实践 浏览器控制 GitHub 仓库 849.1 万 Codex、Claude、Cursor 有
GitHub 代码协作 联网访问 ClawHub 市场 763.3 万 OpenClaw 有
网页设计指南 联网访问 GitHub 仓库 668.6 万 Codex、Claude、Cursor 有
本体论 只读 ClawHub 市场 663.7 万 OpenClaw 有

SKILL.md 全文

17.3 KB
模型实际读到的说明书原文,来自技能仓库

Robel auth skill

Use this skill when a user asks to implement, update, or debug auth based on robelest/convex-auth.

This skill is designed to be copied into other repos.

Non negotiable upstream check before any auth change

Run this every time before proposing code or commands.

Preferred command:

bash .cursor/skills/robel-auth/scripts/check-upstream.sh

Manual checklist if script is unavailable:

  1. Read official docs: https://auth.estifanos.com/getting-started/installation/
  2. Read latest main README: https://raw.githubusercontent.com/robelest/convex-auth/main/README.md
  3. Read latest release README: https://raw.githubusercontent.com/robelest/convex-auth/release/README.md
  4. Check branch level differences: https://github.com/robelest/convex-auth/compare/release...main
  5. Read current self hosting docs if portal or static hosting is involved:
    - https://raw.githubusercontent.com/get-convex/self-hosting/main/INTEGRATION.md
    - https://github.com/get-convex/self-hosting

If main and release conflict, prefer the branch requested by the user. If unspecified, use release for stability and explain that choice.

Important assumptions for this skill

  • Treat the official docs site (auth.estifanos.com) and GitHub as sources of truth every time.
  • Do not assume npm package availability.
  • Validate package availability at execution time.
  • If npm is unavailable, use a GitHub source install pinned to a branch or commit.
  • Keep all Convex code type safe and validator complete.

Published package reality check (critical)

The docs site (auth.estifanos.com) and main branch sometimes describe APIs ahead of the latest preview release on npm. Before writing imports, always inspect what the installed version actually exports:

ls node_modules/@robelest/convex-auth/dist/providers/
cat node_modules/@robelest/convex-auth/dist/providers/index.js
cat node_modules/@robelest/convex-auth/dist/component/index.d.ts

As of 0.0.4-preview.30

The published package now matches the docs site for the common cases:

  • Lowercase factory exports from @robelest/convex-auth/providers: github, google, apple, microsoft, password, passkey, credentials, anonymous, device, email, phone, sso, totp, custom.
  • github, google, apple, microsoft are first-party factories with built-in profile fetch. No arctic wrapping required.
  • password is a factory function. Call it as password(), not new Password().
  • createAuth is exported from @robelest/convex-auth/component.
  • Client factory: import { client } from "@robelest/convex-auth/client" (or /browser for the browser-tuned variant). Both require api in SPA mode: client({ convex, api: api.auth }). Omitting api throws "The \api` option is required when `proxyPath` is not set. Pass { api: api.auth }."at firstsignIn/signOut/verifyCodecall. OnlyproxyPath` mode can skip it.

Older releases (legacy notes)

  • 0.0.4-preview.25 and earlier shipped PascalCase classes (Password, OAuth, etc.) and required arctic for OAuth providers.
  • If you find code on the older API, the upgrade path is: bump to ^0.0.4-preview.30, remove arctic, switch OAuth(new GitHub(...), { profile }) to github({ clientId, clientSecret }), and switch new Password() to password().

If the installed version drifts from the docs site, follow the installed exports and note the drift to the user. Do not blindly copy doc examples.

Clarifying questions to ask first

Ask these before editing:

  1. Which branch is source of truth for this task, release or main.
  2. Is this a new integration or an update to an existing auth setup.
  3. Which framework is used: Vite, Next.js, SvelteKit, TanStack Start, Expo web, or other.
  4. Is self hosted portal/static delivery needed now.
  5. Are they okay pinning dependency to a specific Git commit for reproducibility.

Install and dependency strategy

Never assume one install path.

  1. Try package registry lookup:
    - npm view @robelest/convex-auth version
  2. If package is unavailable or blocked, install from GitHub:
    - npm install github:robelest/convex-auth#release
  3. For deterministic builds, pin a commit SHA:
    - npm install github:robelest/convex-auth#<commit-sha>

If the project uses pnpm or bun, translate the same GitHub dependency pinning pattern.

Quick setup (CLI wizard)

The recommended setup flow:

  1. Install @robelest/convex-auth
  2. Start a Convex deployment with convex dev
  3. Run the auth setup wizard

The wizard handles key generation, convex.config.ts, auth.ts, and http.ts automatically.

Core wiring (3 files)

1. Register the component

// convex/convex.config.ts
import { defineApp } from "convex/server";
import auth from "@robelest/convex-auth/convex.config";

const app = defineApp();
app.use(auth);
export default app;

2. Configure auth

// convex/auth.ts
import { createAuth } from "@robelest/convex-auth/component";
import { components } from "./_generated/api";
import { github } from "@robelest/convex-auth/providers/github";

const auth = createAuth(components.auth, {
  providers: [
    github({
      clientId: process.env.AUTH_GITHUB_ID!,
      clientSecret: process.env.AUTH_GITHUB_SECRET!,
    }),
  ],
});

export { auth };
export const { signIn, signOut, store } = auth;

3. Wire up HTTP routes

// convex/http.ts
import { httpRouter } from "convex/server";
import { auth } from "./auth";

const http = httpRouter();
auth.http.add(http);
export default http;

auth.http.add registers OAuth callbacks and JWKS endpoints in one call.

API layers

Client auth flow: signIn, signOut, and store are the only required client-callable auth functions. Frontends use them through client({ convex, api: api.auth }).

Server helpers: auth.user.*, auth.session.*, auth.account.*, auth.group.*, auth.member.*, auth.invite.*, auth.key.*, auth.http.*, auth.group.sso.*, and auth.group.sso.scim.* are server-side helpers for Convex code. They are not automatically public RPC.

Optional group SSO RPC: If your app wants client-callable group SSO admin APIs, expose app-owned wrappers such as convex/auth/group.ts.

Available providers

All providers import from @robelest/convex-auth/providers:

import {
  anonymous,
  apple,
  custom,
  email,
  github,
  google,
  microsoft,
  passkey,
  password,
  phone,
  sso,
  totp,
} from "@robelest/convex-auth/providers";

OAuth providers

Provider Factory Required env vars
GitHub github({ clientId, clientSecret }) AUTH_GITHUB_ID, AUTH_GITHUB_SECRET
Google google({ clientId, clientSecret }) AUTH_GOOGLE_ID, AUTH_GOOGLE_SECRET
Apple apple({ clientId, teamId, keyId, privateKey }) AUTH_APPLE_ID, AUTH_APPLE_TEAM_ID, AUTH_APPLE_KEY_ID, AUTH_APPLE_PRIVATE_KEY
Microsoft microsoft({ tenant, clientId, clientSecret? }) AUTH_MICROSOFT_TENANT_ID, AUTH_MICROSOFT_ID

All OAuth wrappers derive callback URL from CONVEX_SITE_URL automatically.

Custom OAuth

Use custom() for providers without a first-party wrapper:

custom({
  id: "discord",
  clientId: process.env.AUTH_DISCORD_ID!,
  clientSecret: process.env.AUTH_DISCORD_SECRET!,
  scopes: ["identify", "email"],
  authorization: { url: "https://discord.com/oauth2/authorize", pkce: "optional" },
  token: { url: "https://discord.com/api/oauth2/token", authMethod: "body" },
  profile: async ({ accessToken }) => {
    const res = await fetch("https://discord.com/api/users/@me", {
      headers: { Authorization: `Bearer ${accessToken}` },
    });
    const user = await res.json();
    return { id: String(user.id), email: user.email, name: user.username };
  },
})

Non-OAuth providers

Provider Factory Notes
Password password() Built-in password auth
Magic links email({ from, send }) Requires email transport (e.g. Resend)
Passkeys passkey() WebAuthn based
TOTP totp({ issuer }) Authenticator app codes
Anonymous anonymous() Guest sessions
Phone/SMS phone({ send }) Requires SMS transport (e.g. Twilio)
Group SSO sso() Enables OIDC, SAML 2.0, SCIM 2.0

Configuration options

const auth = createAuth(components.auth, {
  providers: [/* ... */],
  session: {
    totalDurationMs: 30 * 24 * 60 * 60 * 1000,   // 30 days
    inactiveDurationMs: 7 * 24 * 60 * 60 * 1000,  // 7 days
  },
  jwt: {
    durationMs: 60 * 1000,  // 1 minute
  },
  signIn: {
    max_failed_attempts_per_hour: 10,
  },
  callbacks: {
    afterUserCreatedOrUpdated: async (ctx, { userId, existingUser }) => { /* ... */ },
  },
  authorization: {
    roles,  // from defineRoles()
  },
});
Option Type Default Description
providers AuthProviderConfig[] required Auth methods to enable
session.totalDurationMs number 30 days Maximum session lifetime
session.inactiveDurationMs number varies Inactive session timeout
jwt.durationMs number 60s JWT token lifetime
signIn.max_failed_attempts_per_hour number 10 Rate limit for failed sign-in attempts
callbacks.afterUserCreatedOrUpdated function none Post sign-in hook
authorization.roles Record {} App-defined role definitions and grants

Multi-access patterns

Every auth path resolves to the same userId. Three access patterns:

Pattern Context How userId is available
App code (query/mutation/action) auth.ctx() ctx.auth.userId and ctx.auth.user
Raw HTTP (session or API key) auth.http.context(ctx, request) authContext.userId
API key HTTP auth.http.action(...) ctx.key.userId

Auth-aware custom functions

// convex/functions.ts
import { customMutation, customQuery } from "convex-helpers/server/customFunctions";
import { mutation, query } from "./_generated/server";
import { auth } from "./auth";

export const authQuery = customQuery(query, auth.ctx());
export const authMutation = customMutation(mutation, auth.ctx());

Use auth.ctx({ optional: true }) when the same handler should work for both guests and signed-in users.

Raw HTTP mixed auth

http.route({
  path: "/api/data",
  method: "GET",
  handler: httpAction(async (ctx, request) => {
    const authContext = await auth.http.context(ctx, request, { optional: true });
    if (authContext.userId === null) {
      return new Response(JSON.stringify({ error: "Unauthorized" }), { status: 401 });
    }
    const data = await ctx.runQuery(internal.data.forUser, { userId: authContext.userId });
    return Response.json(data);
  }),
});

Authorization patterns

Define roles with grants

import { defineRoles } from "@robelest/convex-auth/authorization";

export const roles = defineRoles({
  orgAdmin: {
    label: "Organization Admin",
    grants: ["members.create", "members.update", "members.delete", "sso.connection.manage", "scim.manage"],
  },
  support: {
    label: "Support",
    grants: ["members.read", "tickets.manage"],
  },
  member: {
    label: "Member",
    grants: [],
  },
});

Assign roles via memberships

await auth.member.create(ctx, { userId, groupId: orgId, roleIds: [roles.orgAdmin.id] });
await auth.member.update(ctx, memberId, { roleIds: [roles.support.id] });
await auth.invite.create(ctx, { groupId: orgId, email: "new@example.com", roleIds: [roles.member.id] });

Check grants (not role names)

// Boolean check
const result = await auth.member.inspect(ctx, { userId: ctx.auth.userId, groupId: orgId });
if (result.grants.includes("members.read")) { /* authorized */ }

// Throwing check
await auth.member.require(ctx, { userId: ctx.auth.userId, groupId: orgId, grants: ["sso.connection.manage"] });

auth.user API

Method Signature Returns Description
get (ctx, userId) Doc<"User"> \| null Fetch user by ID
list (ctx, { where?, limit?, cursor? }) Paginated list List users with filtering
update (ctx, userId, data) { userId } Update user fields
viewer (ctx) Doc<"User"> \| null Current session user document
delete (ctx, userId, { cascade? }) { userId } Delete user; cascade removes sessions, accounts, memberships, keys
setActiveGroup (ctx, { userId, groupId }) { userId, groupId } Set active group
getActiveGroup (ctx, { userId }) Id<"Group"> \| null Get active group ID

Group SSO

Adding sso() to providers enables auth.group.sso.* namespace. Without it, the namespace is a TypeScript error.

Protocol Purpose Namespace
OIDC OpenID Connect identity provider login auth.group.sso.oidc
SAML 2.0 Security Assertion Markup Language login auth.group.sso.saml
SCIM 2.0 Cross-domain user/group provisioning auth.group.sso.scim

All SSO configuration is per-tenant runtime state stored in the Convex database. No app-level config file needed.

Optional SSO hooks:

const auth = createAuth(components.auth, {
  providers: [sso()],
  sso: {
    hooks: {
      profileResolved: async ({ protocol, profile }) => profile,
      beforeProvision: async ({ protocol, profile }) => profile,
      afterProvision: async ({ protocol, userId }) => {},
      allowLink: async ({ protocol, userId, profile }) => true,
    },
  },
});

GitHub OAuth setup instructions for end users

Required link: https://github.com/settings/developers

  1. Go to GitHub Developer Settings: https://github.com/settings/developers
  2. Create a new OAuth App.
  3. Set:
    - Homepage URL = app frontend URL (same as SITE_URL)
    - Authorization callback URL = https://<deployment>.convex.site/api/auth/callback/github
  4. Copy Client ID and Client Secret.
  5. Set Convex env vars: AUTH_GITHUB_ID, AUTH_GITHUB_SECRET
  6. Confirm SITE_URL and CONVEX_SITE_URL are configured.
  7. Deploy and test sign in.

In this codebase, GitHub OAuth is conditionally enabled only when AUTH_GITHUB_ID, AUTH_GITHUB_SECRET, and CONVEX_SITE_URL are present.

Denied session pattern (app-level allowlists)

Provider authentication and app-level authorization are separate decisions. When a user successfully completes OAuth but the app refuses access (allowlist miss, billing gate, role check), do not just redirect or render an "access denied" screen. Sign them out so the auth runtime stops refreshing a session your app does not intend to use:

useEffect(() => {
  if (isAuthenticated && !isAllowed) {
    void authClient.signOut();
  }
}, [isAuthenticated, isAllowed, authClient]);

Render the denied UI immediately. The sign-out resolves the session in the background. Stash any data you want to display (denied email, reason) in component state before sign-out completes if your UI needs to survive the unauthenticated rerender.

This pattern is what auth.estifanos.com/guides/authorization/ recommends for app-level allowlists. It is the right shape for "only one admin email can use the dashboard, everyone else sees the demo view."

Migration guardrails

When upgrading existing apps:

  1. Snapshot current auth wiring before edits.
  2. Update one surface at a time: config, auth module, then HTTP routes.
  3. Keep old and new API mismatch notes in task output.
  4. Verify sign in flow and callback routes before moving on.
  5. Keep migrations minimal and focused to auth wiring only.

Self hosting decision point

Use get-convex/self-hosting only when:

  • user asks for self hosted static assets, or
  • auth portal hosting requires it in the selected upstream version.

When needed, follow the latest upstream integration docs:

  • https://github.com/get-convex/self-hosting
  • https://raw.githubusercontent.com/get-convex/self-hosting/main/INTEGRATION.md

Output requirements for any task using this skill

Before finishing, always report:

  1. Retrieval timestamp for upstream docs.
  2. Which branch was used as source of truth and why.
  3. Install path selected, npm or GitHub pin, and why.
  4. Exact files changed.
  5. Exact commands the user should run next.

Never claim completion without these five items.

Source links

  • https://auth.estifanos.com/getting-started/installation/ (official docs)
  • https://auth.estifanos.com/getting-started/providers/
  • https://auth.estifanos.com/guides/multi-access/
  • https://auth.estifanos.com/guides/authorization/
  • https://auth.estifanos.com/api/user/
  • https://auth.estifanos.com/reference/config/
  • https://auth.estifanos.com/sso/overview/
  • https://github.com/robelest/convex-auth
  • https://github.com/robelest/convex-auth/tree/release
  • https://raw.githubusercontent.com/robelest/convex-auth/main/README.md
  • https://raw.githubusercontent.com/robelest/convex-auth/release/README.md
  • https://github.com/get-convex/self-hosting
  • https://raw.githubusercontent.com/get-convex/self-hosting/main/INTEGRATION.md
  • https://agentskills.io/home

常见问题

5 问
答案由本站依据条目字段整理
robel-auth怎么安装?

没有现成安装命令:按安装说明或仓库 README,把 SKILL.md 放进客户端的 skills 目录(一般一个技能一个文件夹)。

robel-auth支持哪些客户端?

资料没有标注宿主客户端,但只要客户端支持 Skills(Claude、Codex、Cursor 等),一般都能加载。

robel-auth权限高吗,安全吗?

权限级别为未标注权限。安装前先看它会读取或写入哪些内容。

robel-auth收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于技能本身和所用的模型或客户端,正式使用前按作者说明确认。

robel-auth用什么许可证?

许可证标注为 未说明(许可证不明确)。商用或二次分发前请到仓库确认条款原文。

热门专题

按场景挑技能
全部专题 →

技能内容以作者仓库为准;分类、权限级别与许可证状态的中文说明为中文整理,最近核验 未标注。