claude-git-hooks 2.45.0 → 2.61.2

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 CHANGED
@@ -5,40 +5,377 @@ 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.61.2] - 2026-06-01
9
+
10
+ ### 🐛 Fixed
11
+ - Fixed incorrect import path for gotcha solicitation in PR pipeline
12
+
13
+
14
+ ## [2.61.1] - 2026-06-01
15
+
16
+ ### ✨ Added
17
+ - Auto-regeneration of stale Library books during `create-release` — stale books are now regenerated before the release is tagged, keeping the tag accurate (#178, AUT-3738)
18
+
19
+ ### 🔧 Changed
20
+ - Staleness warning templates are now context-aware: `CONSOLE_WARNING_TEMPLATE` and `PR_BODY_SECTION_TEMPLATE` accept an `autoRegen` option to tailor messaging per consumer (`will-run` for create-release, `deferred` for bump-version, `completed`/`failed` in PR body)
21
+ - PR body staleness section now reflects the actual auto-regeneration outcome instead of always listing remediation scripts
22
+ - Console staleness warning in `bump-version` now tells the user that Library will be auto-regenerated when they run `create-pr`
23
+
24
+ ### 🗑️ Removed
25
+ - Removed static recommended-scripts list from console staleness warnings (replaced by context-aware auto-regeneration messages)
26
+
27
+
28
+ ## [2.61.0] - 2026-06-01
29
+
30
+ ### ✨ Added
31
+ - Added canonical staleness-warning templates (`CONSOLE_WARNING_TEMPLATE`, `PR_BODY_SECTION_TEMPLATE`, `PR_TAG_VALUE`) for consistent Library staleness messaging across all consumer commands (AUT-3738)
32
+ - Added non-blocking Library staleness verification gate to the `create-release` workflow — warns operators when Library books are out of date without blocking the release (AUT-3738)
33
+ - Added automatic release PR creation step in `create-release` with idempotency check, staleness section in PR body wrapped in marker comments, and `library-stale` label when applicable (AUT-3738)
34
+ - Added `LIBRARY_VERIFY_SKIPPED_WARNING_RELEASE` constant for release-specific Library verification skip messaging (AUT-3738)
35
+
36
+ ### 🔧 Changed
37
+ - Refactored `bump-version` Library warning to use the canonical `CONSOLE_WARNING_TEMPLATE` instead of inline formatting (AUT-3738)
38
+ - Changed `create-release` Library staleness gate from blocking (exit on stale) to non-blocking (warn and continue), using the librarian `verify()` API instead of raw staleness tools (AUT-3738)
39
+ - Refactored `library-warnings.js` to re-export canonical wording from the librarian messages module instead of defining constants inline (AUT-3738)
40
+ - Updated Library books for `create-release`, `bump-version`, and `library-warnings` to reflect new dependencies and exports (AUT-3738)
41
+
42
+ ### 🗑️ Removed
43
+ - Removed blocking Library staleness check from `create-release` that imported `.library/tools/staleness.js` directly and aborted on drift (AUT-3738)
44
+ - Removed `LIBRARY_STALE_WARNING` constant from `library-warnings.js`, replaced by canonical `CONSOLE_WARNING_TEMPLATE` (AUT-3738)
45
+
46
+
47
+ ## [2.61.0] - 2026-05-29
48
+
49
+ ### ✨ Added
50
+
51
+ - Added gotcha solicitation orchestrator for the Library system, enabling interactive developer prompts to capture known gotchas per book during the create-pr pipeline (AUT-3735)
52
+ - Added end-to-end cross-cutting tests for the gotcha solicitation flow covering manual-additions preservation and API-down graceful degradation (AUT-3735)
53
+ - Added Library verification gate for the bump-version workflow with warning constants in `library-warnings.js` (#176, AUT-3737)
54
+
55
+ ### 🔧 Changed
56
+
57
+ - Updated bump-version book to reference the new `library-warnings.js` dependency (AUT-3737)
58
+
59
+ ## [2.60.0] - 2026-06-01
60
+
61
+ ### ✨ Added
62
+
63
+ - Added canonical staleness-warning templates (`CONSOLE_WARNING_TEMPLATE`, `PR_BODY_SECTION_TEMPLATE`, `PR_TAG_VALUE`) for consistent Library staleness messaging across all consumer commands (AUT-3738)
64
+ - Added non-blocking Library staleness verification gate to the `create-release` workflow — warns operators when Library books are out of date without blocking the release (AUT-3738)
65
+ - Added staleness section to release PR body when Library is stale, wrapped in marker comments for downstream tooling (AUT-3738)
66
+
67
+ ### 🔧 Changed
68
+
69
+ - Refactored `bump-version` Library warning to use the canonical `CONSOLE_WARNING_TEMPLATE` instead of inline formatting (AUT-3738)
70
+ - Updated Library books for `create-release`, `bump-version`, and `library-warnings` to reflect new dependencies and exports (AUT-3738)
71
+
72
+ ### 🗑️ Removed
73
+
74
+ - Removed gotcha solicitation orchestrator (`gotcha-solicitation.js`) from the Library system (AUT-3738)
75
+
76
+ ## [2.59.0] - 2026-05-29
77
+
78
+ ### ✨ Added
79
+
80
+ - Library verification gate in `bump-version` command — warns about stale or missing Library books before proceeding with version bump (AUT-3737)
81
+ - Read-only `verify()` staleness check to librarian module with never-throws guarantee (AUT-3737)
82
+ - Warning wording constants for Library verification gates in `lib/messages/library-warnings.js` (AUT-3737)
83
+ - `updatePullRequestBody()` method to GitHub API utility (#175)
84
+
85
+ ### 🔧 Changed
86
+
87
+ - Back-merge co-change pipeline "skipped" message now uses `logger.warning` instead of raw stderr write (#175)
88
+ - Library books synced for back-merge and github-api modules (#175)
89
+
90
+ ## [2.58.0] - 2026-05-29
91
+
92
+ ### ✨ Added
93
+
94
+ - Integrated co-change correlation pipeline into back-merge workflow — runs 6-step detection, mode resolution, sidecar write, injection, and report generation after merge commit (AUT-3777)
95
+ - Added `updatePullRequestBody()` to GitHub API module for updating PR body content
96
+ - Auto-attach co-change analysis report to back-merge PR body with idempotent marker comments for safe re-runs (AUT-3777)
97
+ - Added comprehensive smoke tests for back-merge co-change pipeline glue
98
+
99
+ ### 🔧 Changed
100
+
101
+ - Back-merge co-change step now uses `coChangePipeline()` orchestrator instead of the standalone `inject-co-change.js` tool — stages and commits Library changes as a separate `chore(library)` commit
102
+ - Updated Library README with full `coChangePipeline()` documentation including sequence diagram, consumer contract, mode reference, and limitations
103
+
104
+ ### 🐛 Fixed
105
+
106
+ - Fixed false-positive linter warnings (#174)
107
+
108
+ ### 🗑️ Removed
109
+
110
+ - Removed legacy `inject-co-change.js` tool invocation from back-merge post-push step, replaced by integrated pipeline
111
+
112
+ ## [2.57.1] - 2026-05-29
113
+
114
+ ### 🐛 Fixed
115
+
116
+ - Filtered ESLint meta-warnings for ignored files that produced false-positive linter output
117
+ - Fixed co-change pipeline injection result not being captured when running in inject mode
118
+
119
+ ### 🗑️ Removed
120
+
121
+ - Removed `createPrPipeline()` Library maintenance orchestrator and associated M6 documentation
122
+
123
+ ## [2.57.0] - 2026-05-28
124
+
125
+ ### ✨ Added
126
+
127
+ - Added `createPrPipeline()` 5-step Library maintenance orchestrator for the `create-pr` command — runs staleness detection, auto-section regeneration, book add/remove/rename, frontmatter sync, and gotcha solicitation sequentially (AUT-3736)
128
+ - Added comprehensive pipeline documentation to Library README including sequence diagram, consumer contract, and return shape
129
+
130
+ ### 🔧 Changed
131
+
132
+ - Integrated Library maintenance pipeline into `create-pr` command — now triggers full book sync instead of only reporting staleness (AUT-3736)
133
+ - Updated Library milestone status: M5 (core hypothesis validation) marked as shipped, M6 (lifecycle automation) added as in-progress
134
+ - Removed unused variables in `co-change-pipeline.js` (`injectionResult`), `cross-ref-injector.js` (`fileContents`), and renamed unused parameter in `gotcha-persistence.js` (`opts` → `_opts`)
135
+ - Replaced string concatenation with template literals in `gotcha-persistence.js`
136
+
137
+ ## [2.56.0] - 2026-05-28
138
+
139
+ ### ✨ Added
140
+
141
+ - Added candidate gotcha text generator for librarian books — calls Claude API to propose non-obvious tribal knowledge from PR descriptions, commit messages, and source comments (AUT-3735)
142
+ - Added gotcha persistence module for appending accepted gotchas below the manual-additions separator in book files, with idempotency and frontmatter flagging when the API is unreachable (AUT-3735)
143
+ - Added co-change analysis pipeline (#170)
144
+
145
+ ## [2.55.0] - 2026-05-27
146
+
147
+ ### ✨ Added
148
+
149
+ - Added co-change detector that parses git history within a configurable window, computes co-occurrence weighted edges between file pairs, and filters by confidence thresholds (AUT-3740)
150
+ - Added cross-reference injector that updates book frontmatter with co-change cross-references, supporting bidirectional refs for regular books and directional used_by refs for utility books (AUT-3740)
151
+ - Added co-change pipeline orchestrator that runs the full 5-step sequence: detection, mode resolution, sidecar write, optional injection, and markdown analysis report generation (AUT-3740)
152
+ - Added comprehensive unit and idempotency tests for co-change pipeline and cross-ref injector (AUT-3740)
153
+
154
+ ### 🔧 Changed
155
+
156
+ - Replaced string concatenation with template literal in co-change-mode sidecar writer (lint fix)
157
+
158
+ ## [2.54.1] - 2026-05-27
159
+
160
+ ### ✨ Added
161
+
162
+ - Added comprehensive test suite for librarian console API covering isTTY, selectOne, selectMany, confirm, and freeText functions (AUT-3756)
163
+ - Added gotcha solicitation usage example demonstrating the console API interactive workflow (AUT-3756)
164
+
165
+ ## [2.54.0] - 2026-05-27
166
+
167
+ ### ✨ Added
168
+
169
+ - Co-change mode dispatcher for the back-merge pipeline with two modes: `collect-only` (edge accumulation) and `inject` (cross-reference writing), with automatic transition after a configurable threshold of 5 back-merges (AUT-3772)
170
+ - Sidecar state file (`.library/maps/co-change-state.json`) for persisting co-change edges, back-merge counts, and transition configuration across pipeline runs
171
+ - CLI override support (`--co-change-mode=collect-only|inject`) for per-invocation mode control without mutating sidecar state
172
+ - Schema validation, append-only edge merging, and alphabetical edge normalization for deterministic sidecar diffs
173
+ - Comprehensive unit tests for co-change mode dispatcher covering constants, validation, I/O, edge operations, mode resolution, and cold-start behavior
174
+
175
+ ### 🔧 Changed
176
+
177
+ - Updated back-merge documentation to reflect co-change edge collection and conditional injection via mode dispatcher (#167)
178
+
179
+ ## [2.53.0] - 2026-05-27
180
+
181
+ ### ✨ Added
182
+
183
+ - Added post-regen review pass that uses Claude CLI to suggest manual-section improvements based on auto-section changes (#166)
184
+ - Added `--no-review` flag to `regenerate` and `report` commands to skip the Claude review step
185
+ - Added `line-diff.js` — pure-function line-based diff utility for LLM consumption (no shell dependencies)
186
+ - Added `llm.js` — thin Claude CLI wrapper with availability check and graceful degradation
187
+ - Added `review-pass.js` — interactive review workflow: Accept / Edit / Skip / Skip-all per suggestion
188
+
189
+ ### 🔧 Changed
190
+
191
+ - Enriched `regenerate()` output with `diff_context` (old/new auto-section, manual section, source file) for changed books
192
+ - Updated `report` command to include the review pass as Step 2b in the full maintenance cycle
193
+ - Renumbered execution prompt steps (overflow check → Step 4, gotcha solicitation → Step 5, report → Step 6) to accommodate the new review step
194
+
195
+ ## [2.52.0] - 2026-05-27
196
+
197
+ ### ✨ Added
198
+
199
+ - Interactive console primitive for the librarian, enabling programmatic library access (AUT-3734)
200
+ - Comprehensive I/O documentation, execution flows, cross-references, and gotchas for library books: analysis-engine, analyze-diff, analyze-pr, authorization, bump-version (AUT-3734)
201
+
202
+ ### 🔧 Changed
203
+
204
+ - ESLint configuration now includes `.library/librarian/**` in linting scope
205
+
206
+ ### 🐛 Fixed
207
+
208
+ - Fixed bump-version issue (#165)
209
+ - Fixed inaccuracies in library book documentation (AUT-3734)
210
+
211
+ ## [2.51.2] - 2026-05-26
212
+
213
+ ### 🔧 Changed
214
+
215
+ - Made library integration visible in CLI (#164)
216
+
217
+ ### 🐛 Fixed
218
+
219
+ - Fixed partial file selection during version bump — `updateVersionFiles` no longer silently skips unselected files; callers now filter before calling, ensuring only user-selected files are bumped (AUT-3733)
220
+
221
+ ## [2.51.1] - 2026-05-25
222
+
223
+ ### ✨ Added
224
+
225
+ - Specification guide (SPEC_GUIDE.md) — a practitioner's guide to building a Code Knowledge Library, covering setup, schema, taxonomy, maintenance, and worked examples (AUT-3722)
226
+ - Overlap-check tool for detecting book content overlap, closing Library milestone M4 (AUT-3722, #162)
227
+ - Maps/ artifacts (dependency graph, co-change seeds) surfaced via librarian module for programmatic access (AUT-3722)
228
+
229
+ ### 🔧 Changed
230
+
231
+ - Rewrote Library README as a specification-oriented guide with clearer structure, worked examples, milestone status tracking, and getting-started table (AUT-3722)
232
+ - Rewrote CLAUDE.md Library section to align with specification guide format and reference SPEC_GUIDE.md (AUT-3722)
233
+ - Made Library integration visible in CLI output so users can discover library-powered features (#163)
234
+
235
+ ## [2.51.0] - 2026-05-25
236
+
237
+ ### ✨ Added
238
+
239
+ - Added unified Library CLI at `.library/bin/library` with commands: check, regenerate, extract, tokens, graph, inject, validate, report (AUT-3272)
240
+ - Added centralized path resolution module (`.library/paths.js`) with resolver.yaml parser for repository-agnostic Library adoption
241
+ - Added Library CLI command registry (`.library/cli.js`) following the same pattern as `lib/cli-metadata.js`
242
+ - Added Library staleness checks to workflow commands: non-blocking warnings in `pre-commit`, `analyze-diff`, and `create-pr`; blocking gates in `create-release` and `close-release` (AUT-3272)
243
+ - Added co-change reference injection to `back-merge` command — automatically refreshes Library references after post-deploy merge (AUT-3272)
244
+ - Added `source:` field to `resolver.yaml` for configurable source directory resolution
245
+ - Added M5 validation results to Library README — hypothesis validated with modest effect size (0.7% mean token reduction, 8/8 accuracy parity)
246
+ - Added npm scripts for all Library CLI commands: `library:check`, `library:regenerate`, `library:extract`, `library:validate`, `library:report`
247
+ - Added N-gram overlap-check tool that compares CLAUDE.md against Library files, audits pointers, and categorises retained sections (AUT-3722)
248
+ - Added Specification Guide (SPEC_GUIDE.md) — a self-contained practitioner's guide for building a Code Knowledge Library in any repository (AUT-3722)
249
+ - Added maps/ artifact resolution to librarian — direct access via @maps/ paths and heuristic routing for co-change, dependency graph, and methodology queries (AUT-3722)
250
+ - Added co-change references to books via PR #161 (AUT-3315)
251
+
252
+ ### 🔧 Changed
253
+
254
+ - Refactored all Library tools (`staleness.js`, `generate-graph.js`, `inject-co-change.js`, `measure-tokens.js`, `extract.js`, `librarian/index.js`) to use centralized `paths.js` instead of per-tool `__dirname` arithmetic (AUT-3272)
255
+ - Rewrote `.library/README.md` with adoption guide, command reference, book schema documentation, and automated maintenance via git hooks section
256
+ - Replaced legacy npm scripts (`library:tokens`, `library:graph`, `library:extract-poc`, `library:inject-co-change`) with unified CLI-routed equivalents
257
+ - Updated `jest.config.js` to ignore tests inside `.claude/worktrees/` directories
258
+ - Bumped `last_verified` dates to 2026-05-22 across all 70 Library books
259
+ - Rewrote Library README as a specification-oriented guide — restructured around how the Library works (books, indexes, resolver, librarian, auto-generation) rather than operational steps (AUT-3722)
260
+ - Rewrote CLAUDE.md Library section to reference the Specification Guide instead of duplicating Library documentation (AUT-3722)
261
+ - Closed M4 milestone — resolved OPEN items 1–5 in SPEC_GUIDE § 13 with evidence and deferral justifications (AUT-3722)
262
+
263
+ ## [2.50.0] - 2026-05-20
264
+
265
+ ### ✨ Added
266
+
267
+ - Added co-change reference tracking to library books — frontmatter now includes `co_change_references` with commit counts, confidence scores, and trigger descriptions for files that historically change together (AUT-3315)
268
+ - Added `CO_CHANGE_SEEDS.md` co-change seed patterns document with 4 architectural coupling patterns mined from 6 months of git history (AUT-3315)
269
+ - Added `inject-co-change.js` CLI tool to inject co-change references from seed patterns into book frontmatter, with `--dry-run`, `--json`, and `--seeds` options (AUT-3315)
270
+ - Added librarian module for automated library maintenance pipeline (#160)
271
+
272
+ ### 🔧 Changed
273
+
274
+ - Moved staleness detection scripts from `.library/maintenance/` to `.library/tools/` directory (AUT-3315)
275
+ - Updated `.library/maps/` directory scope to include co-change seeds and token reports (AUT-3315)
276
+ - Updated `.library/tools/` directory scope to cover all standalone CLI utilities — staleness, graph, tokens, and co-change injection (AUT-3315)
277
+
278
+ ## [2.49.0] - 2026-05-19
279
+
280
+ ### ✨ Added
281
+
282
+ - Librarian module for Library maintenance pipeline with five core functions: fetch, regenerate, checkOverflow, solicitGotchas, and buildReport (AUT-3309)
283
+ - Execution prompt for running full regeneration cycles via Sonnet sessions (AUT-3309)
284
+ - Report template for structured maintenance cycle output (AUT-3309)
285
+ - Staleness detector for tracking book drift via AST hash comparison (#159, AUT-3307)
286
+
287
+ ### 🔧 Changed
288
+
289
+ - Renamed librarian `fetch` export to `fetchLibraryContent` for clarity (AUT-3309)
290
+ - Updated Library README with comprehensive documentation covering auto-generation, staleness detection, librarian module, and maintenance workflow
291
+ - Book schema `generated_from` field now supports AST hash format (`ast:sha256:<hex>`) for staleness tracking
292
+ - Library book count updated from 26 to 70 reflecting auto-generated coverage
293
+
294
+ ## [2.48.0] - 2026-05-19
295
+
296
+ ### ✨ Added
297
+
298
+ - Added staleness detector for library books to identify outdated documentation (AUT-3307)
299
+
300
+ ### 🗑️ Removed
301
+
302
+ - Removed extractor evaluation artifacts (PARSER_DECISION.md, QUALITY_GAP.md) after library auto-update evaluation completed (#158, AUT-3305)
303
+
304
+ ## [2.47.1] - 2026-05-19
305
+
306
+ ### 🐛 Fixed
307
+
308
+ - Fixed path normalization in AST extractor for Windows compatibility by using `fileURLToPath()` instead of raw URL pathname and normalizing backslashes in relative paths (AUT-3305)
309
+ - Fixed cross-platform book file detection in help catalog by using regex path separator matching instead of literal forward slash
310
+
311
+ ## [2.47.0] - 2026-05-19
312
+
313
+ ### ✨ Added
314
+
315
+ - Quality gap report and batch runner for the AST documentation extractor (AUT-3305)
316
+ - "preserve-if-filled" strategy for the AST extractor to retain manually-written book sections during regeneration (AUT-3305)
317
+
318
+ ### 🔧 Changed
319
+
320
+ - Regenerated all library book documentation from AST extractor output, replacing manually-maintained books with accurate cross-references and call signatures (AUT-3305, PR #157)
321
+
322
+ ## [2.46.0] - 2026-05-18
323
+
324
+ ### ✨ Added
325
+
326
+ - Added AST extractor POC with JavaScript and Python language adapters (AUT-3273)
327
+ - Added source-to-book auto-section generator for automated library documentation (AUT-3273)
328
+ - Generated book stubs for 40 source modules in `.library/books/` (AUT-3273)
329
+ - Added centralized configuration registry (`config-registry.js` + `defaults.json`) with remote override support (#156, ISSUE-138)
330
+
331
+ ### 🔧 Changed
332
+
333
+ - Configuration merge priority expanded from 4 to 5 layers, adding remote `settings.json` team-policy overrides (#156)
334
+ - Orchestrator model, threshold, and timeout are now configurable via remote `settings.json` instead of hardcoded values (#156)
335
+ - Judge timeout now configurable via remote `settings.json` (#156)
336
+ - Updated library README and shelf indexes to reflect new book count (AUT-3273)
337
+ - ESLint config updated to include `.library/extractor/` files (AUT-3273)
338
+
8
339
  ## [2.45.0] - 2026-05-13
9
340
 
10
341
  ### ✨ Added
342
+
11
343
  - Added centralized config-registry module with local defaults and remote override support (SUE-138)
12
344
  - Added lib/defaults.json as the single source of truth for all package default values (SUE-138)
13
345
 
14
346
  ### 🔧 Changed
347
+
15
348
  - Replaced inline hardcoded constants across modules with config-registry lookups — judge, orchestrator, Linear connector, model aliases, linter tools, and PR analysis categories now read from defaults.json with remote override capability (SUE-138)
16
349
  - Updated config merge priority to HARDCODED < remote settings.json < defaults < preset < user overrides (SUE-138)
17
350
  - Added config-registry mocks to unit tests for modules consuming centralized defaults (SUE-138)
18
351
 
19
352
  ### 🐛 Fixed
20
- - Fixed Linear ticket fetch issue (#155)
21
353
 
354
+ - Fixed Linear ticket fetch issue (#155)
22
355
 
23
356
  ## [2.44.1] - 2026-05-13
24
357
 
25
358
  ### ✨ Added
359
+
26
360
  - Added unit tests for linear-connector module covering ticket extraction, parsing, token loading, connection testing, and ticket fetching (SUE-154)
27
361
 
28
362
  ### 🐛 Fixed
363
+
29
364
  - Fixed help command to cap book reads at 5 in Pass 2, preventing oversized prompts when the LLM requests too many library books (SUE-154)
30
365
 
31
366
  ### 🗑️ Removed
32
- - Removed CLAUDE-MIGRATION.md — migration map no longer needed after library stabilization
33
367
 
368
+ - Removed CLAUDE-MIGRATION.md — migration map no longer needed after library stabilization
34
369
 
35
370
  ## [2.44.0] - 2026-05-04
36
371
 
37
372
  ### ✨ Added
373
+
38
374
  - New `HELP_NAVIGATE.md` prompt template for the first-pass catalog navigation (SUE-152)
39
375
  - Auto-discovery of `.library/` catalog files (by-code, by-domain, by-task-type shelves) for AI help context
40
376
 
41
377
  ### 🔧 Changed
378
+
42
379
  - Rewrote AI help command to use a two-pass librarian approach navigating local `.library/` instead of single-pass CLAUDE.md lookup (SUE-152)
43
380
  - Pass 1 sends project catalog to Claude; if deeper detail is needed, Pass 2 reads specific book files from local disk — no GitHub API calls
44
381
  - Updated `HELP_QUERY.md` template to accept catalog + book content instead of flat documentation
@@ -47,56 +384,63 @@ y este proyecto adhiere a [Semantic Versioning](https://semver.org/spec/v2.0.0.h
47
384
  - Updated unit tests to cover two-pass librarian flow, catalog mocking, and book-read scenarios
48
385
 
49
386
  ### 🔒 Security
387
+
50
388
  - Added path traversal protection when reading LLM-requested book paths — resolved paths are verified against the package root before disk access
51
389
 
52
390
  ### 🗑️ Removed
391
+
53
392
  - Removed GitHub API dependency (`fetchFileContent`, `parseGitHubRepo`) from AI help flow — all context is now read from local disk
54
393
  - Removed `readClaudeMd()` single-file reader in favor of `readLibraryCatalog()` multi-file catalog builder
55
394
 
56
-
57
395
  ## [2.43.0] - 2026-04-30
58
396
 
59
397
  ### ✨ Added
398
+
60
399
  - Headless mode for git hooks via CLAUDE_HOOKS_HEADLESS=1 environment variable, routing all LLM calls through the Anthropic SDK instead of the Claude CLI for CI/ECS environments (CT-805)
61
400
  - Unit tests for pre-commit and prepare-commit-msg hooks covering headless mode propagation and error messaging (CT-805)
62
401
 
63
402
  ### 🔧 Changed
403
+
64
404
  - Hook error messages now show SDK-specific guidance ("Check that ANTHROPIC_API_KEY is set") in headless mode and CLI-specific guidance otherwise (CT-805)
65
405
  - Headless flag propagated through full analysis chain: runAnalysis, orchestrateBatches, judgeAndFix, and analyzeCode all accept and forward the headless option (CT-805)
66
406
 
67
407
  ### 🐛 Fixed
408
+
68
409
  - Cross-platform path separator handling in hooks-verified marker test (#150)
69
410
  - Contract documentation test updated to match current CLAUDE.md section heading (#150)
70
411
 
71
-
72
412
  ## [2.42.0] - 2026-04-30
73
413
 
74
414
  ### ✨ Added
415
+
75
416
  - Added `Hooks-Verified: true` Git trailer to commits that pass pre-commit analysis, coordinated via a tree-SHA marker file in `.git/` (CT-802)
76
417
  - Added `hooks-verified-marker.js` utility for marker file CRUD between pre-commit (writes) and prepare-commit-msg (reads/validates/consumes)
77
418
  - Added `getStagedTreeSha()`, `hasHooksVerifiedTrailer()`, and `appendTrailer()` to git-operations for tree fingerprinting and canonical trailer formatting via `git interpret-trailers`
78
419
  - Added hooks-verified marker writing to the `analyze` command when staged-scope analysis completes without critical/blocker issues (CT-802)
79
420
 
80
421
  ### 🔧 Changed
422
+
81
423
  - Reorganized CLAUDE.md project documentation into `.library/` structure with indexed books, shelves, and domain reading lists (#149)
82
424
  - Updated commit-workflow domain reading list and hook books to document the new Hooks-Verified trailer pipeline
83
425
 
84
426
  ### 🐛 Fixed
85
- - Deferred trailer append in prepare-commit-msg until the final message is written, preventing the auto-generated message flow from overwriting the `Hooks-Verified` trailer (CT-802)
86
427
 
428
+ - Deferred trailer append in prepare-commit-msg until the final message is written, preventing the auto-generated message flow from overwriting the `Hooks-Verified` trailer (CT-802)
87
429
 
88
430
  ## [2.41.1] - 2026-04-30
89
431
 
90
432
  ### ✨ Added
433
+
91
434
  - Added headless mode and JSON output support for `analyze`, `create-pr`, and `lint` commands (#148, CT-799)
92
435
 
93
436
  ### 🔧 Changed
94
- - Redistributed CLAUDE.md content into `.library/` — new `conventions.md` coding standards reference, enriched book indexes with key exports, and expanded domain quick-reference tables
95
437
 
438
+ - Redistributed CLAUDE.md content into `.library/` — new `conventions.md` coding standards reference, enriched book indexes with key exports, and expanded domain quick-reference tables
96
439
 
97
440
  ## [2.41.0] - 2026-04-30
98
441
 
99
442
  ### ✨ Added
443
+
100
444
  - Added `--headless` flag to `analyze`, `create-pr`, and `lint` commands for non-interactive CI execution (CT-799)
101
445
  - Added `--format json` output mode that emits a single structured JSON line to stdout, routing all other output to stderr (CT-799)
102
446
  - Added `CostTracker` integration in headless mode for `analyze` and `create-pr` to report Claude API costs in JSON output (CT-799)
@@ -104,42 +448,46 @@ y este proyecto adhiere a [Semantic Versioning](https://semver.org/spec/v2.0.0.h
104
448
  - Added early fatal guard for detached HEAD state in `create-pr` with actionable fix instructions (CT-804, #147)
105
449
 
106
450
  ### 🔧 Changed
451
+
107
452
  - Updated `interactive-ui.js` display helpers (`showSuccess`, `showError`, `showWarning`, `showInfo`) to delegate to `logger.js`, enabling JSON mode output routing to stderr
108
453
  - Updated `displayLintResults` to accept a `{ silent }` option that suppresses decorative output in JSON mode
109
454
  - Updated `create-pr` headless mode to resolve all 11 interactive decision points with documented defaults (auto-push, squash for unknown strategy, skip tag prompts)
110
455
 
111
-
112
456
  ## [2.40.0] - 2026-04-30
113
457
 
114
458
  ### ✨ Added
459
+
115
460
  - Added early detached HEAD detection in `create-pr` command with actionable error message and remediation steps (CT-804)
116
461
  - Added Operational Contract documentation in CLAUDE.md defining runtime environment requirements for CI/container orchestrators
117
462
  - Added CWD & Branch Contract reference book (`.library/books/cwd-contract.md`) with command-level HEAD tolerance matrix
118
463
  - Added smoke tests to prevent accidental deletion of contract documentation
119
464
 
120
465
  ### 🔧 Changed
466
+
121
467
  - Moved branch detection earlier in `create-pr` flow (before interactive prompts) to fail fast on detached HEAD
122
468
  - Replaced `error()` + `return` with `fatal()` for detached HEAD guard in `create-pr`, ensuring consistent process termination
123
469
 
124
-
125
470
  ## [2.39.0] - 2026-04-29
126
471
 
127
472
  ### ✨ Added
473
+
128
474
  - Added `--headless` flag to `install` command for CI/container environments — skips all side effects: dependency checks, git config, `.gitignore` updates, shell completions, linter availability check, and GitHub token setup (CT-803)
129
475
  - Added `--verify-sdk` flag to `install` command — opt-in 1-token SDK ping (haiku, 10s timeout) to validate `ANTHROPIC_API_KEY` after installation; exits 1 in headless mode on failure, warns in interactive mode (CT-803)
130
476
  - Added `verifySDKConnection()` to `claude-client.js` — minimal SDK connectivity check that delegates to `_executeSDK('ping')` and never throws (CT-803)
131
477
  - Added `--headless` bypass for authorization guard in CLI router — CI runners skip RBAC checks entirely; governance enforced at branch-protection level (CT-803)
132
478
 
133
479
  ### 🔧 Changed
480
+
134
481
  - Install orchestration expanded from 20 to 21 steps to accommodate the new SDK verification step
135
482
 
136
483
  ### ⚠️ Deprecated
137
- - Deprecated `--skip-auth` flag on `install` command — use `--headless` instead for full CI/container mode; logs a deprecation warning when used
138
484
 
485
+ - Deprecated `--skip-auth` flag on `install` command — use `--headless` instead for full CI/container mode; logs a deprecation warning when used
139
486
 
140
487
  ## [2.38.0] - 2026-04-29
141
488
 
142
489
  ### ✨ Added
490
+
143
491
  - Added headless mode (`--headless`) for `analyze-pr` command — skips all interactive prompts for CI/automation pipelines
144
492
  - Added JSON output mode (`--format json`) for `analyze-pr` — emits a single structured JSON document to stdout with verdict, severity counts, comments, and cost data (requires `--headless`)
145
493
  - Added cost tracking for headless `analyze-pr` runs via `CostTracker` integration (#144)
@@ -148,28 +496,30 @@ y este proyecto adhiere a [Semantic Versioning](https://semver.org/spec/v2.0.0.h
148
496
  - Added JSON mode to logger (`setJSONMode`) — routes `info`/`success`/`warning`/`debug` to stderr, reserving stdout for structured output
149
497
 
150
498
  ### 🔧 Changed
499
+
151
500
  - Changed `error()` in helpers.js to log-only (no longer calls `process.exit`) — callers needing termination should use `fatal()` instead
152
501
  - Changed `bin/claude-hooks` to use `fatal()` for unknown command errors
153
502
  - Changed `helpers.info()`, `helpers.success()`, and `helpers.warning()` to delegate to logger equivalents, respecting JSON mode routing
154
503
 
155
-
156
504
  ## [2.37.0] - 2026-04-29
157
505
 
158
506
  ### ✨ Added
507
+
159
508
  - Added cost tracking for headless SDK calls — per-call USD cost calculation with cache token multipliers, hardcoded Anthropic pricing table, and CloudWatch-friendly structured JSON logs (`cost-tracker.js`)
160
509
  - Added optional Langfuse tracing integration for headless SDK calls — records LLM generations (model, tokens, cost, prompt/response) as traces; disabled by default, activated via `LANGFUSE_ENABLED` env var (`langfuse-tracer.js`)
161
510
  - Added `costTracker` option to `analyzeCode()`, `executeClaudeWithRetry()`, and `executeClaude()` for external cost accumulation across multiple calls
162
511
  - Added `._costs` field to `analyzeCode()` results in headless mode — contains per-call token usage and USD cost snapshot
163
512
 
164
513
  ### 🔧 Changed
514
+
165
515
  - Changed `_executeSDK()` return type from plain text string to `{ text, usage, model }` — callers now receive normalized token usage and resolved model ID
166
516
  - Normalized SDK usage fields with defaults (0 for missing cache token counts) to ensure consistent downstream processing
167
517
  - Updated library documentation with new books for `cost-tracker.js` and `langfuse-tracer.js`, updated `claude-client.js` book with observability details
168
518
 
169
-
170
519
  ## [2.36.0] - 2026-04-28
171
520
 
172
521
  ### ✨ Added
522
+
173
523
  - Added SDK adapter for headless mode in claude-client — dual execution backend: CLI spawn for local/interactive use, or Anthropic SDK direct calls for headless/ECS environments (#141)
174
524
  - Added `_executeSDK()` function for direct Anthropic SDK calls with lazy-loaded `@anthropic-ai/sdk` dependency
175
525
  - Added `resolveModelAlias()` and `MODEL_ALIASES` constant with environment variable overrides (`CLAUDE_MODEL_SONNET`, `CLAUDE_MODEL_OPUS`, `CLAUDE_MODEL_HAIKU`)
@@ -177,21 +527,24 @@ y este proyecto adhiere a [Semantic Versioning](https://semver.org/spec/v2.0.0.h
177
527
  - Added `claude.defaultModel` to hardcoded config as fallback model for SDK headless mode
178
528
 
179
529
  ### 🔧 Changed
530
+
180
531
  - Changed `analyzeCode()` to return parsed JSON object instead of raw response text
181
532
  - Changed `executeClaude()` to branch between SDK path (when `headless: true`) and CLI spawn path
182
533
  - SDK errors marked with `fromSDK: true` are no longer retried by `withRetry` — the Anthropic SDK already retries internally (2 attempts for rate limits, timeouts, and 5xx)
183
534
  - Updated claude-client library book to document dual-backend architecture, SDK gotchas, and new exports
184
535
 
185
536
  ### 🐛 Fixed
537
+
186
538
  - Fixed Spotless timeouts and cmd.exe per-file mode (#141)
187
539
 
188
540
  ### 🗑️ Removed
189
- - Removed `.library/CATEGORY_COMPLETENESS_REPORT.md` and `.library/CLASSIFICATION_REPORT.md` reports
190
541
 
542
+ - Removed `.library/CATEGORY_COMPLETENESS_REPORT.md` and `.library/CLASSIFICATION_REPORT.md` reports
191
543
 
192
544
  ## [2.35.3] - 2026-04-22
193
545
 
194
546
  ### ✨ Added
547
+
195
548
  - Code Knowledge Library (`.library/`) with 25 reference books covering source modules — structured documentation with call signatures, I/O behavior, cross-references, and gotchas per module (#125-#131)
196
549
  - By-code index for navigating from source file paths to their reference books (`by-code/utils.md`, `by-code/commands.md`, `by-code/hooks.md`)
197
550
  - By-domain index with curated reading lists for four business workflows: commit pipeline, release management, PR analysis, and GitHub integration (`by-domain/`)
@@ -201,24 +554,26 @@ y este proyecto adhiere a [Semantic Versioning](https://semver.org/spec/v2.0.0.h
201
554
  - Classification report and category completeness report validating all 66 source modules against the 8-category taxonomy
202
555
 
203
556
  ### 🐛 Fixed
204
- - Spotless linting timeouts and cmd.exe per-file mode on Windows — resolves batch-mode failures when Spotless wrapper is a `.cmd`/`.bat` file (#124, #125)
205
557
 
558
+ - Spotless linting timeouts and cmd.exe per-file mode on Windows — resolves batch-mode failures when Spotless wrapper is a `.cmd`/`.bat` file (#124, #125)
206
559
 
207
560
  ## [2.35.2] - 2026-04-13
208
561
 
209
562
  ### ✨ Added
563
+
210
564
  - Added Maven Wrapper (mvnw/mvnw.cmd) auto-detection for Spotless — bypasses cmd.exe metacharacter issues on Windows/WSL2
211
565
  - Added per-file execution mode for Spotless to avoid pipe (`|`) metacharacter in regex arguments on Windows
212
566
  - Added `env` option to `runTool`, `runToolFix`, and `runToolWithAutoFix` for passing extra environment variables to tool invocations
213
567
  - Added `configDir` to `_detectInProjectFiles` return value for downstream Maven Wrapper resolution
214
568
 
215
569
  ### 🐛 Fixed
216
- - Fixed Spotless linter failing on Windows/WSL2 when multiple Java files are staged — `|` (pipe) in the `DspotlessFiles` regex was interpreted as a shell pipe by cmd.exe during batch script expansion
217
570
 
571
+ - Fixed Spotless linter failing on Windows/WSL2 when multiple Java files are staged — `|` (pipe) in the `DspotlessFiles` regex was interpreted as a shell pipe by cmd.exe during batch script expansion
218
572
 
219
573
  ## [2.35.1] - 2026-04-08
220
574
 
221
575
  ### ✨ Added
576
+
222
577
  - Local binary resolution for linter tools — walks up from config directory to repo root, preferring project-installed binaries over npx to prevent version mismatches (#123)
223
578
  - Array-form `detectInProjectFile` for tool detection — Prettier and ESLint now recognized via config files (.prettierrc, .eslintrc.json, eslint.config.js, etc.) in addition to package.json dependencies
224
579
  - WSL2/Windows interop support for .cmd/.bat tool binaries, with proper cmd.exe metacharacter escaping
@@ -226,39 +581,43 @@ y este proyecto adhiere a [Semantic Versioning](https://semver.org/spec/v2.0.0.h
226
581
  - New `localBin` and `toolCwd` options for `runTool`/`runToolFix`/`runToolWithAutoFix` enabling direct binary execution and correct plugin resolution in monorepos
227
582
 
228
583
  ### 🔧 Changed
584
+
229
585
  - Replaced `execSync` with `execFileSync` in tool-runner — args passed directly to process, preventing shell interpretation of regex metacharacters (e.g., `|` in Spotless patterns) and file path injection
230
586
  - Tool detection now requires project-level configuration when `detectInProjectFile` is defined — PATH-only presence no longer sufficient, preventing false positives (e.g., mvn in PATH treated as Spotless available)
231
587
  - Project file scanning starts from repo root instead of cwd, fixing detection when git hooks run from subdirectories
232
588
  - Increased judge timeout from 120s to 180s
233
589
 
234
590
  ### 🐛 Fixed
591
+
235
592
  - Fixed tool auto-fix being attempted after execution failures (ENOENT, EACCES) by tracking `executionFailed` flag and skipping fix step
236
593
  - Fixed ENOENT handling in `runToolFix` — missing command binary now returns gracefully instead of being misinterpreted as a partial fix
237
594
  - Fixed `git add` in restage step to use `execFileSync` with proper argument array instead of shell string interpolation
238
595
 
239
596
  ### 🔒 Security
597
+
240
598
  - Eliminated shell injection risk in tool execution by switching from `execSync` (shell-based) to `execFileSync` (direct process spawn)
241
599
  - Added `_escapeCmdMeta()` and `_prepareExec()` for safe cmd.exe argument passing when executing .cmd/.bat files on Windows/WSL
242
600
 
243
-
244
601
  ## [2.35.0] - 2026-03-27
245
602
 
246
603
  ### ✨ Added
604
+
247
605
  - Prettier formatting support — auto-formats JS/TS/CSS/HTML/JSON/YAML/MD files before linting (format first, then lint)
248
606
  - Remote formatter configuration — preset-to-tools mapping fetched from centralized git-hooks-config repo, allowing team-wide control without releasing new versions
249
607
  - New `parsePrettierOutput()` function for parsing Prettier --check output into structured issues
250
608
 
251
609
  ### 🔧 Changed
610
+
252
611
  - Linting pipeline now runs formatters (Prettier) before linters (ESLint) for consistent code style
253
612
  - Updated preset-to-tools mapping: frontend, fullstack, ai, and default presets now include Prettier
254
613
  - `getLinterToolsForPreset()` now fetches remote config with local fallback instead of using hardcoded mapping only
255
614
  - `runLinters()` and `checkLinterAvailability()` converted to async functions to support remote config fetching
256
615
  - Unfixable linting issues are now forwarded to the Claude judge for semantic resolution instead of blocking directly
257
616
 
258
-
259
617
  ## [2.34.0] - 2026-03-27
260
618
 
261
619
  ### ✨ Added
620
+
262
621
  - Pre-commit linting with ESLint, Spotless, and sqlfluff - runs before Claude analysis with auto-fix and re-stage
263
622
  - `lint` command - run linters on staged files, directories, or specific files (`claude-hooks lint [paths...]`)
264
623
  - Linter availability check during installation - verifies linter presence per preset and shows install instructions
@@ -267,30 +626,33 @@ y este proyecto adhiere a [Semantic Versioning](https://semver.org/spec/v2.0.0.h
267
626
  - Maven availability check during installation with install instructions for backend/fullstack presets
268
627
 
269
628
  ### 🔧 Changed
629
+
270
630
  - Pre-commit flow now runs linting before Claude analysis - fast, deterministic checks first
271
631
  - Unfixable lint issues are forwarded to the judge for semantic resolution
272
632
  - Updated documentation to reflect new linting workflow and command usage
273
633
 
274
634
  ### 🐛 Fixed
275
- - WSL Claude CLI detection in non-default distros (#120, #121)
276
635
 
636
+ - WSL Claude CLI detection in non-default distros (#120, #121)
277
637
 
278
638
  ## [2.33.1] - 2026-03-26
279
639
 
280
640
  ### 🔧 Changed
641
+
281
642
  - Improved WSL Claude CLI detection to resolve Claude's path via login shell when installed via nvm or user-scoped npm prefix
282
643
  - Added support for detecting Claude CLI in non-default WSL distros when the default distro is docker-desktop or similar
283
644
  - Switched to execFileSync for WSL distro listing to avoid cmd.exe quote mangling issues
284
645
  - Updated README-NPM with release workflow commands documentation and WSL troubleshooting guide
285
646
 
286
647
  ### 🐛 Fixed
648
+
287
649
  - Fixed Claude CLI not being detected on Windows when running from Git Bash with Claude installed inside WSL via nvm (#120)
288
650
  - Fixed WSL distro detection failing due to UTF-16LE encoding from wsl.exe output
289
651
 
290
-
291
652
  ## [2.33.0] - 2026-03-20
292
653
 
293
654
  ### ✨ Added
655
+
294
656
  - Always-on metrics system for code quality observability (#41) - collects structured JSONL events locally with 90-day retention for trend analysis
295
657
  - Team-based reviewer selection via GitHub Teams API (#115, #36) - automatically resolves team members and excludes PR author when selecting reviewers
296
658
  - New metrics module (`lib/utils/metrics.js`) with fire-and-forget event recording that never blocks callers
@@ -298,19 +660,21 @@ y este proyecto adhiere a [Semantic Versioning](https://semver.org/spec/v2.0.0.h
298
660
  - Documented proven implementation patterns in CLAUDE.md covering testability, git operations, and architecture best practices
299
661
 
300
662
  ### 🔧 Changed
663
+
301
664
  - Telemetry system now always enabled - removed opt-out toggle for consistent observability
302
665
  - Existing telemetry events dual-write to unified metrics system for consolidated analysis
303
666
  - PR statistics module now records to both legacy JSONL and new metrics system
304
667
  - Judge module switched from telemetry to metrics recording with richer event data including false positives and unresolved issues
305
668
 
306
669
  ### 🗑️ Removed
670
+
307
671
  - Removed `system.telemetry` configuration option - metrics are now always collected locally
308
672
  - Removed telemetry disabled warnings from `batch-info` and `telemetry-cmd` commands
309
673
 
310
-
311
674
  ## [2.32.0] - 2026-03-19
312
675
 
313
676
  ### ✨ Added
677
+
314
678
  - Team-based reviewer selection using GitHub Teams API for Pull Requests (#36)
315
679
  - New `reviewer-selector.js` module for intelligent team member resolution with PR author exclusion
316
680
  - Support for `teamSlug` configuration in `config.github.pr` (defaults to 'automation')
@@ -318,6 +682,7 @@ y este proyecto adhiere a [Semantic Versioning](https://semver.org/spec/v2.0.0.h
318
682
  - New GitHub API methods: `listRepoTeams()` and `listTeamMembers()` for team resolution
319
683
 
320
684
  ### 🔧 Changed
685
+
321
686
  - PR reviewer selection now prioritizes GitHub Teams API over CODEOWNERS file
322
687
  - Updated `createPullRequest()` to accept `teamReviewers` parameter for team-based review requests
323
688
  - Refactored `github-client.js` to focus on config-based fallback reviewers only
@@ -325,18 +690,18 @@ y este proyecto adhiere a [Semantic Versioning](https://semver.org/spec/v2.0.0.h
325
690
  - Updated documentation to reflect team-based reviewer workflow in CLAUDE.md and README files
326
691
 
327
692
  ### 🗑️ Removed
693
+
328
694
  - CODEOWNERS file parsing and resolution logic from reviewer selection workflow
329
695
  - Methods `readCodeowners()` and `parseCodeownersReviewers()` from `github-client.js`
330
696
 
331
-
332
697
  ## [2.31.1] - 2026-03-19
333
698
 
334
699
  ### 🔧 Changed
700
+
335
701
  - Migrated authorization config repository from `claude-hooks-config` to `git-hooks-config` as the definitive source for permissions and labels
336
702
  - Centralized existing permissions and labels configuration in the definitive repository
337
703
  - Updated documentation in CLAUDE.md to reference the new `git-hooks-config` repository and document team-wide remote config pattern
338
704
 
339
-
340
705
  ## [2.31.0] - 2026-03-19
341
706
 
342
707
  ### ✨ Added