一键导入
hooks-automation
Automated coordination and formatting using standard Git hooks and Claude Code's native tool hooks (PreToolUse/PostToolUse).
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Automated coordination and formatting using standard Git hooks and Claude Code's native tool hooks (PreToolUse/PostToolUse).
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Develop and contribute to the Plexium codebase — package structure, build commands, test patterns, architecture layers
Operate within a Plexium-powered repository — read wiki before work, update wiki after changes, follow ownership rules, use retrieval
Use when the user wants to install or verify the Plexium CLI from inside Codex.
Use when the user wants to initialize Plexium, set up the current repository for Codex, verify readiness, or connect Plexium's MCP server in Codex.
Use when the user wants to install Plexium, set up the current repo for Claude Code, verify readiness, or query the Plexium wiki from Claude Code.
Use when the user wants to search or retrieve information from the Plexium wiki in the current repository.
| name | Hooks Automation |
| version | 2.0.0 |
| description | Automated coordination and formatting using standard Git hooks and Claude Code's native tool hooks (PreToolUse/PostToolUse). |
| tags | ["hooks","automation","git","claude-code"] |
Automate development workflows, enforce quality, and manage state using standard Git hooks and Claude Code's native hooks configuration.
Git hooks are standard scripts executed by Git before or after events like commit, push, and merge.
Create a script at .git/hooks/pre-commit (make sure to chmod +x):
#!/bin/bash
# Run linting and tests before allowing a commit
echo "Running pre-commit checks..."
# Run linter
npm run lint
if [ $? -ne 0 ]; then
echo "Linting failed. Please fix errors before committing."
exit 1
fi
# Run tests
npm test
if [ $? -ne 0 ]; then
echo "Tests failed. Please fix tests before committing."
exit 1
fi
echo "All checks passed!"
exit 0
Note: For easier management across teams, use tools like Husky or Lefthook instead of manual .git/hooks scripts.
Claude Code supports powerful event-driven hooks defined in .claude/settings.json or ~/.claude/hooks.json. These hooks can run bash commands or LLM prompts before/after tools are used.
Automatically format files after Claude edits them:
{
"hooks": {
"PostToolUse": [
{
"matcher": "Write|Edit|NotebookEdit",
"hooks": [
{
"type": "command",
"command": "npx prettier --write \"\\${tool.params.file_path}\"",
"continueOnError": true
}
]
}
]
}
}
Prevent Claude from running dangerous shell commands:
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "prompt",
"prompt": "Command: $TOOL_INPUT.command. Check for destructive operations (rm -rf /, dd, mkfs). Return 'approve' or 'deny' with explanation.",
"timeout": 15
}
]
}
]
}
}
continueOnError for non-critical post-operation hooks (like auto-formatting) so the agent loop isn't broken if the hook fails..lefthook.yml) into version control so the entire team uses the same automation.