Skip to content

[Docs]: Incorrect hooks.json format in plugin-structure skill examples #90

@sjnims

Description

@sjnims

Which documentation needs improvement?

Skill documentation

Specific Location

  • plugins/plugin-dev/skills/plugin-structure/SKILL.md (lines 225-239)
  • plugins/plugin-dev/skills/plugin-structure/examples/standard-plugin.md (lines 427-451)
  • plugins/plugin-dev/skills/plugin-structure/examples/advanced-plugin.md (lines 630-681)
  • plugins/plugin-dev/skills/plugin-structure/references/component-patterns.md (lines 307-322)

What's unclear or missing?

The hooks.json examples in the plugin-structure skill show an incorrect format that is missing the required "hooks" wrapper object.

Currently shown (incorrect):

{
  "PreToolUse": [{
    "matcher": "Write|Edit",
    "hooks": [{
      "type": "command",
      "command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/validate.sh",
      "timeout": 30
    }]
  }]
}

Correct format (per hook-development skill, CLAUDE.md, and official docs):

{
  "hooks": {
    "PreToolUse": [{
      "matcher": "Write|Edit",
      "hooks": [{
        "type": "command",
        "command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/validate.sh",
        "timeout": 30
      }]
    }]
  }
}

Evidence from hook-development skill (SKILL.md:66-71, 124, 431):

"For plugin hooks in hooks/hooks.json, use wrapper format"
"Important: For plugin hooks.json, wrap these in {"hooks": {...}}"
"Note: Plugin hooks use the {"hooks": {...}} wrapper format"

Note: references/manifest-reference.md (line 276) correctly shows the wrapper format, creating an inconsistency within the skill itself.

Suggested Improvement

Update all hooks.json examples in the affected files to use the correct wrapper format:

  1. SKILL.md - Update the Hooks section configuration example
  2. examples/standard-plugin.md - Update hooks/hooks.json content
  3. examples/advanced-plugin.md - Update hooks/hooks.json content
  4. references/component-patterns.md - Update hook configuration examples

Type of issue

  • Incorrect information

Additional Context

This was discovered during a comprehensive skill review against:

  • The skill-development skill best practices
  • Official Claude Code documentation (code.claude.com/docs/en/skills.md and plugins-reference.md)
  • The hook-development skill (authoritative source for hooks format)

Users copying the current examples will create plugins with broken hooks that fail silently or error on load.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions