claude-git-hooks 2.21.0 → 2.30.1
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 +138 -6
- package/CLAUDE.md +469 -69
- package/README.md +5 -0
- package/bin/claude-hooks +89 -0
- package/lib/cli-metadata.js +68 -1
- package/lib/commands/analyze-pr.js +19 -24
- package/lib/commands/back-merge.js +740 -0
- package/lib/commands/check-coupling.js +209 -0
- package/lib/commands/close-release.js +485 -0
- package/lib/commands/create-pr.js +62 -3
- package/lib/commands/create-release.js +600 -0
- package/lib/commands/diff-batch-info.js +7 -13
- package/lib/commands/help.js +5 -7
- package/lib/commands/install.js +1 -5
- package/lib/commands/revert-feature.js +436 -0
- package/lib/commands/shadow.js +654 -0
- package/lib/config.js +1 -2
- package/lib/hooks/pre-commit.js +8 -6
- package/lib/utils/authorization.js +429 -0
- package/lib/utils/claude-client.js +14 -7
- package/lib/utils/coupling-detector.js +133 -0
- package/lib/utils/diff-analysis-orchestrator.js +7 -14
- package/lib/utils/git-operations.js +480 -1
- package/lib/utils/github-api.js +182 -0
- package/lib/utils/judge.js +66 -7
- package/lib/utils/linear-connector.js +1 -4
- package/lib/utils/package-info.js +0 -1
- package/lib/utils/token-store.js +5 -3
- package/package.json +69 -69
package/CHANGELOG.md
CHANGED
|
@@ -5,9 +5,134 @@ Todos los cambios notables en este proyecto se documentarán en este archivo.
|
|
|
5
5
|
El formato está basado en [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
y este proyecto adhiere a [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [2.30.1] - 2026-03-17
|
|
9
|
+
|
|
10
|
+
### ✨ Added
|
|
11
|
+
- Comprehensive Release Workflow Guide in CLAUDE.md documenting all workflow automation commands (check-coupling, create-release, shadow, revert-feature, close-release, back-merge) with step-by-step lifecycle, command details, and authorization model
|
|
12
|
+
|
|
13
|
+
### 🔧 Changed
|
|
14
|
+
- Increased timeout for AI help commands from 30s to 60s to improve reliability of claude-hooks help queries and issue reporting
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [2.30.0] - 2026-03-17
|
|
18
|
+
|
|
19
|
+
### ✨ Added
|
|
20
|
+
- New `close-release` command for release-candidate finalization (#ISSUE-97) — soft-resets RC onto main, creates a single clean commit with feature list, force-pushes with lease, and creates PR to main with merge-commit strategy label
|
|
21
|
+
- Support for `--auto-describe` flag to generate release description using Claude AI
|
|
22
|
+
- Support for `--dry-run` flag to preview close-release actions without executing
|
|
23
|
+
- Support for `--no-pr` flag to skip PR creation during release closure
|
|
24
|
+
- New `back-merge` command for post-deploy branch synchronization (#105)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
## [2.29.0] - 2026-03-17
|
|
28
|
+
|
|
29
|
+
### ✨ Added
|
|
30
|
+
- Added `back-merge` command for post-deploy branch synchronization (#96) - automates the release close workflow: tags release, resets shadow to main, merges main into develop, deletes RC branches, and offers to restore reverted features for the next sprint
|
|
31
|
+
- Added automatic conflict resolution for version files during back-merge (accepts source/main version)
|
|
32
|
+
- Added CHANGELOG conflict handling during back-merge - stages with conflict markers and prompts user to continue or abort
|
|
33
|
+
- Added revert follow-up feature that reads revert-log.json and offers to apply revert-the-revert for features removed from the closed RC
|
|
34
|
+
- Added branch protection detection during back-merge push with helpful PR creation advice
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
## [2.28.0] - 2026-03-17
|
|
38
|
+
|
|
39
|
+
### ✨ Added
|
|
40
|
+
- New `revert-feature` command to revert squash-merged features by task ID in release-candidate branches (#95)
|
|
41
|
+
- Coupling detection when reverting features - warns if other RC commits share modified files
|
|
42
|
+
- Revert log tracking at `.claude/revert-log.json` for back-merge workflows
|
|
43
|
+
- Optional shadow branch sync after revert with `--update-shadow` flag
|
|
44
|
+
- Dry-run mode for `revert-feature` to preview revert actions without executing
|
|
45
|
+
- New `getCommitFiles()` utility in git-operations for retrieving files changed in a specific commit
|
|
46
|
+
|
|
47
|
+
### 🐛 Fixed
|
|
48
|
+
- Added debug logging for git log failures in revert-feature command to aid troubleshooting
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
## [2.27.0] - 2026-03-17
|
|
52
|
+
|
|
53
|
+
### ✨ Added
|
|
54
|
+
- New `create-release` command to automate release-candidate branch creation from develop (#94)
|
|
55
|
+
- Automatic version file discovery and bump during release creation
|
|
56
|
+
- Git tag creation with skip logic if tag already exists
|
|
57
|
+
- Shadow branch deployment integration after RC push
|
|
58
|
+
- Support for `--dry-run` flag to preview release changes without executing
|
|
59
|
+
- Support for `--no-shadow` flag to skip shadow deployment
|
|
60
|
+
- Support for `--skip-push` flag for local-only branch creation
|
|
61
|
+
- Support for `--update-changelog` flag to generate CHANGELOG entry during release
|
|
62
|
+
- Comprehensive precondition validation: clean working directory, develop branch check, remote sync verification, existing RC detection
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
## [2.26.0] - 2026-03-16
|
|
66
|
+
|
|
67
|
+
### ✨ Added
|
|
68
|
+
- Merge strategy auto-detection in `create-pr` command - automatically detects required merge strategy (squash vs merge commit) from branch naming conventions (feature/* → squash, release-candidate/* → merge-commit, hotfix/* → merge-commit, any → main → merge-commit)
|
|
69
|
+
- Merge strategy labels (`merge-strategy:squash` or `merge-strategy:merge-commit`) automatically added to created PRs
|
|
70
|
+
- Merge strategy display in PR preview showing detected strategy before creation
|
|
71
|
+
- Body reminder prepended to PR description for merge-commit PRs warning about required merge method
|
|
72
|
+
- Interactive merge strategy selection prompt when branch pattern is unknown or ambiguous
|
|
73
|
+
- Shadow branch lifecycle management command (`claude-hooks shadow <analyze|reset|sync>`) for managing shadow branches - analyze divergence vs main and active RC, reset shadow to clean copy of main, or sync shadow with source branch (#101)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
## [2.25.0] - 2026-03-16
|
|
77
|
+
|
|
78
|
+
### ✨ Added
|
|
79
|
+
- New `shadow` command to manage the shadow branch lifecycle — analyze divergence vs main and active RC, reset shadow to a clean copy of main, or sync shadow with a source branch (RC, develop, feature)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
## [2.24.0] - 2026-03-16
|
|
83
|
+
|
|
84
|
+
### ✨ Added
|
|
85
|
+
|
|
86
|
+
- New `check-coupling` command to detect overlapping file changes across open PRs targeting a base branch
|
|
87
|
+
- Role-based authorization system for workflow commands with fail-closed security model
|
|
88
|
+
- Detailed error messages for authorization failures with clear guidance
|
|
89
|
+
|
|
90
|
+
### 🔧 Changed
|
|
91
|
+
|
|
92
|
+
- Extracted permissions repository path to constant for improved maintainability
|
|
93
|
+
- Separated permissions repository owner validation from organization membership checks
|
|
94
|
+
|
|
95
|
+
### 🐛 Fixed
|
|
96
|
+
|
|
97
|
+
- Updated test constant values to ensure test suite passes
|
|
98
|
+
|
|
99
|
+
## [2.23.0] - 2026-03-16
|
|
100
|
+
|
|
101
|
+
### ✨ Added
|
|
102
|
+
|
|
103
|
+
- Added role-based authorization system for protected workflow commands (create-release, close-release, back-merge, shadow, revert-feature, bump-version)
|
|
104
|
+
- Added fail-closed authorization guard in CLI router that blocks commands when authorization cannot be verified
|
|
105
|
+
- Added centralized permissions sourced from external GitHub repository (claude-hooks-permissions/permissions.json)
|
|
106
|
+
- Added GitHub API functions for authorization: getAuthenticatedUser(), checkOrgMembership(), getCollaboratorPermission()
|
|
107
|
+
- Added detailed error messages for all authorization failure scenarios (token issues, org membership, permission levels, repo governance)
|
|
108
|
+
|
|
109
|
+
### 🔧 Changed
|
|
110
|
+
|
|
111
|
+
- Extracted permissions source path to a constant (PERMISSIONS_SOURCE) for consistent error messaging
|
|
112
|
+
- Separated permissions repository owner from organization membership check to support different hosting locations
|
|
113
|
+
|
|
114
|
+
### 🔒 Security
|
|
115
|
+
|
|
116
|
+
- Implemented fail-closed authorization design that blocks all commands on any authorization system error
|
|
117
|
+
|
|
118
|
+
## [2.22.0] - 2026-03-12
|
|
119
|
+
|
|
120
|
+
### ✨ Added
|
|
121
|
+
|
|
122
|
+
- Branch lifecycle management functions in git-operations: checkoutBranch, mergeBranch, resetBranch, forcePush, deleteRemoteBranch, getDivergence
|
|
123
|
+
- Utility functions for branch workflows: readFileFromRef, getLatestTag, isWorkingDirectoryClean, getActiveBranch
|
|
124
|
+
- Debug diagnostics for judge fix application failures - diagnoses CRLF mismatches and search string issues
|
|
125
|
+
- Debug dump output for judge decisions (written to .claude/out/judge-debug.json when debug mode enabled)
|
|
126
|
+
|
|
127
|
+
### 🔧 Changed
|
|
128
|
+
|
|
129
|
+
- Enhanced judge module with detailed failure diagnostics including line ending detection and hex dumps
|
|
130
|
+
- Updated CLAUDE.md documentation to reflect expanded git-operations API
|
|
131
|
+
|
|
8
132
|
## [2.21.0] - 2026-03-10
|
|
9
133
|
|
|
10
134
|
### ✨ Added
|
|
135
|
+
|
|
11
136
|
- New `analyze-pr` command to analyze GitHub PRs with team guidelines and post review comments (#86)
|
|
12
137
|
- Linear ticket enrichment for PR analysis - automatically fetches ticket context when `[AUT-1234]` pattern found in PR title
|
|
13
138
|
- New `setup-linear` command for interactive Linear token configuration
|
|
@@ -19,13 +144,14 @@ y este proyecto adhiere a [Semantic Versioning](https://semver.org/spec/v2.0.0.h
|
|
|
19
144
|
- Category normalization with fuzzy alias mapping for analysis results
|
|
20
145
|
|
|
21
146
|
### 🔧 Changed
|
|
147
|
+
|
|
22
148
|
- Extended `github-api.js` with PR fetch, review creation, and URL parsing capabilities
|
|
23
149
|
- Updated documentation (README, README-NPM, CLAUDE.md) with analyze-pr usage and architecture
|
|
24
150
|
|
|
25
|
-
|
|
26
151
|
## [2.20.0] - 2026-03-09
|
|
27
152
|
|
|
28
153
|
### ✨ Added
|
|
154
|
+
|
|
29
155
|
- Intelligent batch orchestration for commits with 3+ files using Opus to semantically group files, assign per-batch models, and inject shared commit context
|
|
30
156
|
- Auto-fix judge that evaluates all issues at any severity level, auto-applies search/replace fixes, and dismisses false positives - any unresolved issue blocks the commit (#85)
|
|
31
157
|
- New `batch-info` command to display orchestration configuration and per-model average analysis speed from telemetry
|
|
@@ -36,6 +162,7 @@ y este proyecto adhiere a [Semantic Versioning](https://semver.org/spec/v2.0.0.h
|
|
|
36
162
|
- DIFF_ANALYSIS_ORCHESTRATION_PROMPT.md template for Opus batch grouping
|
|
37
163
|
|
|
38
164
|
### 🔧 Changed
|
|
165
|
+
|
|
39
166
|
- Analysis routing now uses three-tier strategy: 1-2 files use sequential single call, 3+ files trigger intelligent orchestration
|
|
40
167
|
- Judge now runs on all issues regardless of severity (previously only CRITICAL/BLOCKER blocked commits)
|
|
41
168
|
- Resolution prompt file is only generated if issues remain after judge evaluation
|
|
@@ -47,13 +174,14 @@ y este proyecto adhiere a [Semantic Versioning](https://semver.org/spec/v2.0.0.h
|
|
|
47
174
|
- Judge can be disabled via `config.judge.enabled: false` to fall back to original quality gate
|
|
48
175
|
|
|
49
176
|
### 🗑️ Removed
|
|
177
|
+
|
|
50
178
|
- Removed `subagents.batchSize` configuration option (orchestration now handled by Opus intelligence)
|
|
51
179
|
- Removed `analyzeCodeParallel()` function from `claude-client.js` (replaced by orchestration-driven parallel execution)
|
|
52
180
|
|
|
53
|
-
|
|
54
181
|
## [2.19.0] - 2026-03-06
|
|
55
182
|
|
|
56
183
|
### ✨ Added
|
|
184
|
+
|
|
57
185
|
- Shell autocompletion for all CLI commands, flags, and arguments — Bash, Zsh, Fish, and PowerShell (#78)
|
|
58
186
|
- Command registry (`lib/cli-metadata.js`) — single source of truth for commands, flags, descriptions, and completion metadata
|
|
59
187
|
- Four shell completion generators with per-command flag/arg awareness and dynamic branch completion for `analyze-diff` and `create-pr`
|
|
@@ -61,6 +189,7 @@ y este proyecto adhiere a [Semantic Versioning](https://semver.org/spec/v2.0.0.h
|
|
|
61
189
|
- Self-healing RC file updates — reinstall detects and replaces stale source lines (e.g., Windows backslash paths) automatically
|
|
62
190
|
|
|
63
191
|
### 🔧 Changed
|
|
192
|
+
|
|
64
193
|
- Refactored `bin/claude-hooks` — replaced 130-line switch/case with declarative command registry lookup via `buildCommandMap()`
|
|
65
194
|
- Shell source lines now use `$HOME`-relative paths for cross-platform compatibility (MINGW64, WSL, native Linux/macOS)
|
|
66
195
|
- Completion source lines written to both `~/.bashrc` and `~/.bash_profile` (MINGW64 reads `.bash_profile` first)
|
|
@@ -69,46 +198,49 @@ y este proyecto adhiere a [Semantic Versioning](https://semver.org/spec/v2.0.0.h
|
|
|
69
198
|
- Updated CLAUDE.md with cli-metadata.js documentation, exports table, and Command Registry design pattern
|
|
70
199
|
|
|
71
200
|
### 🐛 Fixed
|
|
201
|
+
|
|
72
202
|
- Bash completions failing on MINGW64/Git Bash due to Windows backslash paths in source lines
|
|
73
203
|
- PowerShell completions failing due to hardcoded Unix profile paths on Windows
|
|
74
204
|
- PowerShell 5.1 `-Native` completers not firing for npm `.ps1` shims — added proxy function wrapper that re-exposes the command as `Function` type
|
|
75
205
|
- PowerShell `[CompletionResult]` type accelerator not resolving in dot-sourced profile scripts
|
|
76
206
|
|
|
77
|
-
|
|
78
207
|
## [2.18.1] - 2026-03-04
|
|
79
208
|
|
|
80
209
|
### ✨ Added
|
|
210
|
+
|
|
81
211
|
- Monorepo support for CHANGELOG discovery - discovers all CHANGELOG.md files and prompts to select when multiple are found (#77)
|
|
82
212
|
- AI-powered help and issue creation system (#79)
|
|
83
213
|
|
|
84
214
|
### 🔧 Changed
|
|
215
|
+
|
|
85
216
|
- Enhanced `walkDirectoryTree` utility function in file-utils.js for reusable directory traversal
|
|
86
217
|
- Updated documentation to reflect monorepo CHANGELOG discovery capabilities
|
|
87
218
|
|
|
88
219
|
### 🐛 Fixed
|
|
89
|
-
- Cross-platform path handling in git hooks directory resolution (normalized path separators)
|
|
90
220
|
|
|
221
|
+
- Cross-platform path handling in git hooks directory resolution (normalized path separators)
|
|
91
222
|
|
|
92
223
|
## [2.18.0] - 2026-03-03
|
|
93
224
|
|
|
94
225
|
### ✨ Added
|
|
226
|
+
|
|
95
227
|
- AI-powered help command - ask natural language questions about claude-hooks and get answers from documentation (`claude-hooks help "how do presets work?"`) (#79)
|
|
96
228
|
- Interactive issue creation - guided GitHub issue creation using repository templates (`claude-hooks help --report-issue`) (#79)
|
|
97
229
|
- New GitHub API functions for fetching file content, directory listings, and creating issues (`fetchFileContent`, `fetchDirectoryListing`, `createIssue`)
|
|
98
230
|
- New prompt templates for AI help system: HELP_QUERY.md, HELP_REPORT_ISSUE.md, HELP_COMPOSE_ISSUE.md
|
|
99
231
|
|
|
100
232
|
### 🔧 Changed
|
|
233
|
+
|
|
101
234
|
- Help command now supports three modes: static help (no args), AI-powered help (with question), and issue reporting (--report-issue)
|
|
102
235
|
- Updated documentation (README.md, README-NPM.md, CLAUDE.md) to reflect new help and issue reporting features
|
|
103
236
|
|
|
104
|
-
|
|
105
237
|
## [2.17.2] - 2026-03-02
|
|
106
238
|
|
|
107
239
|
### 🐛 Fixed
|
|
240
|
+
|
|
108
241
|
- Improved pom.xml version detection to correctly distinguish project version from dependency/property versions (#76)
|
|
109
242
|
- Fixed false version mismatch errors for Maven submodules with inherited parent versions
|
|
110
243
|
|
|
111
|
-
|
|
112
244
|
## [2.17.1] - 2026-03-02
|
|
113
245
|
|
|
114
246
|
### 🐛 Fixed
|