Guest User

Untitled

a guest
Sep 29th, 2025
11
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.59 KB | None | 0 0
  1. {
  2. "hooks": {
  3. "SessionStart": [
  4. {
  5. "matcher": "startup|resume",
  6. "hooks": [
  7. {
  8. "type": "command",
  9. "command": "python3 -c \"import json, sys, os; agents_content = open('AGENTS.md', 'r').read() if os.path.exists('AGENTS.md') else ''; output = {'hookSpecificOutput': {'hookEventName': 'SessionStart', 'additionalContext': agents_content}}; print(json.dumps(output))\"",
  10. "timeout": 30
  11. }
  12. ]
  13. }
  14. ],
  15. "UserPromptSubmit": [
  16. {
  17. "hooks": [
  18. {
  19. "type": "command",
  20. "command": "echo \"🎯 ALWAYS WORKSβ„’ REMINDER\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\nπŸ“Œ Core Philosophy:\n β€’ 'Should work' β‰  'Does work'\n β€’ Pattern matching isn't enough\n β€’ Untested code is just a guess, not a solution\n\nβœ… The 30-Second Reality Check - Must answer YES to ALL:\n β–‘ Did I run/build the code?\n β–‘ Did I trigger the exact feature I changed?\n β–‘ Did I see the expected result with my own eyes?\n β–‘ Did I check for error messages?\n β–‘ Would I bet $100 this works?\n\n🚫 NEVER say:\n ❌ 'This should work now'\n ❌ 'I've fixed the issue' (especially 2nd+ time)\n ❌ 'Try it now' (without trying it myself)\n ❌ 'The logic is correct so...'\n\nπŸ” Specific Test Requirements:\n β€’ UI Changes β†’ Actually click the button/link/form\n β€’ API Changes β†’ Make the actual API call\n β€’ Data Changes β†’ Query the database\n β€’ Logic Changes β†’ Run the specific scenario\n β€’ Config Changes β†’ Restart and verify it loads\n\n😳 The Embarrassment Test:\n 'If the user records trying this and it fails,\n will I feel embarrassed to see their face?'\n\n⏰ Time Reality:\n β€’ Time saved skipping tests: 30 seconds\n β€’ Time wasted when it doesn't work: 30 minutes\n β€’ User trust lost: Immeasurable\n\nπŸ’” Remember: A user describing a bug for the third time\n isn't thinking 'this AI is trying hard' - they're\n thinking 'why am I wasting time with this tool?'\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\"",
  21. "timeout": 5
  22. }
  23. ]
  24. }
  25. ],
  26. "PreToolUse": [
  27. {
  28. "matcher": "Edit|Write|Bash",
  29. "hooks": [
  30. {
  31. "type": "command",
  32. "command": "# Run pre-tool-use script if it exists\nif [ -f \"$CLAUDE_PROJECT_DIR/.claude/hooks/pre-tool-use.js\" ]; then\n node \"$CLAUDE_PROJECT_DIR/.claude/hooks/pre-tool-use.js\" 2>/dev/null || echo \"⚠️ Pre-tool-use script error (continuing anyway)\"\nfi",
  33. "timeout": 10
  34. }
  35. ]
  36. }
  37. ],
  38. "PostToolUse": [
  39. {
  40. "matcher": "Write|Edit|MultiEdit",
  41. "hooks": [
  42. {
  43. "type": "command",
  44. "command": "# Auto-format all modified files based on type\nfor file in $CLAUDE_FILE_PATHS; do\n # Python files - use black\n if [[ \"$file\" == *.py ]]; then\n if command -v black &> /dev/null; then\n echo \"🎨 Formatting Python: $(basename $file)\"\n black \"$file\" 2>/dev/null || true\n fi\n # TypeScript/JavaScript/React files - use prettier\n elif [[ \"$file\" == *.ts ]] || [[ \"$file\" == *.tsx ]] || [[ \"$file\" == *.js ]] || [[ \"$file\" == *.jsx ]]; then\n if command -v npx &> /dev/null; then\n echo \"🎨 Formatting TS/JS: $(basename $file)\"\n npx prettier --write \"$file\" 2>/dev/null || true\n fi\n # JSON/CSS/HTML/MD files - use prettier\n elif [[ \"$file\" == *.json ]] || [[ \"$file\" == *.css ]] || [[ \"$file\" == *.html ]] || [[ \"$file\" == *.md ]]; then\n if command -v npx &> /dev/null; then\n echo \"🎨 Formatting: $(basename $file)\"\n npx prettier --write \"$file\" 2>/dev/null || true\n fi\n fi\ndone",
  45. "timeout": 20,
  46. "run_in_background": true
  47. },
  48. {
  49. "type": "command",
  50. "command": "# Python Syntax Verification - ONLY for modified files\nfor file in $CLAUDE_FILE_PATHS; do\n if [[ \"$file\" == *lightrag/*.py ]] && [[ \"$file\" != *.pyc ]]; then\n echo \"🐍 Verifying Python syntax: $(basename $file)\"\n python -c \"import ast; ast.parse(open('$file').read())\" 2>/dev/null\n if [ $? -ne 0 ]; then\n echo \"\\n❌ PYTHON SYNTAX ERROR DETECTED in $(basename $file)!\"\n echo \"━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\"\n python -c \"import ast; ast.parse(open('$file').read())\" 2>&1\n echo \"━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\"\n echo \"πŸ”§ IMMEDIATE ACTION REQUIRED: Fix syntax before continuing!\"\n exit 2\n fi\n echo \"βœ… Python syntax OK\"\n fi\ndone",
  51. "timeout": 10
  52. },
  53. {
  54. "type": "command",
  55. "command": "# TypeScript Compilation Check - ONLY for modified files\nfor file in $CLAUDE_FILE_PATHS; do\n if [[ \"$file\" == *lightrag_webui/*.tsx ]] || [[ \"$file\" == *lightrag_webui/*.ts ]]; then\n if [[ \"$file\" != *.d.ts ]]; then\n echo \"βš›οΈ Verifying TypeScript: $(basename $file)\"\n cd lightrag_webui 2>/dev/null && npx tsc --noEmit --skipLibCheck \"../$file\" 2>/dev/null\n if [ $? -ne 0 ]; then\n echo \"\\n❌ TYPESCRIPT COMPILATION ERROR in $(basename $file)!\"\n echo \"━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\"\n cd lightrag_webui && npx tsc --noEmit --skipLibCheck \"../$file\" 2>&1\n echo \"━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\"\n echo \"πŸ”§ IMMEDIATE ACTION REQUIRED: Fix TypeScript errors!\"\n exit 2\n fi\n echo \"βœ… TypeScript compilation OK\"\n fi\n fi\ndone",
  56. "timeout": 15
  57. },
  58. {
  59. "type": "command",
  60. "command": "# Architecture Pattern Verification - Quick checks\nfor file in $CLAUDE_FILE_PATHS; do\n if [[ \"$file\" == *lightrag/*.py ]]; then\n # Check for client_id usage (should be workspace_id)\n if grep -q \"client_id\" \"$file\" 2>/dev/null; then\n echo \"⚠️ ARCHITECTURE WARNING in $(basename $file):\"\n echo \" Found 'client_id' - Must use 'workspace_id' for isolation!\"\n grep -n \"client_id\" \"$file\" | head -3\n fi\n # Check for direct Supabase access without Service Factory\n if grep -q \"supabase\\.table\" \"$file\" 2>/dev/null; then\n if ! grep -q \"SupabaseServiceFactory\" \"$file\" 2>/dev/null; then\n echo \"⚠️ ARCHITECTURE WARNING in $(basename $file):\"\n echo \" Direct DB access detected - MUST use Service Factory pattern!\"\n echo \" Example: factory = SupabaseServiceFactory(workspace_id)\"\n fi\n fi\n fi\ndone",
  61. "timeout": 5
  62. }
  63. ]
  64. }
  65. ],
  66. "Stop": [
  67. {
  68. "hooks": [
  69. {
  70. "type": "command",
  71. "command": "echo 'πŸ”” Task completed!' && mpg123 -q -g 50 '/mnt/c/Users/orhei/Desktop/AI Bot/bellsound.mp3' 2>/dev/null || true",
  72. "timeout": 5,
  73. "run_in_background": true
  74. }
  75. ]
  76. }
  77. ]
  78. }
  79. }
Advertisement
Add Comment
Please, Sign In to add comment