docs/SKILL.md
Multi-tenant organization and team management for Convex with @djpanda/convex-tenants and @djpanda/convex-authz. Use when (1) setting up or integrating multi-tenant SaaS with Convex, (2) working with organizations, teams, members, or invitations, (3) configuring authz permissions for tenants, (4) using TenantsProvider, OrganizationSwitcher, or related React components, or (5) the user mentions convex-tenants, @djpanda/convex-tenants, or multi-tenant Convex.
npx skillsauth add dbjpanda/convex-tenants convex-tenantsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Multi-tenant organization and team management for Convex with flexible authorization via @djpanda/convex-authz.
convex/convex.config.ts:import { defineApp } from "convex/server";
import tenants from "@djpanda/convex-tenants/convex.config";
import authz from "@djpanda/convex-authz/convex.config";
const app = defineApp();
app.use(tenants);
app.use(authz);
export default app;
Define authz in convex/authz.ts — use TENANTS_PERMISSIONS and TENANTS_ROLES from the package. See node_modules/@djpanda/convex-tenants/docs/quick-start.md.
Create tenants API in convex/tenants.ts:
import { makeTenantsAPI } from "@djpanda/convex-tenants";
import { components } from "./_generated/api";
import { authz } from "./authz";
export const { listOrganizations, createOrganization, inviteMember, ... } =
makeTenantsAPI(components.tenants, {
authz,
creatorRole: "owner",
auth: async (ctx) => (await getAuthUserId(ctx)) ?? null,
getUser: async (ctx, userId) => {
const user = await ctx.db.get(userId);
return user ? { name: user.name, email: user.email } : null;
},
});
useQuery(api.tenants.listOrganizations), or use pre-built components with TenantsProvider. See node_modules/@djpanda/convex-tenants/docs/react-components.md.authz alongside tenants, not as a child. Other parts of your app can use authz outside tenants.owner, admin, member. See node_modules/@djpanda/convex-tenants/docs/flexible-roles.md.ownerId. Use transferOwnership before owner leaves. All permission checks go through authz.suspended or archived blocks mutations; only updateOrganization with status: "active" can reactivate.| Export | Description |
|--------|-------------|
| TENANTS_PERMISSIONS | Default permissions for definePermissions() |
| TENANTS_ROLES | Default roles (owner, admin, member) for defineRoles() |
| DEFAULT_TENANTS_PERMISSION_MAP | Operation → permission mapping |
| TENANTS_REQUIRED_PERMISSIONS | Flat list of permission strings |
Base path: node_modules/@djpanda/convex-tenants/docs/. Select the doc that matches the user's keywords or task — load only what's needed:
| Doc | Path | Load when user asks about… |
|-----|------|----------------------------|
| quick-start | docs/quick-start.md | Setup, install, first-time integration, convex.config, authz.ts, tenants.ts, getting started, initial setup |
| api-reference | docs/api-reference.md | Function names (listOrganizations, createOrganization, addMember, inviteMember, etc.), makeTenantsAPI options, event hooks, mutation/query args, pagination (listMembers/listTeams/listTeamMembers/listInvitations with optional paginationOpts), API signatures |
| permission-map | docs/permission-map.md | Permissions, permissionMap, who can do what, operation permissions, overriding permissions, guards, access control per operation |
| flexible-roles | docs/flexible-roles.md | Roles, custom roles, owner/admin/member, creatorRole, defineRoles, structural owner, transferOwnership, add/remove roles |
| invitation-system | docs/invitation-system.md | Invitations, inviteMember, acceptInvitation, validateInvitationCreate, validateInvitationAccept, identifier type, email/phone/username, domain whitelist, rate limiting invitations |
| react-components | docs/react-components.md | TenantsProvider, OrganizationSwitcher, MembersSection, TeamsSection, InviteMemberDialog, useOrganization, useMembers, useTeams, useOrganizationInvitations, MembersTable, TeamsGrid, AcceptInvitation, JoinByDomainSection, paginated hooks |
| organization-store | docs/organization-store.md | Active organization, switching orgs, useOrganizationStore, setActiveOrganizationId, localStorage, storageKey, configureOrganizationStore |
npm install @djpanda/convex-tenants @djpanda/convex-authz
For React UI: npm install clsx tailwind-merge (optional peer deps).
development
Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.
development
Maintainer workflow for OpenClaw releases, prereleases, changelog release notes, and publish validation. Use when Codex needs to prepare or verify stable or beta release steps, align version naming, assemble release notes, check release auth requirements, or validate publish-time commands and artifacts.
development
Run, watch, debug, and extend OpenClaw QA testing with qa-lab and qa-channel. Use when Codex needs to execute the repo-backed QA suite, inspect live QA artifacts, debug failing scenarios, add new QA scenarios, or explain the OpenClaw QA workflow. Prefer the live OpenAI lane with regular openai/gpt-5.4 in fast mode; do not use gpt-5.4-pro or gpt-5.4-mini unless the user explicitly overrides that policy.
development
End-to-end Parallels smoke, upgrade, and rerun workflow for OpenClaw across macOS, Windows, and Linux guests. Use when Codex needs to run, rerun, debug, or interpret VM-based install, onboarding, gateway smoke tests, latest-release-to-main upgrade checks, fresh snapshot retests, or optional Discord roundtrip verification under Parallels.