# Write a plugin

A plugin teaches Vaubaan one service — its tools, how each call is cut into permissions, and five plain facts per permission that place it on a row — and you write it with the published kit, without reading the gateway’s code.

[Start a plugin project](https://www.npmjs.com/package/@vaubaan/plugin-cli) · [The author guide](/docs/plugins-guide)

## Five questions per permission

![A plugin author answers five plain questions for each permission in the risk catalog. Merging into main is costly to undo, so it lands on Repairable, at a price; the kit checks it and a reviewer reads it in the catalog pull request.](/drawings/for-plugin-authors-light.svg)

Can it be undone? How far does it reach? What data does it touch? What can it cost? Who sees it? You answer in plain facts; Vaubaan places the permission on its row, the same way for every service, and a reviewer reads your answers like code.

## Model the service first

![Supabase, modelled: one project carries the environment (preview, staging, prod) over 4 planes (db, storage, auth, functions) and their entities. A migration becomes one permission per environment; bulk row writes have no production form. The 27 permissions fold into 5 verbs a person ticks.](/drawings/modelled-then-verbs-light.svg)

Name its planes and entities, and where the environment lives. Cut each act into permissions on the facts that change the harm — a branch, a recipient, an environment — and fold them into a few verbs a person ticks.

## The kit

- **Start a plugin project** (built): `npx @vaubaan/plugin-cli init`, a complete plugin for an imaginary service, its tests passing, with the instructions a coding agent follows to replace it by yours.
- **Deploy it to your instance** (built): the archive goes to your gateway, pending until an administrator activates it.
- **Try a call without a gateway, run a local gateway, sign a private plugin, submit to the catalog** (planned): [the intents](https://github.com/vaubaan/gateway/blob/main/docs/intents/ship-a-plugin.md).

## Read a real one

How to write, test and deploy a plugin, step by step: the [author guide](/docs/plugins-guide). GitHub’s [risk catalog](https://github.com/vaubaan/gateway/blob/main/plugins/github/src/risk-catalog.yaml) and [its page on this site](/plugins/github), generated from it. The repository’s own plugins and how they are reviewed: [plugins/README.md](https://github.com/vaubaan/gateway/blob/main/plugins/README.md).
