Permix
DevelopmentpermixPermix is an Agent Skill for development published in the letstri/permix repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Applies Permix authorization once a schema exists: permix.check() paths and ReBAC callbacks, frontend bindings (permix/react, permix/vue, permix/solid, permix/svelte) with SSR dehydrate/hydrate for Next.js and TanStack Start, and server middleware (permix/express, hono, fastify, trpc, orpc, node, elysia). Use for anything past initial setup — checking permissions, gating UI, or protecting routes. For creating the schema and first `permix.setup()`, use permix-getting-started first.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/letstri/permix/blob/HEAD/permix/skills/permix/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/permix, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Permix — check, frontend, server
Assumes a permix instance already exists (see permix-getting-started). Load the reference file that matches the task instead of reading everything:
| Task | Reference |
|---|---|
permix.check() paths, callbacks, ~all/~any, ReBAC/ABAC with entity data, isReady | references/check.md |
React, Vue, Solid, or Svelte UI — PermixProvider, usePermix, createComponents, SSR dehydrate/hydrate for Next.js / TanStack Start | references/frontend.md |
Protecting Express, Hono, Fastify, tRPC, oRPC, Node, or Elysia routes — setupMiddleware, checkMiddleware | references/server.md |
Rules that apply everywhere
- Authorization must run on the server. Client-side
check(React/Vue/Solid/Svelte) is UX only — mirror every path withcheckMiddlewarein references/server.md. - Use the same schema and path strings (
post.update, not ad-hoc strings) across client hooks and server middleware, or types and behavior drift apart. checkbeforeisReadythrowsPermixNotReadyError— gate UI withisReady/isReadyAsync, and callsetupMiddlewarebeforecheckMiddlewareon the server.- SSR
hydratealone is not enough. It only restores booleans; callsetupagain on the client for function-based/ReBAC rules — see the SSR section of references/frontend.md.