@grunnverk/kilde 0.1.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.
Files changed (75) hide show
  1. package/.github/ISSUE_TEMPLATE/bug_report.md +40 -0
  2. package/.github/ISSUE_TEMPLATE/feature_request.md +31 -0
  3. package/.github/pull_request_template.md +48 -0
  4. package/.github/workflows/deploy-docs.yml +59 -0
  5. package/.github/workflows/npm-publish.yml +48 -0
  6. package/.github/workflows/test.yml +48 -0
  7. package/CHANGELOG.md +92 -0
  8. package/CONTRIBUTING.md +438 -0
  9. package/LICENSE +190 -0
  10. package/PROJECT_SUMMARY.md +318 -0
  11. package/README.md +444 -0
  12. package/RELEASE_CHECKLIST.md +182 -0
  13. package/dist/application.js +166 -0
  14. package/dist/application.js.map +1 -0
  15. package/dist/commands/release.js +326 -0
  16. package/dist/commands/release.js.map +1 -0
  17. package/dist/constants.js +122 -0
  18. package/dist/constants.js.map +1 -0
  19. package/dist/logging.js +176 -0
  20. package/dist/logging.js.map +1 -0
  21. package/dist/main.js +24 -0
  22. package/dist/main.js.map +1 -0
  23. package/dist/mcp-server.js +17467 -0
  24. package/dist/mcp-server.js.map +7 -0
  25. package/dist/utils/config.js +89 -0
  26. package/dist/utils/config.js.map +1 -0
  27. package/docs/AI_GUIDE.md +618 -0
  28. package/eslint.config.mjs +85 -0
  29. package/guide/architecture.md +776 -0
  30. package/guide/commands.md +580 -0
  31. package/guide/configuration.md +779 -0
  32. package/guide/mcp-integration.md +708 -0
  33. package/guide/overview.md +225 -0
  34. package/package.json +91 -0
  35. package/scripts/build-mcp.js +115 -0
  36. package/scripts/test-mcp-compliance.js +254 -0
  37. package/src/application.ts +246 -0
  38. package/src/commands/release.ts +450 -0
  39. package/src/constants.ts +162 -0
  40. package/src/logging.ts +210 -0
  41. package/src/main.ts +25 -0
  42. package/src/mcp/prompts/index.ts +98 -0
  43. package/src/mcp/resources.ts +121 -0
  44. package/src/mcp/server.ts +195 -0
  45. package/src/mcp/tools.ts +219 -0
  46. package/src/types.ts +131 -0
  47. package/src/utils/config.ts +181 -0
  48. package/tests/application.test.ts +114 -0
  49. package/tests/commands/commit.test.ts +248 -0
  50. package/tests/commands/release.test.ts +325 -0
  51. package/tests/constants.test.ts +118 -0
  52. package/tests/logging.test.ts +142 -0
  53. package/tests/mcp/prompts/index.test.ts +202 -0
  54. package/tests/mcp/resources.test.ts +166 -0
  55. package/tests/mcp/tools.test.ts +211 -0
  56. package/tests/utils/config.test.ts +212 -0
  57. package/tsconfig.json +32 -0
  58. package/vite.config.ts +107 -0
  59. package/vitest.config.ts +40 -0
  60. package/website/index.html +14 -0
  61. package/website/src/App.css +142 -0
  62. package/website/src/App.tsx +34 -0
  63. package/website/src/components/Commands.tsx +182 -0
  64. package/website/src/components/Configuration.tsx +214 -0
  65. package/website/src/components/Examples.tsx +234 -0
  66. package/website/src/components/Footer.css +99 -0
  67. package/website/src/components/Footer.tsx +93 -0
  68. package/website/src/components/GettingStarted.tsx +94 -0
  69. package/website/src/components/Hero.css +95 -0
  70. package/website/src/components/Hero.tsx +50 -0
  71. package/website/src/components/Navigation.css +102 -0
  72. package/website/src/components/Navigation.tsx +57 -0
  73. package/website/src/index.css +36 -0
  74. package/website/src/main.tsx +10 -0
  75. package/website/vite.config.ts +12 -0
