skills/paperclip-create-plugin/SKILL.md
Use this skill when the task is to create, scaffold, or iterate on a Paperclip plugin against a local Paperclip instance.
Plugins are their own packages. Unless the task explicitly asks for a bundled in-repo example, do not add plugin source under packages/plugins/ in this repo.
~/dev/paperclip-plugins/<name>).Only edit Paperclip core itself when the user asks to surface a plugin as a bundled example (server/src/routes/plugins.ts, in-repo example lists, docs).
Reference docs when you need detail:
doc/plugins/PLUGIN_AUTHORING_GUIDE.mdpackages/plugins/sdk/README.mddoc/plugins/PLUGIN_SPEC.md — future-looking context onlyCurrent runtime assumptions:
ctx.assets is not supported in the current runtimeUse paperclipai plugin init. Do not invoke the scaffold package node entrypoint by hand unless the CLI command is unavailable in the environment.
paperclipai plugin init @acme/my-plugin --output ~/dev/paperclip-plugins
Useful flags (all optional):
--output <dir> — parent directory; the command creates <dir>/<unscoped-name>/. Defaults to the current directory.--template <default|connector|workspace|environment> — starter template.--category <connector|workspace|automation|ui|environment> — manifest category.--display-name <name>, --description <text>, --author <name> — manifest metadata.--sdk-path <path> — snapshot the local SDK from a Paperclip checkout into .paperclip-sdk/ (useful when developing against an unreleased SDK).On success the command prints the exact next commands (cd, pnpm install, pnpm dev, paperclipai plugin install <abs-path>). Run them in order.
If paperclipai is not on PATH in your environment, fall back to:
pnpm --filter @paperclipai/create-paperclip-plugin build
node packages/plugins/create-paperclip-plugin/dist/index.js @acme/my-plugin \
--output /absolute/path \
--sdk-path /absolute/path/to/paperclip/packages/plugins/sdk
In the scaffolded plugin folder:
pnpm install
pnpm dev # esbuild --watch: rebuilds dist/manifest.js, dist/worker.js, dist/ui/
paperclipai plugin install /absolute/path/to/my-plugin
Notes:
paperclipai plugin install auto-detects local paths (absolute, ./, ../, ~, or an existing relative folder) and forwards isLocalPath: true to the server. Pass --local to force local mode if the heuristic is ambiguous.dist/) for local-path plugins and restarts the plugin worker on rebuild — you do not need to reinstall after every edit.pnpm dev:ui, port 4177) is optional and template-dependent; only mention it if the template wires devUiUrl and you verified it works end to end.--version only applies to npm package installs. Combining it with a local path is an error.After install, inspect with:
paperclipai plugin list
paperclipai plugin inspect <plugin-key>
Open and confirm:
src/manifest.ts — declared capabilities and slotssrc/worker.ts — worker entrysrc/ui/index.tsx — UI entry (if applicable)tests/plugin.spec.ts — placeholder testpackage.json — paperclipPlugin block points at dist/manifest.js, dist/worker.js, dist/ui/Make sure the plugin:
ctx.assetsroutePath only on page slotsFrom the plugin folder:
pnpm typecheck
pnpm test
pnpm build
If the plugin is already running under pnpm dev, you can keep the watcher up and run pnpm typecheck and pnpm test in a separate shell.
If you changed Paperclip SDK/host/plugin runtime code in addition to the plugin, also run the relevant Paperclip workspace checks.
When you finish a local plugin task, report:
paperclipai plugin init, pnpm install, pnpm dev, paperclipai plugin install <path> invocations (and any verification commands).paperclipai plugin list / plugin inspect (plugin key, version, status). Note if status is anything other than ready and include lastError.pnpm typecheck, pnpm test, pnpm build pass/fail with the failing output if any.If any item is missing, mark it as such — do not silently skip.
Do not add the plugin under packages/plugins/ or update bundled-example wiring unless the user explicitly asks for a bundled example. Local-path installs are the supported development model; npm packages are the production deployment path.
If the user does ask for a bundled example, also update:
server/src/routes/plugins.ts example listWhen authoring or updating plugin docs: