[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M718BCARZ2J4PW0X3AJCZ8MZ":3,"skill-same:01M718BCARZ2J4PW0X3AJCZ8MZ":99},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":44,"linkOnly":45,"markdownContent":46,"markdownBody":47,"frontMatter":48,"refName":50,"commitSha":51,"skillDirectory":52,"forksCount":53,"repositoryHtmlUrl":54,"repositoryHomepageUrl":55,"ownerHtmlUrl":56,"ownerBlogUrl":57,"ownerDescription":6,"updatedAt":58,"install":59,"resources":72},"01M718BCARZ2J4PW0X3AJCZ8MZ","plugin-structure",null,"This skill should be used when the user asks to \"create a plugin\", \"scaffold a plugin\", \"understand plugin structure\", \"organize plugin components\", \"set up plugin.json\", \"use ${CLAUDE_PLUGIN_ROOT}\", \"add commands\u002Fagents\u002Fskills\u002Fhooks\", \"configure auto-discovery\", or needs guidance on plugin directory layout, manifest configuration, component organization, file naming conventions, or Claude Code plugin architecture best practices.","anthropics\u002Fclaude-plugins-official","anthropics","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F76263028?v=4","01M697XGDPXJAVQ8391V2BCYTE","Anthropic","01M7188MR49TZ9N2ZKPXJ7M7HY",46789,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-plugins-official\u002Fblob\u002Fmain\u002Fplugins\u002Fplugin-dev\u002Fskills\u002Fplugin-structure\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43],"Plugin Structure","plugin","structure","commands","directory","organization","layout","component","create","architecture","components","code","configure","when","auto","auto-discovery","up","hooks","plugin architecture","SET","2026-11-10 10:12:30",false,"---\nname: plugin-structure\ndescription: This skill should be used when the user asks to \"create a plugin\", \"scaffold a plugin\", \"understand plugin structure\", \"organize plugin components\", \"set up plugin.json\", \"use ${CLAUDE_PLUGIN_ROOT}\", \"add commands\u002Fagents\u002Fskills\u002Fhooks\", \"configure auto-discovery\", or needs guidance on plugin directory layout, manifest configuration, component organization, file naming conventions, or Claude Code plugin architecture best practices.\nversion: 0.1.0\n---\n\n# Plugin Structure for Claude Code\n\n## Overview\n\nClaude Code plugins follow a standardized directory structure with automatic component discovery. Understanding this structure enables creating well-organized, maintainable plugins that integrate seamlessly with Claude Code.\n\n**Key concepts:**\n- Conventional directory layout for automatic discovery\n- Manifest-driven configuration in `.claude-plugin\u002Fplugin.json`\n- Component-based organization (commands, agents, skills, hooks)\n- Portable path references using `${CLAUDE_PLUGIN_ROOT}`\n- Explicit vs. auto-discovered component loading\n\n## Directory Structure\n\nEvery Claude Code plugin follows this organizational pattern:\n\n```\nplugin-name\u002F\n├── .claude-plugin\u002F\n│   └── plugin.json          # Required: Plugin manifest\n├── commands\u002F                 # Slash commands (.md files)\n├── agents\u002F                   # Subagent definitions (.md files)\n├── skills\u002F                   # Agent skills (subdirectories)\n│   └── skill-name\u002F\n│       └── SKILL.md         # Required for each skill\n├── hooks\u002F\n│   └── hooks.json           # Event handler configuration\n├── .mcp.json                # MCP server definitions\n└── scripts\u002F                 # Helper scripts and utilities\n```\n\n**Critical rules:**\n\n1. **Manifest location**: The `plugin.json` manifest MUST be in `.claude-plugin\u002F` directory\n2. **Component locations**: All component directories (commands, agents, skills, hooks) MUST be at plugin root level, NOT nested inside `.claude-plugin\u002F`\n3. **Optional components**: Only create directories for components the plugin actually uses\n4. **Naming convention**: Use kebab-case for all directory and file names\n\n## Plugin Manifest (plugin.json)\n\nThe manifest defines plugin metadata and configuration. Located at `.claude-plugin\u002Fplugin.json`:\n\n### Required Fields\n\n```json\n{\n  \"name\": \"plugin-name\"\n}\n```\n\n**Name requirements:**\n- Use kebab-case format (lowercase with hyphens)\n- Must be unique across installed plugins\n- No spaces or special characters\n- Example: `code-review-assistant`, `test-runner`, `api-docs`\n\n### Recommended Metadata\n\n```json\n{\n  \"name\": \"plugin-name\",\n  \"version\": \"1.0.0\",\n  \"description\": \"Brief explanation of plugin purpose\",\n  \"author\": {\n    \"name\": \"Author Name\",\n    \"email\": \"author@example.com\",\n    \"url\": \"https:\u002F\u002Fexample.com\"\n  },\n  \"homepage\": \"https:\u002F\u002Fdocs.example.com\",\n  \"repository\": \"https:\u002F\u002Fgithub.com\u002Fuser\u002Fplugin-name\",\n  \"license\": \"MIT\",\n  \"keywords\": [\"testing\", \"automation\", \"ci-cd\"]\n}\n```\n\n**Version format**: Follow semantic versioning (MAJOR.MINOR.PATCH)\n**Keywords**: Use for plugin discovery and categorization\n\n### Component Path Configuration\n\nSpecify custom paths for components (supplements default directories):\n\n```json\n{\n  \"name\": \"plugin-name\",\n  \"commands\": \".\u002Fcustom-commands\",\n  \"agents\": [\".\u002Fagents\", \".\u002Fspecialized-agents\"],\n  \"hooks\": \".\u002Fconfig\u002Fhooks.json\",\n  \"mcpServers\": \".\u002F.mcp.json\"\n}\n```\n\n**Important**: Custom paths supplement defaults—they don't replace them. Components in both default directories and custom paths will load.\n\n**Path rules:**\n- Must be relative to plugin root\n- Must start with `.\u002F`\n- Cannot use absolute paths\n- Support arrays for multiple locations\n\n## Component Organization\n\n### Commands\n\n**Location**: `commands\u002F` directory\n**Format**: Markdown files with YAML frontmatter\n**Auto-discovery**: All `.md` files in `commands\u002F` load automatically\n\n**Example structure**:\n```\ncommands\u002F\n├── review.md        # \u002Freview command\n├── test.md          # \u002Ftest command\n└── deploy.md        # \u002Fdeploy command\n```\n\n**File format**:\n```markdown\n---\nname: command-name\ndescription: Command description\n---\n\nCommand implementation instructions...\n```\n\n**Usage**: Commands integrate as native slash commands in Claude Code\n\n### Agents\n\n**Location**: `agents\u002F` directory\n**Format**: Markdown files with YAML frontmatter\n**Auto-discovery**: All `.md` files in `agents\u002F` load automatically\n\n**Example structure**:\n```\nagents\u002F\n├── code-reviewer.md\n├── test-generator.md\n└── refactorer.md\n```\n\n**File format**:\n```markdown\n---\ndescription: Agent role and expertise\ncapabilities:\n  - Specific task 1\n  - Specific task 2\n---\n\nDetailed agent instructions and knowledge...\n```\n\n**Usage**: Users can invoke agents manually, or Claude Code selects them automatically based on task context\n\n### Skills\n\n**Location**: `skills\u002F` directory with subdirectories per skill\n**Format**: Each skill in its own directory with `SKILL.md` file\n**Auto-discovery**: All `SKILL.md` files in skill subdirectories load automatically\n\n**Example structure**:\n```\nskills\u002F\n├── api-testing\u002F\n│   ├── SKILL.md\n│   ├── scripts\u002F\n│   │   └── test-runner.py\n│   └── references\u002F\n│       └── api-spec.md\n└── database-migrations\u002F\n    ├── SKILL.md\n    └── examples\u002F\n        └── migration-template.sql\n```\n\n**SKILL.md format**:\n```markdown\n---\nname: Skill Name\ndescription: When to use this skill\nversion: 1.0.0\n---\n\nSkill instructions and guidance...\n```\n\n**Supporting files**: Skills can include scripts, references, examples, or assets in subdirectories\n\n**Usage**: Claude Code autonomously activates skills based on task context matching the description\n\n### Hooks\n\n**Location**: `hooks\u002Fhooks.json` or inline in `plugin.json`\n**Format**: JSON configuration defining event handlers\n**Registration**: Hooks register automatically when plugin enables\n\n**Example structure**:\n```\nhooks\u002F\n├── hooks.json           # Hook configuration\n└── scripts\u002F\n    ├── validate.sh      # Hook script\n    └── check-style.sh   # Hook script\n```\n\n**Configuration format**:\n```json\n{\n  \"PreToolUse\": [{\n    \"matcher\": \"Write|Edit\",\n    \"hooks\": [{\n      \"type\": \"command\",\n      \"command\": \"bash ${CLAUDE_PLUGIN_ROOT}\u002Fhooks\u002Fscripts\u002Fvalidate.sh\",\n      \"timeout\": 30\n    }]\n  }]\n}\n```\n\n**Available events**: PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification\n\n**Usage**: Hooks execute automatically in response to Claude Code events\n\n### MCP Servers\n\n**Location**: `.mcp.json` at plugin root or inline in `plugin.json`\n**Format**: JSON configuration for MCP server definitions\n**Auto-start**: Servers start automatically when plugin enables\n\n**Example format**:\n```json\n{\n  \"mcpServers\": {\n    \"server-name\": {\n      \"command\": \"node\",\n      \"args\": [\"${CLAUDE_PLUGIN_ROOT}\u002Fservers\u002Fserver.js\"],\n      \"env\": {\n        \"API_KEY\": \"${API_KEY}\"\n      }\n    }\n  }\n}\n```\n\n**Usage**: MCP servers integrate seamlessly with Claude Code's tool system\n\n## Portable Path References\n\n### ${CLAUDE_PLUGIN_ROOT}\n\nUse `${CLAUDE_PLUGIN_ROOT}` environment variable for all intra-plugin path references:\n\n```json\n{\n  \"command\": \"bash ${CLAUDE_PLUGIN_ROOT}\u002Fscripts\u002Frun.sh\"\n}\n```\n\n**Why it matters**: Plugins install in different locations depending on:\n- User installation method (marketplace, local, npm)\n- Operating system conventions\n- User preferences\n\n**Where to use it**:\n- Hook command paths\n- MCP server command arguments\n- Script execution references\n- Resource file paths\n\n**Never use**:\n- Hardcoded absolute paths (`\u002FUsers\u002Fname\u002Fplugins\u002F...`)\n- Relative paths from working directory (`.\u002Fscripts\u002F...` in commands)\n- Home directory shortcuts (`~\u002Fplugins\u002F...`)\n\n### Path Resolution Rules\n\n**In manifest JSON fields** (hooks, MCP servers):\n```json\n\"command\": \"${CLAUDE_PLUGIN_ROOT}\u002Fscripts\u002Ftool.sh\"\n```\n\n**In component files** (commands, agents, skills):\n```markdown\nReference scripts at: ${CLAUDE_PLUGIN_ROOT}\u002Fscripts\u002Fhelper.py\n```\n\n**In executed scripts**:\n```bash\n#!\u002Fbin\u002Fbash\n# ${CLAUDE_PLUGIN_ROOT} available as environment variable\nsource \"${CLAUDE_PLUGIN_ROOT}\u002Flib\u002Fcommon.sh\"\n```\n\n## File Naming Conventions\n\n### Component Files\n\n**Commands**: Use kebab-case `.md` files\n- `code-review.md` → `\u002Fcode-review`\n- `run-tests.md` → `\u002Frun-tests`\n- `api-docs.md` → `\u002Fapi-docs`\n\n**Agents**: Use kebab-case `.md` files describing role\n- `test-generator.md`\n- `code-reviewer.md`\n- `performance-analyzer.md`\n\n**Skills**: Use kebab-case directory names\n- `api-testing\u002F`\n- `database-migrations\u002F`\n- `error-handling\u002F`\n\n### Supporting Files\n\n**Scripts**: Use descriptive kebab-case names with appropriate extensions\n- `validate-input.sh`\n- `generate-report.py`\n- `process-data.js`\n\n**Documentation**: Use kebab-case markdown files\n- `api-reference.md`\n- `migration-guide.md`\n- `best-practices.md`\n\n**Configuration**: Use standard names\n- `hooks.json`\n- `.mcp.json`\n- `plugin.json`\n\n## Auto-Discovery Mechanism\n\nClaude Code automatically discovers and loads components:\n\n1. **Plugin manifest**: Reads `.claude-plugin\u002Fplugin.json` when plugin enables\n2. **Commands**: Scans `commands\u002F` directory for `.md` files\n3. **Agents**: Scans `agents\u002F` directory for `.md` files\n4. **Skills**: Scans `skills\u002F` for subdirectories containing `SKILL.md`\n5. **Hooks**: Loads configuration from `hooks\u002Fhooks.json` or manifest\n6. **MCP servers**: Loads configuration from `.mcp.json` or manifest\n\n**Discovery timing**:\n- Plugin installation: Components register with Claude Code\n- Plugin enable: Components become available for use\n- No restart required: Changes take effect on next Claude Code session\n\n**Override behavior**: Custom paths in `plugin.json` supplement (not replace) default directories\n\n## Best Practices\n\n### Organization\n\n1. **Logical grouping**: Group related components together\n   - Put test-related commands, agents, and skills together\n   - Create subdirectories in `scripts\u002F` for different purposes\n\n2. **Minimal manifest**: Keep `plugin.json` lean\n   - Only specify custom paths when necessary\n   - Rely on auto-discovery for standard layouts\n   - Use inline configuration only for simple cases\n\n3. **Documentation**: Include README files\n   - Plugin root: Overall purpose and usage\n   - Component directories: Specific guidance\n   - Script directories: Usage and requirements\n\n### Naming\n\n1. **Consistency**: Use consistent naming across components\n   - If command is `test-runner`, name related agent `test-runner-agent`\n   - Match skill directory names to their purpose\n\n2. **Clarity**: Use descriptive names that indicate purpose\n   - Good: `api-integration-testing\u002F`, `code-quality-checker.md`\n   - Avoid: `utils\u002F`, `misc.md`, `temp.sh`\n\n3. **Length**: Balance brevity with clarity\n   - Commands: 2-3 words (`review-pr`, `run-ci`)\n   - Agents: Describe role clearly (`code-reviewer`, `test-generator`)\n   - Skills: Topic-focused (`error-handling`, `api-design`)\n\n### Portability\n\n1. **Always use ${CLAUDE_PLUGIN_ROOT}**: Never hardcode paths\n2. **Test on multiple systems**: Verify on macOS, Linux, Windows\n3. **Document dependencies**: List required tools and versions\n4. **Avoid system-specific features**: Use portable bash\u002FPython constructs\n\n### Maintenance\n\n1. **Version consistently**: Update version in plugin.json for releases\n2. **Deprecate gracefully**: Mark old components clearly before removal\n3. **Document breaking changes**: Note changes affecting existing users\n4. **Test thoroughly**: Verify all components work after changes\n\n## Common Patterns\n\n### Minimal Plugin\n\nSingle command with no dependencies:\n```\nmy-plugin\u002F\n├── .claude-plugin\u002F\n│   └── plugin.json    # Just name field\n└── commands\u002F\n    └── hello.md       # Single command\n```\n\n### Full-Featured Plugin\n\nComplete plugin with all component types:\n```\nmy-plugin\u002F\n├── .claude-plugin\u002F\n│   └── plugin.json\n├── commands\u002F          # User-facing commands\n├── agents\u002F            # Specialized subagents\n├── skills\u002F            # Auto-activating skills\n├── hooks\u002F             # Event handlers\n│   ├── hooks.json\n│   └── scripts\u002F\n├── .mcp.json          # External integrations\n└── scripts\u002F           # Shared utilities\n```\n\n### Skill-Focused Plugin\n\nPlugin providing only skills:\n```\nmy-plugin\u002F\n├── .claude-plugin\u002F\n│   └── plugin.json\n└── skills\u002F\n    ├── skill-one\u002F\n    │   └── SKILL.md\n    └── skill-two\u002F\n        └── SKILL.md\n```\n\n## Troubleshooting\n\n**Component not loading**:\n- Verify file is in correct directory with correct extension\n- Check YAML frontmatter syntax (commands, agents, skills)\n- Ensure skill has `SKILL.md` (not `README.md` or other name)\n- Confirm plugin is enabled in Claude Code settings\n\n**Path resolution errors**:\n- Replace all hardcoded paths with `${CLAUDE_PLUGIN_ROOT}`\n- Verify paths are relative and start with `.\u002F` in manifest\n- Check that referenced files exist at specified paths\n- Test with `echo $CLAUDE_PLUGIN_ROOT` in hook scripts\n\n**Auto-discovery not working**:\n- Confirm directories are at plugin root (not in `.claude-plugin\u002F`)\n- Check file naming follows conventions (kebab-case, correct extensions)\n- Verify custom paths in manifest are correct\n- Restart Claude Code to reload plugin configuration\n\n**Conflicts between plugins**:\n- Use unique, descriptive component names\n- Namespace commands with plugin name if needed\n- Document potential conflicts in plugin README\n- Consider command prefixes for related functionality\n\n---\n\nFor detailed examples and advanced patterns, see files in `references\u002F` and `examples\u002F` directories.\n","# Plugin Structure for Claude Code\n\n## Overview\n\nClaude Code plugins follow a standardized directory structure with automatic component discovery. Understanding this structure enables creating well-organized, maintainable plugins that integrate seamlessly with Claude Code.\n\n**Key concepts:**\n- Conventional directory layout for automatic discovery\n- Manifest-driven configuration in `.claude-plugin\u002Fplugin.json`\n- Component-based organization (commands, agents, skills, hooks)\n- Portable path references using `${CLAUDE_PLUGIN_ROOT}`\n- Explicit vs. auto-discovered component loading\n\n## Directory Structure\n\nEvery Claude Code plugin follows this organizational pattern:\n\n```\nplugin-name\u002F\n├── .claude-plugin\u002F\n│   └── plugin.json          # Required: Plugin manifest\n├── commands\u002F                 # Slash commands (.md files)\n├── agents\u002F                   # Subagent definitions (.md files)\n├── skills\u002F                   # Agent skills (subdirectories)\n│   └── skill-name\u002F\n│       └── SKILL.md         # Required for each skill\n├── hooks\u002F\n│   └── hooks.json           # Event handler configuration\n├── .mcp.json                # MCP server definitions\n└── scripts\u002F                 # Helper scripts and utilities\n```\n\n**Critical rules:**\n\n1. **Manifest location**: The `plugin.json` manifest MUST be in `.claude-plugin\u002F` directory\n2. **Component locations**: All component directories (commands, agents, skills, hooks) MUST be at plugin root level, NOT nested inside `.claude-plugin\u002F`\n3. **Optional components**: Only create directories for components the plugin actually uses\n4. **Naming convention**: Use kebab-case for all directory and file names\n\n## Plugin Manifest (plugin.json)\n\nThe manifest defines plugin metadata and configuration. Located at `.claude-plugin\u002Fplugin.json`:\n\n### Required Fields\n\n```json\n{\n  \"name\": \"plugin-name\"\n}\n```\n\n**Name requirements:**\n- Use kebab-case format (lowercase with hyphens)\n- Must be unique across installed plugins\n- No spaces or special characters\n- Example: `code-review-assistant`, `test-runner`, `api-docs`\n\n### Recommended Metadata\n\n```json\n{\n  \"name\": \"plugin-name\",\n  \"version\": \"1.0.0\",\n  \"description\": \"Brief explanation of plugin purpose\",\n  \"author\": {\n    \"name\": \"Author Name\",\n    \"email\": \"author@example.com\",\n    \"url\": \"https:\u002F\u002Fexample.com\"\n  },\n  \"homepage\": \"https:\u002F\u002Fdocs.example.com\",\n  \"repository\": \"https:\u002F\u002Fgithub.com\u002Fuser\u002Fplugin-name\",\n  \"license\": \"MIT\",\n  \"keywords\": [\"testing\", \"automation\", \"ci-cd\"]\n}\n```\n\n**Version format**: Follow semantic versioning (MAJOR.MINOR.PATCH)\n**Keywords**: Use for plugin discovery and categorization\n\n### Component Path Configuration\n\nSpecify custom paths for components (supplements default directories):\n\n```json\n{\n  \"name\": \"plugin-name\",\n  \"commands\": \".\u002Fcustom-commands\",\n  \"agents\": [\".\u002Fagents\", \".\u002Fspecialized-agents\"],\n  \"hooks\": \".\u002Fconfig\u002Fhooks.json\",\n  \"mcpServers\": \".\u002F.mcp.json\"\n}\n```\n\n**Important**: Custom paths supplement defaults—they don't replace them. Components in both default directories and custom paths will load.\n\n**Path rules:**\n- Must be relative to plugin root\n- Must start with `.\u002F`\n- Cannot use absolute paths\n- Support arrays for multiple locations\n\n## Component Organization\n\n### Commands\n\n**Location**: `commands\u002F` directory\n**Format**: Markdown files with YAML frontmatter\n**Auto-discovery**: All `.md` files in `commands\u002F` load automatically\n\n**Example structure**:\n```\ncommands\u002F\n├── review.md        # \u002Freview command\n├── test.md          # \u002Ftest command\n└── deploy.md        # \u002Fdeploy command\n```\n\n**File format**:\n```markdown\n---\nname: command-name\ndescription: Command description\n---\n\nCommand implementation instructions...\n```\n\n**Usage**: Commands integrate as native slash commands in Claude Code\n\n### Agents\n\n**Location**: `agents\u002F` directory\n**Format**: Markdown files with YAML frontmatter\n**Auto-discovery**: All `.md` files in `agents\u002F` load automatically\n\n**Example structure**:\n```\nagents\u002F\n├── code-reviewer.md\n├── test-generator.md\n└── refactorer.md\n```\n\n**File format**:\n```markdown\n---\ndescription: Agent role and expertise\ncapabilities:\n  - Specific task 1\n  - Specific task 2\n---\n\nDetailed agent instructions and knowledge...\n```\n\n**Usage**: Users can invoke agents manually, or Claude Code selects them automatically based on task context\n\n### Skills\n\n**Location**: `skills\u002F` directory with subdirectories per skill\n**Format**: Each skill in its own directory with `SKILL.md` file\n**Auto-discovery**: All `SKILL.md` files in skill subdirectories load automatically\n\n**Example structure**:\n```\nskills\u002F\n├── api-testing\u002F\n│   ├── SKILL.md\n│   ├── scripts\u002F\n│   │   └── test-runner.py\n│   └── references\u002F\n│       └── api-spec.md\n└── database-migrations\u002F\n    ├── SKILL.md\n    └── examples\u002F\n        └── migration-template.sql\n```\n\n**SKILL.md format**:\n```markdown\n---\nname: Skill Name\ndescription: When to use this skill\nversion: 1.0.0\n---\n\nSkill instructions and guidance...\n```\n\n**Supporting files**: Skills can include scripts, references, examples, or assets in subdirectories\n\n**Usage**: Claude Code autonomously activates skills based on task context matching the description\n\n### Hooks\n\n**Location**: `hooks\u002Fhooks.json` or inline in `plugin.json`\n**Format**: JSON configuration defining event handlers\n**Registration**: Hooks register automatically when plugin enables\n\n**Example structure**:\n```\nhooks\u002F\n├── hooks.json           # Hook configuration\n└── scripts\u002F\n    ├── validate.sh      # Hook script\n    └── check-style.sh   # Hook script\n```\n\n**Configuration format**:\n```json\n{\n  \"PreToolUse\": [{\n    \"matcher\": \"Write|Edit\",\n    \"hooks\": [{\n      \"type\": \"command\",\n      \"command\": \"bash ${CLAUDE_PLUGIN_ROOT}\u002Fhooks\u002Fscripts\u002Fvalidate.sh\",\n      \"timeout\": 30\n    }]\n  }]\n}\n```\n\n**Available events**: PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification\n\n**Usage**: Hooks execute automatically in response to Claude Code events\n\n### MCP Servers\n\n**Location**: `.mcp.json` at plugin root or inline in `plugin.json`\n**Format**: JSON configuration for MCP server definitions\n**Auto-start**: Servers start automatically when plugin enables\n\n**Example format**:\n```json\n{\n  \"mcpServers\": {\n    \"server-name\": {\n      \"command\": \"node\",\n      \"args\": [\"${CLAUDE_PLUGIN_ROOT}\u002Fservers\u002Fserver.js\"],\n      \"env\": {\n        \"API_KEY\": \"${API_KEY}\"\n      }\n    }\n  }\n}\n```\n\n**Usage**: MCP servers integrate seamlessly with Claude Code's tool system\n\n## Portable Path References\n\n### ${CLAUDE_PLUGIN_ROOT}\n\nUse `${CLAUDE_PLUGIN_ROOT}` environment variable for all intra-plugin path references:\n\n```json\n{\n  \"command\": \"bash ${CLAUDE_PLUGIN_ROOT}\u002Fscripts\u002Frun.sh\"\n}\n```\n\n**Why it matters**: Plugins install in different locations depending on:\n- User installation method (marketplace, local, npm)\n- Operating system conventions\n- User preferences\n\n**Where to use it**:\n- Hook command paths\n- MCP server command arguments\n- Script execution references\n- Resource file paths\n\n**Never use**:\n- Hardcoded absolute paths (`\u002FUsers\u002Fname\u002Fplugins\u002F...`)\n- Relative paths from working directory (`.\u002Fscripts\u002F...` in commands)\n- Home directory shortcuts (`~\u002Fplugins\u002F...`)\n\n### Path Resolution Rules\n\n**In manifest JSON fields** (hooks, MCP servers):\n```json\n\"command\": \"${CLAUDE_PLUGIN_ROOT}\u002Fscripts\u002Ftool.sh\"\n```\n\n**In component files** (commands, agents, skills):\n```markdown\nReference scripts at: ${CLAUDE_PLUGIN_ROOT}\u002Fscripts\u002Fhelper.py\n```\n\n**In executed scripts**:\n```bash\n#!\u002Fbin\u002Fbash\n# ${CLAUDE_PLUGIN_ROOT} available as environment variable\nsource \"${CLAUDE_PLUGIN_ROOT}\u002Flib\u002Fcommon.sh\"\n```\n\n## File Naming Conventions\n\n### Component Files\n\n**Commands**: Use kebab-case `.md` files\n- `code-review.md` → `\u002Fcode-review`\n- `run-tests.md` → `\u002Frun-tests`\n- `api-docs.md` → `\u002Fapi-docs`\n\n**Agents**: Use kebab-case `.md` files describing role\n- `test-generator.md`\n- `code-reviewer.md`\n- `performance-analyzer.md`\n\n**Skills**: Use kebab-case directory names\n- `api-testing\u002F`\n- `database-migrations\u002F`\n- `error-handling\u002F`\n\n### Supporting Files\n\n**Scripts**: Use descriptive kebab-case names with appropriate extensions\n- `validate-input.sh`\n- `generate-report.py`\n- `process-data.js`\n\n**Documentation**: Use kebab-case markdown files\n- `api-reference.md`\n- `migration-guide.md`\n- `best-practices.md`\n\n**Configuration**: Use standard names\n- `hooks.json`\n- `.mcp.json`\n- `plugin.json`\n\n## Auto-Discovery Mechanism\n\nClaude Code automatically discovers and loads components:\n\n1. **Plugin manifest**: Reads `.claude-plugin\u002Fplugin.json` when plugin enables\n2. **Commands**: Scans `commands\u002F` directory for `.md` files\n3. **Agents**: Scans `agents\u002F` directory for `.md` files\n4. **Skills**: Scans `skills\u002F` for subdirectories containing `SKILL.md`\n5. **Hooks**: Loads configuration from `hooks\u002Fhooks.json` or manifest\n6. **MCP servers**: Loads configuration from `.mcp.json` or manifest\n\n**Discovery timing**:\n- Plugin installation: Components register with Claude Code\n- Plugin enable: Components become available for use\n- No restart required: Changes take effect on next Claude Code session\n\n**Override behavior**: Custom paths in `plugin.json` supplement (not replace) default directories\n\n## Best Practices\n\n### Organization\n\n1. **Logical grouping**: Group related components together\n   - Put test-related commands, agents, and skills together\n   - Create subdirectories in `scripts\u002F` for different purposes\n\n2. **Minimal manifest**: Keep `plugin.json` lean\n   - Only specify custom paths when necessary\n   - Rely on auto-discovery for standard layouts\n   - Use inline configuration only for simple cases\n\n3. **Documentation**: Include README files\n   - Plugin root: Overall purpose and usage\n   - Component directories: Specific guidance\n   - Script directories: Usage and requirements\n\n### Naming\n\n1. **Consistency**: Use consistent naming across components\n   - If command is `test-runner`, name related agent `test-runner-agent`\n   - Match skill directory names to their purpose\n\n2. **Clarity**: Use descriptive names that indicate purpose\n   - Good: `api-integration-testing\u002F`, `code-quality-checker.md`\n   - Avoid: `utils\u002F`, `misc.md`, `temp.sh`\n\n3. **Length**: Balance brevity with clarity\n   - Commands: 2-3 words (`review-pr`, `run-ci`)\n   - Agents: Describe role clearly (`code-reviewer`, `test-generator`)\n   - Skills: Topic-focused (`error-handling`, `api-design`)\n\n### Portability\n\n1. **Always use ${CLAUDE_PLUGIN_ROOT}**: Never hardcode paths\n2. **Test on multiple systems**: Verify on macOS, Linux, Windows\n3. **Document dependencies**: List required tools and versions\n4. **Avoid system-specific features**: Use portable bash\u002FPython constructs\n\n### Maintenance\n\n1. **Version consistently**: Update version in plugin.json for releases\n2. **Deprecate gracefully**: Mark old components clearly before removal\n3. **Document breaking changes**: Note changes affecting existing users\n4. **Test thoroughly**: Verify all components work after changes\n\n## Common Patterns\n\n### Minimal Plugin\n\nSingle command with no dependencies:\n```\nmy-plugin\u002F\n├── .claude-plugin\u002F\n│   └── plugin.json    # Just name field\n└── commands\u002F\n    └── hello.md       # Single command\n```\n\n### Full-Featured Plugin\n\nComplete plugin with all component types:\n```\nmy-plugin\u002F\n├── .claude-plugin\u002F\n│   └── plugin.json\n├── commands\u002F          # User-facing commands\n├── agents\u002F            # Specialized subagents\n├── skills\u002F            # Auto-activating skills\n├── hooks\u002F             # Event handlers\n│   ├── hooks.json\n│   └── scripts\u002F\n├── .mcp.json          # External integrations\n└── scripts\u002F           # Shared utilities\n```\n\n### Skill-Focused Plugin\n\nPlugin providing only skills:\n```\nmy-plugin\u002F\n├── .claude-plugin\u002F\n│   └── plugin.json\n└── skills\u002F\n    ├── skill-one\u002F\n    │   └── SKILL.md\n    └── skill-two\u002F\n        └── SKILL.md\n```\n\n## Troubleshooting\n\n**Component not loading**:\n- Verify file is in correct directory with correct extension\n- Check YAML frontmatter syntax (commands, agents, skills)\n- Ensure skill has `SKILL.md` (not `README.md` or other name)\n- Confirm plugin is enabled in Claude Code settings\n\n**Path resolution errors**:\n- Replace all hardcoded paths with `${CLAUDE_PLUGIN_ROOT}`\n- Verify paths are relative and start with `.\u002F` in manifest\n- Check that referenced files exist at specified paths\n- Test with `echo $CLAUDE_PLUGIN_ROOT` in hook scripts\n\n**Auto-discovery not working**:\n- Confirm directories are at plugin root (not in `.claude-plugin\u002F`)\n- Check file naming follows conventions (kebab-case, correct extensions)\n- Verify custom paths in manifest are correct\n- Restart Claude Code to reload plugin configuration\n\n**Conflicts between plugins**:\n- Use unique, descriptive component names\n- Namespace commands with plugin name if needed\n- Document potential conflicts in plugin README\n- Consider command prefixes for related functionality\n\n---\n\nFor detailed examples and advanced patterns, see files in `references\u002F` and `examples\u002F` directories.\n",{"name":5,"version":49,"description":7},"0.1.0","main","dceb15d50832e6adf380bedc26dde03d251324b9","plugins\u002Fplugin-dev\u002Fskills\u002Fplugin-structure",4865,"https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-plugins-official","https:\u002F\u002Fcode.claude.com\u002Fdocs\u002Fen\u002Fplugins","https:\u002F\u002Fgithub.com\u002Fanthropics","https:\u002F\u002Fanthropic.com","2026-11-11 08:12:44",{"source":8,"skillName":5,"commands":60,"prompt":70,"zipAvailable":71},[61,64,67],{"tool":62,"command":63},"npx","npx skills add anthropics\u002Fclaude-plugins-official --skill plugin-structure",{"tool":65,"command":66},"bunx","bunx skills add anthropics\u002Fclaude-plugins-official --skill plugin-structure",{"tool":68,"command":69},"pnpm","pnpm dlx skills add anthropics\u002Fclaude-plugins-official --skill plugin-structure","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-plugins-official\u002Fblob\u002Fmain\u002Fplugins\u002Fplugin-dev\u002Fskills\u002Fplugin-structure\u002FSKILL.md",true,[73,79,83,87,91,95],{"path":74,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":77,"sourceHtmlUrl":78},"examples\u002Fadvanced-plugin.md","REFERENCE","参考文档",18746,"https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-plugins-official\u002Fblob\u002Fmain\u002Fplugins\u002Fplugin-dev\u002Fskills\u002Fplugin-structure\u002Fexamples\u002Fadvanced-plugin.md",{"path":80,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":81,"sourceHtmlUrl":82},"examples\u002Fminimal-plugin.md",1731,"https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-plugins-official\u002Fblob\u002Fmain\u002Fplugins\u002Fplugin-dev\u002Fskills\u002Fplugin-structure\u002Fexamples\u002Fminimal-plugin.md",{"path":84,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":85,"sourceHtmlUrl":86},"examples\u002Fstandard-plugin.md",13310,"https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-plugins-official\u002Fblob\u002Fmain\u002Fplugins\u002Fplugin-dev\u002Fskills\u002Fplugin-structure\u002Fexamples\u002Fstandard-plugin.md",{"path":88,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":89,"sourceHtmlUrl":90},"README.md",3210,"https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-plugins-official\u002Fblob\u002Fmain\u002Fplugins\u002Fplugin-dev\u002Fskills\u002Fplugin-structure\u002FREADME.md",{"path":92,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":93,"sourceHtmlUrl":94},"references\u002Fcomponent-patterns.md",12086,"https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-plugins-official\u002Fblob\u002Fmain\u002Fplugins\u002Fplugin-dev\u002Fskills\u002Fplugin-structure\u002Freferences\u002Fcomponent-patterns.md",{"path":96,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":97,"sourceHtmlUrl":98},"references\u002Fmanifest-reference.md",12061,"https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-plugins-official\u002Fblob\u002Fmain\u002Fplugins\u002Fplugin-dev\u002Fskills\u002Fplugin-structure\u002Freferences\u002Fmanifest-reference.md",[100,127,152,175,200,219],{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":104,"sourceHtmlUrl":105,"categories":106,"keywords":108,"publishedAt":44},"01M718BVSPNAK6S5NZCYFDBG6E","skill-creator","Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.","https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-plugins-official\u002Fblob\u002Fmain\u002Fplugins\u002Fskill-creator\u002Fskills\u002Fskill-creator\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-plugins-official\u002Fblob\u002Fmain\u002Fplugins\u002Fskill-creator\u002Fskills\u002Fskill-creator\u002FSKILL.md",[107],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[109,110,111,112,113,114,37,115,32,116,117,118,119,120,121,122,123,124,125,126],"skill creator","creator","performance","improve","run evals","new","analysis","optimize","variance analysis","run","edit","benchmark","existing skill","evals","for","accuracy","scratch","use",{"skillNo":128,"name":129,"nameZh":6,"description":130,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":131,"categories":132,"keywords":138,"publishedAt":44},"01M718BSVAWJRFN6MRCZZ0QX4X","session-report","Generate an explorable HTML report of Claude Code session usage (tokens, cache, subagents, skills, expensive prompts) from ~\u002F.claude\u002Fprojects transcripts.","https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-plugins-official\u002Fblob\u002Fmain\u002Fplugins\u002Fsession-report\u002Fskills\u002Fsession-report\u002FSKILL.md",[133],{"categoryNo":134,"categoryName":135,"taxonomyType":136,"taxonomyTypeDesc":137},"01JBSEEDCAT000000000000034","行政与办公人员","PROFESSION","适用职业",[139,140,141,142,143,144,145,146,147,148,149,35,150,151],"session","report","session report","projects","usage","generate","tokens","html report","transcripts","prompts","cache","html","subagents",{"skillNo":153,"name":154,"nameZh":6,"description":155,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":156,"categories":157,"keywords":161,"publishedAt":44},"01M718BPKHVD214FAS1T4E5XCE","receipts","Generate a personal Claude Code usage & impact report (\"receipts\") from this machine's local session transcripts — for justifying Claude Code usage\u002Fspend to a manager, self-review, or \"what have I been using this for\" check-ins. Mines ~\u002F.claude\u002Fprojects locally (no extra API calls beyond one final write-up), cross-references local git history, and writes a markdown report plus a self-contained HTML receipt to your home directory. Use when the user asks for \"receipts\", an \"impact report\", \"usage report\", wants to \"show my Claude Code activity\", \"prove the value of Claude Code\", or runs `\u002Freceipts`.","https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-plugins-official\u002Fblob\u002Fmain\u002Fplugins\u002Freceipts\u002Fskills\u002Freceipts\u002FSKILL.md",[158],{"categoryNo":159,"categoryName":160,"taxonomyType":136,"taxonomyTypeDesc":137},"01JBSEEDCAT000000000000030","开发工程师",[154,142,162,40,163,164,37,35,165,166,167,168,144,169,28,170,171,172,173,174],"show","local","impact","api","review","self","references","markdown","write","git","activity","my","manager",{"skillNo":176,"name":177,"nameZh":6,"description":178,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":179,"categories":180,"keywords":181,"publishedAt":44},"01M718BJMX0T4691FJQ62GYY5C","project-artifact","Generate and publish a project status artifact — an opinionated, tabbed status page for a project too big for one update (overview & success criteria, the workstream sequence, next steps, plus background, plan, risks & open questions, and decisions\u002FFAQ when they earn a tab) — published with the built-in Artifact tool to a default-private claude.ai page the user can share with teammates. Use when a piece of work spans several workstreams and you want a shareable overview kept current. Each artifact is backed by a small per-project config in the plugin data dir, so refreshing it re-gathers live state, redeploys the same URL, and reports only the delta. For software projects whose workstreams are PRs, also read swe.md (the X.Y PR-numbering convention; pulling PR state with gh\u002Fgit; a per-PR detail block). Needs the built-in Artifact tool (claude.ai login). Not for single-PR changes or public docs.","https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-plugins-official\u002Fblob\u002Fmain\u002Fplugins\u002Fproject-artifact\u002Fskills\u002Fproject-artifact\u002FSKILL.md",[],[182,183,184,185,142,186,187,188,189,190,191,37,192,193,194,195,196,197,198,199],"project","artifact","project artifact","project status","re","default","next steps","open","only","SWE","URL","you","reports","publish","work","plan","status page","next",{"skillNo":201,"name":202,"nameZh":6,"description":203,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":204,"categories":205,"keywords":207,"publishedAt":44},"01M718BF1TTFP5CM0S5HBW64FJ","skill-development","This skill should be used when the user wants to \"create a skill\", \"add a skill to plugin\", \"write a new skill\", \"improve skill description\", \"organize skill content\", or needs guidance on skill structure, progressive disclosure, or skill development best practices for Claude Code plugins.","https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-plugins-official\u002Fblob\u002Fmain\u002Fplugins\u002Fplugin-dev\u002Fskills\u002Fskill-development\u002FSKILL.md",[206],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[208,209,210,112,114,211,37,35,32,26,170,212,213,214,215,123,216,217,218,25],"development","skill development","skill to plugin","improve skill","organize","new skill","claude code plugins","add","progressive","best practices","progressive disclosure",{"skillNo":220,"name":221,"nameZh":6,"description":222,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":223,"categories":224,"keywords":226,"publishedAt":44},"01M718B96YP8C46R8KW4KYYMPZ","plugin-settings","This skill should be used when the user asks about \"plugin settings\", \"store plugin configuration\", \"user-configurable plugin\", \".local.md files\", \"plugin state files\", \"read YAML frontmatter\", \"per-project plugin settings\", or wants to make plugin behavior configurable. Documents the .claude\u002Fplugin-name.local.md pattern for storing plugin-specific configuration with YAML frontmatter and markdown content.","https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-plugins-official\u002Fblob\u002Fmain\u002Fplugins\u002Fplugin-dev\u002Fskills\u002Fplugin-settings\u002FSKILL.md",[225],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[227,25,228,182,163,229,230,37,231,169,232,233,234,235,123,236,237,238,239,240],"Plugin Settings","settings","files","documents","markdown content","read","pattern","frontmatter","make","store","with","state","make plugin","name"]