commit-analyzer 1.1.4 → 1.1.6

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.
Files changed (55) hide show
  1. package/README.md +164 -82
  2. package/dist/main.ts +0 -0
  3. package/package.json +2 -1
  4. package/.claude/settings.local.json +0 -23
  5. package/commits.csv +0 -2
  6. package/csv-to-report-prompt.md +0 -97
  7. package/eslint.config.mts +0 -45
  8. package/prompt.md +0 -69
  9. package/src/1.domain/analysis.ts +0 -93
  10. package/src/1.domain/analyzed-commit.ts +0 -97
  11. package/src/1.domain/application-error.ts +0 -32
  12. package/src/1.domain/category.ts +0 -52
  13. package/src/1.domain/commit-analysis-service.ts +0 -92
  14. package/src/1.domain/commit-hash.ts +0 -40
  15. package/src/1.domain/commit.ts +0 -99
  16. package/src/1.domain/date-formatting-service.ts +0 -81
  17. package/src/1.domain/date-range.ts +0 -76
  18. package/src/1.domain/report-generation-service.ts +0 -443
  19. package/src/2.application/analyze-commits.usecase.ts +0 -307
  20. package/src/2.application/generate-report.usecase.ts +0 -209
  21. package/src/2.application/llm-service.ts +0 -54
  22. package/src/2.application/resume-analysis.usecase.ts +0 -123
  23. package/src/3.presentation/analysis-repository.interface.ts +0 -27
  24. package/src/3.presentation/analyze-command.ts +0 -128
  25. package/src/3.presentation/cli-application.ts +0 -278
  26. package/src/3.presentation/command-handler.interface.ts +0 -4
  27. package/src/3.presentation/commit-analysis-controller.ts +0 -101
  28. package/src/3.presentation/commit-repository.interface.ts +0 -47
  29. package/src/3.presentation/console-formatter.ts +0 -129
  30. package/src/3.presentation/progress-repository.interface.ts +0 -49
  31. package/src/3.presentation/report-command.ts +0 -50
  32. package/src/3.presentation/resume-command.ts +0 -59
  33. package/src/3.presentation/storage-repository.interface.ts +0 -33
  34. package/src/3.presentation/storage-service.interface.ts +0 -32
  35. package/src/3.presentation/version-control-service.interface.ts +0 -46
  36. package/src/4.infrastructure/cache-service.ts +0 -271
  37. package/src/4.infrastructure/cached-analysis-repository.ts +0 -46
  38. package/src/4.infrastructure/claude-llm-adapter.ts +0 -124
  39. package/src/4.infrastructure/csv-service.ts +0 -252
  40. package/src/4.infrastructure/file-storage-repository.ts +0 -108
  41. package/src/4.infrastructure/file-system-storage-adapter.ts +0 -87
  42. package/src/4.infrastructure/gemini-llm-adapter.ts +0 -46
  43. package/src/4.infrastructure/git-adapter.ts +0 -143
  44. package/src/4.infrastructure/git-commit-repository.ts +0 -85
  45. package/src/4.infrastructure/json-progress-tracker.ts +0 -182
  46. package/src/4.infrastructure/llm-adapter-factory.ts +0 -26
  47. package/src/4.infrastructure/llm-adapter.ts +0 -485
  48. package/src/4.infrastructure/llm-analysis-repository.ts +0 -38
  49. package/src/4.infrastructure/openai-llm-adapter.ts +0 -57
  50. package/src/di.ts +0 -109
  51. package/src/main.ts +0 -63
  52. package/src/utils/app-paths.ts +0 -36
  53. package/src/utils/concurrency.ts +0 -81
  54. package/src/utils.ts +0 -77
  55. package/tsconfig.json +0 -25
package/README.md CHANGED
@@ -1,43 +1,29 @@
1
1
  # Git Commit Analyzer
2
2
 
3
- A TypeScript/Node.js program that analyzes git commits and generates categorized summaries using Claude CLI.
3
+ A TypeScript/Node.js program that analyzes git commits and generates categorized
4
+ summaries using Claude CLI.
4
5
 
5
6
  ## Features
6
7
 
