RolebookDocs

Set up Rolebook

The rolebook-setup agent skill.

Adds Rolebook authorization to a Next.js or Hono app in TypeScript: a policy file, a session-to-binding loader, trusted resource loaders, and server-side permission checks on routes. Use when the user asks to add Rolebook, add roles or permissions, protect routes or server actions, or check who may read or change a record.

Skill name: rolebook-setup. Ask your agent for the task in your own words, or invoke the skill by name where your tool supports it.

Packages it needs

RequirementPackage and supported versions
Alwaysrolebook >=4.0.0 <5.0.0

The skill checks the installed versions against these ranges before it uses each part, and stops rather than up- or downgrading without your consent.

What it does

  1. Before you start
  2. Find the framework
  3. Agree the model with the user
  4. Write the policy
  5. Load assignments
  6. Load trusted resources
  7. Protect the routes
  8. Test it
  9. Check your work

Reference files

The skill loads these files from its references/ folder when a step needs them:

  • assignments.md
  • hono.md
  • nextjs.md
  • resources.md
  • security-rules.md