claude-git-hooks 2.3.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,41 +1,41 @@
1
1
  {
2
- "preset": null,
3
- "analysis": {
4
- "maxFileSize": 100000,
5
- "maxFiles": 10,
6
- "timeout": 120000,
7
- "contextLines": 3,
8
- "ignoreExtensions": []
9
- },
10
- "commitMessage": {
11
- "autoKeyword": "auto",
12
- "timeout": 180000
13
- },
14
- "subagents": {
15
- "enabled": true,
16
- "model": "haiku",
17
- "batchSize": 3
18
- },
19
- "templates": {
20
- "baseDir": ".claude",
21
- "analysis": "CLAUDE_ANALYSIS_PROMPT_SONAR.md",
22
- "guidelines": "CLAUDE_PRE_COMMIT_SONAR.md",
23
- "commitMessage": "COMMIT_MESSAGE.md",
24
- "analyzeDiff": "ANALYZE_DIFF.md",
25
- "resolution": "CLAUDE_RESOLUTION_PROMPT.md",
26
- "subagentInstruction": "SUBAGENT_INSTRUCTION.md"
27
- },
28
- "output": {
29
- "outputDir": ".claude/out",
30
- "debugFile": ".claude/out/debug-claude-response.json",
31
- "resolutionFile": ".claude/out/claude_resolution_prompt.md",
32
- "prAnalysisFile": ".claude/out/pr-analysis.json"
33
- },
34
- "system": {
35
- "debug": false,
36
- "wslCheckTimeout": 3000
37
- },
38
- "git": {
39
- "diffFilter": "ACM"
40
- }
2
+ "preset": "ai",
3
+ "analysis": {
4
+ "maxFileSize": 1000000,
5
+ "maxFiles": 30,
6
+ "timeout": 180000,
7
+ "contextLines": 3,
8
+ "ignoreExtensions": []
9
+ },
10
+ "commitMessage": {
11
+ "autoKeyword": "auto",
12
+ "timeout": 180000
13
+ },
14
+ "subagents": {
15
+ "enabled": false,
16
+ "model": "haiku",
17
+ "batchSize": 1
18
+ },
19
+ "templates": {
20
+ "baseDir": ".claude",
21
+ "analysis": "CLAUDE_ANALYSIS_PROMPT_SONAR.md",
22
+ "guidelines": "CLAUDE_PRE_COMMIT_SONAR.md",
23
+ "commitMessage": "COMMIT_MESSAGE.md",
24
+ "analyzeDiff": "ANALYZE_DIFF.md",
25
+ "resolution": "CLAUDE_RESOLUTION_PROMPT.md",
26
+ "subagentInstruction": "SUBAGENT_INSTRUCTION.md"
27
+ },
28
+ "output": {
29
+ "outputDir": ".claude/out",
30
+ "debugFile": ".claude/out/debug-claude-response.json",
31
+ "resolutionFile": ".claude/out/claude_resolution_prompt.md",
32
+ "prAnalysisFile": ".claude/out/pr-analysis.json"
33
+ },
34
+ "system": {
35
+ "debug": false,
36
+ "wslCheckTimeout": 3000
37
+ },
38
+ "git": {
39
+ "diffFilter": "ACM"
40
+ }
41
41
  }
@@ -8,6 +8,7 @@ set -e
8
8
 
9
9
  # Colors for output
10
10
  RED='\033[0;31m'
11
+ YELLOW='\033[1;33m'
11
12
  NC='\033[0m'
12
13
 
13
14
  # Convert Windows path to Git Bash/WSL path
@@ -64,13 +65,50 @@ find_hook_script() {
64
65
  return 1
65
66
  }
66
67
 
