plugin-packager-hooks
Handle hook scripts and paths for plugin packaging
When & Why to Use This Skill
This Claude skill streamlines the plugin development lifecycle by automating the management of hook scripts and dynamic path resolutions. It ensures that plugin packages are portable and robust by providing standardized methods for script validation, permission handling, and modular hook configuration, making it an essential utility for developers building complex Claude agent extensions.
Use Cases
- Automating script permissions: Quickly making shell and Python scripts executable within the plugin directory to ensure seamless integration during the packaging process.
- Dynamic path resolution: Implementing portable file paths using environment variables like CLAUDE_PLUGIN_ROOT to ensure the plugin functions correctly across different deployment environments.
- Modular hook configuration: Organizing and merging multiple hook definitions from different functional modules (e.g., security, language-specific tools) into a unified plugin manifest.
- Pre-packaging validation: Scanning and validating script permissions and file types within the hooks directory to prevent runtime failures in the agent environment.
| name | plugin-packager-hooks |
|---|---|
| description | Handle hook scripts and paths for plugin packaging |
Hook Script Handling
Make Executable
chmod +x hooks/golang/scripts/*.sh
chmod +x hooks/security/scripts/*.py
Dynamic Path Resolution
Use ${CLAUDE_PLUGIN_ROOT} for portable paths:
{
"script": "${CLAUDE_PLUGIN_ROOT}/hooks/golang/scripts/go-fmt.sh"
}
Validate All Scripts
find hooks -type f \( -name "*.sh" -o -name "*.py" \) ! -perm -u+x
Multiple hooks.json Handling
Option 1: Array Reference (Recommended)
{
"hooks": [
"./hooks/golang/hooks.json",
"./hooks/security/hooks.json"
]
}
Option 2: Inline Merged
Combine all hook definitions into single inline object in plugin.json.