进阶 zcode.z.ai 2026-11-25 14:51:22 · 6 阅读
第42章 Plugin
Core FeaturesPlugin
Plugins extend what ZCode can do. A single plugin can bundle skills, commands, subagents, and MCP servers, so teams can package reusable tooling into one extension and enable it from a single workspace.
ZCode provides a Plugin Marketplace for browsing official plugins, community plugins, and marketplaces you add, with one-click installation and centralized management of installed plugins.
Entry point: click Plugin Marketplace in the left sidebar, or click Browse plugin marketplace under Settings → Plugins. A project must be open to use the marketplace.
What A Plugin Contains
A single plugin can bundle several capabilities. ZCode detects which components a plugin includes from its directory layout and shows them as badges or counts in the list:
ComponentDescriptionSkillSkill files that teach ZCode Agent specific ways of workingCommandQuick commands invoked with /AgentSubagents registered together with the pluginMCP serversExternal tool servers registered with the plugin, grouped by their plugin in the MCP listHookAutomation hooks triggered on specific events
When you enable a plugin, its runnable components — skills, commands, and MCP servers — are registered into the current workspace; disabling it disables them together.
Plugin Marketplace
The marketplace is organized into three segments. Use the search box at the top to find plugins within the current segment.
Public: plugins published by ZCode. App plugins are listed first; these open an interactive interface in the side pane next to the chat, such as PDF, Presentations, and Jupyter Notebook. Other plugins are grouped by category, such as Developer Tools, Utilities, Productivity, Finance, and 3D/Games. Plugins with a Coding Plan tag work better with a Coding Plan.
Community: plugins developed and maintained by third-party developers and listed in the official ZCode plugin marketplace.
Personal: marketplaces that you add. ZCode includes the Claude Code Plugins marketplace by default, which you can browse and install from directly.
Click Install on a plugin card to install it; its capabilities are available immediately. For installed plugins, use the switch on the card to enable or disable them; Uninstall is in the card's … menu. When a new version is available, the card shows Update. Click Refresh in the top-right corner to reload the plugin lists of all marketplaces and check installed plugins for updates.
Plugins in the Public and Community segments are provided by the official ZCode plugin marketplace. Its plugin list is updated automatically, so newly listed plugins are available without a client update. The official marketplace cannot be removed.
Community Plugins and Safety
The Plugin Marketplace includes a Community segment. Browse community plugins under Plugin Marketplace → Community, and use the search box to search within that segment. When there are no community plugins to display, the page shows No community plugins yet. Third-party marketplaces you add appear under Personal, even when they are maintained by the community.
Security note: community plugins are developed and maintained by third parties, and ZCode does not guarantee that they are free of security risks. Before installing, verify the source and review the plugin's instructions and source code to understand its required permissions and the commands it may execute. Use these plugins only in trusted projects; if a problem occurs, disable or uninstall the plugin, then report it through Feedback and Support.
Before installing, open the plugin details and review Components and Information for its MCP servers, skills, commands, subagents, hooks, developer, and website. These describe the plugin's capabilities; also check the plugin's instructions and source code for external service authorization and local commands.
Updates may change a plugin's capabilities. Before clicking Update, review its instructions, required permissions, and commands again, particularly new or changed MCP servers, skills, commands, and hooks. The update notice reads Takes effect in new sessions.
To stop using a plugin, turn off its switch on the card or in Manage plugins, or choose … → Disable on its details page. To remove it, choose … → Uninstall. The confirmation dialog warns: “This removes the plugin's cached files, its data directory, and any saved configuration. This cannot be undone.” Save any data you need before confirming.
Plugin Details
Click any plugin card to open its details page and review its capabilities before installing:
Components: the MCP servers, skills, commands, subagents, and hooks included in the plugin.
Information: developer, category, version, website, and related details.
Try now: available for installed plugins. It creates a new task associated with the plugin, which you can send after adding your request. Some plugins also provide a preview and example prompts at the top of the page that you can start from directly.
Updates: when a newer version of an installed plugin is available, the details page displays an update prompt. Updates take effect in new sessions; send /reload to apply them to a task that is already open.
Add Your Own Marketplace
In addition to official plugins, ZCode supports marketplaces maintained by your team or the community. Click Add → Add plugin marketplace in the top-right corner and enter the marketplace source:
A GitHub repository, such as owner/repo
A Git repository URL
The URL of a marketplace.json file
A local marketplace directory, which you can drag into the dialog or select with Choose directory
The dialog warns: “Unofficial plugin marketplaces may contain malicious plugins that can harm your device. Verify the source and take precautions before adding.” After verifying the source, select I understand the risks, have verified the source, and have taken precautions. to enable the Add marketplace button.
After the marketplace is added, its plugins appear in the Personal segment and can be browsed and installed in the same way as other plugins.
Click the store icon in the top-right corner to open Marketplace sources, which shows the number of plugins and the last update time for each marketplace and lets you refresh or remove individual marketplaces. The official marketplace and the Claude Code Plugins marketplace can be refreshed but not removed.
To develop a plugin or set up a team marketplace, see Develop Your Own Plugin below, or use the built-in Plugin Creator via Add → Create plugin.
Recommended Plugins
The marketplace offers dozens of plugins. Here is a selection by use case to get started; select ZCode Sites to see how site deployment works.
Develop and deployZCode SitesBuilt-inPublish a web project as a site for a preview or share linkGitHubCommits, pull requests, issues, releases, and ActionsGitLabMerge requests, issues, CI/CD, and releasesCode Security ProtectionSecurity checks before writes and commits, plus an end-of-task reviewAlibaba Cloud CLICredential setup and safe cloud resource operationsCloudbase SkillsBuild, deploy, and troubleshoot on Tencent CloudBaseDocuments and researchJupyter NotebookEdit and run notebook cells together in a side panelTypst WorkbenchLive-preview Typst documents and export PDFsZoteroSearch your library and highlights, cite, and keep a .bib fileObsidianObsidian-flavored notes, Bases views, and Canvas boardsOffice collaborationLark CLIDocs, sheets, Base, calendar, and messagingWeCom CLIMessages, docs, sheets, mail, calendar, and todosDingTalk CLIAuthorize a DingTalk workspace and add upstream skillsTencent Meeting CLIMeetings, recordings, and attendee reportsImages and videoSeedreamCoding PlanCreate an image from text, or edit a reference imageSeedanceCoding PlanShort videos from text, reference media, or first/last framesHappyHorseCoding PlanAds, social clips, and creative videos from text or imagesVideo Agent KitCoding PlanTranscription, frame review, timeline edits, rendering, and TTS3D and gamesBlenderModel in Blender over visible iterationsGodotBuild games and review each iteration in the editorUnityBuild scenes, write C# scripts, and debug prototypesUnreal EngineEdit levels and scene objects, and debug BlueprintsMeshyCoding Plan3D models from text or images, with rigging and animationTripo 3DTextured models for games or 3D printingFinanceWindCoding PlanStock, fund, bond, economic, and research dataRoyalFlush iFinDCoding PlanStock, index, fund, and bond dataTianyanchaCoding PlanCompany information queriesEquity ResearchCoding PlanResearch reports, sector analysis, and valuation models; the group also covers fixed income, funds, and due diligence
Some plugins require the corresponding application to be installed locally (such as Blender, Typst, or Zotero) or a signed-in account. Refer to each plugin's details page for its requirements.
Built-in Plugins
ZCode ships with 16 official plugins, most of which are enabled by default:
PluginDescriptionDefaultVisualizeGenerates interactive charts, explanations, and design previews in the chatOffBrowser UseOperates the ZCode built-in browser to inspect pages and verify interactionsOnDocuments / PDF / Presentations / SpreadsheetsCreate, edit, and review files in each format, with a preview in the side paneOnImage SearchSearches for illustrations and reference imagesOnPlugin CreatorDevelops and debugs custom pluginsOnSkill CreatorCreates and refines custom skillsOnZCode GuideAnswers ZCode configuration questions and diagnoses plugin, skill, and MCP settingsOnAndroid Emulator / iOS SimulatorEnable ZCode Agent to drive the emulator or simulator for building, installing, and UI verification (iOS requires macOS)OffComputer UseEnables ZCode Agent to operate desktop applications and complete tasks on your behalfOffZCode SitesPublishes a web project as a site with a preview or share link, managed in the Sites panel; see Deploying a WebsiteOnDesignCreates web designs, prototypes, and HTML decks, saved as workspace filesOffRestore Legacy SessionsRestores sessions from the legacy client into ZCode tasks and sessionsOff
Plugins that are off by default can be enabled in the marketplace or in Manage plugins.
Manage Plugins
Click Manage plugins in the top-right corner of the marketplace to view all plugins on this computer, grouped into Installed and Built-in.
Use the switch on each row to enable or disable a plugin. Changes take effect immediately.
Plugins with a newer version show an Update button. Uninstall is available in the … menu.
Use the scope menu at the top left to switch to a specific workspace and enable or disable plugins for that workspace only, without affecting other projects.
Disable or uninstall: disabling turns a plugin off temporarily, and it can be re-enabled at any time. Uninstalling removes the plugin and its saved configuration. An uninstalled built-in plugin is not restored by app updates; reinstall it from the marketplace if needed.
Local plugins are not synced to SSH or WSL remote workspaces automatically. Sync them under Settings → Data sync, or choose Sync plugins from the More menu next to the task title. See Remote Development → Syncing local configuration to the remote.
Configure Plugins
Some plugins must be configured before use, for example with a default device or a file path. In Manage plugins, open the plugin's details, expand Advanced details, fill in the Configuration section, and click Save configuration. Sensitive values such as API keys are entered in a password field that is hidden by default; you can reveal the value or clear a saved secret.
Using Installed Plugins
Once a plugin is enabled, its capabilities show up in the corresponding places in the client automatically, with no extra setup:
CapabilityWhere to use itSkillsTrigger automatically when relevant; you can also type / in the input box and pick from the Skills group. In Settings -> Skills they are grouped by their plugin.CommandsType / in the input box and pick from the Commands group; search by keyword for commands or skills.SubagentsCan be dispatched automatically to handle tasks during a conversation; in Settings -> Subagents they are grouped by their plugin (from plugins, definition read-only).MCP serversGrouped by their plugin under Settings -> MCP Servers, loaded automatically as the plugin is enabled or disabled.
Develop Your Own Plugin
All you need is JSON and Markdown — no changes to ZCode itself. Once your plugin is ready, add its local directory through Add your own marketplace above and install it right in the client for testing.
What A Plugin Looks Like
A plugin is just a folder: a manifest plugin.json at the root, plus component directories as needed (all optional).
my-plugin/.zcode-plugin/plugin.jsonRequiredManifestcommands/Slash commands, one .md eachskills/Skills, each subdirectory has a SKILL.mdagents/Subagent .md fileshooks/hooks.jsonHooks.mcp.jsonMCP server declarationsOnly the manifest is required; add the other folders as needed
The manifest is looked up in priority order: .zcode-plugin/plugin.json (recommended) → .claude-plugin/plugin.json (Claude Code compatible).
How to write the five component types:
ComponentFormat and locationCommandscommands/*.md, YAML frontmatter + body; use $ARGUMENTS in the body to receive argumentsSkillsskills//SKILL.md; spell out name / description in the frontmatter — the more precise the description, the more reliably it triggersSubagentsagents/*.md; name / description required in the frontmatter, the body is its system promptHookshooks/hooks.json, run automatically at specific events; enabled and disabled together with the plugin, see HooksMCP servers.mcp.json at the root or mcpServers in the manifest; connects external tools, server keys are auto-namespaced to avoid conflicts
The minimal manifest only needs a name:
{
"name": "hello-world",
"version": "0.1.0",
"description": "My first plugin"
}
plugin.json Field Reference
FieldRequiredMeaningname✅Plugin name, must match ^[a-z0-9][a-z0-9._-]{0,127}$ (starts with a lowercase letter / digit, may contain . _ -, 1–128 chars)versionVersion, defaults to 0.0.0; semantic versioning recommendeddescriptionOne-line description shown in the plugin management UIauthorAuthor, either a string or an object { name, email, url }homepage / repositoryHomepage and repository URLslicenseLicense, e.g. MITkeywordsArray of keywordscommands / skills / hooks / mcpServers / agentsComponent declarations; a directory path string, an array of paths, or an inline objectdependenciesOther plugins this one depends on, written as name@market or a bare name within the same marketplaceuserConfigUser-configurable options (see table below)
If the manifest contains channels / lspServers / outputStyles / settings, the current runtime registers but does not execute them — a diagnostic is emitted and other components still load.
Each entry in userConfig shows up in the Configuration area of the plugin detail dialog for the user to fill in:
FieldMeaningtypeType: string / number / boolean / directory / filetitleTitle shown in the UIdescriptionDescription of the optiondefaultDefault valuerequiredBoolean; required fields are marked "Required" in the UIsensitiveBoolean; sensitive values are entered in a password field that is hidden by default
Sensitive (sensitive) values can be referenced in MCP declarations with ${user_config.key}.
marketplace.json Field Reference
A plugin marketplace is a catalog manifest that tells the client which plugins are available and where they live.
Top-level fields:
FieldRequiredMeaningname✅Marketplace name; same naming rules as plugin namesdescriptionMarketplace descriptionplugins✅Array of plugin entries (see table below)pluginRootBase directory used to resolve each entry's source, relative to the marketplace rootallowCrossMarketplaceDependenciesOnArray of marketplace names allowed for cross-marketplace dependencies
Each entry in plugins[]:
FieldRequiredMeaningname✅Plugin namesourceWhere the plugin code lives. Most commonly a relative path string; can also be an object (see table below)description / versionDisplay description and versioncategory / tagsCategory (string) and tags (string array) for discoverydependenciesOther plugins this one depends on, written as name@market or a bare name within the same marketplacestrictBoolean; apply stricter validation to this entry
The different ways to write source:
FormMeaning"./plugins/hello"Most common. A subdirectory relative to the marketplace root (plugin lives in the same repo){ "source": "directory", "path": "/abs/path" }Local absolute directory path{ "source": "github", "repo": "owner/repo", "path": "subdir", "ref": "main" }Fetch from a GitHub repository, with optional subdirectory and branch{ "source": "git", "url": "https://...git", "path": "subdir", "ref": "..." }Fetch from any Git repository{ "source": "file", "path": "..." }Read a local manifest file{ "source": "url", "url": "https://.../marketplace.json" }An HTTP address pointing to a JSON file; supports headers{ "source": "npm", "package": "..." }Fetch from an npm package
Command .md Field Reference
The frontmatter of commands/*.md supports the following fields:
FieldRequiredMeaningdescription✅Command description (or a non-empty body is enough)argument-hintArgument hint, e.g. "[topic]"allowed-toolsComma-separated; restricts which tools the command may usemodelOverrides the default modelskillsComma-separated; skills to mount automaticallydisable-noninteractiveBoolean; disable this command in non-interactive mode
In the body, $ARGUMENTS stands for all user-provided arguments, and $1 / $2 are positional arguments. The command name comes from the file name and must match ^[a-z0-9][a-z0-9_:-]{0,63}$.
Skill SKILL.md Field Reference
The frontmatter of skills//SKILL.md supports the following fields:
FieldRequiredMeaningname✅Skill name; defaults to the directory namedescription✅Trigger description — spell out "when to use it"; up to 1024 chars, the more precise the more reliably it auto-triggerswhen_to_useAdditional trigger-timing descriptionlicenseLicensemetadataObject; may hold extras such as author / version
Other non-allowlisted fields (such as homepage) are ignored and do not affect loading.
Complete JSON Examples
plugin.json (all fields)
{
"name": "ios-simulator",
"version": "1.2.0",
"description": "iOS simulator dev loop: skills + commands + MCP + hooks",
"author": { "name": "Your Name", "email": "you@example.com", "url": "https://example.com" },
"homepage": "https://example.com/ios-simulator",
"repository": "https://github.com/your-team/ios-simulator",
"license": "MIT",
"keywords": ["ios", "simulator", "mobile"],
"commands": "commands",
"skills": ["skills", "extra-skills"],
"agents": "agents",
"hooks": "hooks/hooks.json",
"mcpServers": ".mcp.json",
"dependencies": ["skill-creator@zcode-plugins-official"],
"userConfig": {
"api_key": {
"title": "API key",
"description": "Used to access a third-party service",
"type": "string",
"required": true,
"sensitive": true
},
"default_device": { "title": "Default device", "type": "string", "default": "iPhone 16" },
"max_retries": { "type": "number", "default": 3 },
"verbose": { "type": "boolean", "default": false },
"workspace_dir": { "type": "directory" },
"config_file": { "type": "file" }
}
}
commands / skills / hooks / mcpServers / agents accept any of three forms — a directory string (like "commands"), an array of paths (like ["skills", "extra-skills"]), or an inline object. The example above demonstrates the string, array, and file-path forms.
marketplace.json (all fields + every source form)
{
"name": "my-market",
"description": "Internal team plugin marketplace",
"pluginRoot": "plugins",
"allowCrossMarketplaceDependenciesOn": ["zcode-plugins-official"],
"plugins": [
{
"name": "hello-world",
"source": "./hello-world",
"description": "A greeting plugin",
"version": "0.1.0",
"category": "demo",
"tags": ["starter", "demo"],
"strict": true
},
{
"name": "from-github",
"source": { "source": "github", "repo": "your-team/another", "path": "plugins/x", "ref": "main" },
"dependencies": ["hello-world", "skill-creator@zcode-plugins-official"]
},
{
"name": "from-git",
"source": { "source": "git", "url": "https://git.example.com/x.git", "path": "sub", "ref": "v1.0" }
},
{
"name": "from-dir",
"source": { "source": "directory", "path": "/abs/path/to/plugin" }
},
{
"name": "from-url",
"source": { "source": "url", "url": "https://example.com/plugin-manifest.json", "headers": { "Authorization": "Bearer xxx" } }
},
{
"name": "from-npm",
"source": { "source": "npm", "package": "@scope/plugin" }
}
]
}
With pluginRoot set, relative source values (like "./hello-world") resolve against it — i.e. plugins/hello-world.
hooks/hooks.json
{
"hooks": {
"SessionStart": [
{
"matcher": "startup|resume",
"hooks": [
{
"type": "command",
"command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run.sh\" start",
"async": false,
"shell": true,
"timeout": 30,
"statusMessage": "Initializing…"
}
]
}
],
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "process",
"command": "node",
"args": ["${CLAUDE_PLUGIN_ROOT}/hooks/check.js"],
"timeoutMs": 5000,
"statusMessage": "Checking command…"
}
]
}
],
"PostToolUse": [
{ "hooks": [ { "type": "command", "command": "echo done" } ] }
],
"Stop": [
{ "hooks": [ { "type": "command", "command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/cleanup.sh\"", "async": true } ] }
]
}
}
Seven events are currently supported: SessionStart, UserPromptSubmit, PreToolUse, PermissionRequest, PostToolUse, PostToolUseFailure, and Stop. Each event holds an array of matcher groups; process executes via argv, while command hands a shell string to the system shell and supports async. The standard location hooks/hooks.json is discovered automatically — do not point the manifest at the same file again. Plugin hooks only join new sessions after the plugin is enabled; see Hooks for the full semantics.
.mcp.json (stdio + http + sse)
{
"mcpServers": {
"ios-simulator": {
"type": "stdio",
"command": "node",
"args": ["${CLAUDE_PLUGIN_ROOT}/dist/mcp/server.js"],
"cwd": "${CLAUDE_PROJECT_DIR}",
"env": {
"IOS_SIM_ROOT": "${CLAUDE_PLUGIN_ROOT}",
"IOS_SIM_DEVICE": "${user_config.default_device}"
},
"enabled": true,
"timeoutMs": 60000
},
"remote-http": {
"type": "http",
"url": "https://mcp.example.com/api",
"headers": { "Authorization": "Bearer ${user_config.api_key}" },
"enabled": true,
"timeoutMs": 30000
},
"remote-sse": {
"type": "sse",
"url": "https://mcp.example.com/sse",
"headers": { "X-Token": "${user_config.api_key}" }
}
}
}
type can be omitted — with a command it defaults to stdio, with a url it defaults to http. Available template variables:
VariableMeaning${CLAUDE_PLUGIN_ROOT}Plugin root directory; ${ZCODE_PLUGIN_ROOT} also works${CLAUDE_PLUGIN_DATA}Plugin data directory${CLAUDE_PROJECT_DIR}Current working directory${user_config.key}References the value of the matching userConfig entry
Server keys are automatically namespaced as plugin:: to avoid conflicts.
Test Locally In The Client
Build the plugin directory locally, then write a marketplace.json whose plugins[].source points at the plugin directory with a relative path.
Open Plugin Marketplace, click Add → Add plugin marketplace in the top-right corner, and enter the directory's local path (the path must exist).
Find it in the Personal segment, click Install and enable it, then trigger its components in a conversation to verify. After code changes, refresh that marketplace from the Marketplace sources panel.
Distribute A Marketplace To Your Team
Put plugins under the marketplace repository's plugins/ directory, list them in a marketplace.json at the root, and push to GitHub.
Put it in a repoPlugins go under plugins/Write marketplace.jsonList every entry at the root; bump version on each releasePush to GitHubThe repository is the marketplace addressTeammates add itAdd → Add plugin marketplace, enter the repo, get every plugin
When releasing a new version, update the plugin's version in marketplace.json accordingly. The client compares it with the version in the installed plugin's plugin.json to determine whether an update is available. Teammates click Add → Add plugin marketplace in the Plugin Marketplace, enter the repository address, and get every plugin at once.
The bundled official plugins are the best examples (skill-creator is the simplest; ios-simulator / android-emulator are the most complete). Start with a skills-only plugin, then add commands, hooks, and MCP once it works.
Security note: enabling a plugin grants code-execution trust. Enabled third-party marketplace plugins can run local processes and read the inherited ZCode Agent environment variables, just like official ones. Review the source, hooks/hooks.json, and scripts before enabling; disable or uninstall anything you don't trust.
Next Steps
HooksThe full development reference for events, I/O contracts, and exit codes.CommandLearn ZCode Agent built-in commands and how to create custom commands.SkillUse Skills to teach agents reusable ways of working.MCPConnect external tool capabilities to ZCode Agent.