@eldrforge/kodrdriv 0.0.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/.gitcarve/config.yaml +11 -0
- package/.gitcarve/context/people/context.md +5 -0
- package/.gitcarve/context/projects/context.md +3 -0
- package/.gitcarve/instructions/INACTIVE-release-pre.md +1 -0
- package/LICENSE +190 -0
- package/README.md +337 -0
- package/dist/arguments.js +252 -0
- package/dist/arguments.js.map +1 -0
- package/dist/commands/commit.js +54 -0
- package/dist/commands/commit.js.map +1 -0
- package/dist/commands/release.js +27 -0
- package/dist/commands/release.js.map +1 -0
- package/dist/constants.js +95 -0
- package/dist/constants.js.map +1 -0
- package/dist/content/diff.js +53 -0
- package/dist/content/diff.js.map +1 -0
- package/dist/content/log.js +34 -0
- package/dist/content/log.js.map +1 -0
- package/dist/error/ExitError.js +9 -0
- package/dist/error/ExitError.js.map +1 -0
- package/dist/logging.js +46 -0
- package/dist/logging.js.map +1 -0
- package/dist/main.js +53 -0
- package/dist/main.js.map +1 -0
- package/dist/prompt/instructions/commit.md +48 -0
- package/dist/prompt/instructions/release.md +31 -0
- package/dist/prompt/personas/you.md +11 -0
- package/dist/prompt/prompts.js +55 -0
- package/dist/prompt/prompts.js.map +1 -0
- package/dist/types.js +29 -0
- package/dist/types.js.map +1 -0
- package/dist/util/child.js +11 -0
- package/dist/util/child.js.map +1 -0
- package/dist/util/openai.js +55 -0
- package/dist/util/openai.js.map +1 -0
- package/dist/util/storage.js +126 -0
- package/dist/util/storage.js.map +1 -0
- package/eslint.config.mjs +82 -0
- package/nodemon.json +14 -0
- package/package.json +74 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/vite.config.ts +90 -0
- package/vitest.config.ts +21 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Everything in a release note should be in pirate speak.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
Copyright 2025 Calen Varek
|
|
179
|
+
|
|
180
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
181
|
+
you may not use this file except in compliance with the License.
|
|
182
|
+
You may obtain a copy of the License at
|
|
183
|
+
|
|
184
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
185
|
+
|
|
186
|
+
Unless required by applicable law or agreed to in writing, software
|
|
187
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
188
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
189
|
+
See the License for the specific language governing permissions and
|
|
190
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
# KodrDriv
|
|
2
|
+
|
|
3
|
+
KodrDriv is a powerful utility designed to automatically generate intelligent release notes and change logs from your Git repository. It analyzes commit history, pull requests, and related metadata to create comprehensive, well-structured documentation of your project's evolution. By leveraging advanced parsing and analysis techniques, it helps teams maintain clear visibility into their codebase's development history while reducing the manual effort typically required for changelog maintenance.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Install KodrDriv globally using npm:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g @eldrforge/kodrdriv
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
This will make the `kodrdriv` command available globally on your system.
|
|
14
|
+
|
|
15
|
+
## Commands
|
|
16
|
+
|
|
17
|
+
KodrDriv provides two main commands:
|
|
18
|
+
|
|
19
|
+
### Commit Command
|
|
20
|
+
|
|
21
|
+
Generate intelligent commit messages:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
kodrdriv commit
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
> [!TIP]
|
|
28
|
+
> ### Working with Staged Changes
|
|
29
|
+
>
|
|
30
|
+
> When you have staged changes using `git add`, the `kodrdriv commit` command will automatically analyze the diff of your staged changes. This allows you to selectively stage files and generate a commit message that specifically addresses those changes, rather than all uncommitted changes in your working directory.
|
|
31
|
+
|
|
32
|
+
> [!TIP]
|
|
33
|
+
> ### Quick Commit with --sendit
|
|
34
|
+
>
|
|
35
|
+
> If you trust the quality of the generated commit messages, you can use the `--sendit` flag to automatically commit your changes with the generated message without review. This is useful for quick, routine changes where you want to streamline your workflow.
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
### Release Command
|
|
39
|
+
|
|
40
|
+
Generate comprehensive release notes based on changes since the last release:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
kodrdriv release
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
> [!TIP]
|
|
47
|
+
> ### Custom Release Range
|
|
48
|
+
>
|
|
49
|
+
> The `kodrdriv release` command supports customizing the range of commits to analyze using the `--from` and `--to` options. By default, it compares changes between the `main` branch and `HEAD`, but you can specify any valid Git reference (branch, tag, or commit hash) for either endpoint. This flexibility allows you to generate release notes for specific version ranges or between different branches.
|
|
50
|
+
|
|
51
|
+
> [!TIP]
|
|
52
|
+
> ### Comparing Releases
|
|
53
|
+
>
|
|
54
|
+
> You can use the `--from` and `--to` options to generate release notes comparing two different releases. For example, to see what changed between v1.0.0 and v1.1.0, you could use `kodrdriv release --from v1.0.0 --to v1.1.0`. This is particularly useful for creating detailed changelogs when preparing release documentation.
|
|
55
|
+
|
|
56
|
+
## Command Line Options
|
|
57
|
+
|
|
58
|
+
KodrDriv provides several command line options to customize its behavior:
|
|
59
|
+
|
|
60
|
+
### Basic Options
|
|
61
|
+
|
|
62
|
+
- `--dry-run`: Perform a dry run without saving files (default: false)
|
|
63
|
+
- `--verbose`: Enable verbose logging (default: false)
|
|
64
|
+
- `--debug`: Enable debug logging (default: false)
|
|
65
|
+
- `--version`: Display version information
|
|
66
|
+
|
|
67
|
+
### Commit Command Options
|
|
68
|
+
|
|
69
|
+
- `--cached`: Use cached diff for generating commit messages
|
|
70
|
+
- `--sendit`: Commit with the generated message without review (default: false)
|
|
71
|
+
|
|
72
|
+
### OpenAI Configuration
|
|
73
|
+
|
|
74
|
+
- `--openai-api-key <key>`: OpenAI API key (can also be set via OPENAI_API_KEY environment variable)
|
|
75
|
+
- `--model <model>`: OpenAI model to use (default: 'gpt-4o-mini')
|
|
76
|
+
|
|
77
|
+
> [!NOTE]
|
|
78
|
+
> ### Security Considerations
|
|
79
|
+
>
|
|
80
|
+
> The OpenAI API key should be handled securely. While the `--openai-api-key` option is available, it's recommended to use environment variables instead. Git Intelligent Change automatically loads environment variables from a `.env` file in your current working directory.
|
|
81
|
+
>
|
|
82
|
+
> While environment variables are a common approach for configuration, they can still pose security risks if not properly managed. We strongly encourage users to utilize secure credential management solutions like 1Password, HashiCorp Vault, or other keystores to protect sensitive information. This helps prevent accidental exposure of API keys and other credentials in logs, process listings, or environment dumps.
|
|
83
|
+
|
|
84
|
+
### Content Configuration
|
|
85
|
+
|
|
86
|
+
- `-c, --content-types [types...]`: Content types to include in the summary (default: ['diff'])
|
|
87
|
+
- Available types: 'log', 'diff'
|
|
88
|
+
- Can specify multiple types: `--content-types log diff`
|
|
89
|
+
|
|
90
|
+
### Instructions
|
|
91
|
+
|
|
92
|
+
- `-i, --instructions <file>`: Path to custom instructions file for the AI (default: './.kodrdriv/instructions.md')
|
|
93
|
+
|
|
94
|
+
### Examples
|
|
95
|
+
|
|
96
|
+
Basic usage with default settings:
|
|
97
|
+
```bash
|
|
98
|
+
kodrdriv commit
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Generate a commit message and automatically commit it:
|
|
102
|
+
```bash
|
|
103
|
+
kodrdriv commit --sendit
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Generate release notes:
|
|
107
|
+
```bash
|
|
108
|
+
kodrdriv release
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Generate a summary including both git log and diff information:
|
|
112
|
+
```bash
|
|
113
|
+
kodrdriv release --content-types log diff
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Run in verbose mode with a custom OpenAI model:
|
|
117
|
+
```bash
|
|
118
|
+
kodrdriv commit --verbose --model gpt-4
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Use custom instructions from a file:
|
|
122
|
+
```bash
|
|
123
|
+
kodrdriv release --instructions ./my-custom-instructions.md
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Configuration Directory
|
|
127
|
+
|
|
128
|
+
KodrDriv uses a configuration directory to store custom settings, instructions, and other configuration files. You can specify a custom location using the `--config-dir` option:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
kodrdriv --config-dir ~/custom-kodrdriv-config
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
By default, the configuration directory is set to `.kodrdriv` in your current working directory. This directory is created automatically if it doesn't exist.
|
|
135
|
+
|
|
136
|
+
The configuration directory structure is as follows:
|
|
137
|
+
|
|
138
|
+
```
|
|
139
|
+
.kodrdriv/
|
|
140
|
+
├── instructions/
|
|
141
|
+
│ ├── commit.md # Override for commit instructions
|
|
142
|
+
│ ├── commit-pre.md # Content prepended to default commit instructions
|
|
143
|
+
│ ├── commit-post.md # Content appended to default commit instructions
|
|
144
|
+
│ ├── release.md # Override for release instructions
|
|
145
|
+
│ ├── release-pre.md # Content prepended to default release instructions
|
|
146
|
+
│ └── release-post.md # Content appended to default release instructions
|
|
147
|
+
└── ... # Other configuration files
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Default Instructions
|
|
151
|
+
|
|
152
|
+
KodrDriv comes with default instructions that guide the AI in generating release notes or change logs. These instructions are defined in the source code:
|
|
153
|
+
|
|
154
|
+
- **Commit Instructions**: The default instructions for commit message generation are defined in [src/prompt/instructions/commit.ts](https://github.com/eldrforge/kodrdriv/blob/main/src/prompt/instructions/commit.ts).
|
|
155
|
+
|
|
156
|
+
- **Release Instructions**: The default instructions for release notes generation are defined in [src/prompt/instructions/release.ts](https://github.com/eldrforge/kodrdriv/blob/main/src/prompt/instructions/release.ts).
|
|
157
|
+
|
|
158
|
+
These instruction files contain detailed guidelines for the AI on how to format and structure the output, including examples and specific requirements for different types of changes.
|
|
159
|
+
|
|
160
|
+
### Customizing Instructions
|
|
161
|
+
|
|
162
|
+
You can override these default instructions in several ways:
|
|
163
|
+
|
|
164
|
+
1. **Command Line Option**: Use the `--instructions` flag to specify a custom instructions file:
|
|
165
|
+
```bash
|
|
166
|
+
kodrdriv --instructions ./my-custom-instructions.txt
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
2. **Default Location**: Even without specifying a command line option, Git Intelligent Change will automatically look for an instructions file at `./.kodrdriv/instructions.md` in your current working directory.
|
|
170
|
+
|
|
171
|
+
3. **File Format**: While the default file is named `instructions.md`, you can use any text file with any extension. The content doesn't have to be in Markdown format - any plain text content will work. This gives you flexibility to use your preferred text editor or format for writing instructions.
|
|
172
|
+
|
|
173
|
+
## Prompt Structure
|
|
174
|
+
|
|
175
|
+
When KodrDriv sends a request to the LLM, it structures the prompt using XML-like tags to organize different components of the input. The prompt is composed of three main sections:
|
|
176
|
+
|
|
177
|
+
```
|
|
178
|
+
<instructions>
|
|
179
|
+
[Your custom instructions or the default instructions]
|
|
180
|
+
</instructions>
|
|
181
|
+
|
|
182
|
+
<log>
|
|
183
|
+
[Git log output if --content-types includes 'log']
|
|
184
|
+
</log>
|
|
185
|
+
|
|
186
|
+
<diff>
|
|
187
|
+
[Git diff output if --content-types includes 'diff']
|
|
188
|
+
</diff>
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Each section serves a specific purpose:
|
|
192
|
+
- `<instructions>`: Contains the guidance for the LLM on how to format and structure the output
|
|
193
|
+
- `<log>`: Contains the git log output, providing commit history and messages
|
|
194
|
+
- `<diff>`: Contains the git diff output, showing the actual code changes
|
|
195
|
+
|
|
196
|
+
## Context
|
|
197
|
+
|
|
198
|
+
KodrDriv can use contextual information about your project to generate more meaningful commit messages and release notes. Context is provided through Markdown files stored in a dedicated directory.
|
|
199
|
+
|
|
200
|
+
### Context Directory Structure
|
|
201
|
+
|
|
202
|
+
The structure of your context directory is entirely up to you. There are no strict requirements for how you organize your context files - you can structure them in whatever way makes the most sense for your project and team.
|
|
203
|
+
|
|
204
|
+
Here are two example approaches to organizing context files:
|
|
205
|
+
|
|
206
|
+
#### Hierarchical Structure Example
|
|
207
|
+
|
|
208
|
+
You can organize context in a hierarchical structure with subdirectories for different categories:
|
|
209
|
+
|
|
210
|
+
```
|
|
211
|
+
.kodrdriv/context/
|
|
212
|
+
├── context.md # Main context file describing sections
|
|
213
|
+
├── people/ # Directory for information about people
|
|
214
|
+
│ ├── context.md # Description of the people section
|
|
215
|
+
│ ├── team-members.md # Information about team members
|
|
216
|
+
│ └── contributors.md # Information about contributors
|
|
217
|
+
├── projects/ # Directory for project information
|
|
218
|
+
│ ├── context.md # Description of the projects section
|
|
219
|
+
│ └── project-details.md # Details about various projects
|
|
220
|
+
└── technologies/ # Directory for technical information
|
|
221
|
+
├── context.md # Description of the technologies section
|
|
222
|
+
├── frameworks.md # Information about frameworks used
|
|
223
|
+
└── libraries.md # Information about libraries used
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
#### Individual Records Example
|
|
227
|
+
|
|
228
|
+
Alternatively, you can use a flatter structure with individual files for each entity:
|
|
229
|
+
|
|
230
|
+
```
|
|
231
|
+
.kodrdriv/context/
|
|
232
|
+
├── context.md # Main context file describing sections
|
|
233
|
+
├── people/ # Directory for individual people information
|
|
234
|
+
│ ├── context.md # Description of the people section
|
|
235
|
+
│ ├── john-doe.md # Information specific to John Doe
|
|
236
|
+
│ ├── jane-smith.md # Information specific to Jane Smith
|
|
237
|
+
│ └── alex-johnson.md # Information specific to Alex Johnson
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
Choose the organization that works best for your needs. The system will process the context files regardless of the structure, as long as they follow the basic Markdown formatting guidelines.
|
|
241
|
+
|
|
242
|
+
### Main Context File
|
|
243
|
+
|
|
244
|
+
The `context.md` file in each directory serves as an introduction to that section. The system loads this file first to understand the structure of the information. For example, a `context.md` file in the people directory might look like:
|
|
245
|
+
|
|
246
|
+
```markdown
|
|
247
|
+
## People
|
|
248
|
+
|
|
249
|
+
This section contains subsections that have information about people.
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
### Context Files
|
|
253
|
+
|
|
254
|
+
After loading the `context.md` file, the system reads all other Markdown files in the directory. It uses the first header in each file as the name of the section or subsection. For example:
|
|
255
|
+
|
|
256
|
+
```markdown
|
|
257
|
+
## Team Members
|
|
258
|
+
|
|
259
|
+
- John Doe: Lead Developer, focuses on backend systems
|
|
260
|
+
- Jane Smith: UX Designer, specializes in responsive interfaces
|
|
261
|
+
- Alex Johnson: DevOps Engineer, manages deployment pipelines
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
### Context Location
|
|
265
|
+
|
|
266
|
+
You can specify where to store your context files in two recommended ways:
|
|
267
|
+
|
|
268
|
+
1. **Project Directory**: Store context files in your project repository at `.kodrdriv/context/`. This is useful when the context is specific to the project and should be versioned with the code.
|
|
269
|
+
|
|
270
|
+
2. **gitignore Directory**: Alternatively, you can store context in your `.gitignore` directory if you want to keep it separate from your project files or if the context contains sensitive information that shouldn't be committed to the repository.
|
|
271
|
+
|
|
272
|
+
To specify a custom context directory, use the `--context-dir` option:
|
|
273
|
+
|
|
274
|
+
```bash
|
|
275
|
+
kodrdriv commit --context-dir ~/my-custom-context
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
By default, KodrDriv looks for context in the `.kodrdriv/context` directory within your project.
|
|
279
|
+
|
|
280
|
+
## Configuration Directory
|
|
281
|
+
|
|
282
|
+
The configuration directory (configDir) allows you to further customize both commit and release instructions by adding pre and post content to the default instructions. This is done by creating additional files in your `.kodrdriv/instructions` directory:
|
|
283
|
+
|
|
284
|
+
### Release Instructions
|
|
285
|
+
1. **Pre-Content**: Create a file named `release-pre.md` to add content that will be prepended to the default release instructions.
|
|
286
|
+
2. **Post-Content**: Create a file named `release-post.md` to add content that should be appended to the default release instructions.
|
|
287
|
+
|
|
288
|
+
### Commit Instructions
|
|
289
|
+
1. **Pre-Content**: Create a file named `commit-pre.md` to add content that will be prepended to the default commit instructions.
|
|
290
|
+
2. **Post-Content**: Create a file named `commit-post.md` to add content that should be appended to the default commit instructions.
|
|
291
|
+
|
|
292
|
+
For example, if you want to add specific formatting requirements before the default release instructions, you could create `.kodrdriv/instructions/release-pre.md`, and if you want to add instructions to the end of the commit instrucitons, you would have a file in `.kodrdriv/instructions/commit-post.md`.
|
|
293
|
+
|
|
294
|
+
### Overriding Default Instructions
|
|
295
|
+
|
|
296
|
+
While the pre and post content files provide a way to extend the default instructions, you can also completely replace them by creating either `commit.md` or `release.md` in your `.kodrdriv/instructions` directory. This gives you full control over the instruction content.
|
|
297
|
+
|
|
298
|
+
However, please note that completely replacing the default instructions should be done with caution. The default instructions are carefully crafted to:
|
|
299
|
+
- Ensure consistent formatting
|
|
300
|
+
- Maintain proper context awareness
|
|
301
|
+
- Follow best practices for commit messages and release notes
|
|
302
|
+
- Handle edge cases and special scenarios
|
|
303
|
+
|
|
304
|
+
By replacing these instructions entirely, you may lose these benefits and potentially create inconsistencies in your documentation. It's recommended to use the pre and post content files to extend the default instructions rather than replacing them entirely, unless you have a specific need to do so.
|
|
305
|
+
|
|
306
|
+
To enable instruction overrides, you'll need to use the `--overrides` flag when running the command.
|
|
307
|
+
|
|
308
|
+
## About the Name
|
|
309
|
+
|
|
310
|
+
Ski carving and efficient software development have a lot in common. Carving uses edge control to follow a smooth, energy-efficient arc — just like automation uses clean, repeatable scripts to replace manual work. Both are about flow: linking turns or commits without hesitation. As carving unlocks speed and control, automation unlocks scalability and momentum. The result is clean tracks — razor-thin arcs on snow, or tidy diffs in code. And when you’ve mastered your craft, you don’t stop to think about your last move. Your code leaves a clean trail — and your commit message can be automated straight from the diff. And — snowboarders carve too. Different board, same beauty. We won’t hold it against you if you’re dropping clean edges on a single plank.
|
|
311
|
+
|
|
312
|
+
## Origin Story: kodrdriv
|
|
313
|
+
|
|
314
|
+
It always happened at the same moment.
|
|
315
|
+
|
|
316
|
+
You’ve just spent the entire day in a flow state — the kind that only comes when everything clicks. Whether it was writing code for a critical feature or hammering out chapters of a Markdown or AsciiDoc book, you were locked in. Maybe you were racing the clock to hit a deadline. Maybe you were just up late trying to carve something beautiful out of nothing. Either way, you went right up to the wire, focused, dialed in, exhausted but satisfied.
|
|
317
|
+
|
|
318
|
+
And then… Git hits you with the meta-question:
|
|
319
|
+
“What did you do?”
|
|
320
|
+
|
|
321
|
+
That one prompt — to sum it all up in a commit message — feels totally out of place. It asks you to stop, zoom out, and articulate everything you’ve just done, right when your brain is at its least reflective. You’re not in summary mode. You’re still in it. Still shaping. Still carving.
|
|
322
|
+
|
|
323
|
+
And that’s the thing: it sounds silly, like it shouldn’t be a real problem. But every developer, every writer who lives in Git knows that exact moment. The friction is real. The context switch is jarring. It’s like being asked to narrate your entire ski run after you’ve blasted through powder, dodged trees, hit the cliff drop — and now you’re out of breath, standing at the bottom, being asked to give a PowerPoint.
|
|
324
|
+
|
|
325
|
+
That’s why I built kodrdriv.
|
|
326
|
+
|
|
327
|
+
It’s not just a tool — it’s a mindset shift. The idea is simple: you’ve already carved your line in the snow. Your code is there. Your diffs are real. Instead of making you explain it, kodrdriv uses an LLM to read the trail you left behind and generate a clean, meaningful commit message. One that actually reflects your work — without breaking your flow or making you guess what mattered most.
|
|
328
|
+
|
|
329
|
+
Whether you’re merging branches or writing books, kodrdriv is built for that end-of-day moment when you want to commit and move on — not pause for existential reflection. It reads the line you’ve drawn, and it helps you push it forward.
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
|