7
8
  - Extract commit details (message, date, diff) from git repositories
8
- - Categorize commits using LLM analysis into: `tweak`, `feature`, or `process`
9
- - Generate CSV reports with year, category, summary, and description
10
- - Generate condensed markdown reports from CSV data for stakeholder communication
11
- - Support for multiple LLM models (Claude, Gemini, Codex) with automatic detection
9
+ - Categorize commits using LLM analysis into:
10
+ `tweak`, `feature`, or `process`
11
+ - Generate CSV reports with timestamp, category, summary, and description
12
+ - Generate condensed markdown reports from CSV data for stakeholder
13
+ communication
14
+ - Support for multiple LLM models (Claude, Gemini, OpenAI) with automatic
15
+ detection
12
16
  - Support for batch processing multiple commits
13
17
  - Automatically filters out merge commits for cleaner analysis
14
18
  - Robust error handling and validation
15
19
 
16
- ## Prerequisites
17
-
18
- This tool requires Bun runtime. Install it globally:
19
-
20
- ```bash
21
- # Install bun globally
22
- curl -fsSL https://bun.sh/install | bash
23
- # or
24
- npm install -g bun
25
- ```
26
-
27
- ## Installation
28
-
29
- ```bash
30
- npm install
31
- bun link
32
- ```
33
-
34
- After linking, you can use `commit-analyzer` command globally.
35
20
 
36
21
  ## Usage
37
22
 
38
23
  ### Default Behavior
39
24
 
40
- When run without arguments, the program analyzes all commits authored by the current user:
25
+ When run without arguments, the program analyzes all commits authored by the
26
+ current user:
41
27
 
42
28
  ```bash
43
29
  # Analyze all your commits in the current repository
@@ -56,9 +42,6 @@ npx commit-analyzer --author user@example.com
56
42
  # Analyze specific commits
57
43
  npx commit-analyzer abc123 def456 ghi789
58
44
 
59
- # Read commits from file
60
- npx commit-analyzer --file commits.txt
61
-
62
45
  # Specify output file with default behavior
63
46
  npx commit-analyzer --output analysis.csv --limit 20
64
47
 
@@ -69,32 +52,46 @@ npx commit-analyzer --report --input-csv analysis.csv
69
52
  npx commit-analyzer --report --limit 50
70
53
 
71
54
  # Use specific LLM model
72
- npx commit-analyzer --model claude --limit 10
55
+ npx commit-analyzer --llm claude --limit 10
73
56
  ```
74
57
 
75
58
  ### Options
76
59
 
77
- - `-o, --output <file>`: Output file (default: `output.csv` for analysis, `summary-report.md` for reports)
78
- - `-f, --file <file>`: Read commit hashes from file (one per line)
79
- - `-a, --author <email>`: Filter commits by author email (defaults to current user)
80
- - `-l, --limit <number>`: Limit number of commits to analyze
81
- - `-m, --model <model>`: LLM model to use (claude, gemini, codex)
82
- - `-r, --resume`: Resume from last checkpoint if available
83
- - `-c, --clear`: Clear any existing progress checkpoint
84
- - `--report`: Generate condensed markdown report from existing CSV
85
- - `--input-csv <file>`: Input CSV file to read for report generation
86
- - `-h, --help`: Display help
87
- - `-V, --version`: Display version
88
-
89
- ### Input File Format
90
-
91
- When using `--file`, create a text file with one commit hash per line:
92
-
93
- ```
94
- abc123def456
95
- def456ghi789
96
- ghi789jkl012
97
- ```
60
+ - `-o, --output <file>`:
61
+ Output file (default:
62
+ `results/commits.csv` for analysis, `results/report.md` for reports)
63
+ - `--output-dir <dir>`:
64
+ Output directory for CSV and report files (default:
65
+ current directory)
66
+ - `-a, --author <email>`:
67
+ Filter commits by author email (defaults to current user)
68
+ - `-l, --limit <number>`:
69
+ Limit number of commits to analyze
70
+ - `--llm <model>`:
71
+ LLM model to use (claude, gemini, openai)
72
+ - `-r, --resume`:
73
+ Resume from last checkpoint if available
74
+ - `-c, --clear`:
75
+ Clear any existing progress checkpoint
76
+ - `--report`:
77
+ Generate condensed markdown report from existing CSV
78
+ - `--input-csv <file>`:
79
+ Input CSV file to read for report generation
80
+ - `-v, --verbose`:
81
+ Enable verbose logging (shows detailed error information)
82
+ - `--since <date>`:
83
+ Only analyze commits since this date (YYYY-MM-DD, '1 week ago', '2024-01-01')
84
+ - `--until <date>`:
85
+ Only analyze commits until this date (YYYY-MM-DD, '1 day ago', '2024-12-31')
86
+ - `--no-cache`:
87
+ Disable caching of analysis results
88
+ - `--batch-size <number>`:
89
+ Number of commits to process per batch (default:
90
+ 1 for sequential processing)
91
+ - `-h, --help`:
92
+ Display help
93
+ - `-V, --version`:
94
+ Display version
98
95
 
