Files
daniel e5177fbe27 🤖 Complete Hook System Overhaul + AI Specification
✅ Fixed ALL remaining hooks (20 total):
- Updated post-tool/ and pre-tool/ hooks to Claude Code array format
- Fixed git-add-changes, format-javascript-files, format-python-files, run-tests-after-changes
- Fixed backup-before-edit, notify-before-bash

🧠 Added AI Hook Specification System:
- CLAUDE_HOOK_SPECIFICATION.md - Complete hook format guide for AI
- AI_HOOK_TEMPLATE.json - Structured template with examples for AI parsing
- HOOK_PATTERNS_COMPRESSED.json - Compressed patterns for rapid AI reference

📊 Technical Improvements:
- All 20 hooks now use proper array/matcher structure
- Regenerated components.json with corrected hook metadata
- Added comprehensive validation rules and anti-patterns
- Included environment variables and cross-platform compatibility guides

🎯 AI Context Enhancement:
- Future Claude Code sessions can reference these files for correct hook generation
- Compressed format optimizes AI parsing while maintaining completeness
- Common patterns and validation rules prevent structure errors

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-14 08:14:04 -04:00

25 lines
831 B
JSON

{
"description": "Automatically stage changes in git after file modifications for easier commit workflow. This hook runs 'git add' on any file that Claude edits or writes, automatically staging changes for the next commit. Includes error suppression so it won't fail in non-git repositories. Helps streamline the development workflow by preparing files for commit.",
"hooks": {
"PostToolUse": [
{
"matcher": "Edit",
"hooks": [
{
"type": "command",
"command": "git add \"$CLAUDE_TOOL_FILE_PATH\" 2>/dev/null || true"
}
]
},
{
"matcher": "Write",
"hooks": [
{
"type": "command",
"command": "git add \"$CLAUDE_TOOL_FILE_PATH\" 2>/dev/null || true"
}
]
}
]
}
}