返回 CodeWhale
SKILL.md
1 ---
2 name: plugin-creator
3 description: Scaffold a local Codewhale plugin bundle with a versioned manifest, namespaced Skills, and a trust review that goes through the session's approval.
4 ---
5
6 # Plugin Creator
7
8 Use this skill when a user wants a local Codewhale plugin bundle. Trusted and
9 enabled bundles may add declarative Skills, commands, agents, hooks, and MCP
10 servers (stdio and remote) through the existing engines. LSP, filesystem
11 roots, and lifecycle mutation are inventory-only. Native plugin code (host
12 code) is inventory-only unless the user has turned on the experimental
13 `[features] extension_host` flag.
14
15 ## Workflow
16
17 1. Pick a Codewhale-owned location:
18 - User bundle: `~/.codewhale/plugins/<plugin-name>/`
19 - Workspace bundle: `<workspace>/.codewhale/plugins/<plugin-name>/`
20 2. Normalize the bundle name to lowercase hyphen-case.
21 3. Create `plugin.json` (Agent Plugins v1.0.0; a legacy `plugin.toml` stays
22 readable, but new bundles use `plugin.json`):
23
24 ```json
25 {
26 "$schema": "https://agent-plugins.org/schemas/plugin.json",
27 "name": "my-plugin",
28 "version": "0.1.0",
29 "description": "What this bundle provides"
30 }
31 ```
32
33 4. Put each Skill under `skills/<skill-name>/SKILL.md`; Codewhale finds
34 `skills/` automatically and exposes each as `my-plugin:<skill-name>`,
35 never as an unqualified command.
36 5. Add MCP servers in a sibling `mcp.json` only when the bundle needs an
37 existing MCP engine. Keep stdio commands and paths inside the bundle. Map local
38 environment values only as exact `${SOURCE_ENV}` references. For remote MCP,
39 use HTTPS (or loopback HTTP), forbid URL user information/query/fragment,
40 use only environment-backed headers or bearer tokens, and declare the exact
41 normalized endpoint host set in `capabilities.network_hosts` under
42 `extensions["net.codewhale"]`. Never place credentials in the manifest.
43 6. Commands (`commands/*.md`), agents (`agents/*.toml`), and hooks
44 (`hooks/*.toml`), declared under `extensions["net.codewhale"]`, activate
45 under the current policy — workspace bundles win same-name collisions over
46 user and built-in bundles. LSP, filesystem roots, and lifecycle mutation
47 are inventory-only: declare them only when inventorying future work. A
48 `native` entry runs only under the experimental plugin host; there it
49 must be one `.mjs`, `.js` or `.mts` ES module file, `/plugin validate` rejects
50 anything else, and its tools always use `Required` approval, never a
51 plugin's read-only hint. Full Access, Bypass, or an exact session grant
52 for the reviewed build can satisfy that gate without a prompt. A bundle
53 that declares only unsupported surfaces cannot be enabled.
54 7. Validate and review without executing bundle content:
55 - `/plugin validate <plugin-name>`
56 - `/plugin show <plugin-name>`
57 - present these results; the person runs `/plugin enable <plugin-name>`
58 to open the content/capability review, reviews it, runs the exact
59 `/plugin trust ...` confirmation shown, then enables the bundle
60 - exception: in Full Access, for a plugin you wrote yourself, you may
61 trust and enable it without asking the person. Write it in an ordinary
62 folder inside the current project (for example
63 `<workspace>/plugins/<plugin-name>/`), not under `.codewhale/plugins/`
64 as in step 1, because `codewhale install` copies it into place and
65 refuses a name that is already in use. Then run, in this order:
66 `codewhale install <folder>`, `codewhale plugins trust <name>` (it prints
67 the review and a review token), `codewhale plugins trust <name>
68 --review-token <token> --yes` with the token from your own run, and
69 `codewhale plugins enable <name>`. These are shell commands, so the
70 session's approval applies to them like any other (Ask asks the person,
71 Auto-Review's reviewer judges, Full Access runs them). The trust is
72 recorded as approved by the agent, for this project only. A bundle that
73 was not installed this way from inside the project is refused. Never do
74 this for a plugin you did not write.
75 8. Verify `/skills inspect` reports plugin provenance and `/plugin list`
76 reports the expected trust and activation state. Trust stages the reviewed
77 content but does not activate it. After enablement, follow the host's
78 reload notice: use `/reload` or a new session to apply changes to a live
79 session's pinned skills and tools.
80
81 Every user and workspace bundle starts untrusted and disabled. Reuse the
82 existing `/plugin marketplace`, install, update, review and reload surfaces;
83 do not add a parallel installer or registry. Catalog membership alone never
84 installs, trusts or enables a plugin.
85
86 ## Plugins with code or a screen
87
88 For a plugin that runs code, adds tools of its own, or shows a screen, use the
89 `cordis-plugin-development` skill when it is offered: it teaches the format
90 that also loads in DeepSeek Harness. Host code runs only under the
91 experimental `[features] extension_host` flag; start from the tested
92 `hello-extension` example and `docs/EXTENSIONS.md` in the Codewhale repository,
93 add a `plugin.json` beside the package for Codewhale's own kinds, and never
94 change the shared process cwd. A person reviews and turns on a plugin as step 7
95 says. `/plugin show <name>` reports owner state, live tools and recent
96 attributed diagnostics. Explain the shared-process and current platform sandbox
97 limits without claiming isolation.
98
98 lines MARKDOWN