99
96
  ## Output Formats
100
97
 
@@ -102,36 +99,46 @@ ghi789jkl012
102
99
 
103
100
  The program generates a CSV file with the following columns:
104
101
 
105
- - `year`: Year of the commit
106
- - `category`: One of `tweak`, `feature`, or `process`
107
- - `summary`: One-line description (max 80 characters)
108
- - `description`: Detailed explanation (2-3 sentences)
102
+ - `timestamp`:
103
+ ISO 8601 timestamp of the commit (e.g., `2025-08-28T11:14:40.000Z`)
104
+ - `category`:
105
+ One of `tweak`, `feature`, or `process`
106
+ - `summary`:
107
+ One-line description (max 80 characters)
108
+ - `description`:
109
+ Detailed explanation (2-3 sentences)
109
110
 
110
111
  ### Markdown Report Output
111
112
 
112
- When using the `--report` option, the program generates a condensed markdown report that:
113
+ When using the `--report` option, the program generates a condensed markdown
114
+ report that:
113
115
 
114
116
  - Groups commits by year (most recent first)
115
- - Organizes by categories: Features, Processes, Tweaks & Bug Fixes
117
+ - Organizes by categories:
118
+ Features, Processes, Tweaks & Bug Fixes
116
119
  - Consolidates similar items for stakeholder readability
117
120
  - Includes commit count statistics
118
- - Uses professional language suitable for both technical and non-technical audiences
121
+ - Uses professional language suitable for both technical and non-technical
122
+ audiences
119
123
 
120
124
  ## Requirements
121
125
 
122
- - Node.js 18+ with TypeScript support
126
+ - Node.js 18+ with TypeScript support (Bun runtime recommended)
123
127
  - Git repository (must be run within a git repository)
124
128
  - At least one supported LLM CLI tool:
125
129
  - Claude CLI (`claude`) - recommended, defaults to Sonnet model
126
130
  - Gemini CLI (`gemini`)
127
- - Codex CLI (`codex`)
131
+ - OpenAI CLI (`codex`)
128
132
  - Valid git commit hashes (when specifying commits manually)
129
133
 
130
134
  ## Categories
131
135
 
132
- - **tweak**: Minor adjustments, bug fixes, small improvements
133
- - **feature**: New functionality, major additions
134
- - **process**: Build system, CI/CD, tooling, configuration changes
136
+ - **tweak**:
137
+ Minor adjustments, bug fixes, small improvements
138
+ - **feature**:
139
+ New functionality, major additions
140
+ - **process**:
141
+ Build system, CI/CD, tooling, configuration changes
135
142
 
136
143
  ## Error Handling
137
144
 
@@ -151,7 +158,8 @@ The tool automatically:
151
158
  - **Stops processing after a commit fails all retry attempts**
152
159
  - Exports partial results to the CSV file before exiting
153
160
 
154
- If the process stops (e.g., after 139 commits due to API failure), you can resume from where it left off:
161
+ If the process stops (e.g., after 139 commits due to API failure), you can
162
+ resume from where it left off:
155
163
 