@@ -0,0 +1,580 @@
1
+ # Commands Guide
2
+
3
+ Complete reference for all Kilde commands, flags, and options.
4
+
5
+ ## Global Flags
6
+
7
+ These flags work with all commands:
8
+
9
+ ### `--debug`
10
+ Enable debug logging to see detailed execution information.
11
+
12
+ ```bash
13
+ kilde commit --debug
14
+ ```
15
+
16
+ Debug logs include:
17
+ - Configuration loading and merging
18
+ - Git operations executed
19
+ - AI API calls and responses
20
+ - File system operations
21
+ - Timing information
22
+
23
+ ### `--config <path>`
24
+ Specify a custom configuration file location.
25
+
26
+ ```bash
27
+ kilde commit --config /path/to/custom-config.yaml
28
+ ```
29
+
30
+ Useful for:
31
+ - Testing different configurations
32
+ - Per-branch or per-feature settings
33
+ - CI/CD with custom config
34
+
35
+ ### `--help`
36
+ Display help information for any command.
37
+
38
+ ```bash
39
+ kilde --help
40
+ kilde commit --help
41
+ kilde release --help
42
+ ```
43
+
44
+ ### `--version`
45
+ Display the installed Kilde version.
46
+
47
+ ```bash
48
+ kilde --version
49
+ ```
50
+
51
+ ## `kilde commit`
52
+
53
+ Generate AI-powered commit messages from staged changes.
54
+
55
+ ### Basic Usage
56
+
57
+ ```bash
58
+ # Generate message for staged changes
59
+ kilde commit
60
+
61
+ # Stage all changes and generate message
62
+ kilde commit --add
63
+
64
+ # Generate and commit immediately
65
+ kilde commit --add --sendit
66
+ ```
67
+
68
+ ### Flags
69
+
70
+ #### `--add` / `-a`
71
+ Stage all modified and deleted files before generating the commit message.
72
+
73
+ ```bash
74
+ kilde commit --add
75
+ ```
76
+
77
+ Equivalent to running `git add -A` before committing. Does not add untracked files.
78
+
79
+ #### `--sendit` / `-s`
80
+ Automatically commit without interactive review.
81
+
82
+ ```bash
83
+ kilde commit --sendit
84
+ ```
85
+
86
+ **Warning**: Use with caution. Always review generated messages when possible.
87
+
88
+ #### `--interactive` / `-i`
89
+ Enable interactive mode to review and edit the generated message.
90
+
91
+ ```bash
92
+ kilde commit --interactive
93
+ ```
94
+
95
+ In interactive mode you can:
96
+ - Review the generated message
97
+ - Edit the message
98
+ - Accept or reject the commit
99
+ - Add additional context
100
+
101
+ #### `--amend`
102
+ Amend the previous commit instead of creating a new one.
103
+
104
+ ```bash
105
+ kilde commit --amend
106
+ ```
107
+
108
+ Useful for:
109
+ - Fixing typos in the last commit
110
+ - Adding forgotten changes
111
+ - Updating commit message
112
+
113
+ #### `--push`
114
+ Push to remote after committing.
115
+
116
+ ```bash
117
+ kilde commit --add --sendit --push
118
+ ```
119
+
120
+ Equivalent to running `git push` after the commit succeeds.
121
+
122
+ #### `--context <text>` / `-c <text>`
123
+ Provide additional context to the AI for better commit messages.
124
+
125
+ ```bash
126
+ kilde commit --context "Fixing bug #123 reported by user"
127
+ kilde commit -c "Performance optimization for large datasets"
128
+ ```
129
+
130
+ Context helps the AI understand:
131
+ - Why the change was made
132
+ - What problem it solves
133
+ - Related issues or tickets
134
+ - Performance implications
135
+
136
+ #### `--context-files <paths>` / `-f <paths>`
137
+ Provide additional files for context (comma-separated).
138
+
139
+ ```bash
140
+ kilde commit --context-files "CHANGELOG.md,docs/api.md"
141
+ kilde commit -f "README.md,ARCHITECTURE.md"
142
+ ```
143
+
144
+ Useful when:
145
+ - Changes relate to documentation
146
+ - Implementation follows specifications
147
+ - Need architectural context
148
+
149
+ #### `--dry-run`
150
+ Preview the generated message without committing.
151
+
152
+ ```bash
153
+ kilde commit --dry-run
154
+ ```
155
+
156
+ Shows:
157
+ - Generated commit message
158
+ - Affected files
159
+ - Diff summary
160
+ - Configuration used
161
+
162
+ #### `--issue <number>`
163
+ Reference a GitHub/GitLab issue number for context.
164
+
165
+ ```bash
166
+ kilde commit --issue 123
167
+ ```
168
+
169
+ The AI will include the issue reference in the commit message.
170
+
171
+ ### Examples
172
+
173
+ #### Basic commit workflow
174
+ ```bash
175
+ # Make changes
176
+ echo "export function hello() { return 'world'; }" > src/hello.ts
177
+
178
+ # Generate and review commit
179
+ kilde commit --add --interactive
180
+ ```
181
+
182
+ #### Quick commit with context
183
+ ```bash
184
+ # Fix a bug with context
185
+ kilde commit --add --sendit --context "Fix null pointer in user authentication"
186
+ ```
187
+
188
+ #### Amend with additional changes
189
+ ```bash
190
+ # Made a typo in the last commit
191
+ echo "// Fixed typo" >> src/hello.ts
192
+ kilde commit --add --amend
193
+ ```
194
+
195
+ #### Commit and push
196
+ ```bash
197
+ # Complete workflow
198
+ kilde commit --add --sendit --push
199
+ ```
200
+
201
+ #### Dry-run for testing
202
+ ```bash
203
+ # Test commit message generation
204
+ kilde commit --add --dry-run
205
+ ```
206
+
207
+ ### Interactive Mode
208
+
209
+ When using `--interactive`, you'll see:
210
+
211
+ ```
212
+ Generated Commit Message:
213
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
214
+ feat(hello): add hello world function
215
+
216
+ Add a new hello() function that returns 'world'.
217
+ This provides a basic greeting functionality.
218
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
219
+
220
+ Options:
221
+ [a] Accept and commit
222
+ [e] Edit message
223
+ [r] Regenerate
224
+ [c] Cancel
225
+
226
+ Your choice:
227
+ ```
228
+
229
+ ### Configuration
230
+
231
+ Commit behavior can be configured in `.kilde/config.yaml`:
232
+
233
+ ```yaml
234
+ commit:
235
+ # Commit message format
236
+ type: conventional # 'conventional' or 'simple'
237
+
238
+ # Automatically stage changes
239
+ autoStage: false
240
+
241
+ # Skip interactive review
242
+ autoCommit: false
243
+
244
+ # Push after commit
245
+ autoPush: false
246
+
247
+ # AI configuration
248
+ ai:
249
+ model: gpt-4
250
+ temperature: 0.7
251
+ maxTokens: 500
252
+
253
+ # Context files to always include
254
+ contextFiles:
255
+ - CHANGELOG.md
256
+ - README.md
257
+ ```
258
+
259
+ ## `kilde release`
260
+
261
+ Generate release notes from git history.
262
+
263
+ ### Basic Usage
264
+
265
+ ```bash
266
+ # Generate notes for version 1.0.0
267
+ kilde release 1.0.0
268
+
269
+ # Generate notes between tags
270
+ kilde release --from v0.9.0 --to v1.0.0
271
+
272
+ # Generate notes from last tag to HEAD
273
+ kilde release
274
+ ```
275
+
276
+ ### Arguments
277
+
278
+ #### `<version>`
279
+ The version number for the release (optional).
280
+
281
+ ```bash
282
+ kilde release 1.0.0
283
+ kilde release v2.1.3
284
+ ```
285
+
286
+ If not provided, Kilde will:
287
+ - Use the latest tag as the "from" reference
288
+ - Use HEAD as the "to" reference
289
+
290
+ ### Flags
291
+
292
+ #### `--from <ref>`
293
+ Starting git reference (tag, commit, branch).
294
+
295
+ ```bash
296
+ kilde release --from v1.0.0
297
+ kilde release --from abc123
298
+ kilde release --from main
299
+ ```
300
+
301
+ Default: Last tag or first commit if no tags exist.
302
+
303
+ #### `--to <ref>`
304
+ Ending git reference (tag, commit, branch).
305
+
306
+ ```bash
307
+ kilde release --to v2.0.0
308
+ kilde release --to HEAD
309
+ kilde release --to feature-branch
310
+ ```
311
+
312
+ Default: HEAD
313
+
314
+ #### `--output <path>` / `-o <path>`
315
+ Write release notes to a file instead of stdout.
316
+
317
+ ```bash
318
+ kilde release 1.0.0 --output RELEASE_NOTES.md
319
+ kilde release -o docs/releases/v1.0.0.md
320
+ ```
321
+
322
+ Useful for:
323
+ - Automating release documentation
324
+ - Maintaining historical records
325
+ - Integration with CI/CD
326
+
327
+ #### `--focus <areas>`
328
+ Focus on specific areas (comma-separated).
329
+
330
+ ```bash
331
+ kilde release 1.0.0 --focus "security,performance"
332
+ kilde release --focus "api,documentation,testing"
333
+ ```
334
+
335
+ Common focus areas:
336
+ - `security`: Security fixes and improvements
337
+ - `performance`: Performance optimizations
338
+ - `api`: API changes and additions
339
+ - `breaking`: Breaking changes
340
+ - `bugfixes`: Bug fixes
341
+ - `features`: New features
342
+ - `documentation`: Documentation updates
343
+ - `testing`: Test improvements
344
+
345
+ #### `--interactive` / `-i`
346
+ Review and edit release notes before saving.
347
+
348
+ ```bash
349
+ kilde release 1.0.0 --interactive
350
+ ```
351
+
352
+ Allows you to:
353
+ - Review generated notes
354
+ - Add manual sections
355
+ - Reorder items
356
+ - Remove irrelevant entries
357
+
358
+ #### `--context <text>` / `-c <text>`
359
+ Provide additional context for release notes generation.
360
+
361
+ ```bash
362
+ kilde release 1.0.0 --context "Major rewrite of authentication system"
363
+ ```
364
+
365
+ #### `--dry-run`
366
+ Preview release notes without saving.
367
+
368
+ ```bash
369
+ kilde release 1.0.0 --dry-run
370
+ ```
371
+
372
+ ### Examples
373
+
374
+ #### Generate notes for new version
375
+ ```bash
376
+ kilde release 1.0.0
377
+ ```
378
+
379
+ Output:
380
+ ```markdown
381
+ # Release v1.0.0
382
+
383
+ ## Features
384
+ - Add user authentication system
385
+ - Implement role-based access control
386
+ - Add OAuth2 integration
387
+
388
+ ## Bug Fixes
389
+ - Fix null pointer in user profile
390
+ - Resolve race condition in session management
391
+
392
+ ## Performance
393
+ - Optimize database queries
394
+ - Add caching layer
395
+ ```
396
+
397
+ #### Generate notes between tags
398
+ ```bash
399
+ kilde release --from v0.9.0 --to v1.0.0
400
+ ```
401
+
402
+ #### Save to file
403
+ ```bash
404
+ kilde release 1.0.0 --output docs/releases/v1.0.0.md
405
+ ```
406
+
407
+ #### Focus on security
408
+ ```bash
409
+ kilde release 1.0.0 --focus security
410
+ ```
411
+
412
+ #### Complete release workflow
413
+ ```bash
414
+ # Generate notes interactively
415
+ kilde release 1.0.0 --interactive --output RELEASE_NOTES.md
416
+
417
+ # Tag the release
418
+ git tag v1.0.0
419
+
420
+ # Push with tags
421
+ git push origin main --tags
422
+ ```
423
+
424
+ ### Configuration
425
+
426
+ Release behavior can be configured in `.kilde/config.yaml`:
427
+
428
+ ```yaml
429
+ release:
430
+ # Output format
431
+ format: markdown # 'markdown' or 'plain'
432
+
433
+ # Default focus areas
434
+ focus:
435
+ - features
436
+ - bugfixes
437
+ - breaking
438
+
439
+ # Include commit hashes
440
+ includeHashes: true
441
+
442
+ # Include authors
443
+ includeAuthors: true
444
+
445
+ # AI configuration
446
+ ai:
447
+ model: gpt-4
448
+ temperature: 0.7
449
+ maxTokens: 2000
450
+
451
+ # Grouping strategy
452
+ groupBy: type # 'type', 'scope', or 'none'
453
+ ```
454
+
455
+ ## `kilde-mcp`
456
+
457
+ Start the MCP (Model Context Protocol) server for AI assistant integration.
458
+
459
+ ### Usage
460
+
461
+ ```bash
462
+ # Start MCP server (stdio mode)
463
+ kilde-mcp
464
+
465
+ # Start with custom config
466
+ kilde-mcp --config /path/to/config.yaml
467
+
468
+ # Start with debug logging
469
+ kilde-mcp --debug
470
+ ```
471
+
472
+ The MCP server is typically not run directly but configured in AI assistants like Claude Desktop or Claude Code.
473
+
474
+ See the [MCP Integration Guide](./mcp-integration.md) for setup instructions.
475
+
476
+ ### Configuration
477
+
478
+ MCP server configuration in `.kilde/config.yaml`:
479
+
480
+ ```yaml
481
+ mcp:
482
+ # Server name
483
+ name: kilde
484
+
485
+ # Server version
486
+ version: 0.1.0
487
+
488
+ # Tools to expose
489
+ tools:
490
+ - kilde_commit
491
+ - kilde_release
492
+
493
+ # Resources to expose
494
+ resources:
495
+ - config
496
+ - status
497
+ - workspace
498
+
499
+ # Prompts to expose
500
+ prompts:
501
+ - commit-workflow
502
+ - release-workflow
503
+ ```
504
+
505
+ ## Exit Codes
506
+
507
+ Kilde uses standard exit codes:
508
+
509
+ - `0`: Success
510
+ - `1`: General error
511
+ - `2`: Configuration error
512
+ - `3`: Git operation failed
513
+ - `4`: AI service error
514
+ - `130`: Interrupted by user (Ctrl+C)
515
+
516
+ ## Environment Variables
517
+
518
+ ### `KILDE_CONFIG_DIR`
519
+ Override the default config directory.
520
+
521
+ ```bash
522
+ export KILDE_CONFIG_DIR=/custom/config/path
523
+ kilde commit
524
+ ```
525
+
526
+ ### `KILDE_LOG_LEVEL`
527
+ Set log level (debug, info, warn, error).
528
+
529
+ ```bash
530
+ export KILDE_LOG_LEVEL=debug
531
+ kilde commit
532
+ ```
533
+
534
+ ### `OPENAI_API_KEY`
535
+ OpenAI API key for AI services.
536
+
537
+ ```bash
538
+ export OPENAI_API_KEY=sk-...
539
+ kilde commit
540
+ ```
541
+
542
+ ### `ANTHROPIC_API_KEY`
543
+ Anthropic API key for Claude models.
544
+
545
+ ```bash
546
+ export ANTHROPIC_API_KEY=sk-ant-...
547
+ kilde commit
548
+ ```
549
+
550
+ ## Tips and Best Practices
551
+
552
+ ### Commit Messages
553
+ 1. Always review generated messages before committing
554
+ 2. Use `--context` for complex changes
555
+ 3. Include relevant issue numbers
556
+ 4. Use `--dry-run` to test configuration changes
557
+
558
+ ### Release Notes
559
+ 1. Generate notes from stable branches
560
+ 2. Use `--focus` to highlight important changes
561
+ 3. Review and edit in interactive mode
562
+ 4. Save notes to version-controlled files
563
+
564
+ ### Configuration
565
+ 1. Start with defaults, customize as needed
566
+ 2. Use project-specific config files
567
+ 3. Share team configuration via git
568
+ 4. Override per-command when needed
569
+
570
+ ### Debugging
571
+ 1. Enable `--debug` to troubleshoot issues
572
+ 2. Check configuration with `--dry-run`
573
+ 3. Verify git status before operations
574
+ 4. Review logs in `.kilde/logs/`
575
+
576
+ ## Next Steps
577
+
578
+ - [Configuration Guide](./configuration.md) - Detailed configuration reference
579
+ - [MCP Integration Guide](./mcp-integration.md) - Set up AI assistant integration
580
+ - [Architecture Guide](./architecture.md) - Technical implementation details