diff --git a/plugins/plugin-dev/skills/plugin-structure/SKILL.md b/plugins/plugin-dev/skills/plugin-structure/SKILL.md index d9c0cd2..495caf4 100644 --- a/plugins/plugin-dev/skills/plugin-structure/SKILL.md +++ b/plugins/plugin-dev/skills/plugin-structure/SKILL.md @@ -224,14 +224,16 @@ hooks/ ```json { - "PreToolUse": [{ - "matcher": "Write|Edit", - "hooks": [{ - "type": "command", - "command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/validate.sh", - "timeout": 30 + "hooks": { + "PreToolUse": [{ + "matcher": "Write|Edit", + "hooks": [{ + "type": "command", + "command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/validate.sh", + "timeout": 30 + }] }] - }] + } } ``` diff --git a/plugins/plugin-dev/skills/plugin-structure/examples/advanced-plugin.md b/plugins/plugin-dev/skills/plugin-structure/examples/advanced-plugin.md index 637b5a9..2b92e74 100644 --- a/plugins/plugin-dev/skills/plugin-structure/examples/advanced-plugin.md +++ b/plugins/plugin-dev/skills/plugin-structure/examples/advanced-plugin.md @@ -629,69 +629,71 @@ bash ${CLAUDE_PLUGIN_ROOT}/skills/kubernetes-ops/scripts/validate-manifest.sh de ```json { - "PreToolUse": [ - { - "matcher": "Write|Edit", - "hooks": [ - { - "type": "command", - "command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/security/scan-secrets.sh", - "timeout": 30 - } - ] - }, - { - "matcher": "Bash", - "hooks": [ - { - "type": "prompt", - "prompt": "Evaluate if this bash command is safe for production environment. Check for destructive operations, missing safeguards, and potential security issues. Commands should be idempotent and reversible.", - "timeout": 20 - } - ] - } - ], - "PostToolUse": [ - { - "matcher": "Bash", - "hooks": [ - { - "type": "command", - "command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/workflow/update-status.sh", - "timeout": 15 - } - ] - } - ], - "Stop": [ - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/quality/check-config.sh", - "timeout": 45 - }, - { - "type": "command", - "command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/workflow/notify-team.sh", - "timeout": 30 - } - ] - } - ], - "SessionStart": [ - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/security/validate-permissions.sh", - "timeout": 20 - } - ] - } - ] + "hooks": { + "PreToolUse": [ + { + "matcher": "Write|Edit", + "hooks": [ + { + "type": "command", + "command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/security/scan-secrets.sh", + "timeout": 30 + } + ] + }, + { + "matcher": "Bash", + "hooks": [ + { + "type": "prompt", + "prompt": "Evaluate if this bash command is safe for production environment. Check for destructive operations, missing safeguards, and potential security issues. Commands should be idempotent and reversible.", + "timeout": 20 + } + ] + } + ], + "PostToolUse": [ + { + "matcher": "Bash", + "hooks": [ + { + "type": "command", + "command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/workflow/update-status.sh", + "timeout": 15 + } + ] + } + ], + "Stop": [ + { + "matcher": ".*", + "hooks": [ + { + "type": "command", + "command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/quality/check-config.sh", + "timeout": 45 + }, + { + "type": "command", + "command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/workflow/notify-team.sh", + "timeout": 30 + } + ] + } + ], + "SessionStart": [ + { + "matcher": ".*", + "hooks": [ + { + "type": "command", + "command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/security/validate-permissions.sh", + "timeout": 20 + } + ] + } + ] + } } ``` diff --git a/plugins/plugin-dev/skills/plugin-structure/examples/standard-plugin.md b/plugins/plugin-dev/skills/plugin-structure/examples/standard-plugin.md index 596a0fa..beef661 100644 --- a/plugins/plugin-dev/skills/plugin-structure/examples/standard-plugin.md +++ b/plugins/plugin-dev/skills/plugin-structure/examples/standard-plugin.md @@ -426,30 +426,32 @@ See language-specific guides for: ```json { - "PreToolUse": [ - { - "matcher": "Write|Edit", - "hooks": [ - { - "type": "prompt", - "prompt": "Before modifying code, verify it meets our coding standards from the code-standards skill. Check formatting, naming conventions, and documentation. If standards aren't met, suggest improvements.", - "timeout": 30 - } - ] - } - ], - "Stop": [ - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/validate-commit.sh", - "timeout": 45 - } - ] - } - ] + "hooks": { + "PreToolUse": [ + { + "matcher": "Write|Edit", + "hooks": [ + { + "type": "prompt", + "prompt": "Before modifying code, verify it meets our coding standards from the code-standards skill. Check formatting, naming conventions, and documentation. If standards aren't met, suggest improvements.", + "timeout": 30 + } + ] + } + ], + "Stop": [ + { + "matcher": ".*", + "hooks": [ + { + "type": "command", + "command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/validate-commit.sh", + "timeout": 45 + } + ] + } + ] + } } ``` diff --git a/plugins/plugin-dev/skills/plugin-structure/references/component-patterns.md b/plugins/plugin-dev/skills/plugin-structure/references/component-patterns.md index a58a7b4..ba5b8a9 100644 --- a/plugins/plugin-dev/skills/plugin-structure/references/component-patterns.md +++ b/plugins/plugin-dev/skills/plugin-structure/references/component-patterns.md @@ -306,10 +306,12 @@ hooks/ **hooks.json**: ```json { - "PreToolUse": [...], - "PostToolUse": [...], - "Stop": [...], - "SessionStart": [...] + "hooks": { + "PreToolUse": [...], + "PostToolUse": [...], + "Stop": [...], + "SessionStart": [...] + } } ```