claude-git-hooks 2.19.0 → 2.21.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.
- package/CHANGELOG.md +46 -0
- package/CLAUDE.md +115 -39
- package/README.md +99 -22
- package/bin/claude-hooks +1 -0
- package/lib/cli-metadata.js +26 -1
- package/lib/commands/analyze-pr.js +683 -0
- package/lib/commands/diff-batch-info.js +105 -0
- package/lib/commands/help.js +70 -38
- package/lib/commands/install.js +0 -10
- package/lib/commands/setup-linear.js +96 -0
- package/lib/config.js +21 -27
- package/lib/hooks/pre-commit.js +43 -17
- package/lib/hooks/prepare-commit-msg.js +3 -24
- package/lib/utils/analysis-engine.js +62 -46
- package/lib/utils/claude-client.js +21 -69
- package/lib/utils/diff-analysis-orchestrator.js +332 -0
- package/lib/utils/github-api.js +176 -112
- package/lib/utils/judge.js +195 -0
- package/lib/utils/linear-connector.js +287 -0
- package/lib/utils/package-info.js +0 -11
- package/lib/utils/pr-statistics.js +85 -0
- package/lib/utils/prompt-builder.js +15 -21
- package/lib/utils/resolution-prompt.js +1 -8
- package/lib/utils/telemetry.js +46 -10
- package/lib/utils/token-store.js +159 -0
- package/package.json +1 -1
- package/templates/ANALYZE_PR.md +79 -0
- package/templates/CLAUDE_RESOLUTION_PROMPT.md +17 -9
- package/templates/DIFF_ANALYSIS_ORCHESTRATION_PROMPT.md +70 -0
- package/templates/config.advanced.example.json +56 -31
- package/templates/config.example.json +0 -11
- package/templates/settings.local.example.json +2 -1
package/lib/cli-metadata.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Three consumers read from this registry:
|
|
6
6
|
* 1. bin/claude-hooks — routing (replaces switch/case)
|
|
7
7
|
* 2. installCompletions() — generates shell completion scripts at install time
|
|
8
|
-
* 3. showStaticHelp() —
|
|
8
|
+
* 3. showStaticHelp() — generates help text from this registry
|
|
9
9
|
*
|
|
10
10
|
* Adding a new command = adding one entry here.
|
|
11
11
|
* Completions auto-update for every user at next install.
|
|
@@ -115,6 +115,21 @@ export const commands = [
|
|
|
115
115
|
completion: "git branch --format='%(refname:short)'"
|
|
116
116
|
}
|
|
117
117
|
},
|
|
118
|
+
{
|
|
119
|
+
name: 'analyze-pr',
|
|
120
|
+
description: 'Analyze a GitHub PR with team guidelines',
|
|
121
|
+
handler: async () => (await import('./commands/analyze-pr.js')).runAnalyzePr,
|
|
122
|
+
args: { name: 'pr-url' },
|
|
123
|
+
flags: {
|
|
124
|
+
'--preset': {
|
|
125
|
+
description: 'Override preset selection',
|
|
126
|
+
takesValue: true,
|
|
127
|
+
values: PRESET_NAMES
|
|
128
|
+
},
|
|
129
|
+
'--model': { description: 'Claude model override', takesValue: true },
|
|
130
|
+
'--dry-run': { description: 'Analyze without posting comments' }
|
|
131
|
+
}
|
|
132
|
+
},
|
|
118
133
|
{
|
|
119
134
|
name: 'create-pr',
|
|
120
135
|
description: 'Create PR with auto-generated metadata',
|
|
@@ -129,6 +144,11 @@ export const commands = [
|
|
|
129
144
|
description: 'Configure GitHub token for PR creation',
|
|
130
145
|
handler: async () => (await import('./commands/setup-github.js')).runSetupGitHub
|
|
131
146
|
},
|
|
147
|
+
{
|
|
148
|
+
name: 'setup-linear',
|
|
149
|
+
description: 'Configure Linear token for ticket enrichment',
|
|
150
|
+
handler: async () => (await import('./commands/setup-linear.js')).runSetupLinear
|
|
151
|
+
},
|
|
132
152
|
{
|
|
133
153
|
name: 'presets',
|
|
134
154
|
description: 'List all available presets',
|
|
@@ -184,6 +204,11 @@ export const commands = [
|
|
|
184
204
|
'--release': { description: 'Mark as released' }
|
|
185
205
|
}
|
|
186
206
|
},
|
|
207
|
+
{
|
|
208
|
+
name: 'batch-info',
|
|
209
|
+
description: 'Show intelligent diff-analysis orchestration configuration and speed telemetry',
|
|
210
|
+
handler: async () => (await import('./commands/diff-batch-info.js')).runDiffBatchInfo
|
|
211
|
+
},
|
|
187
212
|
{
|
|
188
213
|
name: 'telemetry',
|
|
189
214
|
description: 'View or clear telemetry data',
|