agentleFS
genex-gamesgenex-games/genex-desktop/.claude/skills/add-plugin-tool/SKILL.md

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.

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
  1. Very specific:

    Add confirmation (1-300 chars, API 2+) when the tool spends money, publishes or otherwise needs the user's consent before each run.

    line 20
  2. Very specific:

    Treat args as untrusted: check types and ranges again, reject unknown operations.

    line 26
  3. Very specific:

    Skill text: - if the agent needs guidance, update the plugin's skills[] entry so it names the tool by its full <id>__<tool> name.

    line 30
  4. Distinctive:

    Never let a tool argument choose a program, URL or path outside the project.

    line 56

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

  1. 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; object only with apiVersion: 3. Anything else is rejected by validateManifest (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.
  2. Backend - the tool(name, args, ctx) handler returned by activate() in the plugin's backend (src/plugins/example/backend.mjs is the minimal pattern; src/plugins/genex/backend.ts, src/plugins/blender/backend.ts are real ones).
    • Treat args as 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 Error with an actionable message on refusal.
  3. Skill text - if the agent needs guidance, update the plugin's skills[] entry so it names the tool by its full <id>__<tool> name.
  4. Host changes (only when changing the tool system itself): validation in src/substrate/plugins/manifest.ts, dispatch/consent in src/substrate/plugins/registry.ts, the call, its consent wait and its durable record in src/main/core/plugin-tools.ts (PluginToolService), and engine exposure in src/main/core/delegation.ts (search pluginTools: the tool list handed to a session and the dispatch of its calls).
  5. Docs - docs/plugins.md for contract changes; docs/product/assets-plugins.md for anything a user sees.

Tests (red first)

  • Registry behaviour against a copied package: tests/conformance/plugins.test.ts (fixture() copies src/plugins/example into a temp root) - declared vs undeclared fields, wrong types, disabled plugin fails closed, cancelled call not retried.
  • Manifest rules: validateManifest cases in the same file.
  • Consent: tests/conformance/plugin-consent.test.ts when confirmation is 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/example

Never let a tool argument choose a program, URL or path outside the project; those come from reviewed plugin code.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.