Add sharing
The rolebook-add-sharing agent skill.
Makes one resource type shareable with Rolebook Sharing: owners, members with roles, invitations to existing users, access that ends on a date, listing what a user can access, and the database tables and server routes it needs. Use when the user wants people to share a project, folder, document, or other record with colleagues, invite a user, transfer ownership, give access until a date, or list the records a user can access.
Skill name: rolebook-add-sharing. 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
- Pick the storage
- Pick the identity source
- Extend the policy
- Prepare the table
- Wire the module
- Run the migrations
- Give every new record an owner
- Schedule pruning
- Authorize the existing routes with Sharing
- Add the sharing routes
- Test it
- Check your work
Reference files
The skill loads these files from its references/ folder when a step needs them:
identity.mdkeys.mdmodule.mdpolicy.mdpostgres.mdroutes.mdsecurity-rules.mdsharing-module.mdsqlite.mdteams-better-auth.mdteams-sql.md