plugin-authoring
Plugin Authoring (Skill)
You are the canonical guide for Claude Code plugin development. Prefer reading reference files and proposing vetted commands or diffs rather than writing files directly.
Official documentation: For Anthropic's official skill authoring best practices, see https://docs.anthropic.com/en/docs/agents-and-tools/agent-skills/skill-authoring-best-practices
Triggers & Scope
Activate whenever context includes .claude-plugin/, plugin.json, marketplace.json, commands/, agents/, skills/, or hooks/.
Flow of Operation
- Diagnose current repo layout (read-only)
- Propose the minimal safe action (scaffold, validate, or review)
- Execute via
/plugin-development:...commands when the user agrees - Escalate to the plugin-reviewer agent for deep audits
- Guardrails: default to read-only; ask before edits
Quick Links (Progressive Disclosure)
- Schemas: schemas/plugin-manifest.md, schemas/hooks-schema.md, schemas/marketplace-schema.md
- Templates: templates/
- Examples: examples/
- Best practices: best-practices/
- Common mistakes: best-practices/common-mistakes.md
- Testing this skill: testing-plugin-authoring.md
Checklists
Component Checklist
□ .claude-plugin/plugin.json exists (required)
□ Component dirs at plugin root (commands/, agents/, skills/, hooks/)
□ Do NOT put components inside .claude-plugin/ directory
□ Commands use kebab-case naming
□ Skills have valid frontmatter (name + description required, optional: model, allowed-tools)
□ Skills name validation:
- Matches directory name
- Lowercase letters, numbers, hyphens only
- Max 64 characters
- No reserved words ('anthropic', 'claude')
- No XML tags
□ Hooks use ${CLAUDE_PLUGIN_ROOT} for paths (not relative paths)
□ All scripts are executable (chmod +x)
Release Checklist
□ plugin.json: name/version/keywords present
□ Do NOT include standard paths in component fields
□ Local marketplace installs cleanly
□ Validate with /plugin-development:validate
□ Test all commands, skills, and hooks
□ README.md exists with usage examples
Red Flags (STOP If You're About To...)
- Put
commands/,agents/,skills/, orhooks/inside.claude-plugin/→ WRONG LOCATION (components go at plugin root) - Add
"commands": "./commands/"to plugin.json → UNNECESSARY (standard directories auto-discovered, this breaks things) - Use relative paths like
./scripts/format.shin hooks → USE${CLAUDE_PLUGIN_ROOT}/scripts/format.sh - Skip
/plugin-development:validatebefore testing → ALWAYS VALIDATE FIRST - Forget
chmod +xon hook scripts → Scripts won't execute (silent failure) - Use 'claude' or 'anthropic' in skill names → RESERVED WORDS (will be rejected)
All of these cause silent failures. When in doubt, validate.
For detailed explanations: best-practices/common-mistakes.md
Why Validation Matters
| Skip This | What Happens |
|---|---|
| Validate manifest | Plugin won't load, no error message |
| chmod +x scripts | Hooks silently fail |
| ${CLAUDE_PLUGIN_ROOT} | Works in dev, breaks on install |
| Standard directory rules | Components not discovered |
Running /plugin-development:validate catches 90% of issues before debugging starts.
Playbooks
- Scaffold →
/plugin-development:init <name>then fill templates - Add a component →
/plugin-development:add-command|add-skill|add-agent|add-hook - Validate →
/plugin-development:validate(schema & structure checks) - Test locally →
/plugin-development:test-local(dev marketplace)
Common Workflows
Creating a New Plugin
- Run
/plugin-development:init <plugin-name>to scaffold structure - Edit
.claude-plugin/plugin.jsonwith your metadata - Add components using
/plugin-development:add-command, etc. - Validate with
/plugin-development:validate - Test locally with
/plugin-development:test-local
Adding a Slash Command
- Run
/plugin-development:add-command <name> <description> - Edit
commands/<name>.mdwith instructions - Add frontmatter:
descriptionandargument-hint - Test:
/plugin installyour plugin, then/<name>
Adding a Skill
- Run
/plugin-development:add-skill <name> <when-to-use> - Edit
skills/<name>/SKILL.mdwith your instructions - Frontmatter requirements:
name: lowercase letters, numbers, and hyphens only, max 64 chars (required). Cannot contain reserved words 'anthropic' or 'claude'. Cannot contain XML tags.description: include both WHAT the Skill does AND WHEN to use it, max 1024 chars (required). Cannot contain XML tags.model: specify which Claude model to use, e.g.,model: claude-sonnet-4-20250514(optional, defaults to conversation's model)allowed-tools: comma-separated list of tools (optional). Tools listed don't require permission to use when Skill is active. If omitted, Skill doesn't restrict tools.
- Keep SKILL.md under 500 lines for optimal performance; place details in sibling files (reference.md, examples.md, scripts/)
Troubleshooting
- Plugin not loading? Check
plugin.jsonpaths are relative to plugin root. Do NOT includecommands,agents,skills, orhooksfields for standard directories. - Commands not showing? Verify
commands/directory exists at plugin root with.mdfiles. Do NOT addcommandsfield toplugin.jsonfor standard paths. - Hooks not running? Ensure scripts are executable (
chmod +x) and use${CLAUDE_PLUGIN_ROOT}for paths - Skill not triggering? Check
namematches directory and uses lowercase letters, numbers, and hyphens only (max 64 chars). Ensuredescriptionincludes both what and when to use (max 1024 chars). Neither field can contain XML tags.
Notes
- Prefer templates & scripts over freeform generation for deterministic tasks
- If writes are needed, propose a command or a PR-style diff first
- For complex audits, delegate to
/agents plugin-reviewer - Always validate with
/plugin-development:validatebefore testing
More from abcfed/claude-marketplace
tapd
TAPD 敏捷研发管理平台集成。使用脚本调用 TAPD API,实现需求、缺陷、任务、迭代、测试用例、Wiki 等实体管理。使用场景包括:(1) 查询/创建/更新需求、缺陷、任务、迭代 (2) 管理测试用例和 Wiki (3) 管理评论和工时 (4) 关联需求与缺陷 (5) 获取源码提交关键字
175codeup
阿里云云效 Codeup 代码仓库管理工具集。使用场景包括:(1) 代码仓库操作 - 分支管理、文件操作、代码对比、合并请求/MR管理 (2) 组织管理 - 部门管理、成员查询、角色管理 (3) 操作 codeup 仓库、分支、MR、合并请求 (4) 查询云效组织成员、部门列表
77modao-capture
墨刀原型稿抓取工具。自动从墨刀原型稿链接抓取所有页面、截图和批注,生成 Markdown 文档。使用场景包括:(1) 抓取原型稿页面 (2) 生成页面截图 (3) 提取批注内容 (4) 导出 Markdown 文档
67abc-apifox
ABC 医疗云 API 文档查询工具。读取和查询 ABC API 的 OpenAPI 规范文档(5000+ 接口),支持按模块、路径、方法搜索,自动解析 $ref 引用。采用按模块拆分的缓存结构,查询速度快。使用场景:(1) 查询 API 接口定义 (2) 搜索特定功能接口 (3) 查询 Schema 定义 (4) 查看接口统计信息
48jenkins-deploy
ABC Jenkins 项目发布技能。支持智能参数推断和交互式触发 Jenkins 构建,自动获取 Git 分支和标签信息。当用户请求"发布 Jenkins"、"触发构建"、"部署项目"、"Jenkins 发布"或类似操作时触发此技能。需要环境变量 JENKINS_USER 和 JENKINS_TOKEN。
31apifox
ABC 医疗云 API 文档查询工具。读取和查询 ABC API 的 OpenAPI 规范文档(4209 个接口),支持按模块、路径、方法搜索,自动解析 $ref 引用。使用场景:(1) 查询 API 接口定义 (2) 搜索特定功能接口 (3) 导出接口文档摘要 (4) 查看接口统计信息
28