Add custom roles
The rolebook-custom-roles agent skill.
Moves an app that uses Rolebook Sharing to versioned policies stored in its own database, so operators can save, preview, and publish policy changes and define custom member roles per tenant within a fixed template. Use when the user wants roles that differ per customer or workspace, a custom role such as an editor who may only edit drafts, policy changes without a redeploy, a preview of who gains or loses access before publishing, or a record of policy versions.
Skill name: rolebook-custom-roles. Ask your agent for the task in your own words, or invoke the skill by name where your tool supports it.
Packages it needs
| Requirement | Package and supported versions |
|---|---|
| Always | rolebook >=4.0.0 <5.0.0 |
| Always | @rolebook/sharing >=0.1.0 <0.2.0 |
| One of | @rolebook/sharing-postgres >=0.1.0 <0.2.0, @rolebook/sharing-sqlite >=0.1.0 <0.2.0 |
| One of | @rolebook/sharing-better-auth >=0.1.0 <0.2.0, @rolebook/sharing-clerk >=0.1.0 <0.2.0, @rolebook/sharing-workos >=0.1.0 <0.2.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
- Before you start
- Check the starting point
- Agree the model with the user
- Fence the storage
- Switch the module
- Add the operator routes
- Accept custom labels in the sharing routes
- Test it
- Check your work
Reference files
The skill loads these files from its references/ folder when a step needs them:
module.mdoperator.mdpostgres.mdsecurity-rules.mdsqlite.mdtesting.md