RolebookDocs

Write a storage adapter

The rolebook-write-adapter agent skill.

Writes a Rolebook Sharing storage adapter for a database the first-party adapters do not cover, and proves it with the @rolebook/sharing-testkit contract suite before any route uses it. Use when the user wants Rolebook Sharing on another database or storage layer, asks to implement SharingAdapter, or wants to check that an existing adapter meets the sharing security contract.

Skill name: rolebook-write-adapter. 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
Always@rolebook/sharing-testkit >=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. Agree the model with the user
  4. Read the interface
  5. Keep these guarantees
  6. Run the contract
  7. Use it
  8. Check your work

Reference files

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

  • contract.md
  • security-rules.md