RolebookDocs

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

RequirementPackage and supported versions
Alwaysrolebook >=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

  1. Before you start
  2. Check the starting point
  3. Pick the storage
  4. Pick the identity source
  5. Extend the policy
  6. Prepare the table
  7. Wire the module
  8. Run the migrations
  9. Give every new record an owner
  10. Schedule pruning
  11. Authorize the existing routes with Sharing
  12. Add the sharing routes
  13. Test it
  14. Check your work

Reference files

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

  • identity.md
  • keys.md
  • module.md
  • policy.md
  • postgres.md
  • routes.md
  • security-rules.md
  • sharing-module.md
  • sqlite.md
  • teams-better-auth.md
  • teams-sql.md