create-cowork-plugin by anthropics/knowledge-work-plugins
npx skills add https://github.com/anthropics/knowledge-work-plugins --skill create-cowork-plugin通过引导式对话从头开始构建一个新插件。引导用户完成发现、规划、设计、实现和打包过程——最终交付一个可立即安装的 .plugin 文件。
插件是一个独立的目录,通过技能、智能体、钩子和 MCP 服务器集成来扩展 Claude 的能力。此技能编码了完整的插件架构以及通过对话创建插件的五阶段工作流程。
流程如下:
.plugin 文件非技术性输出:所有面向用户的对话都使用通俗语言。除非用户询问,否则不要暴露实现细节,如文件路径、目录结构或模式字段。所有内容都应围绕插件将做什么来表述。
每个插件都遵循以下布局:
plugin-name/
├── .claude-plugin/
│ └── plugin.json # 必需:插件清单
├── skills/ # 技能(包含 SKILL.md 的子目录)
│ └── skill-name/
│ ├── SKILL.md
│ └── references/
├── agents/ # 子智能体定义(.md 文件)
├── .mcp.json # MCP 服务器定义
└── README.md # 插件文档
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
遗留
commands/格式:较旧的插件可能包含一个commands/目录,其中包含单文件的.md斜杠命令。此格式仍然有效,但新插件应使用skills/*/SKILL.md—— Cowork UI 将两者呈现为单一的"技能"概念,并且技能格式通过references/支持渐进式披露。
规则:
.claude-plugin/plugin.json 始终是必需的skills/、agents/)位于插件根目录,而不是在 .claude-plugin/ 内部位于 .claude-plugin/plugin.json。必需的最小字段是 name。
{
"name": "plugin-name",
"version": "0.1.0",
"description": "插件用途的简要说明",
"author": {
"name": "作者姓名"
}
}
命名规则: kebab-case,小写字母加连字符,无空格或特殊字符。版本: semver 格式(主版本.次版本.修订版本)。从 0.1.0 开始。
可选字段:homepage、repository、license、keywords。
可以指定自定义组件路径(补充,不替换自动发现):
{
"commands": "./custom-commands",
"agents": ["./agents", "./specialized-agents"],
"hooks": "./config/hooks.json",
"mcpServers": "./.mcp.json"
}
每种组件类型的详细模式在 references/component-schemas.md 中。摘要:
| 组件 | 位置 | 格式 |
|---|---|---|
| 技能 | skills/*/SKILL.md | Markdown + YAML 前置元数据 |
| MCP 服务器 | .mcp.json | JSON |
| 智能体(在 Cowork 中不常用) | agents/*.md | Markdown + YAML 前置元数据 |
| 钩子(在 Cowork 中很少使用) | hooks/hooks.json | JSON |
| 命令(遗留) | commands/*.md | Markdown + YAML 前置元数据 |
此模式与 Claude Code 的插件系统共享,但您正在为 Claude Cowork 创建一个插件,这是一个用于知识工作的桌面应用程序。Cowork 用户通常会发现技能最有用。使用 skills/*/SKILL.md 搭建新插件 —— 除非用户明确需要遗留的单文件格式,否则不要创建 commands/。
~~ 占位符的自定义插件默认情况下不要使用或询问此模式。 仅当用户明确表示希望其组织外部的人员使用该插件时,才引入
~~占位符。如果用户似乎希望外部分发插件,您可以提及这是一个选项,但不要通过 AskUserQuestion 主动询问。
当插件打算与公司外部的其他人共享时,可能包含需要针对个体用户进行调整的部分。您可能需要按类别而非特定产品引用外部工具(例如,"项目跟踪器"而不是"Jira")。当需要共享时,使用通用语言,并用两个波浪号字符标记这些需要自定义的部分,例如 在 ~~项目跟踪器 中创建问题。如果使用了任何工具类别,请在插件根目录编写一个 CONNECTORS.md 文件来解释:
# 连接器
## 工具引用如何工作
插件文件使用 `~~类别` 作为占位符,代表用户在该类别中连接的任何工具。插件是工具无关的——它们按类别而非特定产品来描述工作流程。
## 此插件的连接器
| 类别 | 占位符 | 选项 |
| --------------- | ------------------- | ------------------------------- |
| 聊天 | `~~聊天` | Slack, Microsoft Teams, Discord |
| 项目跟踪器 | `~~项目跟踪器` | Linear, Asana, Jira |
在钩子和 MCP 配置中,所有插件内部路径引用都使用 ${CLAUDE_PLUGIN_ROOT}。切勿硬编码绝对路径。
当您询问用户时,使用 AskUserQuestion。不要假设"行业标准"默认值是正确的。注意:AskUserQuestion 始终包含一个"跳过"按钮和一个用于自定义答案的自由文本输入框,因此不要将 None 或 Other 作为选项包含在内。
目标:了解用户想要构建什么以及为什么。
询问(仅限不清楚的内容——如果用户的初始请求已经回答了问题,则跳过):
在继续之前,总结理解并确认。
输出:插件目的和范围的清晰陈述。
目标:确定插件需要哪些组件类型。
根据发现阶段的答案,确定:
呈现一个组件计划表,包括您决定不创建的组件类型:
| 组件 | 数量 | 用途 |
|-----------|-------|---------|
| 技能 | 3 | X 的领域知识,/执行操作,/检查操作 |
| 智能体 | 0 | 不需要 |
| 钩子 | 1 | 验证写入操作 |
| MCP | 1 | 连接到服务 Y |
在继续之前获取用户的确认或调整。
输出:确认要创建的组件列表。
目标:详细指定每个组件。在实现之前解决所有歧义。
对于计划中的每种组件类型,提出有针对性的设计问题。按组件类型分组呈现问题。等待答案后再继续。
技能:
智能体:
钩子:
MCP 服务器:
如果用户说"你认为什么最好",请提供具体建议并获得明确确认。
输出:每个组件的详细规范。
目标:遵循最佳实践创建所有插件文件。
操作顺序:
plugin.json 清单references/component-schemas.md)README.md实现指南:
references/ 中。前置元数据描述必须是第三人称,并包含特定的触发短语。技能正文是给 Claude 的指令,而不是给用户阅读的消息——将它们写成关于要做什么的指令。<example> 块的描述,以及 Markdown 正文中的系统提示。hooks/hooks.json 中。脚本路径使用 ${CLAUDE_PLUGIN_ROOT}。对于复杂逻辑,优先使用基于提示的钩子。.mcp.json 中。本地服务器路径使用 ${CLAUDE_PLUGIN_ROOT}。在 README 中记录所需的环境变量。目标:交付完成的插件。
claude plugin validate <path-to-plugin-json>;修复任何错误和警告.plugin 文件:cd /path/to/plugin-dir && zip -r /tmp/plugin-name.plugin . -x "*.DS_Store" && cp /tmp/plugin-name.plugin /path/to/outputs/plugin-name.plugin
重要:始终先在
/tmp/中创建 zip 文件,然后复制到 outputs 文件夹。直接写入 outputs 文件夹可能会因权限问题而失败。
命名:使用
plugin.json中的插件名称作为.plugin文件名(例如,如果名称是code-reviewer,则输出code-reviewer.plugin)。
.plugin 文件将以富预览形式出现在聊天中,用户可以浏览文件并通过按按钮接受插件。
references/ 中,工作示例在 examples/ 中。<example> 块。${CLAUDE_PLUGIN_ROOT},切勿使用硬编码路径。references/component-schemas.md —— 每种组件类型(技能、智能体、钩子、MCP、遗留命令、CONNECTORS.md)的详细格式规范references/example-plugins.md —— 三个不同复杂度的完整示例插件结构每周安装次数
135
代码仓库
GitHub 星标数
8.9K
首次出现
2026年2月10日
安全审计
安装于
opencode125
codex121
gemini-cli120
github-copilot116
kimi-cli111
amp111
Build a new plugin from scratch through guided conversation. Walk the user through discovery, planning, design, implementation, and packaging — delivering a ready-to-install .plugin file at the end.
A plugin is a self-contained directory that extends Claude's capabilities with skills, agents, hooks, and MCP server integrations. This skill encodes the full plugin architecture and a five-phase workflow for creating one conversationally.
The process:
.plugin fileNontechnical output : Keep all user-facing conversation in plain language. Do not expose implementation details like file paths, directory structures, or schema fields unless the user asks. Frame everything in terms of what the plugin will do.
Every plugin follows this layout:
plugin-name/
├── .claude-plugin/
│ └── plugin.json # Required: plugin manifest
├── skills/ # Skills (subdirectories with SKILL.md)
│ └── skill-name/
│ ├── SKILL.md
│ └── references/
├── agents/ # Subagent definitions (.md files)
├── .mcp.json # MCP server definitions
└── README.md # Plugin documentation
Legacy
commands/format: Older plugins may include acommands/directory with single-file.mdslash commands. This format still works, but new plugins should useskills/*/SKILL.mdinstead — the Cowork UI presents both as a single "Skills" concept, and the skills format supports progressive disclosure viareferences/.
Rules:
.claude-plugin/plugin.json is always requiredskills/, agents/) go at the plugin root, not inside .claude-plugin/Located at .claude-plugin/plugin.json. Minimal required field is name.
{
"name": "plugin-name",
"version": "0.1.0",
"description": "Brief explanation of plugin purpose",
"author": {
"name": "Author Name"
}
}
Name rules: kebab-case, lowercase with hyphens, no spaces or special characters. Version: semver format (MAJOR.MINOR.PATCH). Start at 0.1.0.
Optional fields: homepage, repository, license, keywords.
Custom component paths can be specified (supplements, does not replace, auto-discovery):
{
"commands": "./custom-commands",
"agents": ["./agents", "./specialized-agents"],
"hooks": "./config/hooks.json",
"mcpServers": "./.mcp.json"
}
Detailed schemas for each component type are in references/component-schemas.md. Summary:
| Component | Location | Format |
|---|---|---|
| Skills | skills/*/SKILL.md | Markdown + YAML frontmatter |
| MCP Servers | .mcp.json | JSON |
| Agents (uncommonly used in Cowork) | agents/*.md | Markdown + YAML frontmatter |
| Hooks (rarely used in Cowork) | hooks/hooks.json | JSON |
| Commands (legacy) | commands/*.md |
This schema is shared with Claude Code's plugin system, but you're creating a plugin for Claude Cowork, a desktop app for doing knowledge work. Cowork users will usually find skills the most useful. Scaffold new plugins withskills/*/SKILL.md — do not create commands/ unless the user explicitly needs the legacy single-file format.
~~ placeholdersDo not use or ask about this pattern by default. Only introduce
~~placeholders if the user explicitly says they want people outside their organization to use the plugin. You can mention this is an option if it seems like the user wants to distribute the plugin externally, but do not proactively ask about this with AskUserQuestion.
When a plugin is intended to be shared with others outside their company, it might have parts that need to be adapted to individual users. You might need to reference external tools by category rather than specific product (e.g., "project tracker" instead of "Jira"). When sharing is needed, use generic language and mark these as requiring customization with two tilde characters such as create an issue in ~~project tracker. If used any tool categories, write a CONNECTORS.md file at the plugin root to explain:
# Connectors
## How tool references work
Plugin files use `~~category` as a placeholder for whatever tool the user
connects in that category. Plugins are tool-agnostic — they describe
workflows in terms of categories rather than specific products.
## Connectors for this plugin
| Category | Placeholder | Options |
| --------------- | ------------------- | ------------------------------- |
| Chat | `~~chat` | Slack, Microsoft Teams, Discord |
| Project tracker | `~~project tracker` | Linear, Asana, Jira |
Use ${CLAUDE_PLUGIN_ROOT} for all intra-plugin path references in hooks and MCP configs. Never hardcode absolute paths.
When you ask the user something, use AskUserQuestion. Don't assume "industry standard" defaults are correct. Note: AskUserQuestion always includes a Skip button and a free-text input box for custom answers, so do not include None or Other as options.
Goal : Understand what the user wants to build and why.
Ask (only what is unclear — skip questions if the user's initial request already answers them):
Summarize understanding and confirm before proceeding.
Output : Clear statement of plugin purpose and scope.
Goal : Determine which component types the plugin needs.
Based on the discovery answers, determine:
Present a component plan table, including component types you decided not to create:
| Component | Count | Purpose |
|-----------|-------|---------|
| Skills | 3 | Domain knowledge for X, /do-thing, /check-thing |
| Agents | 0 | Not needed |
| Hooks | 1 | Validate writes |
| MCP | 1 | Connect to service Y |
Get user confirmation or adjustments before proceeding.
Output : Confirmed list of components to create.
Goal : Specify each component in detail. Resolve all ambiguities before implementation.
For each component type in the plan, ask targeted design questions. Present questions grouped by component type. Wait for answers before proceeding.
Skills:
Agents:
Hooks:
MCP Servers:
If the user says "whatever you think is best," provide specific recommendations and get explicit confirmation.
Output : Detailed specification for every component.
Goal : Create all plugin files following best practices.
Order of operations:
plugin.json manifestreferences/component-schemas.md for exact formats)README.md documenting the pluginImplementation guidelines:
references/. Frontmatter description must be third-person with specific trigger phrases. Skill bodies are instructions FOR Claude, not messages to the user — write them as directives about what to do.<example> blocks showing triggering conditions, plus a system prompt in the markdown body.hooks/hooks.json. Use ${CLAUDE_PLUGIN_ROOT} for script paths. Prefer prompt-based hooks for complex logic..mcp.json at plugin root. Use ${CLAUDE_PLUGIN_ROOT} for local server paths. Document required env vars in README.Goal : Deliver the finished plugin.
claude plugin validate <path-to-plugin-json>; fix any errors and warnings.plugin file:cd /path/to/plugin-dir && zip -r /tmp/plugin-name.plugin . -x "*.DS_Store" && cp /tmp/plugin-name.plugin /path/to/outputs/plugin-name.plugin
Important : Always create the zip in
/tmp/first, then copy to the outputs folder. Writing directly to the outputs folder may fail due to permissions.
Naming : Use the plugin name from
plugin.jsonfor the.pluginfile (e.g., if name iscode-reviewer, outputcode-reviewer.plugin).
The .plugin file will appear in the chat as a rich preview where the user can browse the files and accept the plugin by pressing a button.
references/, working examples in examples/.<example> blocks.${CLAUDE_PLUGIN_ROOT} for intra-plugin paths, never hardcoded paths.references/component-schemas.md — Detailed format specifications for every component type (skills, agents, hooks, MCP, legacy commands, CONNECTORS.md)references/example-plugins.md — Three complete example plugin structures at different complexity levelsWeekly Installs
135
Repository
GitHub Stars
8.9K
First Seen
Feb 10, 2026
Security Audits
Gen Agent Trust HubPassSocketFailSnykWarn
Installed on
opencode125
codex121
gemini-cli120
github-copilot116
kimi-cli111
amp111
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
140,500 周安装
ClawDirect-Dev:基于ATXP构建面向AI智能体的网页身份验证与支付集成方案
4,300 周安装
FastAPI Python开发指南:高效后端API构建与最佳实践
4,300 周安装
PRD转Issues工具:AI辅助将产品需求文档分解为GitHub可执行任务
4,500 周安装
Firebase Data Connect 教程:PostgreSQL 关系型数据库与 GraphQL API 开发指南
5,300 周安装
Instaclaw AI代理照片分享平台 | 使用ATXP生成并分享AI艺术作品
4,400 周安装
ClawDirect AI代理社交网络目录 | ATXP MCP工具快速接入指南
4,400 周安装
| Markdown + YAML frontmatter |