gut-cli 0.1.11 → 0.1.13
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/.gut/branch.md +27 -0
- package/.gut/changelog.md +38 -0
- package/.gut/checkout.md +29 -0
- package/.gut/commit.md +22 -0
- package/.gut/config.json +3 -0
- package/.gut/explain-file.md +30 -0
- package/.gut/explain.md +31 -0
- package/.gut/find.md +25 -0
- package/.gut/merge.md +30 -0
- package/.gut/pr.md +36 -0
- package/.gut/review.md +24 -0
- package/.gut/stash.md +20 -0
- package/.gut/summary.md +38 -0
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/.gut/branch.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
You are an expert at creating git branch names.
|
|
2
|
+
|
|
3
|
+
Generate a clean, descriptive branch name for the following:
|
|
4
|
+
|
|
5
|
+
## Description
|
|
6
|
+
|
|
7
|
+
{{description}}
|
|
8
|
+
|
|
9
|
+
{{#type}}
|
|
10
|
+
Branch type: {{type}}
|
|
11
|
+
{{/type}}
|
|
12
|
+
|
|
13
|
+
{{#issue}}
|
|
14
|
+
Include issue number: {{issue}}
|
|
15
|
+
{{/issue}}
|
|
16
|
+
|
|
17
|
+
## Rules
|
|
18
|
+
|
|
19
|
+
- Use format: `<type>/<short-description>`
|
|
20
|
+
- Types: feature, fix, hotfix, chore, refactor, docs, test
|
|
21
|
+
- Use kebab-case for description
|
|
22
|
+
- Keep it short (under 50 chars total)
|
|
23
|
+
- No special characters except hyphens and slashes
|
|
24
|
+
|
|
25
|
+
## Output
|
|
26
|
+
|
|
27
|
+
Respond with ONLY the branch name, nothing else.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
You are an expert at writing release notes and changelogs.
|
|
2
|
+
|
|
3
|
+
Generate a changelog entry for changes from {{fromRef}} to {{toRef}}.
|
|
4
|
+
|
|
5
|
+
Today's date is {{todayDate}}. Use this date for the release date.
|
|
6
|
+
|
|
7
|
+
## Commits
|
|
8
|
+
|
|
9
|
+
{{commits}}
|
|
10
|
+
|
|
11
|
+
## Diff summary
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
{{diff}}
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Format
|
|
18
|
+
|
|
19
|
+
Use Keep a Changelog format (https://keepachangelog.com/):
|
|
20
|
+
- Group changes by: Added, Changed, Deprecated, Removed, Fixed, Security
|
|
21
|
+
- Each item should be a concise description of the change
|
|
22
|
+
- Use past tense
|
|
23
|
+
|
|
24
|
+
## Focus on
|
|
25
|
+
|
|
26
|
+
- User-facing changes and improvements
|
|
27
|
+
- Bug fixes and their impact
|
|
28
|
+
- Breaking changes (highlight these)
|
|
29
|
+
- Group related changes together
|
|
30
|
+
- Write for end users, not developers (unless it's a library)
|
|
31
|
+
|
|
32
|
+
## Output
|
|
33
|
+
|
|
34
|
+
Respond with a JSON object containing:
|
|
35
|
+
- version: Version string if detected (optional)
|
|
36
|
+
- date: Release date in YYYY-MM-DD format
|
|
37
|
+
- sections: Array of { type, items[] }
|
|
38
|
+
- summary: Brief summary of this release (optional)
|
package/.gut/checkout.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Checkout Branch Name Generation
|
|
2
|
+
|
|
3
|
+
You are an expert at creating git branch names.
|
|
4
|
+
|
|
5
|
+
Analyze the following git diff and generate a clean, descriptive branch name that captures the essence of the changes.
|
|
6
|
+
|
|
7
|
+
## Git diff
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
{{diff}}
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Branch Naming Convention
|
|
14
|
+
|
|
15
|
+
- Use format: `<type>/<short-description>`
|
|
16
|
+
- Types: feature, fix, hotfix, chore, refactor, docs, test
|
|
17
|
+
- Use kebab-case for description
|
|
18
|
+
- Keep it short (under 50 chars total)
|
|
19
|
+
- No special characters except hyphens and slashes
|
|
20
|
+
|
|
21
|
+
## Focus on
|
|
22
|
+
|
|
23
|
+
- The main purpose of the changes
|
|
24
|
+
- Whether it's a feature, fix, refactor, etc.
|
|
25
|
+
- Key files or functionality being modified
|
|
26
|
+
|
|
27
|
+
## Output
|
|
28
|
+
|
|
29
|
+
Respond with ONLY the branch name, nothing else.
|
package/.gut/commit.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
You are an expert at writing git commit messages.
|
|
2
|
+
|
|
3
|
+
Analyze the following git diff and generate a concise, meaningful commit message.
|
|
4
|
+
|
|
5
|
+
## Git diff
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
{{diff}}
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Rules
|
|
12
|
+
|
|
13
|
+
- Use format: `<type>(<scope>): <description>`
|
|
14
|
+
- Types: feat, fix, docs, style, refactor, perf, test, chore, build, ci
|
|
15
|
+
- Scope is optional but helpful
|
|
16
|
+
- Description should be lowercase, imperative mood, no period at end
|
|
17
|
+
- Keep the first line under 72 characters
|
|
18
|
+
- If changes are complex, add a blank line and bullet points for details
|
|
19
|
+
|
|
20
|
+
## Output
|
|
21
|
+
|
|
22
|
+
Respond with ONLY the commit message, nothing else.
|
package/.gut/config.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
You are an expert at explaining code in a clear and insightful way.
|
|
2
|
+
|
|
3
|
+
Analyze the following file and explain what it does, its purpose, and its role in a project.
|
|
4
|
+
|
|
5
|
+
## File
|
|
6
|
+
|
|
7
|
+
Path: {{filePath}}
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
{{content}}
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Focus on
|
|
14
|
+
|
|
15
|
+
- What this file does (main functionality)
|
|
16
|
+
- Its purpose and role in the codebase
|
|
17
|
+
- Key functions, classes, or components it defines
|
|
18
|
+
- Dependencies and what it interacts with
|
|
19
|
+
- Any important patterns or architecture decisions
|
|
20
|
+
|
|
21
|
+
## Output
|
|
22
|
+
|
|
23
|
+
Explain in a way that helps someone quickly understand this file's purpose and how it fits into the larger codebase.
|
|
24
|
+
|
|
25
|
+
Respond with a JSON object containing:
|
|
26
|
+
- summary: One-line summary
|
|
27
|
+
- purpose: The purpose and role of this code
|
|
28
|
+
- changes: Array of { file, description }
|
|
29
|
+
- impact: What impact or role this has in the project
|
|
30
|
+
- notes: Important considerations or caveats (optional)
|
package/.gut/explain.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
You are an expert at explaining code changes in a clear and insightful way.
|
|
2
|
+
|
|
3
|
+
Analyze the following {{targetType}} and provide a comprehensive explanation.
|
|
4
|
+
|
|
5
|
+
## Context
|
|
6
|
+
|
|
7
|
+
{{context}}
|
|
8
|
+
|
|
9
|
+
## Diff
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
{{diff}}
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Focus on
|
|
16
|
+
|
|
17
|
+
- What the changes accomplish (not just what files changed)
|
|
18
|
+
- WHY these changes were likely made
|
|
19
|
+
- The broader context and purpose
|
|
20
|
+
- Any important implications or side effects
|
|
21
|
+
|
|
22
|
+
## Output
|
|
23
|
+
|
|
24
|
+
Explain in a way that helps someone understand not just the "what" but the "why" behind these changes.
|
|
25
|
+
|
|
26
|
+
Respond with a JSON object containing:
|
|
27
|
+
- summary: One-line summary
|
|
28
|
+
- purpose: The purpose and role of this code
|
|
29
|
+
- changes: Array of { file, description }
|
|
30
|
+
- impact: What impact or role this has in the project
|
|
31
|
+
- notes: Important considerations or caveats (optional)
|
package/.gut/find.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
You are an expert at understanding git history and finding relevant commits.
|
|
2
|
+
|
|
3
|
+
The user is looking for commits related to: "{{query}}"
|
|
4
|
+
|
|
5
|
+
## Commits to search
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
{{commits}}
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Instructions
|
|
12
|
+
|
|
13
|
+
Find the commits that best match the user's query. Consider:
|
|
14
|
+
- Commit messages that mention similar concepts
|
|
15
|
+
- Related features, bug fixes, or changes
|
|
16
|
+
- Semantic similarity (e.g., "login" matches "authentication")
|
|
17
|
+
|
|
18
|
+
Return up to {{maxResults}} matching commits, ordered by relevance (most relevant first).
|
|
19
|
+
Only include commits that actually match the query - if none match well, return an empty array.
|
|
20
|
+
|
|
21
|
+
## Output
|
|
22
|
+
|
|
23
|
+
Respond with a JSON object containing:
|
|
24
|
+
- matches: Array of { hash, reason }
|
|
25
|
+
- summary: Brief summary of the search results (optional)
|
package/.gut/merge.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
You are an expert at resolving git merge conflicts intelligently.
|
|
2
|
+
|
|
3
|
+
Analyze the following conflicted file and provide a resolution.
|
|
4
|
+
|
|
5
|
+
## Context
|
|
6
|
+
|
|
7
|
+
- File: {{filename}}
|
|
8
|
+
- Merging: {{theirsRef}} into {{oursRef}}
|
|
9
|
+
|
|
10
|
+
## Conflicted content
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
{{content}}
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Rules
|
|
17
|
+
|
|
18
|
+
- Understand the intent of both changes
|
|
19
|
+
- Combine changes when both are valid additions
|
|
20
|
+
- Choose the more complete/correct version when they conflict
|
|
21
|
+
- Preserve all necessary functionality
|
|
22
|
+
- The resolved content should be valid, working code
|
|
23
|
+
- Do NOT include conflict markers (<<<<<<, =======, >>>>>>)
|
|
24
|
+
|
|
25
|
+
## Output
|
|
26
|
+
|
|
27
|
+
Respond with a JSON object containing:
|
|
28
|
+
- resolvedContent: The resolved file content
|
|
29
|
+
- explanation: Brief explanation of how the conflict was resolved
|
|
30
|
+
- strategy: "ours" | "theirs" | "combined" | "rewritten"
|
package/.gut/pr.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
You are an expert at writing pull request descriptions.
|
|
2
|
+
|
|
3
|
+
Generate a clear and informative PR title and description based on the following information.
|
|
4
|
+
|
|
5
|
+
## Context
|
|
6
|
+
|
|
7
|
+
- Branch: {{currentBranch}} -> {{baseBranch}}
|
|
8
|
+
- Commits:
|
|
9
|
+
{{commits}}
|
|
10
|
+
|
|
11
|
+
## Diff summary
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
{{diff}}
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Rules for title
|
|
18
|
+
|
|
19
|
+
- Title should be concise (under 72 chars), start with a verb
|
|
20
|
+
|
|
21
|
+
## Rules for description
|
|
22
|
+
|
|
23
|
+
- Description should have:
|
|
24
|
+
- ## Summary section with 2-3 bullet points
|
|
25
|
+
- ## Changes section listing key modifications
|
|
26
|
+
- ## Test Plan section (suggest what to test)
|
|
27
|
+
|
|
28
|
+
## Output
|
|
29
|
+
|
|
30
|
+
Respond in JSON format:
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"title": "...",
|
|
34
|
+
"body": "..."
|
|
35
|
+
}
|
|
36
|
+
```
|
package/.gut/review.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
You are an expert code reviewer. Analyze the following git diff and provide a structured review.
|
|
2
|
+
|
|
3
|
+
## Git diff
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
{{diff}}
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Focus on
|
|
10
|
+
|
|
11
|
+
- Bugs and potential issues
|
|
12
|
+
- Security vulnerabilities
|
|
13
|
+
- Performance concerns
|
|
14
|
+
- Code style and best practices
|
|
15
|
+
- Suggestions for improvement
|
|
16
|
+
|
|
17
|
+
## Output
|
|
18
|
+
|
|
19
|
+
Be constructive and specific. Include line numbers when possible.
|
|
20
|
+
|
|
21
|
+
Respond with a JSON object containing:
|
|
22
|
+
- summary: Brief overall assessment
|
|
23
|
+
- issues: Array of { severity: "critical"|"warning"|"suggestion", file, line?, message, suggestion? }
|
|
24
|
+
- positives: Array of good practices observed
|
package/.gut/stash.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
You are an expert at summarizing code changes.
|
|
2
|
+
|
|
3
|
+
Generate a short, descriptive stash name for the following changes.
|
|
4
|
+
|
|
5
|
+
## Diff
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
{{diff}}
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Rules
|
|
12
|
+
|
|
13
|
+
- Start with "WIP: " prefix
|
|
14
|
+
- Keep it under 50 characters total
|
|
15
|
+
- Be specific about what the changes do
|
|
16
|
+
- Use present tense
|
|
17
|
+
|
|
18
|
+
## Output
|
|
19
|
+
|
|
20
|
+
Respond with ONLY the stash name, nothing else.
|
package/.gut/summary.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
You are an expert at writing work summaries and reports.
|
|
2
|
+
|
|
3
|
+
Generate a clear, professional work summary for the following git activity.
|
|
4
|
+
|
|
5
|
+
## Context
|
|
6
|
+
|
|
7
|
+
- Author: {{author}}
|
|
8
|
+
- Period: {{period}}
|
|
9
|
+
- Format: {{format}}
|
|
10
|
+
|
|
11
|
+
## Commits
|
|
12
|
+
|
|
13
|
+
{{commits}}
|
|
14
|
+
|
|
15
|
+
{{#diff}}
|
|
16
|
+
## Diff summary
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
{{diff}}
|
|
20
|
+
```
|
|
21
|
+
{{/diff}}
|
|
22
|
+
|
|
23
|
+
## Focus on
|
|
24
|
+
|
|
25
|
+
- What was accomplished (not just listing commits)
|
|
26
|
+
- Group related work together
|
|
27
|
+
- Highlight important achievements
|
|
28
|
+
- Use clear, non-technical language where possible
|
|
29
|
+
- Make it suitable for sharing with team or manager
|
|
30
|
+
|
|
31
|
+
## Output
|
|
32
|
+
|
|
33
|
+
Respond with a JSON object containing:
|
|
34
|
+
- title: One-line title for the summary
|
|
35
|
+
- overview: Brief overview of what was accomplished
|
|
36
|
+
- highlights: Array of key accomplishments
|
|
37
|
+
- details: Array of { category, items[] }
|
|
38
|
+
- stats: { commits, filesChanged?, additions?, deletions? } (optional)
|
package/dist/index.js
CHANGED
|
@@ -513,7 +513,8 @@ async function generateChangelog(context, options, template) {
|
|
|
513
513
|
fromRef: context.fromRef,
|
|
514
514
|
toRef: context.toRef,
|
|
515
515
|
commits: commitList,
|
|
516
|
-
diff: context.diff.slice(0, 8e3)
|
|
516
|
+
diff: context.diff.slice(0, 8e3),
|
|
517
|
+
todayDate: (/* @__PURE__ */ new Date()).toISOString().split("T")[0]
|
|
517
518
|
});
|
|
518
519
|
const result = await generateObject({
|
|
519
520
|
model,
|