add-plugin-tool
Skill810 starsChanged 25 days agoMITView on GitHub
Add or change an agent-callable tool contributed by a Studio plugin (manifest declaration, backend handler, consent, docs and tests). Use for bundled plugins in src/plugins/* or when changing how plugin tools are validated or dispatched.
In this repository33 other files it gives its agents.
- AGENTS.mdAGENTS.md
- src/AGENTS.mdAGENTS.md
- tests/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- src/CLAUDE.mdCLAUDE.md
- tests/CLAUDE.mdCLAUDE.md
- add-event-typeSkill
- add-ipc-channelSkill
- add-plugin-toolSkill
- better-colorsSkill
- better-layoutSkill
- better-typographySkill
- better-uiSkill
- better-writingSkill
- breakSkill
- harness-incident-fixSkill
- run-area-testsSkill
- variantSkill
- verify-ui-via-dev-controlSkill
- wire-artSkill
- add-event-typeSkill
- add-ipc-channelSkill
- better-colorsSkill
- better-layoutSkill
- better-typographySkill
- better-uiSkill
- better-writingSkill
- breakSkill
- harness-incident-fixSkill
- run-area-testsSkill
- variantSkill
- verify-ui-via-dev-controlSkill
- wire-artSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 20
Add confirmation (1-300 chars, API 2+) when the tool spends money, publishes or otherwise needs the user's consent before each run.
- Very specific: line 26
Treat args as untrusted: check types and ranges again, reject unknown operations.
- Very specific: line 30
Skill text: - if the agent needs guidance, update the plugin's skills[] entry so it names the tool by its full <id>__<tool> name.
- Distinctive: line 56
Never let a tool argument choose a program, URL or path outside the project.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Add a plugin tool
A plugin tool is declared in the plugin's plugin.json, handled by its isolated backend
process and exposed to every engine as <plugin-id>__<tool-name>. Contract reference:
docs/plugins.md (manifest table, API versions, consent model) and src/plugin-sdk/index.d.ts.
Files
- Manifest -
src/plugins/<id>/plugin.json,tools[]:{name, description, parameters:{type:"object", properties, required}}.name: lowercase id, unique within the plugin.- Parameters are scalar (
string|number|boolean) under API 1 and 2;objectonly withapiVersion: 3. Anything else is rejected byvalidateManifest(src/substrate/plugins/manifest.ts). - Add
confirmation(1-300 chars, API 2+) when the tool spends money, publishes or otherwise needs the user's consent before each run. - The description is model-facing: say when to use it, what it costs and what not to do.
- Backend - the
tool(name, args, ctx)handler returned byactivate()in the plugin's backend (src/plugins/example/backend.mjsis the minimal pattern;src/plugins/genex/backend.ts,src/plugins/blender/backend.tsare real ones).- Treat
argsas untrusted: check types and ranges again, reject unknown operations. - Reach host services only through
ctx.host(...); a backend cannot read credentials, open URLs or touch files outside the bound project and its own storage. - Return plain JSON. Throw an
Errorwith an actionable message on refusal.
- Treat
- Skill text - if the agent needs guidance, update the plugin's
skills[]entry so it names the tool by its full<id>__<tool>name. - Host changes (only when changing the tool system itself): validation in
src/substrate/plugins/manifest.ts, dispatch/consent insrc/substrate/plugins/registry.ts, the call, its consent wait and its durable record insrc/main/core/plugin-tools.ts(PluginToolService), and engine exposure insrc/main/core/delegation.ts(searchpluginTools: the tool list handed to a session and the dispatch of its calls). - Docs -
docs/plugins.mdfor contract changes;docs/product/assets-plugins.mdfor anything a user sees.
Tests (red first)
- Registry behaviour against a copied package:
tests/conformance/plugins.test.ts(fixture()copiessrc/plugins/exampleinto a temp root) - declared vs undeclared fields, wrong types, disabled plugin fails closed, cancelled call not retried. - Manifest rules:
validateManifestcases in the same file. - Consent:
tests/conformance/plugin-consent.test.tswhenconfirmationis involved. - Genex/Blender tools:
tests/conformance/genex-plugin-cli.test.ts,tests/conformance/blender.test.ts. - Package as a user would see it:
npm run plugin:doctor -- src/plugins/<id>.
npm test -- tests/conformance/plugins.test.ts tests/conformance/plugin-devkit.test.ts
npm run plugin:doctor -- src/plugins/exampleNever let a tool argument choose a program, URL or path outside the project; those come from reviewed plugin code.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