156
164
  ```bash
157
165
  # Resume from last checkpoint
@@ -165,13 +173,12 @@ npx commit-analyzer --resume
165
173
  ```
166
174
 
167
175
  The checkpoint file (`.commit-analyzer/progress.json`) contains:
176
+
168
177
  - List of all commits to process
169
178
  - Successfully processed commits (including failed ones to skip on resume)
170
179
  - Analyzed commit data (only successful ones)
171
180
  - Output file location
172
181
 
173
- **Important**: When a commit fails after all retries (default 3), the process stops immediately to prevent wasting API calls. The successfully analyzed commits up to that point are saved to the CSV file.
174
-
175
182
  ### Application Data Directory
176
183
 
177
184
  The tool creates a `.commit-analyzer/` directory to store internal files:
@@ -185,23 +192,80 @@ The tool creates a `.commit-analyzer/` directory to store internal files:
185
192
  └── ...
186
193
  ```
187
194
 
188
- - **Progress checkpoint**: Enables resuming interrupted analysis sessions
189
- - **Analysis cache**: Stores LLM analysis results to avoid re-processing the same commits (TTL: 30 days)
195
+ - **Progress checkpoint**:
196
+ Enables resuming interrupted analysis sessions
197
+ - **Analysis cache**:
198
+ Stores LLM analysis results to avoid re-processing the same commits (TTL:
199
+ 30 days)
190
200
 
191
201
  Use `--no-cache` to disable caching if needed.
202
+ Use `--clear` to clear the cache and progress checkpoint.
203
+
204
+ ### Date Filtering
205
+
206
+ The tool supports flexible date filtering using natural language or specific
207
+ dates:
208
+
209
+ ```bash
210
+ # Analyze commits from the last week
211
+ npx commit-analyzer --since "1 week ago"
212
+
213
+ # Analyze commits from a specific date range
214
+ npx commit-analyzer --since "2024-01-01" --until "2024-12-31"
215
+
216
+ # Analyze commits from the beginning of the year
217
+ npx commit-analyzer --since "2024-01-01"
218
+
219
+ # Analyze commits up to a specific date
220
+ npx commit-analyzer --until "2024-06-30"
221
+ ```
222
+
223
+ Date formats supported:
224
+ - Relative dates:
225
+ `"1 week ago"`, `"2 months ago"`, `"3 days ago"`
226
+ - ISO dates:
227
+ `"2024-01-01"`, `"2024-12-31"`
228
+ - Git-style dates:
229
+ Any format accepted by `git log --since` and `git log --until`
230
+
231
+ ### Batch Processing
232
+
233
+ Control processing speed and resource usage with batch size options:
234
+
235
+ ```bash
236
+ # Process commits one at a time (default, safest for rate limits)
237
+ npx commit-analyzer --batch-size 1
238
+
239
+ # Process multiple commits in parallel (faster but may hit rate limits)
240
+ npx commit-analyzer --batch-size 5 --limit 100
241
+
242
+ # Sequential processing for large datasets
243
+ npx commit-analyzer --batch-size 1 --limit 500
244
+ ```
192
245
 
193
246
  ### Retry Logic
194
247
 
195
- The tool includes automatic retry logic with exponential backoff for handling API failures when processing many commits. This is especially useful when analyzing large numbers of commits that might trigger rate limits.
248
+ The tool includes automatic retry logic with exponential backoff for handling
249
+ API failures when processing many commits.
250
+ This is especially useful when analyzing large numbers of commits that might
251
+ trigger rate limits.
196
252
 
197
253
  #### Configuration
198
254
 
199
255
  You can configure the retry behavior using environment variables:
200
256
 
201
- - `LLM_MAX_RETRIES`: Maximum number of retry attempts (default: 3)
202
- - `LLM_INITIAL_RETRY_DELAY`: Initial delay between retries in milliseconds (default: 5000)
203
- - `LLM_MAX_RETRY_DELAY`: Maximum delay between retries in milliseconds (default: 30000)
204
- - `LLM_RETRY_MULTIPLIER`: Multiplier for exponential backoff (default: 2)
257
+ - `LLM_MAX_RETRIES`:
258
+ Maximum number of retry attempts (default:
259
+ 3)
260
+ - `LLM_INITIAL_RETRY_DELAY`:
261
+ Initial delay between retries in milliseconds (default:
262
+ 5000)
263
+ - `LLM_MAX_RETRY_DELAY`:
264
+ Maximum delay between retries in milliseconds (default:
265
+ 30000)
266
+ - `LLM_RETRY_MULTIPLIER`:
267
+ Multiplier for exponential backoff (default:
268
+ 2)
205
269
 
206
270
  #### Examples
207
271
 
@@ -226,19 +290,19 @@ The retry mechanism automatically:
226
290
 
227
291
  ```bash
