# Writing plugins

## Checking your plugin

```bash
lim check     # errors in command names, parameters, types and characters, with positions and suggested fixes (plugin checks too)
lim reference # how your commands appear in the reference
lim trace <file>  # run without a screen and see the state (stage.extra) as JSON
lim shot <file> --skip N --settle  # a screenshot of page N (the [N] in lim trace)
lim shot <file#label>             # if your command's screen comes right after the label, a screenshot of that screen
lim playtest --rebuild --runs 2       # play the exported browser version to the end (commands with screens go on through autoplay)
```

For unit tests, the quickest way is to pass `implementations` from `combinePlugins([plugin])` to `Runtime`, run it with `HeadlessHost` and
check `runtime.state.stage.extra`. For import, pass a registry built from `specs` and the `./import` to
`resolveImportProfile`, and check the result by using its `tags` as `profile` for `convert`
([examples/stamp-plugin/test](../../examples/stamp-plugin/test)).