68
+ # Early validation: Check if .claude directory exists
69
+ # Why: Provides helpful error message if installation incomplete or in wrong directory
70
+ REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || echo "")
71
+ if [ -z "$REPO_ROOT" ]; then
72
+ echo -e "${RED}Error: Not in a git repository${NC}" >&2
73
+ exit 1
74
+ fi
75
+
76
+ if [ ! -d "$REPO_ROOT/.claude" ]; then
77
+ echo -e "${RED}Error: .claude directory not found${NC}" >&2
78
+ echo "" >&2
79
+ echo "Claude Git Hooks installation is incomplete or missing." >&2
80
+ echo "" >&2
81
+ echo "Current directory: $(pwd)" >&2
82
+ echo "Repository root: $REPO_ROOT" >&2
83
+ echo "" >&2
84
+ echo "Common cause: Installation performed from wrong directory" >&2
85
+ echo "" >&2
86
+ echo "Solution:" >&2
87
+ echo " cd $REPO_ROOT" >&2
88
+ echo " claude-hooks install --force" >&2
89
+ exit 1
90
+ fi
91
+
67
92
  # Find the Node.js script
68
93
  NODE_HOOK=$(find_hook_script)
69
94
 
70
95
  if [ -z "$NODE_HOOK" ]; then
71
96
  echo -e "${RED}Error: Could not find pre-commit.js${NC}" >&2
72
- echo "Claude Git Hooks may not be properly installed." >&2
73
- echo "Try running: claude-hooks install --force" >&2
97
+ echo "" >&2
98
+ echo "Claude Git Hooks installation is incomplete." >&2
99
+ echo "" >&2
100
+ echo "Current directory: $(pwd)" >&2
101
+ echo "Repository root: $REPO_ROOT" >&2
102
+ echo "" >&2
103
+ echo "Common cause: Installation from wrong directory or npm package not properly installed" >&2
104
+ echo "" >&2
105
+ echo "Solution:" >&2
106
+ echo " # Verify you're in repository root" >&2
107
+ echo " cd $REPO_ROOT" >&2
108
+ echo " # Verify npm package is installed globally" >&2
109
+ echo " npm list -g claude-git-hooks" >&2
110
+ echo " # Reinstall hooks" >&2
111
+ echo " claude-hooks install --force" >&2
74
112
  exit 1
75
113
  fi
76
114
 
@@ -8,6 +8,7 @@ set -e
8
8
 
9
9
  # Colors for output
10
10
  RED='\033[0;31m'
11
+ YELLOW='\033[1;33m'
11
12
  NC='\033[0m'
12
13
 
13
14
  # Convert Windows path to Git Bash/WSL path
@@ -64,13 +65,50 @@ find_hook_script() {
64
65
  return 1
65
66
  }
66
67
 
68
+ # Early validation: Check if .claude directory exists
69
+ # Why: Provides helpful error message if installation incomplete or in wrong directory
70
+ REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || echo "")
71
+ if [ -z "$REPO_ROOT" ]; then
72
+ echo -e "${RED}Error: Not in a git repository${NC}" >&2
73
+ exit 1
74
+ fi
75
+
76
+ if [ ! -d "$REPO_ROOT/.claude" ]; then
77
+ echo -e "${RED}Error: .claude directory not found${NC}" >&2
78
+ echo "" >&2
79
+ echo "Claude Git Hooks installation is incomplete or missing." >&2
80
+ echo "" >&2
81
+ echo "Current directory: $(pwd)" >&2
82
+ echo "Repository root: $REPO_ROOT" >&2
83
+ echo "" >&2
84
+ echo "Common cause: Installation performed from wrong directory" >&2
85
+ echo "" >&2
86
+ echo "Solution:" >&2
87
+ echo " cd $REPO_ROOT" >&2
88
+ echo " claude-hooks install --force" >&2
89
+ exit 1
90
+ fi
91
+
67
92
  # Find the Node.js script
68
93
  NODE_HOOK=$(find_hook_script)
69
94
 
70
95
  if [ -z "$NODE_HOOK" ]; then
71
96
  echo -e "${RED}Error: Could not find prepare-commit-msg.js${NC}" >&2
72
- echo "Claude Git Hooks may not be properly installed." >&2
73
- echo "Try running: claude-hooks install --force" >&2
97
+ echo "" >&2
98
+ echo "Claude Git Hooks installation is incomplete." >&2
99
+ echo "" >&2
100
+ echo "Current directory: $(pwd)" >&2
101
+ echo "Repository root: $REPO_ROOT" >&2
102
+ echo "" >&2
103
+ echo "Common cause: Installation from wrong directory or npm package not properly installed" >&2
104
+ echo "" >&2
105
+ echo "Solution:" >&2
106
+ echo " # Verify you're in repository root" >&2
107
+ echo " cd $REPO_ROOT" >&2
108
+ echo " # Verify npm package is installed globally" >&2
109
+ echo " npm list -g claude-git-hooks" >&2
110
+ echo " # Reinstall hooks" >&2
111
+ echo " claude-hooks install --force" >&2
74
112
  exit 1