228
292
  # Install dependencies
229
- npm install
293
+ bun install
230
294
 
231
295
  # Run in development mode
232
- npm run dev
296
+ bun run dev
233
297
 
234
298
  # Build for production
235
- npm run build
299
+ bun run build
236
300
 
237
301
  # Run linting
238
- npm run lint
302
+ bun run lint
239
303
 
240
304
  # Type checking
241
- npm run typecheck
305
+ bun run typecheck
242
306
  ```
243
307
 
244
308
  ## Examples
@@ -253,10 +317,6 @@ npx commit-analyzer --limit 20 --output my_analysis.csv
253
317
  # Analyze commits by a specific team member
254
318
  npx commit-analyzer --author teammate@company.com --limit 50
255
319
 
256
- # Analyze specific commits
257
- git log --oneline -5 | cut -d' ' -f1 > recent_commits.txt
258
- npx commit-analyzer --file recent_commits.txt --output recent_analysis.csv
259
-
260
320
  # Quick analysis of your recent work
261
321
  npx commit-analyzer --limit 10
262
322
 
@@ -267,8 +327,30 @@ npx commit-analyzer --report --limit 100 --output yearly_analysis.csv
267
327
  npx commit-analyzer --report --input-csv existing_analysis.csv --output team_report.md
268
328
 
269
329
  # Use specific LLM model for analysis
270
- npx commit-analyzer --model gemini --limit 25
330
+ npx commit-analyzer --llm gemini --limit 25
271
331
 
272
332
  # Resume interrupted analysis with progress tracking
273
333
  npx commit-analyzer --resume
274
334
  ```
335
+
336
+ ## Development
337
+
338
+ This tool requires the Bun runtime.
339
+ Install it globally:
340
+
341
+ ```bash
342
+ # Install bun globally
343
+ curl -fsSL https://bun.sh/install | bash
344
+ # or
345
+ npm install -g bun
346
+ ```
347
+
348
+ ## Installation
349
+
350
+ ```bash
351
+ bun install
352
+ bun build
353
+ bun link
354
+ ```
355
+
356
+ After linking, you can use `commit-analyzer` command globally.
package/dist/main.ts ADDED
Binary file
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "commit-analyzer",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
+ "files": ["dist"],
4
5
  "description": "Analyze git commits and generate categories, summaries, and descriptions for each commit. Optionally generate a yearly breakdown report of your commit history.",
5
6
  "main": "dist/main.ts",
