agentsclimarketplace

060104 better auth rbac

Skill natuleadan/skills/skills/060104-better-auth-rbac

Role-based access control with Better Auth — permission statements, createAccessControl, authorize() checks, dual auth, and frontend permission sync.From its SKILL.md

Install
npx -y skills add natuleadan/skills --skill 060104-better-auth-rbac

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its file declares

Copied from the file, not written here

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

1.1 KB, 202 tokens by cl100k_base, as published. Nobody here has run it

Better Auth RBAC

When to use

When implementing granular role-based permissions beyond Better Auth's built-in admin plugin roles.

References

TopicFile
Permission statementsreferences/permission-statements.md
Role definitionsreferences/role-definitions.md
Dual auth (API key + session)references/dual-auth.md
Frontend permissions syncreferences/frontend-sync.md

Quick checklist

  • Define all permission actions in customStatements with as const
  • Create roles with ac.newRole({}) mapping statements to actions
  • Check permissions with roleObj.authorize(permissions)
  • Admin role always passes (short-circuit before authorize)
  • Use requireApiKeyOrSession() for dual auth (Bearer or cookie)
  • Frontend: keep permissions.ts in sync with backend role definitions

What ships with it: 7 files

7.1 KB alongside SKILL.md, 1 of them executable

evals/

scripts/

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.