75
113
  fi
76
114
 
@@ -1,12 +1,12 @@
1
1
  {
2
- "analysis": {
3
- "maxFileSize": 100000,
4
- "maxFiles": 10,
5
- "timeout": 120000
6
- },
7
- "subagents": {
8
- "enabled": false,
9
- "model": "sonnet",
10
- "batchSize": 3
11
- }
2
+ "analysis": {
3
+ "maxFileSize": 1000000,
4
+ "maxFiles": 10,
5
+ "timeout": 300000
6
+ },
7
+ "subagents": {
8
+ "enabled": true,
9
+ "model": "haiku",
10
+ "batchSize": 3
11
+ }
12
12
  }
@@ -1,12 +1,12 @@
1
1
  {
2
- "analysis": {
3
- "maxFileSize": 100000,
4
- "maxFiles": 10,
5
- "timeout": 120000
6
- },
7
- "subagents": {
8
- "enabled": true,
9
- "model": "sonnet",
10
- "batchSize": 3
11
- }
2
+ "analysis": {
3
+ "maxFileSize": 1000000,
4
+ "maxFiles": 10,
5
+ "timeout": 300000
6
+ },
7
+ "subagents": {
8
+ "enabled": true,
9
+ "model": "haiku",
10
+ "batchSize": 3
11
+ }
12
12
  }
@@ -1,12 +1,12 @@
1
1
  {
2
- "analysis": {
3
- "maxFileSize": 150000,
4
- "maxFiles": 8,
5
- "timeout": 120000
6
- },
7
- "subagents": {
8
- "enabled": false,
9
- "model": "sonnet",
10
- "batchSize": 2
11
- }
2
+ "analysis": {
3
+ "maxFileSize": 1000000,
4
+ "maxFiles": 8,
5
+ "timeout": 300000
6
+ },
7
+ "subagents": {
8
+ "enabled": true,
9
+ "model": "haiku",
10
+ "batchSize": 2
11
+ }
12
12
  }
@@ -1,12 +1,12 @@
1
1
  {
2
- "analysis": {
3
- "maxFileSize": 100000,
4
- "maxFiles": 10,
5
- "timeout": 120000
6
- },
7
- "subagents": {
8
- "enabled": false,
9
- "model": "sonnet",
10
- "batchSize": 3
11
- }
2
+ "analysis": {
3
+ "maxFileSize": 1000000,
4
+ "maxFiles": 10,
5
+ "timeout": 300000
6
+ },
7
+ "subagents": {
8
+ "enabled": true,
9
+ "model": "haiku",
10
+ "batchSize": 3
11
+ }
12
12
  }
@@ -1,12 +1,12 @@
1
1
  {
2
- "analysis": {
3
- "maxFileSize": 100000,
4
- "maxFiles": 10,
5
- "timeout": 120000
6
- },
7
- "subagents": {
8
- "enabled": true,
9
- "model": "sonnet",
10
- "batchSize": 3
11
- }
2
+ "analysis": {
3
+ "maxFileSize": 1000000,
4
+ "maxFiles": 10,
5
+ "timeout": 300000
6
+ },
7
+ "subagents": {
8
+ "enabled": true,
9
+ "model": "haiku",
10
+ "batchSize": 3
11
+ }
12
12
  }
@@ -1,12 +1,12 @@
1
1
  {
2
- "analysis": {
3
- "maxFileSize": 100000,
4
- "maxFiles": 15,
5
- "timeout": 180000
6
- },
7
- "subagents": {
8
- "enabled": true,
9
- "model": "sonnet",
10
- "batchSize": 4
11
- }
2
+ "analysis": {
3
+ "maxFileSize": 1000000,
4
+ "maxFiles": 15,
5
+ "timeout": 300000
6
+ },
7
+ "subagents": {
8
+ "enabled": true,
9
+ "model": "haiku",
10
+ "batchSize": 4
11
+ }
12
12
  }