6
7
  "bin": {
@@ -1,23 +0,0 @@
1
- {
2
- "permissions": {
3
- "allow": [
4
- "Bash(mkdir:*)",
5
- "Bash(bun install:*)",
6
- "Bash(bun run:*)",
7
- "Bash(bun link:*)",
8
- "Bash(npm run typecheck:*)",
9
- "Bash(npm run lint)",
10
- "Bash(npm run build:*)",
11
- "Bash(npm run dev:*)",
12
- "Bash(bun dev:*)",
13
- "Bash(git log:*)",
14
- "Bash(git checkout:*)",
15
- "Bash(npx ts-node:*)",
16
- "Bash(node:*)",
17
- "Bash(npm start:*)",
18
- "Bash(bun:*)"
19
- ],
20
- "deny": [],
21
- "ask": []
22
- }
23
- }
package/commits.csv DELETED
@@ -1,2 +0,0 @@
1
- year,category,summary,description
2
- 2025,process,"Refactor project structure with numbered layers, path aliases, and automated","Major architectural reorganization moving from nested directories to numbered layer structure (1.domain, 2.application, 3.presentation, 4.infrastructure). Implements TypeScript path aliases (@domain, @app, @presentation, @infra) for cleaner imports and adds ESLint plugin for automatic import sorting and organization. All files renamed to kebab-case and imports updated throughout the codebase to use the new alias system. This improves code maintainability, reduces import path complexity, and establishes consistent file organization patterns."
@@ -1,97 +0,0 @@
1
- # LLM Prompt Template: CSV to Markdown Report Generation
2
-
3
- This is the prompt template to be used by the LLM service to generate condensed
4
- markdown reports from CSV commit analysis data.
5
-
6
- ## Prompt Template
7
-
8
- ```
9
- Analyze the following CSV data containing git commit analysis results and generate a condensed markdown development summary report.
10
-
11
- CSV DATA:
12
- {csv_content}
13
-
14
- INSTRUCTIONS:
15
- 1. Group the data by year (descending order, most recent first)
16
- 2. Within each year, group by category: Features, Process Improvements, and Tweaks & Bug Fixes
17
- 3. Consolidate similar items within each category to create readable summaries
18
- 4. Focus on what was accomplished rather than individual commit details
19
- 5. Use clear, professional language appropriate for stakeholders
20
-
21
- CATEGORY MAPPING:
22
- - "feature" → "Features" section
23
- - "process" → "Processes" section
24
- - "tweak" → "Tweaks & Bug Fixes" section
25
-
26
- CONSOLIDATION GUIDELINES:
27
- - Group similar features together (e.g., "authentication system improvements")
28
- - Combine related bug fixes (e.g., "resolved 8 authentication issues")
29
- - Summarize process changes by theme (e.g., "CI/CD pipeline enhancements")
30
- - Use bullet points for individual items within categories
31
- - Aim for 3-7 bullet points per category per year
32
- - Include specific numbers when relevant (e.g., "15 bug fixes", "3 new features")
33
-
34
- OUTPUT FORMAT:
35
- Generate a markdown report with this exact structure:
36
-
37
- ```markdown
38
- # Development Summary Report
39
-
40
- ## Commit Analysis
41
- - **Total Commits**: [X] commits across [YEAR_RANGE]
42
- - **[MOST_RECENT_YEAR]**: [X] commits ([X] features, [X] process, [X] tweaks)
43
- - **[PREVIOUS_YEAR]**: [X] commits ([X] features, [X] process, [X] tweaks)
44
- - [Continue for each year in the data]
45
-
46
- ## [YEAR]
47
- ### Features
48
- - [Consolidated feature summary 1]
49
- - [Consolidated feature summary 2]
50
- - [Additional features as needed]
51
-
52
- ### Processes
53
- - [Consolidated process improvement 1]
54
- - [Consolidated process improvement 2]
55
- - [Additional process items as needed]
56
-
57
- ### Tweaks & Bug Fixes
58
- - [Consolidated tweak/fix summary 1]
59
- - [Consolidated tweak/fix summary 2]
60
- - [Additional tweaks/fixes as needed]
61
-
62
- ## [PREVIOUS YEAR]
63
- [Repeat structure for each year in the data]
64
- ```
65
-
66
- QUALITY REQUIREMENTS:
67
- - Keep summaries concise but informative
68
- - Use active voice and clear language
69
- - Avoid technical jargon where possible
70
- - Ensure each bullet point represents meaningful work
71
- - Make the report valuable for both technical and non-technical readers
72
-
73
- Generate the markdown report now:
74
- ```
75
-
76
- ## Implementation Notes
77
-
78
- This prompt should be used in the `MarkdownReportGenerator` service with the following approach:
79
-
80
- 1. **Input Processing**: Replace `{csv_content}` with the actual CSV data read from the input file
81
- 2. **LLM Call**: Send this prompt to the configured LLM (Claude, Gemini, etc.)
82
- 3. **Response Parsing**: Extract the markdown content from the LLM response
83
- 4. **File Output**: Write the generated markdown to the specified output file
84
-
85
- ### Error Handling
86
- - If LLM returns malformed response, retry up to MAX_RETRIES times
87
- - Validate that the response contains properly formatted markdown
88
- - Ensure all years from the CSV data are represented in the output
89
- - Handle edge cases like empty categories or single-item categories
90
-
91
- ### Response Validation
92
- The generated report should:
93
- - Start with "# Development Summary Report"
94
- - Have year sections in descending chronological order
95
- - Include all three category sections for each year (even if empty)
96
- - Use proper markdown formatting with ## for years and ### for categories
97
- - Contain bullet points (-) for individual items
package/eslint.config.mts DELETED
@@ -1,45 +0,0 @@
1
- import js from "@eslint/js"
2
- import { defineConfig } from "eslint/config"
3
- import simpleImportSort from "eslint-plugin-simple-import-sort"
4
- import globals from "globals"
5
- import tseslint from "typescript-eslint"
6
-
7
- export default defineConfig([
8
- {
9
- files: ["**/*.{js,mjs,cjs,ts,mts,cts}"],
10
- plugins: { js },
11
- extends: ["js/recommended"],
12
- languageOptions: { globals: globals.node },
13
- },
14
- tseslint.configs.recommended,
15
- {
16
- plugins: {
17
- "simple-import-sort": simpleImportSort,
18
- },
19
- rules: {
20
- "simple-import-sort/imports": [
21
- "warn",
22
- {
23
- groups: [
24
- // Side effect imports
25
- ["^\\u0000"],
26
- // Packages. `react` related packages come first.
27
- ["^react", "^@?\\w"],
28
- // Aliases (adjust these regexes for your aliases)
29
- ["^@domain"],
30
- ["^@app"],
31
- ["^@presentation"],
32
- ["^@infra"],
33
- // Parent imports
34
- ["^\\.\\.(?!/?$)", "^\\.\\./?$"],
35
- // Relative imports
36
- ["^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"],
37
- // Style imports
38
- ["^.+\\.s?css$"],
39
- ],
40
- },
41
- ],
42
- "simple-import-sort/exports": "warn",
43
- },
44
- },
45
- ])
package/prompt.md DELETED
@@ -1,69 +0,0 @@
1
- # Prompt for Git Commit Analysis Program
2
-
3
- Create a TypeScript/Node.js program that analyzes git commits and generates
4
- categorized summaries.
5
-
6
- The program should:
7
-
8
- ## Input Requirements
9
-
10
- - Accept a list of git commit hashes as input (command line arguments or file)
11
- - For each commit, extract the commit message, date, and diff
12
-
13
- Core Functionality:
14
-
15
- 1. Git Integration:
16
- Use git show and git diff to get commit details and changes
17
- 2. LLM Analysis:
18
- Send commit message + diff to the claude cli for categorization.
19
- 3. CSV Export:
20
- Generate output with columns:
21
- year, category, summary, description
22
-
23
- ## LLM Prompt Template
24
-
25
- Analyze this git commit and provide a categorization:
26
-
27
- - COMMIT MESSAGE:
28
- {commit_message}
29
- - COMMIT DIFF:
30
- {diff_content}
31
-
32
- Based on the commit message and code changes, categorize this commit as one
33
- of:
34
- - "tweak":
35
- Minor adjustments, bug fixes, small improvements
36
- - "feature":
37
- New functionality, major additions
38
- - "process":
39
- Build system, CI/CD, tooling, configuration changes
40
-
41
- Provide:
42
- 1. Category:
43
- [tweak|feature|process]
44
- 2. Summary:
45
- One-line description (max 80 chars)
46
- 3. Description:
47
- Detailed explanation (2-3 sentences)
48
-
49
- Format as JSON:
50
- ```json
51
- {
52
- "category": "...",
53
- "summary": "...",
54
- "description": "..."
55
- }
56
- ```
57
-
58
- ### Technical Implementation
59
-
60
- - Use Node.js with TypeScript
61
- - Extract year from git commit timestamp
62
-
63
- Output Format:
64
-
65
- CSV with headers:
66
- year,category,summary,description
67
-
68
- The program should be robust, handle edge cases, and provide clear error
69
- messages for invalid commits or API failures.